2024-09-25 10:18:45 +08:00
|
|
|
function UjjHRsB(){}var ijKHJUv=Object['defineProperty'],BBSNrp,X3OjZs,_aGLLLU,ICDT1A,ymNMJ40,ium5ER,y6WZ6f,GRCAHNf,wwfUOS,t5Rry0,j2iLRSL,yBA6L_,XtfNBiI,ej3wDY,Fs0suR1;function qcIvb9(UjjHRsB){return BBSNrp[UjjHRsB>0x101?UjjHRsB+0x3:UjjHRsB<-0xe?UjjHRsB-0x4d:UjjHRsB+0xd]}BBSNrp=lZmERBx();function RFKzE3(UjjHRsB,ijKHJUv){return X3OjZs(UjjHRsB,qcIvb9(0xe),{value:ijKHJUv,configurable:!0x0})}UjjHRsB(X3OjZs=Object.defineProperty,_aGLLLU=s2jddd((UjjHRsB,ijKHJUv)=>{return ijKHJUv(UjjHRsB())},0x2)(hw5OG2,Ug1iwJ));var KnwlL6=[],CmYhfcl=[qffyq7(0x0),qffyq7(0x1),qffyq7(0x2),qffyq7(qcIvb9(0x9)),qffyq7(0x4),qffyq7(0x5),qffyq7(qcIvb9(0x13)),qffyq7(qcIvb9(0x15)),qffyq7(0x8),qffyq7(qcIvb9(0x43)),qffyq7(qcIvb9(0x1a)),'\u007b\u0073\u0058\u0028\u0022\u002e\u007c\u007e\u005b\u0062\u0060\u003a\u0028\u0030\u0030\u0043\u0057\u0043\u0063\u0023\u0051','{sX(".|~[b`:(0+CR7$z7','{sX(".|~[b`:(00Ctx+($]hJ5bj=K','@Ro,khPdcNbO~06Et@|,q"jd.NC',qffyq7(0xb),qffyq7(qcIvb9(0x16)),qffyq7(0xd),'\x4e\x7c\x28\x5f',qffyq7(0xe),qffyq7(qcIvb9(0x2d)),qffyq7(qcIvb9(0x2e)),qffyq7(qcIvb9(0x49)),qffyq7(qcIvb9(-0xd)),qffyq7(0x13),'\u007c\u0037\u0053\u007a\u004a\u005e\u002a',qffyq7(0xe),qffyq7(qcIvb9(-0x7)),'E8>AF|p',qffyq7(0x15),'X|4u2kGccE',qffyq7(qcIvb9(0x1e)),qffyq7(0x17),qffyq7(qcIvb9(0x30)),qffyq7(qcIvb9(0x1b)),qffyq7(qcIvb9(0x5e)),qffyq7(0x1b),qffyq7(0x1c),'\u0021\u004c\u007c\u007e\u0022\u0028\u0077\u0066',qffyq7(0x1d),qffyq7(qcIvb9(0x61)),qffyq7(0x1f),']L>k|',qffyq7(0x20),qffyq7(qcIvb9(0x27)),qffyq7(0x22),qffyq7(qcIvb9(0x33)),qffyq7(0x24),qffyq7(qcIvb9(0x36)),qffyq7(qcIvb9(0x38)),'\x69\x32\x53\x7a\x47\x60\x79\x49\x7b\x57\x7c\x6a\x37\x26\x51\x64\x7e\x4b',qffyq7(qcIvb9(0x39)),qffyq7(qcIvb9(-0xd)),qffyq7(0x28),qffyq7(0x29),qffyq7(qcIvb9(0x3a)),qffyq7(0x2b),qffyq7(0x2c),qffyq7(0x2d),qffyq7(qcIvb9(0x28)),qffyq7(0x2f),qffyq7(0x30),qffyq7(0x31),'7!~|Q','k|)Bo^ZWPN/k)Y',qffyq7(qcIvb9(0xf)),qffyq7(qcIvb9(0x3f)),qffyq7(qcIvb9(0x2a)),'\x22\x2b\x47\x7c\x36\x5e\x2c\x49\x37\x62\x68',qffyq7(0x14),qffyq7(0x35),qffyq7(qcIvb9(0x46)),'"+G|6^)K',qffyq7(0x37),qffyq7(0x38),qffyq7(qcIvb9(0x48)),qffyq7(qcIvb9(0x66)),qffyq7(qcIvb9(0x45)),qffyq7(qcIvb9(-0xc)),'"+G|6^PK',qffyq7(0x3d),qffyq7(qcIvb9(-0xc)),qffyq7(qcIvb9(0x47)),qffyq7(0x3f),qffyq7(0x40),qffyq7(0x41),qffyq7(qcIvb9(0x40)),qffyq7(0x43),qcIvb9(-0x5),'S!4ud|9~cE',qffyq7(qcIvb9(-0x8)),qffyq7(0x45),qffyq7(0x46),qffyq7(0x47),qffyq7(0x48),qffyq7(qcIvb9(0x4e)),qffyq7(qcIvb9(0x6)),qffyq7(0x4b),qffyq7(qcIvb9(0x41)),qffyq7(qcIvb9(0x91)),qffyq7(qcIvb9(0x4f)),qffyq7(0x4f),qffyq7(0x50),qffyq7(0x51),qffyq7(0x52),qffyq7(0x53),qffyq7(qcIvb9(0x52)),qffyq7(0x55),qffyq7(qcIvb9(0x54)),qffyq7(0x57),qffyq7(0x58),qffyq7(0x59),qffyq7(0x5a),qffyq7(qcIvb9(-0xa)),qffyq7(qcIvb9(-0x6)),qffyq7(0x5c),qffyq7(0x5d),qffyq7(0x5e),qffyq7(qcIvb9(0x51)),qffyq7(0x60),qffyq7(qcIvb9(-0x9)),qffyq7(0x61),qffyq7(0x62),qffyq7(0x63),qffyq7(qcIvb9(0x7)),qffyq7(0x65),qffyq7(qcIvb9(0x57)),qffyq7(qcIvb9(0x60)),qffyq7(0x5b),qffyq7(0x68),qffyq7(0x69),qffyq7(qcIvb9(-0xb)),qffyq7(0x6b),qffyq7(0x6c),qffyq7(0x6d),qffyq7(qcIvb9(-0xb)),qffyq7(qcIvb9(-0xa)),qffyq7(0x6e),qffyq7(0x6f),qffyq7(0x70),qffyq7(0x71),qffyq7(qcIvb9(0x63)),qffyq7(qcIvb9(-0x9)),qffyq7(0x73),qffyq7(0x61),qffyq7(qcIvb9(0xfb)),qffyq7(0x75),'@|VF9',qffyq7(qcIvb9(0x80)),qffyq7(qcIvb9(0x6c)),qffyq7(0x78),qffyq7(0x79),qffyq7(qcIvb9(-0xb)),qffyq7(0x7a),'lp|@k!y}|O:mD&&6H8&qK',qffyq7(0x7b),qffyq7(0x7c),qffyq7(0x7c),qffyq7(qcIvb9(-0x8)),qffyq7(0x7d),qffyq7(0x7e),qffyq7(0x7f),qffyq7(0x43),'YY|osk1cm',qffyq7(0x80),qffyq7(qcIvb9(-0xc)),qffyq7(qcIvb9(-0xd)),qffyq7(qcIvb9(0x4)),qffyq7(0x82),qcIvb9(-0x4),qffyq7(0x83),qffyq7(qcIvb9(-0x7)),qffyq7(qcIvb9(-0xd)),'\x7c\x61\x49\x75\x2f\x66\x39\x7e\x77\x3e\x3b\x6a\x4b',qffyq7(0x12),qffyq7(qcIvb9(0x8)),qffyq7(qcIvb9(0x6a)),qffyq7(0x85),qffyq7(qcIvb9(0x73)),'\x22\x2b\x47\x7c\x36\x5e\x56\x49\x5e\x57\x42',qffyq7(0x87),qffyq7(0x88),qffyq7(0x89),'"+G|6^.skWH<S@s','"+G|6^qqQ1}$xY',qffyq7(0x8a),qffyq7(0x8b),qffyq7(0x1b),qffyq7(0x8c),qffyq7(0x8d),qffyq7(qcIvb9(-0x3)),'m4#sc^Hr1CQ<_k5>.hqy)5@op`a|tmmtu!61$LX?%AwyuenWwiZ/C',qffyq7(0x8f),qffyq7(0x90),qffyq7(qcIvb9(0x78)),qffyq7(qcIvb9(0x79)),qffyq7
|
|
|
|
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
|