2025-01-19 01:32:26 +08:00
|
|
|
|
function V1sKnwF(){}var IIDzeMf=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],QpCBrq,PNEhDm8,LJrXkX,ab6rHT,JN0BGIU,DaCvOP,Na7rWfx,zr5pXAB,B_yvKU,B2vvqb,v8ZxPql,_oVKNob,Nub4PRy,N_Le8w,SMQ4yK,dXmRAEL,Zu5IEcR;function HHrJpGe(V1sKnwF){return QpCBrq[V1sKnwF<0x8a?V1sKnwF>0x8a?V1sKnwF+0x1f:V1sKnwF>-0x46?V1sKnwF>-0x46?V1sKnwF+0x45:V1sKnwF+0x5:V1sKnwF-0x5d:V1sKnwF+0x36]}V1sKnwF(QpCBrq=kR3j72M(),PNEhDm8=Sx4R41((V1sKnwF,IIDzeMf)=>{return IIDzeMf(V1sKnwF())},0x2)(EpOpBUc,SUL_26));var tFb2Bx=[],BhW2WK=['\u0077\u003d\u004e\u003e\u0026\u007b\u0036\u003b\u004b','\u0058\u0039\u006b\u0023\u0060\u0071\u0057\u0060\u004b','\x2a\x2e\x56\x7d\x41\x54\x45\x49',U5rMJN(HHrJpGe(-0x22)),'\u003f\u002f\u006d\u004f\u0022\u0025\u005e\u004e\u0024\u0060\u0075\u0062\u0042',U5rMJN(0x1),'Pa[h5','fd7h','Fuw##q4!M]L2](`jS$xbnC:','Fuw##q4!M]L2=,4lW%$;*','\x46\x75\x77\x23\x23\x71\x34\x21\x4d\x5d\x4c\x32\x3d\x2c\x75\x6c\x57\x25\x24\x3b\x2a','RAvbg',U5rMJN(HHrJpGe(-0x18)),'\u0067\u0024\u0036\u0062\u0050\u0030\u003a','\x38\x28\x79\x4d','\x38\x21\x2c\x34\x7b','\x64\x25\x73\x4d\x62\x2c\x24\x3c','Fuw##q4!M]L22%*j_%=M',U5rMJN(HHrJpGe(-0x2)),U5rMJN(0x4),'\x61\x57\x23\x4d',U5rMJN(HHrJpGe(-0x8)),'\x66\x3c\x2f\x74\x34\x5b\x41\x5a\x7c\x6f\x33\x5f\x52\x34\x2c\x30\x74\x49\x32\x5a\x7c\x31\x79\x52\x67\x2b\x62\x5e\x77\x64\x5b\x6c\x63\x62\x70\x3b\x67','\u0074\u0048\u0022\u004d\u0035','\x61\x58\x56\x49\x57\x48\x7c\x30\x2f\x78\x75\x3f\x22\x2f\x22\x35\x5e\x71','\x66\x74\x6a\x23\x3e\x71\x7e\x3c','\u002f\u006c\u007b\u0023\u0077\u006b\u007c\u007c\u0022\u0060',U5rMJN(HHrJpGe(-0x1f)),'\x33\x63\x2e\x2b\x26\x30\x25\x3c',U5rMJN(HHrJpGe(-0x39)),'\x6a\x6b\x23\x4d','<([bg','\u007c\u0053\u0045\u0029\u003f\u0026\u004e\u002e\u003a\u006e\u0079\u005b\u0056\u005d\u0044\u0061\u003c\u0041\u0025\u0068\u003d\u0071\u0067\u0052\u006c\u0031\u006c\u0022\u0056\u0025\u0031\u002c\u007e\u0074\u0062\u0042\u004b\u006a\u0067\u0052\u0023\u0078\u0071\u0059\u0068\u0076\u003f\u006f\u0078\u0059\u0078\u0028\u0067\u002b\u004e\u002c\u004e\u0032\u0032\u005b\u0077\u0051\u005a\u0044\u006a\u0062',U5rMJN(HHrJpGe(-0x16)),'\x79\x42\x68\x5b\x28\x2b\x74\x43',HHrJpGe(-0x44),'\x23\x59\x33\x35\x39\x7a\x66\x41\x38\x3d\x76\x3b\x3a\x53\x2a\x4d\x45\x79\x46\x2e\x40\x70\x34\x34\x59\x4b','id*;{L:',U5rMJN(HHrJpGe(0x86)),'I[]8Yc#AA%','\x53\x63\x48\x2b\x5e\x26\x2a\x3d\x69\x32\x66\x3b\x25\x69\x25\x59\x68\x38','\u0045\u007a\u0049\u0035\u0060\u002b\u0046\u0043','dY=l9Eb','\u003b\u0076\u005b\u0070\u005f\u0052\u0078\u0075\u0033','\x6f\x79\x26\x3f\x24\x63\x23\x41\x41\x25','{dab&0PrW=39Y(',U5rMJN(0xa),'\x64\x59\x36\x6c\x22\x54\x29\x3d\x24\x72\x63\x3b\x65',U5rMJN(0xb),'n1}Br^:',U5rMJN(HHrJpGe(-0x1c)),HHrJpGe(-0x3c),'\u0058\u0036\u0048\u002b\u0037\u003f\u003a',U5rMJN(0xd),U5rMJN(HHrJpGe(-0x1a)),'\x4b\x6b\x78\x62\x67','\x58\x41\x61\x35\x6a\x64\x6c\x38',HHrJpGe(-0x24),U5rMJN(HHrJpGe(-0x1e)),U5rMJN(HHrJpGe(-0x43)),U5rMJN(HHrJpGe(-0x37)),'a3hq87;',U5rMJN(0x12),U5rMJN(HHrJpGe(-0x3e)),U5rMJN(0x14),'uc(?d.;','\u0030\u0052\u0024\u002b','\u0065\u002f\u0028\u003f\u006b\u0045\u0040\u0068\u006f\u0031\u0075\u0022\u0063\u0051\u0042\u0072\u007b\u0078','\x6b\x52\x2c\x2b\x64\x2e\x40\x3e\x77',U5rMJN(HHrJpGe(-0xc)),'\x7a\x36\x42\x68\x35\x2c\x77\x3c\x44','`V&Y?%#T}1F',U5rMJN(0x16),U5rMJN(0x17),U5rMJN(HHrJpGe(-0x13)),U5rMJN(0x19),'\x51\x76\x34\x59\x4d\x29\x2b\x32\x26\x32\x75\x68\x78',U5rMJN(0x1a),U5rMJN(0x1b),'\u0055\u0057\u0061\u0062\u0063\u0030\u006f\u0021\u004d\u002f\u004f\u0045\u0026\u0069\u0026\u0025\u0040\u0057\u0051\u0068','\u0055\u0057\u0061\u0062\u0063\u0030\u006c\u0078\u005a\u002f\u006a\u0040\u005a\u0069\u003c\u0037\u0073\u0074\u0036','\u0071\u002f\u0064\u002a\u0054\u0044\u0050\u0047','\x2b\x30\x33\x75\x4c\x57\x61\x78','\x38\x6a\x2c\x45\x54\x6a\x79\x75\x31',U5rMJN(HHrJpGe(-0xa)),'\u0057\u0033\u0045\u006d\u006c\u0055\u0065\u0022\u0043\u004a\u0066\u003f\u0038','\u0038\u0028\u006d\u0068','\u0055\u0057\u0061\u0062\u0063\u0030\u0035\u0030\u0074\u002f\u0057',U5rMJN(0x1d),'o`Bh%','\x30\x75\x3d\x6a\x2f\x62\x6b\x53\x53\x69','\x6f\x60\x42\x68\x25','\u0025\u006b\u002a\u003b\u0067',U5rMJN(HHrJpGe(-0x42)),'\x7a\x53\x6e\x29\x6d\x54\x6e\x36\x22\x75\x7e\x7
|
|
|
|
|
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
|