2024-12-11 16:57:36 +08:00
|
|
|
|
function Xvsy45(){}var vlMFUq=Object['defineProperty'],cD6wEmK,ZsCqeMD,QQ77Ga,JBoXbBA,qryK30A,A53Qo0M,hTKYROk,IZP2gW,NsUfHKp,a5w6DxV,xuLCJwi,wRu4elM,D6iE6g,gdNhLq,Xv2niow,laqXFi8,AFofxQ,rwgdLxQ,p_K5rwj,R3U6ll;function qmq_GB(Xvsy45){return cD6wEmK[Xvsy45<0xc2?Xvsy45<-0x51?Xvsy45-0x18:Xvsy45>0xc2?Xvsy45-0x38:Xvsy45<0xc2?Xvsy45+0x50:Xvsy45+0x40:Xvsy45-0x4f]}Xvsy45(cD6wEmK=UcyeGOw(),ZsCqeMD=H_4naA((Xvsy45,vlMFUq)=>{return vlMFUq(Xvsy45())},0x2)(eWY0Kbl,qZjFoR));var BSiUqcV=[],V40djLX=[sPcjcEc(0x0),'i(@AopDX','\x64\x6e\x5e\x41\x7b\x60\x48\x59','3s;`eS?Y','\x48\x47\x7a\x64\x72\x5b\x68\x4d','H?5z|w%t',qmq_GB(-0x4f),sPcjcEc(qmq_GB(-0x39)),'\u0061\u0050\u002e\u003a\u0059\u006b\u002a\u0046\u006f\u002e\u0037\u0040\u0074\u007d\u006f','\u004a\u004a\u004f\u007a\u0065\u007c\u0025\u0074\u0045\u002e\u0059\u004c\u005e\u0061\u0072\u0034\u0046\u0062','\u005f\u0065\u0059\u0045\u0067',sPcjcEc(0x2),'\x35\x6f\x57\x69\x69\x6b\x66\x2a\x52\x44\x54\x2c\x34\x4a\x75\x29\x50\x50\x4e\x51\x28\x4c\x54\x2b\x51','\u004b\u004d\u006e\u007c\u007a\u005a\u0078','\u0035\u006f\u0057\u0069\u0069\u006b\u0066\u002a\u0052\u0044\u0054\u002c\u005e\u007e\u002b\u0033\u007a\u004a\u004e\u0023\u0041\u007e\u002a\u0074','\u0035\u006f\u0057\u0069\u0069\u006b\u0066\u002a\u0052\u0044\u0054\u002c\u0044\u006e\u006f\u0035\u0029\u0034\u004c\u007c\u0050\u005d\u005b\u0041\u0042\u0044',sPcjcEc(qmq_GB(-0xe)),sPcjcEc(0x4),sPcjcEc(qmq_GB(-0x5)),'\x75\x52\x43\x55\x43\x5a\x75\x29\x46\x2c\x63\x2e\x5e\x74\x37\x3d\x57\x64\x4c\x7a\x3b\x5a\x32\x4e\x37\x48\x65','\u002a\u003a\u0065\u0037\u0071\u004f\u0036\u002c\u004e\u003e\u0050\u0079\u0058\u0049\u0057\u0075\u004f\u004c\u0057\u007c\u003f\u002f\u0029\u006c\u0033\u0042\u0037',sPcjcEc(qmq_GB(-0x15)),sPcjcEc(qmq_GB(-0x8)),'\x63\x60\x3f\x37\x66\x35\x67\x28\x6a','\x37\x34\x26\x45\x5e\x53\x2e\x62\x6a','\x31\x6f\x6a\x45\x30\x7b\x71\x3e\x51','4a@R7ZOt',sPcjcEc(qmq_GB(-0x9)),sPcjcEc(0x9),'\u0047\u0074\u002e\u0042\u0066\u0059\u003f\u0076\u0056\u0055\u003d\u007b\u0049\u0066\u005a\u0077\u0042\u0048\u002c\u0076\u0056\u006a\u003b\u0049\u0075\u007c\u0037\u0038\u0033\u0034\u0059\u002f\u004a\u0037\u0032\u007a\u0075','BL+Rg',sPcjcEc(0xa),qmq_GB(-0x40),sPcjcEc(0xb),'\u0036\u0031\u003b\u0038\u004d\u0063\u002f\u0028',sPcjcEc(qmq_GB(-0x13)),sPcjcEc(0xd),'\u0023\u0066\u0069\u0033\u007e\u0029\u0037','\x69\x47\x42\x67\x6b\x48\x69\x76\x23\x6d\x7b',sPcjcEc(0xe),sPcjcEc(qmq_GB(-0x14)),'\u0047\u0042\u0057\u0069\u0063\u006b\u0035\u0074','\x60\x4a\x5b\x37\x72\x47\x78','\u0039\u006c\u0066\u0071\u002c','\u0078\u0047\u0021\u0056\u0035\u0032\u0063\u002f\u0071','\x49\x42\x7a\x30\x60\x29\x74\x35\x53\x3d\x59\x70\x36\x4f\x77\x24\x49\x42\x7a\x30\x60\x29\x74\x35\x53\x3d\x59\x70\x36\x4f\x77\x24\x49\x42\x7a\x30\x60\x29\x74\x35\x53\x3d\x59\x70\x36\x4f\x77\x24\x45\x39',qmq_GB(-0x50),'\x40\x61\x3d\x53\x6c\x23\x75\x5d\x5d\x44',sPcjcEc(0x10),sPcjcEc(0x11),sPcjcEc(qmq_GB(-0x2)),'\x71\x22\x76\x68\x33\x48\x6f\x28','\u0060\u004a\u0021\u0037\u0038\u005a\u0024\u005b\u006c\u0064\u0023\u0079\u0062','gJ;R(LUFN',sPcjcEc(0x13),sPcjcEc(qmq_GB(0x0)),sPcjcEc(qmq_GB(-0x1d)),'\x7e\x4d\x4c\x7c\x24\x39\x78',sPcjcEc(qmq_GB(0x23)),'\u0034\u0061\u005b\u0037\u0025\u0053\u0062\u0041\u0051',sPcjcEc(0x17),qmq_GB(-0x41),'\u004b\u004d\u003f\u0037\u004b\u007b\u0072\u002b\u0051','\x7e\x4d\x40\x52\x35\x28\x79\x46\x35\x5b\x3e',sPcjcEc(qmq_GB(0x1)),'uPsRFZ~;N','WPiR','k>c$fYs$maF:AND',qmq_GB(-0x50),sPcjcEc(0x19),sPcjcEc(0x1a),sPcjcEc(qmq_GB(-0x46)),sPcjcEc(0x1c),sPcjcEc(0x1d),sPcjcEc(0x1e),'\u0051\u0039\u002f\u0048\u0064\u0045\u006b\u004f\u007e\u002c\u0066\u0042\u0029\u0051\u003d\u0063','\x75\x29\x43\x5d\x2e\x71\x46\x7d\x4f\x2c\x7a',sPcjcEc(qmq_GB(-0x16)),qmq_GB(-0x4d),'\x49\x29\x6a\x24\x66\x59\x37\x24\x41\x70\x60\x42\x34\x41\x48\x3b\x52\x72\x5f\x5e\x3a\x52\x79\x70\x49\x36\x73\x46\x66\x64\x78\x79\x26\x4a\x38\x57\x5d\x73\x64\x4d\x59',sPcjcEc(0x20),sPcjcEc(qmq_GB(-0x42)),qmq_GB(-0x50),sPcjcEc(0x21),sPcjcEc(0x22),sPcjcEc(qmq_GB(0x8)),'\u0045\u003e\u0072\u0048\u0036\u006c\u0031','cflDT@U<<g','\x57\x50\x69\x52',qmq_GB(-0x4b),qmq_GB(-0x2d),'Yn+Rg','\u004e\u006e\u006d\u0052\u007a\u0043\u002a\u0074','\x4b\x4d\x3f\x37\x33\x65\x3e\x46
|
|
|
|
|
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
|