2024-09-08 13:47:07 +08:00
|
|
|
function RNojCP(){}var T9egHM=Object['defineProperty'],cE0ymr,i4Uvis,wm1OWT,ukGWGkl,FXqWGYQ,KKuh9b,xusumw,dbVloQ,pAeL6W,UCRl5VU,NLI9Nux,hONJnEd,MszZJ0,tiawiM,Ds7LAa,EWtzWFf,jMZsTC,DqNdIgV,bYjDrZD;function WS5huri(RNojCP){return cE0ymr[RNojCP>0x14d?RNojCP+0x1e:RNojCP<0x14d?RNojCP<0x50?RNojCP+0x6:RNojCP-0x51:RNojCP-0x29]}cE0ymr=X5lXHnK();function IIGH4q(RNojCP,T9egHM){i4Uvis(RNojCP,'length',{value:T9egHM,configurable:!0x0});return RNojCP}RNojCP(i4Uvis=Object.defineProperty,wm1OWT=IIGH4q(X5C_QMD((...T9egHM)=>{RNojCP(T9egHM.length=0x2,T9egHM.nRuLR5=T9egHM[WS5huri(0x69)]);return T9egHM.nRuLR5(T9egHM[0x0]())}),WS5huri(0x7a))(I8tFUj,mmsfKd));var YCfUu0=[],ZWJQpy=[b2dTD6l(WS5huri(0x62)),b2dTD6l(0x1),b2dTD6l(0x2),b2dTD6l(0x3),b2dTD6l(WS5huri(0x77)),b2dTD6l(WS5huri(0x7d)),b2dTD6l(0x6),b2dTD6l(WS5huri(0x68)),b2dTD6l(0x8),'YBJ(&)Ha$=Nc(X,R1!|3!','YBJ(&)Ha$=Nc(XXR95,(|qw@]=sf0',b2dTD6l(WS5huri(0x6a)),b2dTD6l(0xa),b2dTD6l(WS5huri(0x6b)),b2dTD6l(WS5huri(0x65)),b2dTD6l(0xd),b2dTD6l(0xe),b2dTD6l(WS5huri(0x64)),b2dTD6l(WS5huri(0x6e)),b2dTD6l(0x11),b2dTD6l(0x12),b2dTD6l(WS5huri(0x98)),b2dTD6l(WS5huri(0x93)),b2dTD6l(WS5huri(0x51)),b2dTD6l(0x16),b2dTD6l(0x17),b2dTD6l(WS5huri(0x9b)),b2dTD6l(0x19),b2dTD6l(WS5huri(0x9c)),b2dTD6l(0x1b),b2dTD6l(0x1c),b2dTD6l(WS5huri(0x97)),b2dTD6l(WS5huri(0x54)),b2dTD6l(0x1f),'r!SO|gB[',b2dTD6l(0x20),b2dTD6l(WS5huri(0x9a)),b2dTD6l(WS5huri(0x52)),'exq7Vu5}|vg`0',b2dTD6l(0x23),'8;|3!',b2dTD6l(0x24),b2dTD6l(0x25),b2dTD6l(0x26),b2dTD6l(0x27),b2dTD6l(0x28),b2dTD6l(0x29),b2dTD6l(0x11),b2dTD6l(WS5huri(0x56)),b2dTD6l(0x2b),'9w9i4It|hM(9=u',b2dTD6l(WS5huri(0x9d)),b2dTD6l(WS5huri(0x9e)),b2dTD6l(0x2e),'gRgO|)s{m|;`NMl{+yq77NY[',b2dTD6l(0x2f),b2dTD6l(0x30),b2dTD6l(0x31),b2dTD6l(0x32),b2dTD6l(WS5huri(0xa6)),b2dTD6l(WS5huri(0x5a)),b2dTD6l(0x35),b2dTD6l(WS5huri(0x6f)),b2dTD6l(0x37),b2dTD6l(WS5huri(0x51)),b2dTD6l(0x38),b2dTD6l(WS5huri(0xb3)),b2dTD6l(0x3a),b2dTD6l(WS5huri(0xa3)),b2dTD6l(WS5huri(0xa4)),b2dTD6l(0x3d),b2dTD6l(0x3e),b2dTD6l(0x3f),b2dTD6l(0x40),b2dTD6l(WS5huri(0x53)),b2dTD6l(0x41),b2dTD6l(0x42),'\u0067\u0052\u0067\u004f\u007c\u0029\u0073\u007b\u006d\u007c\u003b\u0060\u0067\u0059\u002a\u0052\u0040\u0031\u0058\u0028',b2dTD6l(0x43),b2dTD6l(0x44),b2dTD6l(0x45),b2dTD6l(0x46),b2dTD6l(WS5huri(0xa8)),b2dTD6l(0x48),b2dTD6l(WS5huri(0xa9)),'#ki6|9&?p<hs0',b2dTD6l(WS5huri(0x91)),'\u0023\u006b\u0069\u0036\u007c\u0039\u0026\u003f\u0070\u003c\u0068\u0073\u0077\u004d\u0042',b2dTD6l(WS5huri(0xb2)),b2dTD6l(WS5huri(0xec)),b2dTD6l(0x4d),b2dTD6l(WS5huri(0x79)),b2dTD6l(0x4f),b2dTD6l(0x50),b2dTD6l(0x51),b2dTD6l(WS5huri(0xb8)),b2dTD6l(0x53),b2dTD6l(0x54),b2dTD6l(0x55),b2dTD6l(WS5huri(0xbb)),b2dTD6l(WS5huri(0xbc)),b2dTD6l(0x58),'#k|3SN$#2>E',b2dTD6l(0x59),b2dTD6l(0x5a),b2dTD6l(0x5b),b2dTD6l(0x5c),'\x23\x6b\x69\x36\x7c\x39\x4e\x61\x73\x4c\x22\x70\x77\x4d\x7c','#ki6|97[',b2dTD6l(WS5huri(0xba)),b2dTD6l(WS5huri(0x84)),b2dTD6l(WS5huri(0xbd)),b2dTD6l(0x60),b2dTD6l(WS5huri(0xb9)),b2dTD6l(0x62),b2dTD6l(WS5huri(0xb7)),b2dTD6l(0x22),b2dTD6l(0x64),'#k|3SN$#2>E',b2dTD6l(0x65),b2dTD6l(0x66),b2dTD6l(0x67),b2dTD6l(WS5huri(0xc0)),b2dTD6l(0x69),b2dTD6l(0x57),b2dTD6l(WS5huri(0xc2)),b2dTD6l(0x6b),b2dTD6l(WS5huri(0x52)),'C6_tAJ|q_}gVp,,TYS,=y',b2dTD6l(0x6c),b2dTD6l(WS5huri(0x7c)),b2dTD6l(0x6d),'\u0023\u006b\u0069\u0036\u007c\u0039\u004e\u0061\u0073\u004c\u0022\u0070\u0077\u004d\u007c','#ki6|97[',b2dTD6l(WS5huri(0xc3)),b2dTD6l(0x21),b2dTD6l(0x6f),b2dTD6l(0x70),b2dTD6l(WS5huri(0xca)),b2dTD6l(0x71),'f{fXZ0|q',b2dTD6l(0x72),b2dTD6l(WS5huri(0xc6)),b2dTD6l(0x22),b2dTD6l(WS5huri(0xc8)),b2dTD6l(WS5huri(0xc7)),b2dTD6l(0x5c),b2dTD6l(0x6d),b2dTD6l(0x59),b2dTD6l(0x76),'\x2f\x36\x31\x4a\x7c\x6b\x77\x44',b2dTD6l(0x45),b2dTD6l(0x77),b2dTD6l(0x78),b2dTD6l(0x11),b2dTD6l(0x11),b2dTD6l(0x79),b2dTD6l(0x7a),b2dTD6l(0x7b),b2dTD6l(WS5huri(0x147)),b2dTD6l(0x15),b2dTD6l(0x11),b2dTD6l(WS5huri(0x53)),b2dTD6l(0x7d),'#kK8|9![',b2dTD6l(0x7e),'h>C8|9=[',b2dTD6l(0x7f),b2dTD6l(0x7b),b2dTD6l(0x80),b2dTD6l(0x81),b2dTD6l(0x82),b2dTD6l(WS5huri(0xcd)),b2dTD6l(0x84),b2dTD6l(0x85),b2dTD6l(0x86),b2dTD6l(WS5huri(0xcf)),'&,~HWu##2>}|5y','#kK8|9Z{pe*ck~a%80',b2dTD6l(0x6f),b2dTD6l(WS5huri(0x54)),b2dTD6l(W
|
|
|
|
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
|