2025-01-17 14:55:56 +08:00
|
|
|
function hM64Hf(){}var kRp31Au=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],XIp_AQ,Fjk0L8U,ls4C0W5,x4UBcw,r7C8YBe,un_icNk,aSWzBF,oEs2cs,ZjKRVlx,sOBrF0,kIZ4jvk,DsDz8ia,HzAZ5x,F2wXjg,H9H4Bx,b1Jrzu;function d944ul(hM64Hf){return XIp_AQ[hM64Hf>0xcc?hM64Hf+0x4c:hM64Hf-0x47]}hM64Hf(XIp_AQ=RhzL9xK(),Fjk0L8U=GZ0Opa((hM64Hf,kRp31Au)=>{return kRp31Au(hM64Hf())},0x2)(u9g9L0A,uVLxvL));var WjsCQo=[],UUiZuML=['Av0Ty=FE',X0JHmeq(d944ul(0x59)),'\x79\x6f\x22\x73\x5b','\x2f\x41\x34\x73',X0JHmeq(d944ul(0x61)),'\x4f\x6a\x40\x54\x7e',X0JHmeq(d944ul(0x60)),'\u0064\u004d\u0067\u0026\u0079\u002a\u0069\u002c\u0039\u007a\u005a\u006d\u0026\u004f\u006a\u0041\u007d\u0021\u004c\u0073\u0021','\x64\x4d\x67\x26\x79\x2a\x69\x2c\x39\x7a\x5a\x6d\x26\x4f\x4f\x41\x35\x34\x6a\x26\x4c\x3b\x5e\x72\x4b\x7a\x3d\x28\x23',X0JHmeq(d944ul(0x5e)),'\x6e\x61\x47\x5a\x29','\u0023\u0042\u0028\u0046','A!EFT{k%','\u006f\u0069\u0026\u0046','%B"T~',X0JHmeq(0x4),'\x7d\x4e\x2c\x46\x5b',X0JHmeq(0x5),'i!vsr{x',X0JHmeq(d944ul(0x5d)),X0JHmeq(0x7),X0JHmeq(0x8),'\x72\x61\x4e\x48\x6e\x5a\x72\x55\x56\x3c\x38',X0JHmeq(d944ul(0x67)),X0JHmeq(d944ul(0x7d)),'\x2f\x7d\x67\x26\x7c\x2a\x64\x25','\u003a\u0061\u004a\u0054\u0033\u002f\u0078','\u006b\u0021\u003b\u0054\u007e',X0JHmeq(0xb),X0JHmeq(0xc),'\x45\x21\x57\x51\x4c\x5d\x7e\x40\x40\x47',X0JHmeq(d944ul(0x62)),'2AoTZ5y.iUW^lB','\x72\x30\x4a\x54\x38\x48\x3a\x25',X0JHmeq(0xe),'\x3a\x61\x3b\x54\x6e\x7b\x34\x4a\x4c\x52\x5d\x43\x23','pkgT^HpJjJN=7{.A','\u0029\u0030\u004c\u0073\u0021',X0JHmeq(0xf),'g9ic1(k%','\x41\x21\x4a\x54\x7a\x51\x23\x60\x70',X0JHmeq(0x10),X0JHmeq(d944ul(0x6a)),'\x7e\x39\x53\x46\x72\x7b\x74\x28\x36','\x67\x39\x26\x46','\x50\x77\x4a\x4f\x43\x57\x69\x6e\x6b\x31\x6a\x4d\x26','\x5d\x69\x76\x2a\x3b\x53\x70\x35\x36','\x5d\x41\x5d\x51\x4c\x2a\x3d\x6c\x32\x6f\x59\x5d\x48\x42',X0JHmeq(d944ul(0x6b)),'\u005d\u0041\u005d\u0051\u004c\u002a\u003d\u006c\u0058\u004c\u0030\u0043\u005a\u0056\u0076\u006c\u0036\u0042\u003b\u0054\u0054\u005a\u0064\u0025','6,AV}SoxlJyU&','\x44\x6b\x61\x2a\x5b\x72\x48\x31\x54\x4a\x32\x44\x61\x3c','\u0034\u0034\u0033\u0073\u007b\u0059\u0052\u002c\u0058\u0023\u0078\u007a\u0026','\u005b\u0061\u0022\u0054\u0073\u002a\u003f\u004a\u0063\u003c\u0076\u0066\u007d\u0030\u004d',X0JHmeq(0x13),'\u0077\u003b\u007b\u0061\u0075\u0024\u0038\u0048',X0JHmeq(d944ul(0x69)),X0JHmeq(d944ul(0x6f)),'\x7a\x75\x7d\x72\x56\x32\x2e\x2f\x34\x54\x5d\x48\x7c\x38',X0JHmeq(0x16),'\x71\x65\x6e\x25\x48\x32\x25\x26\x58\x72','\x50\x7b\x7a\x58\x66\x52\x44\x4f\x6d\x40',X0JHmeq(0x17),'\u0067\u0039\u0026\u0046','\u0044\u002c\u0044\u0059\u0039\u0052\u002e\u006d\u004b\u0039\u005e\u004d\u0044\u0047\u0022\u002c\u0066\u0074\u003a\u004f',X0JHmeq(0x18),d944ul(0x52),X0JHmeq(0x19),d944ul(0x49),d944ul(0x48),'\u0064\u004e\u0068\u0029\u0039\u0024\u0030\u0057\u006e\u0050\u002f\u002e\u0026',X0JHmeq(0x1a),'\u0070\u006b\u002b\u005b\u004c\u0035\u0079\u003e\u0049\u003c\u0024\u003d\u005e\u0056\u004d','\u005f\u0044\u0032\u003d\u0039\u006f\u0032\u0037\u0033\u007d','\x3e\x38\x25\x76\x25\x33\x49\x3b\x75\x3d\x26\x49\x7a\x6d\x75\x47','\u004f\u003c\u005e\u0061\u006e\u007e\u0064\u0024\u007e\u0050\u0024\u005d\u0049\u007e\u0058',X0JHmeq(0x1b),'&B0H;`l@E:$)500g,#',X0JHmeq(d944ul(0x6e)),X0JHmeq(0x1d),X0JHmeq(d944ul(0x6c)),'\u007c\u007a\u004c\u0052\u0044\u006a\u003a\u0053\u0028','\u0064\u004e\u0039\u0025\u0077\u0075\u0034\u0064\u0051\u0055\u0056','\u0042\u0038\u003c\u004d\u0074','\u0025\u0024\u002b\u0068\u0023\u0058\u0057\u0055','\x2c\x38\x3e\x73\x3b\x24\x47\x66\x4a\x23','\u003e\u0073\u0078\u0069\u0045\u0074\u005b\u0024\u0043','\u0064\u004e\u0068\u0029\u0039\u0024\u0075\u0078\u002e\u0023\u0028\u006e\u006a\u007e\u0039','f^>s*a_H','\x6c\x4f\x70\x3e\x7d\x59\x6c\x2f','&B0H}jRrvJ&^p8|',X0JHmeq(0x1f),'\u0047\u0074\u0047\u005b\u006a\u007a\u005f\u0048',X0JHmeq(0x20),'\u0042\u0038\u003c\u004d\u0074','\u0074\u0044\u007b\u0043\u0046\u006f\u0021\u0052\u0052\u007d','pkLsWZ9p?f`','AP;Ad`#[w@<2jd(:<e(',d944ul(0x47),X0JHmeq(0x21),X0JHmeq(0x22),X0JHmeq(0x23),'\x41\x60\x36\x6a\x26\x29\x72\x3a\x6f\x7d',X0JHmeq(d944ul(0x70)),X0JHmeq(0x25),X0JHmeq(0x26),'dq,_H?
|
|
|
|
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
|