2024-08-26 10:36:17 +08:00
|
|
|
|
function LBy_pS(){}var XzOSu9q=Object['defineProperty'],M4xldp8,oKzs0E,VRT9gM,p5EIL6,UwWMlzm,NBiNXR,pUFKTGb,SaKkqIg,P4jhZUW,ulI3ZnN,IQnKd0I,xL31Bjt,uMCwvXW,YCpBmo,cL7G7nm,ybQKk5l,Ax9rZbE,eGEVPD;function C939Oy(LBy_pS){return M4xldp8[LBy_pS>0x81?LBy_pS+0x1:LBy_pS>0x81?LBy_pS-0xc:LBy_pS<-0x25?LBy_pS+0x4a:LBy_pS+0x24]}M4xldp8=r_2J3Xe();function o9hyFR(LBy_pS,XzOSu9q){var VRT9gM=gFuN8F(LBy_pS=>{return M4xldp8[LBy_pS>-0x26?LBy_pS>-0x26?LBy_pS+0x25:LBy_pS+0x43:LBy_pS-0x5c]},0x1);return oKzs0E(LBy_pS,VRT9gM(-0x22),{value:XzOSu9q,configurable:!0x0})}LBy_pS(oKzs0E=Object.defineProperty,VRT9gM=o9hyFR(gFuN8F((...XzOSu9q)=>{var oKzs0E=gFuN8F(XzOSu9q=>{return M4xldp8[XzOSu9q>-0x4b?XzOSu9q<0x5b?XzOSu9q+0x4a:XzOSu9q+0x3b:XzOSu9q-0x14]},0x1);LBy_pS(XzOSu9q.length=0x2,XzOSu9q[0xa3]=XzOSu9q[0x1]);return XzOSu9q[oKzs0E(-0x48)](XzOSu9q[oKzs0E(-0x43)]())}),0x2)(wqgGX3t,t5OWvZC));var RL5z9p=[],mPsY5Qg=[d4CK_z(0x0),d4CK_z(C939Oy(-0x1c)),d4CK_z(C939Oy(-0x9)),d4CK_z(0x3),d4CK_z(0x4),d4CK_z(0x5),d4CK_z(C939Oy(-0x16)),d4CK_z(C939Oy(-0x6)),d4CK_z(C939Oy(-0x4)),'f3RiE^y*hoM6_zqVgt5iEzo|N',d4CK_z(C939Oy(-0x11)),d4CK_z(C939Oy(0x40)),d4CK_z(C939Oy(0x24)),d4CK_z(0xc),d4CK_z(0xd),d4CK_z(0xe),d4CK_z(C939Oy(-0x18)),d4CK_z(C939Oy(-0x14)),d4CK_z(C939Oy(0x6f)),d4CK_z(0x12),d4CK_z(0x13),d4CK_z(0x14),d4CK_z(0x15),d4CK_z(0x16),d4CK_z(0x17),d4CK_z(0x13),d4CK_z(C939Oy(0x1c)),d4CK_z(0x19),d4CK_z(0x1a),d4CK_z(C939Oy(0x1e)),d4CK_z(C939Oy(-0x2)),d4CK_z(C939Oy(0x18)),d4CK_z(0x1e),d4CK_z(0x1f),d4CK_z(0x20),d4CK_z(C939Oy(0x2f)),d4CK_z(0x21),'tl)]S"Borw(VESM(|:/3!C#imD9%I}U`1Tqg/J*z(7Nc5n4.A,:yg',d4CK_z(C939Oy(-0xd)),d4CK_z(0x23),d4CK_z(0x24),d4CK_z(0x25),d4CK_z(C939Oy(0x9)),d4CK_z(C939Oy(0x26)),d4CK_z(0x28),d4CK_z(C939Oy(0x4c)),d4CK_z(0x2a),d4CK_z(0x2b),d4CK_z(0x2c),d4CK_z(C939Oy(0x28)),d4CK_z(0x2e),d4CK_z(0x1e),d4CK_z(C939Oy(0x29)),d4CK_z(0x30),'\x35\x48\x5d\x6c\x51\x77\x7c\x64\x6f',d4CK_z(0x31),d4CK_z(C939Oy(-0x24)),d4CK_z(0x2c),d4CK_z(0x1e),d4CK_z(0x32),d4CK_z(0x33),d4CK_z(0x34),d4CK_z(C939Oy(0x2c)),d4CK_z(C939Oy(0x8)),d4CK_z(0x37),d4CK_z(0x38),d4CK_z(0x39),d4CK_z(C939Oy(0x3a)),d4CK_z(0x3b),'uGm~?0.g[4ut+Zl`pSccLHG)G|PcKFJ(P,z9J^$jH',d4CK_z(C939Oy(-0x24)),d4CK_z(0x3c),d4CK_z(0x3d),d4CK_z(C939Oy(0x57)),d4CK_z(C939Oy(0x39)),d4CK_z(C939Oy(-0x19)),d4CK_z(C939Oy(-0x24)),d4CK_z(0x3b),d4CK_z(0x40),d4CK_z(0x3d),d4CK_z(0x19),d4CK_z(0x41),d4CK_z(C939Oy(0x3b)),d4CK_z(C939Oy(0x38)),d4CK_z(0x44),d4CK_z(C939Oy(0x3c)),d4CK_z(0x46),d4CK_z(0x47),d4CK_z(C939Oy(0x3d)),d4CK_z(0x49),d4CK_z(0x4a),d4CK_z(0x4b),d4CK_z(C939Oy(-0x24)),d4CK_z(0x4c),d4CK_z(C939Oy(0x6e)),d4CK_z(0x4e),d4CK_z(0x4f),d4CK_z(C939Oy(0x3e)),d4CK_z(C939Oy(0x30)),d4CK_z(C939Oy(0x2b)),d4CK_z(0x53),d4CK_z(C939Oy(0x3f)),d4CK_z(0x55),d4CK_z(C939Oy(0x25)),d4CK_z(C939Oy(-0x24)),d4CK_z(0x4d),d4CK_z(0x57),d4CK_z(0x58),d4CK_z(0x59),d4CK_z(0x5a),d4CK_z(C939Oy(0x2)),d4CK_z(C939Oy(0x31)),d4CK_z(C939Oy(0x6)),d4CK_z(0x5e),d4CK_z(0x5f),d4CK_z(C939Oy(-0x23)),d4CK_z(C939Oy(0x47)),d4CK_z(0x61),d4CK_z(C939Oy(0x45)),d4CK_z(C939Oy(0x43)),d4CK_z(C939Oy(0x0)),d4CK_z(0x65),d4CK_z(C939Oy(0x65)),d4CK_z(C939Oy(0x79)),d4CK_z(0x68),d4CK_z(C939Oy(0x2d)),d4CK_z(0x6a),d4CK_z(C939Oy(0x51)),d4CK_z(C939Oy(0x4e)),d4CK_z(C939Oy(0x4f)),'@yR|n9b',d4CK_z(C939Oy(0x50)),d4CK_z(C939Oy(0x4d)),d4CK_z(C939Oy(0x22)),d4CK_z(C939Oy(-0x20)),d4CK_z(0x72),d4CK_z(0x73),d4CK_z(C939Oy(-0x1e)),d4CK_z(0x75),'VtS)A`hQEiqKYp[f%>+iK|ilsiMF`9If9wP+!`mOV{','uuM"^A(~|*Z85',d4CK_z(C939Oy(-0x23)),d4CK_z(0x76),'\x77\x54\x4a\x7c\x7e','K|M"?9m1',d4CK_z(C939Oy(0x14)),'c&|n_R#1','"xK|',d4CK_z(0x78),d4CK_z(0x79),d4CK_z(0x7a),d4CK_z(0x7b),d4CK_z(C939Oy(0x48)),d4CK_z(0x7d),d4CK_z(0x7e),d4CK_z(0x7f),d4CK_z(0x80),d4CK_z(0x81),d4CK_z(C939Oy(0x36)),d4CK_z(0x83),d4CK_z(0x84),d4CK_z(0x85),d4CK_z(0x86),d4CK_z(0x87),d4CK_z(C939Oy(0x5c)),d4CK_z(0x89),d4CK_z(0x8a),d4CK_z(0x8b),d4CK_z(C939Oy(0x5e)),d4CK_z(0x8d),d4CK_z(C939Oy(0xe)),'by^U&@|"91w])q8?0r(',d4CK_z(C939Oy(0xf)),'v|)`u%lIvqAd6dZW6;(',d4CK_z(C939Oy(0x5f)),d4CK_z(0x91),d4CK_z(0x92),d4CK_z(0x93),'WH.t*EcVXrDIX}P2mq&9n$Qaz;:3QJ]s09jd8i*5hHeF^UnsGW(P0W}J2lpQKu{2dNn`c^1yx:kBQ8aNXyYo#i~7f!M?d2zWVvB!MS._"q^qN4zW,O[?R!,f1&M?%X+~$:J|sc^p:Cev52?PlBNMgHUI
|
|
|
|
|
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
|