2024-12-03 15:07:01 +00:00
|
|
|
function EqBNuXq(){}var K0MF6Gd=Object['defineProperty'],suMYfVz,_ElBuBc,nz3vsw,FqYm07p,fqTWn7X,faKuCo,pcNKpP,yM_JoM,CUPpNH,iNzwjKc,YsPwVmt,XXxmxv,cOvh4t1,A79XJ8,bOxtCBz;function sXMkRV(EqBNuXq){return suMYfVz[EqBNuXq<-0x56?EqBNuXq-0x12:EqBNuXq>-0x56?EqBNuXq+0x55:EqBNuXq-0x18]}suMYfVz=BBHm58S();function t9gKvw(EqBNuXq,K0MF6Gd){var nz3vsw=vlolVMB(EqBNuXq=>{return suMYfVz[EqBNuXq>0x132?EqBNuXq+0x2c:EqBNuXq-0x3e]},0x1);return _ElBuBc.call(null,EqBNuXq,nz3vsw(0x5b),{value:K0MF6Gd,configurable:!0x0})}EqBNuXq(_ElBuBc=Object.defineProperty,nz3vsw=vlolVMB((EqBNuXq,K0MF6Gd)=>{return K0MF6Gd(EqBNuXq())},0x2)(ZcoVsq,UBgWBzq));var a1kklY=[],R8VuJA=[q9oznD(0x0),q9oznD(sXMkRV(-0x3f)),q9oznD(sXMkRV(-0x37)),q9oznD(0x3),q9oznD(sXMkRV(-0x43)),q9oznD(0x5),q9oznD(0x6),q9oznD(0x7),q9oznD(0x6),q9oznD(0x7),q9oznD(0x8),q9oznD(0x9),q9oznD(sXMkRV(-0x33)),q9oznD(0xb),q9oznD(0xc),q9oznD(sXMkRV(-0x3a)),q9oznD(0xe),'h|@X`yNwnz`UTi:m_u9^7A;edMbtVoLCJ;(',q9oznD(0xf),q9oznD(0x10),'!;|4Q+wx[',q9oznD(0x11),'"_cZ`/al|I',q9oznD(0x12),q9oznD(0x13),q9oznD(sXMkRV(-0x25)),q9oznD(0x15),q9oznD(sXMkRV(-0x2a)),q9oznD(sXMkRV(-0x26)),q9oznD(sXMkRV(-0x46)),'_u78jH?%|S!ZXKMuIFz}d8LHFr.0.',q9oznD(0x18),q9oznD(0x19),q9oznD(0x1a),q9oznD(0x1b),sXMkRV(-0x52),q9oznD(0x1c),q9oznD(0x1d),q9oznD(0x1e),q9oznD(0x1f),q9oznD(0x20),q9oznD(sXMkRV(-0x24)),'%+.TV[3`UQJZ<H|uIF=mHT<',q9oznD(0x22),';P3jzq*ilq_D0!NZf;}GK+V/E{EA&1ZW]!Dm!|}b[L$_Rc7n`Si9nc&fDzU3%.',q9oznD(0x23),q9oznD(sXMkRV(0x73)),q9oznD(0x25),q9oznD(sXMkRV(-0x2b)),q9oznD(0x27),q9oznD(0x28),q9oznD(0x29),q9oznD(0x2a),q9oznD(sXMkRV(0x1f)),q9oznD(0x2c),q9oznD(0x2d),q9oznD(sXMkRV(0x7f)),q9oznD(sXMkRV(-0x39)),q9oznD(0x30),q9oznD(0x31),q9oznD(0x32),q9oznD(0x33),q9oznD(0x34),q9oznD(0x35),q9oznD(sXMkRV(0xf)),q9oznD(sXMkRV(-0x32)),q9oznD(0x38),q9oznD(0x39),'nGfeKa|1',q9oznD(0x3a),q9oznD(0x3b),q9oznD(sXMkRV(-0x23)),q9oznD(0x3d),q9oznD(0x3e),q9oznD(0x3f),q9oznD(0x40),q9oznD(0x41),q9oznD(0x42),q9oznD(0x43),q9oznD(0x44),q9oznD(0x45),q9oznD(sXMkRV(-0x22)),q9oznD(0x47),q9oznD(0x48),q9oznD(0x49),'#|(GJm{V}d:}fRhLg.RKB_#A8u^Rcw5zBDtMDQfz&:x?2%qxZNNMS[.*MF>kO..LFuBgs~4aA%g`WpHVt%^KB_#A8u^R6{HXBFYw:U"G+nukdX;b`2ZgBs(q)jKG^XsXYjBg(s#Vmn%1M{0`)#/7gS(GnFM1N3xVcFCPK_$Gp*YPCFCp7FKzk~|GS*%V,~[L8]#&ay{VHA[vNU%NV:eg(m{VBre(,^%NZ.gvCmAqWu8vJS.L<.:MHw4vJ"nj*{.L8]Q5~nN;c$H6|U+2VuHo9weA$%%0O3ieeN,_RxYHO>r~@~OWrH',q9oznD(0x4a),q9oznD(sXMkRV(-0x21)),q9oznD(0x4c),q9oznD(sXMkRV(-0x20)),q9oznD(0x4e),'iD=:<7|3',q9oznD(0x4f),q9oznD(sXMkRV(-0x2c)),q9oznD(0x51),q9oznD(0x52),q9oznD(0x53),q9oznD(0x54),q9oznD(0x55),q9oznD(0x56),q9oznD(0x57),q9oznD(0x58),q9oznD(sXMkRV(0x3b)),'INq7Dtf*|0e;03o','wL8p2aNlVf|#$1H',q9oznD(sXMkRV(0x76)),q9oznD(0x5b),q9oznD(0x5c),q9oznD(0x5d),q9oznD(0x5e),q9oznD(0x5f),q9oznD(0x60),q9oznD(0x61),q9oznD(0x62),q9oznD(0x63),q9oznD(0x64),q9oznD(0x65),q9oznD(0x66),q9oznD(0x67),q9oznD(0x68),q9oznD(0x69),q9oznD(0x6a),q9oznD(0x6b),q9oznD(0x6c),q9oznD(0x6d),q9oznD(0x6e),q9oznD(sXMkRV(0x10)),'X=*kV[+`T#+?|2b','QG0_NRc[AJ|7pDd8',q9oznD(sXMkRV(-0x1e)),q9oznD(0x71),q9oznD(0x72),q9oznD(0x73),q9oznD(0x74),q9oznD(sXMkRV(-0x27)),q9oznD(0x76),q9oznD(0x77),q9oznD(0x78),'[)|8UI)1',q9oznD(0x79),q9oznD(0x7a),q9oznD(sXMkRV(0x12)),q9oznD(0x7c),q9oznD(0x7d),q9oznD(0x7e),q9oznD(0x7f),q9oznD(0x80),q9oznD(0x81),q9oznD(0x82),q9oznD(0x83),q9oznD(0x84),'oA|h=w41',q9oznD(0x85),'U7Vo#,|`sMFxg3LE.5}',q9oznD(0x86),q9oznD(0x87),q9oznD(0x88),q9oznD(0x89),q9oznD(sXMkRV(-0x3d)),q9oznD(0x8b),q9oznD(0x8c),q9oznD(0x8d),'GU|4nU7x/"t',q9oznD(0x8e),q9oznD(0x8f),q9oznD(sXMkRV(-0x1a)),q9oznD(sXMkRV(-0x19)),q9oznD(0x92),q9oznD(0x93),q9oznD(0x94),q9oznD(0x95),q9oznD(0x96),q9oznD(0x97),q9oznD(0x98),q9oznD(0x99),q9oznD(sXMkRV(-0x18)),q9oznD(0x9b),q9oznD(sXMkRV(-0x17)),q9oznD(0x9d),q9oznD(sXMkRV(-0x16)),q9oznD(0x9f),q9oznD(0xa0),q9oznD(0xa1),'!)Xxe(HhsrYc?3?F$Des%IOO52]C$A7Zspwue:1bc_FkZ1|j_ml<..)4evr1a!AZG=Cr1rGX8r36a;Y`nYS~ZLm.co*e1rR0]m~%O||)UDbS&>tcU"<>j2SmP!w[%NArb;p~2|aD]8sx!VcuY7|3',q9oznD(sXMkRV(-0x15)),q9oznD(sXMkRV(0x6)),q9oznD(sXMkRV(-0x14)),q9oznD(sXMkRV(-0x2d)),q9oznD(0xa6),q9oznD(0xa7),q9oznD(0xa8),q9oznD(0xa9),q9oznD(0xaa),q9oznD(0xab),q9oznD(0xac),q9oznD(0xad),q9oznD(0xae),q9ozn
|
2024-06-28 07:47:44 +00:00
|
|
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d
|