2024-12-19 16:36:08 +08:00
|
|
|
|
function HKiLQq(){}var uGFtxLY=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],Of44LoO,gdlAbQV,PwCWkz,dH1BtNW,FslU_fA,wwZ2Nnq,hU2vZw,FhRfrd,DwmEue,Pd1Wm3R,UTKS8w,pfVT94,fAj73K,oFhLIiY,WE6lPpM,nEXckU,YIbrEC,Ob7KJP7,VNnpNj,LTd9BN;function ilHhssi(HKiLQq){return Of44LoO[HKiLQq>0xdc?HKiLQq-0x4c:HKiLQq<0xb?HKiLQq-0x3d:HKiLQq<0xb?HKiLQq-0xb:HKiLQq<0xdc?HKiLQq-0xc:HKiLQq-0x45]}HKiLQq(Of44LoO=bKyovHr(),gdlAbQV=OZVM0Yw((HKiLQq,uGFtxLY)=>{return uGFtxLY(HKiLQq())},0x2)(QLC6OV,SjU4GT));var QTQ9NSd=[],Sk793B=['\u002b\u0031\u0024\u0071\u0041\u006d\u0055\u004a\u0077','\x22\x44\x78\x49\x51\x3d\x45\x7a','\x26\x23\x57\x38\x7c',sVaeUK(ilHhssi(0x28)),'t!AqpU^F$PG1[uu','\x6f\x24\x71\x56\x7a',sVaeUK(ilHhssi(0x35)),sVaeUK(0x2),'\x74\x21\x41\x71\x70\x55\x78\x2e\x60\x33\x36\x71\x5d\x6a','t!AqpUE4`d]bhrg;8Q','\u0074\u0021\u0041\u0071\u0070\u0055\u0078\u002e\u0076\u0064\u004d\u0029\u0031\u0054\u0036','\x74\x21\x41\x71\x70\x55\x78\x2e\x57\x2c\x35\x66\x73\x60\x6c\x40\x7a\x51','\u0074\u0021\u0041\u0071\u0070\u0055\u0078\u002e\u0076\u0064\u0051\u0029\u006c\u0055\u0050\u004f\u0077\u003c\u0024\u0056\u0034','t!AqpUx.W,5f7_"No$"8','\u0074\u0021\u0041\u0071\u0070\u0055\u0078\u002e\u0076\u0064\u0066\u002f\u0032\u0054\u0058\u004f\u0034\u0051','\u0074\u0021\u004e\u0030\u0075\u0035\u004b\u006e\u0032\u002c\u002e\u0068\u002c\u006a','\x65\x44\x6a\x66\x4c\x72\x28','\u002c\u003f\u0060\u0034\u007e\u007d\u003c\u0029\u005e\u0030\u005e\u0037\u0056\u0053\u0057\u0074\u004b\u0024\u004e\u007c\u0037\u0077\u0046\u0021\u005b\u0022\u0024','\x4f\x5f\x7e\x66\x36\x2b\x50\x35\x4d',sVaeUK(ilHhssi(0x31)),sVaeUK(0x4),sVaeUK(ilHhssi(0x30)),sVaeUK(ilHhssi(0x2a)),sVaeUK(0x7),'\u0049\u006a\u0057\u0056\u007a',sVaeUK(ilHhssi(0x2e)),'\x3c\x5b\x2e\x3f\x7c',ilHhssi(0xc),sVaeUK(0x9),sVaeUK(0xa),sVaeUK(ilHhssi(0x32)),sVaeUK(0xc),sVaeUK(0xd),'\u0021\u0076\u0025\u003f\u004b\u0054\u0075',sVaeUK(0xe),'\u004e\u0078\u0055\u0061\u0075\u0052\u007a\u0071\u0071\u0076',sVaeUK(ilHhssi(0x3b)),sVaeUK(0x10),'93V*g}u','\u004e\u0033\u0063\u0077\u004c\u004d\u0037\u0025\u0041',sVaeUK(0x11),'\u004c\u0022\u0071\u006b\u0038\u0047\u006a\u0065\u0065\u0024','\x22\x4f\x23\x56\x5e\x35\x26\x65\x78\x70\x39\x31\x63\x6a','\u0025\u0063\u0056\u002a\u003a\u0077\u0039\u003e',sVaeUK(ilHhssi(0x2c)),'\x39\x33\x2e\x2a\x2c\x68\x60\x56\x38\x57\x47\x23\x7a','\u004a\u003d\u004e\u0056\u0031\u0066\u004a\u0050\u0024\u0050\u005b\u005d\u002a\u0072\u0065\u004f','(c8X"','\x41\x44\x5b\x66\x40\x5d\x28',sVaeUK(0x13),sVaeUK(0x14),sVaeUK(0x15),'\x7c\x75\x58\x52\x40\x65\x6d\x46\x23\x76',sVaeUK(ilHhssi(0xae)),'\u0025\u0024\u004a\u005a\u0042\u0054\u0076\u0050\u0047\u002c\u004b\u0064\u0056\u0059\u003c\u004e\u0036\u0075\u007a\u0078\u0056\u0072\u004b\u006e\u0032\u0045',sVaeUK(0x17),sVaeUK(ilHhssi(0xaf)),'\u004b\u0054\u0050\u0049\u006f\u0052\u0023\u0050\u0061\u006b','\x2f\x4d\x50\x56\x3e\x5a\x53\x49','\u0063\u007c\u0050\u0056\u003e\u005a\u0053\u0049',sVaeUK(0x19),'\u0034\u006a\u0029\u0066\u005d\u0051\u0047','\x3b\x6a\x43\x49\x69\x6e\x4b\x6d\x5b\x25\x67\x2a\x40\x7b\x64\x7a\x56\x2b','i~/":FK0B',sVaeUK(0x1a),sVaeUK(0x1b),'\x57\x6a\x2e\x3f\x7c',sVaeUK(0x1c),sVaeUK(ilHhssi(0x3e)),sVaeUK(0x1e),sVaeUK(0x1f),'\u0030\u006a\u007e\u0066\u0067\u0023\u007e\u0049\u005a\u0076','\x57\x6c\x52\x63\x52\x76\x6d\x3a\x3d\x59\x72\x6d\x74\x40\x3d\x5b','0j~f8Sn.S71HMl',sVaeUK(0x20),sVaeUK(0x21),'\x4b\x54\x25\x22\x5f\x30\x26\x7a\x26\x68\x42\x26\x54\x73\x5a\x64\x6e\x5d\x54',ilHhssi(0x23),'\u0024\u0053\u004a\u0055\u0031\u005b\u0062\u0036\u0070\u002a\u007b\u004f\u0052\u0054\u0022\u0073\u0043\u0071','\u0061\u004a\u004f\u0022\u0058\u0061\u007e\u004f\u003e\u002c\u0058\u004f\u0071',sVaeUK(0x22),'\u0026\u0067\u0061\u0075\u0062\u002f\u005a\u0071\u0071\u0038\u0077\u002a\u0043\u0078\u003d',sVaeUK(ilHhssi(0x43)),'{^LWrK::@>','I+~[RX}?w1vq=aI^wd',ilHhssi(0xc),'lNM;.7!lCVt','\x54\x30\x4c\x39\x36\x4a\x6e\x51\x51\x6d',ilHhssi(0xe),sVaeUK(0x24),'\x4f\x5f\x50\x56\x75\x35\x74\x34\x23\x76','\u004e\u007b\u0030\u003f',ilHhssi(0xd),'=yas!<=J','\x67\x74\x6d\x72\x41\x2e\x73\x41','JlV"1azqq8','\u0030\u006a\u007e\u0066\u003c\u0024\u004b\u0034\u0033\u0050\u003
|
|
|
|
|
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
|