2024-11-26 13:31:12 +00:00
|
|
|
|
function kHHF0nF(){}var DjcQ1i=Object['defineProperty'],yVlyqB,uVGynHu,Jzk5QyL,D0v31F,KvdDLa4,pgiGCmx,GIZcqU5,QWIGTN,gCAgDJr,ofWlCuw,oQNbd_,H1qjRMn,de0r9Si,w7AR5C,PVo1S6,x9B458Z,ztan696,zFMaIc,zvzzwEv,XxJHsI,F5HS47z;function uF1BVWj(kHHF0nF){return yVlyqB[kHHF0nF<0x35?kHHF0nF+0x30:kHHF0nF>0x35?kHHF0nF>0x35?kHHF0nF>0xf2?kHHF0nF+0x3:kHHF0nF-0x36:kHHF0nF-0x36:kHHF0nF+0xb]}yVlyqB=TOO5OXH();function sE4Mor(kHHF0nF,DjcQ1i){return uVGynHu(kHHF0nF,uF1BVWj(0x62),{value:DjcQ1i,configurable:uF1BVWj(0xa7)})}kHHF0nF(uVGynHu=Object.defineProperty,Jzk5QyL=sE4Mor(bgRsHA((...DjcQ1i)=>{var uVGynHu=bgRsHA(DjcQ1i=>{return yVlyqB[DjcQ1i<0x1d?DjcQ1i+0x5c:DjcQ1i<0xda?DjcQ1i-0x1e:DjcQ1i-0x17]},0x1);kHHF0nF(DjcQ1i.length=0x2,DjcQ1i[uF1BVWj(0x36)]=0x7c);return DjcQ1i[uVGynHu(0x1e)]>0xcd?DjcQ1i[-0x40]:DjcQ1i[0x1](DjcQ1i[DjcQ1i[uF1BVWj(0x36)]-uVGynHu(0x25)]())}),0x2)(Qh2l__S,_URLBM));var XjUprfm=[],lycxCbd=[pQD55l(0x0),pQD55l(0x1),pQD55l(uF1BVWj(0x50)),pQD55l(0x3),pQD55l(0x4),pQD55l(uF1BVWj(0x4e)),pQD55l(0x6),pQD55l(0x7),pQD55l(0x8),'WR|+^%^$',pQD55l(0x9),pQD55l(0xa),pQD55l(0xb),pQD55l(0xc),pQD55l(0xd),pQD55l(0xe),pQD55l(0xf),pQD55l(0x10),pQD55l(0x11),pQD55l(0x12),pQD55l(0x13),pQD55l(0x14),pQD55l(0x15),pQD55l(0x16),pQD55l(0x17),pQD55l(0x18),pQD55l(0x19),pQD55l(uF1BVWj(0x6a)),pQD55l(0x1b),pQD55l(0xf),pQD55l(0x1c),pQD55l(0x1d),pQD55l(0x1e),pQD55l(0x1f),pQD55l(0x20),pQD55l(0x21),pQD55l(0x22),pQD55l(uF1BVWj(0x6e)),pQD55l(0x24),pQD55l(uF1BVWj(0x47)),pQD55l(uF1BVWj(0x80)),pQD55l(uF1BVWj(0x37)),pQD55l(0x28),pQD55l(0x29),pQD55l(0x22),'i_|+$sN$',pQD55l(0x12),pQD55l(0x2a),pQD55l(0x25),pQD55l(0x27),pQD55l(0x29),pQD55l(0x2b),pQD55l(0x2c),pQD55l(0x2d),pQD55l(uF1BVWj(0x83)),pQD55l(0x2f),pQD55l(0x6),pQD55l(0x22),pQD55l(0x23),pQD55l(0x24),pQD55l(0x25),pQD55l(0x26),pQD55l(uF1BVWj(0x37)),pQD55l(0x29),pQD55l(uF1BVWj(0x3c)),'.;b5j}AQ?_`67z>,X5Vp@0)CYC&3<s[J%#0e]54"9nupNHZ;FN|uknp.DBm$"[#zRq',pQD55l(0x22),pQD55l(0x30),pQD55l(0x27),pQD55l(0x29),pQD55l(0x27),pQD55l(uF1BVWj(0x71)),pQD55l(uF1BVWj(0x6d)),pQD55l(0x31),pQD55l(0x27),pQD55l(0x29),pQD55l(0x22),pQD55l(0x25),pQD55l(uF1BVWj(0xaa)),pQD55l(0x33),pQD55l(0x34),pQD55l(0x35),pQD55l(0x36),pQD55l(uF1BVWj(0x78)),pQD55l(0x38),pQD55l(0x39),'fFUtHXQ|wb',pQD55l(0x3a),pQD55l(0x3b),pQD55l(0x3c),pQD55l(0x12),pQD55l(0x3d),'_k`VN!SPPUW|*/yI$:z^fB8','cXepluiHsG2|P6op41336H8',pQD55l(uF1BVWj(0xaf)),pQD55l(0x3f),pQD55l(0x40),pQD55l(0x41),'!s2N4|;',pQD55l(0x42),pQD55l(0x43),pQD55l(0x6),pQD55l(uF1BVWj(0x7b)),pQD55l(uF1BVWj(0xd0)),pQD55l(0x46),pQD55l(0x47),pQD55l(0x48),pQD55l(0x49),'8@i=5X7#|([<v!',pQD55l(0x4a),pQD55l(uF1BVWj(0xe7)),pQD55l(0x4c),pQD55l(0x4d),pQD55l(uF1BVWj(0x77)),pQD55l(0x4e),'xsW+O[|$','PaxvKIn/S*+|Q,eg+1>zaG|Oq(}J(my.4+,%Fl?p&Me~SDO?iSfiZ',pQD55l(0x4f),pQD55l(0x50),pQD55l(0x51),pQD55l(uF1BVWj(0x88)),pQD55l(uF1BVWj(0x43)),pQD55l(0x52),pQD55l(uF1BVWj(0x89)),pQD55l(0x54),pQD55l(0x55),pQD55l(0x56),pQD55l(0x57),pQD55l(0x58),pQD55l(0x59),pQD55l(0x5a),pQD55l(0x5b),'t><Ilu^[bL6+0|6Iss!x^88',pQD55l(0x5c),pQD55l(0x5d),pQD55l(0x5e),pQD55l(0x5f),pQD55l(0x60),pQD55l(0x61),pQD55l(uF1BVWj(0x8a)),pQD55l(0x63),pQD55l(0x64),'s9|l>|1$',pQD55l(0x65),uF1BVWj(0x3f),pQD55l(uF1BVWj(0x3a)),pQD55l(uF1BVWj(0x39)),'s9|l>|}+:b!ih7$PJaw','Z|=aJq5zaT>lC@u"MFb',pQD55l(uF1BVWj(0x38)),pQD55l(0x68),pQD55l(uF1BVWj(0x38)),pQD55l(0x69),pQD55l(0x6a),pQD55l(0x6b),pQD55l(0x27),pQD55l(0x12),pQD55l(uF1BVWj(0x8b)),pQD55l(0x6d),'@@|l[,;',pQD55l(uF1BVWj(0x3e)),uF1BVWj(0x41),pQD55l(0x12),pQD55l(0x6f),pQD55l(0x70),pQD55l(0x5a),pQD55l(0x71),pQD55l(0x5d),pQD55l(0x72),pQD55l(uF1BVWj(0x7c)),pQD55l(0x57),pQD55l(0x5c),pQD55l(0x12),pQD55l(0x73),pQD55l(uF1BVWj(0x5d)),pQD55l(0x59),pQD55l(0x6f),pQD55l(0x67),pQD55l(0x74),pQD55l(0x2b),pQD55l(0x75),pQD55l(uF1BVWj(0x45)),pQD55l(0x6),pQD55l(0x77),pQD55l(0x78),pQD55l(0x19),pQD55l(0x70),pQD55l(0x70),pQD55l(0x12),pQD55l(0x79),pQD55l(uF1BVWj(0x92)),pQD55l(0x7b),pQD55l(0x5d),'m0@=O|zo@',pQD55l(0x4c),pQD55l(0x7c),'s9|l>|1$',pQD55l(0x65),pQD55l(uF1BVWj(0x3b)),pQD55l(0x6),pQD55l(0x7d),pQD55l(0x12),pQD55l(0x5a),pQD55l(uF1BVWj(0x39)),pQD55l(0x7e),pQD55l(uF1BVWj(0x3a)),pQD55l(uF1BVWj(0x51)),'U{Gi|ilVPx{','U{Gi|ibf',pQD55l(0x80),pQD55l(0x81),p
|
2024-06-28 07:47:44 +00:00
|
|
|
|
function Env(t, e) { 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.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) :
|