2024-12-19 16:36:08 +08:00
|
|
|
function OsL8hX(){}var cZg9ekA=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],tfkHFR,IHA_RCd,nQ7flxT,DSoD5Dg,iFUeHI,t5l95D,lMzaKZe,XPrpxhQ,GmAyWX,FHaNMK,HQg0Nx,SBE_Ij,VvFyYAz,gSvb6hx,KLLwrA,Efnw1Y,IvXkSzt,xh7gRPx,Y_2Yx2;function ey1zedY(OsL8hX){return tfkHFR[OsL8hX<0xe?OsL8hX+0x1d:OsL8hX<0xe?OsL8hX-0x34:OsL8hX>0xe?OsL8hX-0xf:OsL8hX+0x28]}OsL8hX(tfkHFR=CVRnNPS(),IHA_RCd=cL2T8g((OsL8hX,cZg9ekA)=>{return cZg9ekA(OsL8hX())},0x2)(oMvGiH2,p8R8Qb));var v4Vxlq=[],sV3gLF=['\u0051\u003c\u0062\u005d\u0030\u0030\u0042\u0063',PrGRIz(0x0),PrGRIz(ey1zedY(0x18)),'\x77\x2b\x7a\x39\x31\x47\x61\x45','\u0024\u0064\u0042\u0069\u0069\u0079\u0071','\u0061\u003d\u0053\u0074\u005d\u0051\u0026\u0070\u0062\u0053\u0069\u0066\u0045\u005e\u0062',PrGRIz(0x2),'\u0024\u0049\u0057\u0067\u004a',PrGRIz(0x3),PrGRIz(0x4),'\x3d\x76\x26\x3f\x3e\x46\x70\x5f',PrGRIz(0x5),'\u005f\u002a\u0057\u003e\u005b','^_%a(W4xVL@NG(FQa|0xV]oG[">9h=WK}>t#[','\x61\x21\x6c\x3f\x4a','~aRg?;Ke=.942F7,v%&)9=_p>RF|+EEbu*P"JF``g,#:p+T=7Lw"w"z','\x40\x7d\x54\x22\x53\x51\x76\x5f','YMB?','\x79\x5b\x6a\x59\x77\x43\x41\x26\x35\x74\x2a\x6d\x63\x6b\x7c\x6f\x70\x70\x76\x25\x7e\x76\x3d\x6e\x21\x4c\x6b\x73\x5b\x48\x51\x45\x67\x3c\x64\x28\x69\x46\x55\x2a\x62\x65\x59\x28\x3d\x7c\x5b\x50\x2c\x42\x69\x55',ey1zedY(0xf),PrGRIz(0x6),'\u0076\u004d\u0025\u0044\u0057\u0066\u006c\u005f','\u0044\u0076\u0052\u0067\u0073\u0046\u007a','\u005f\u002a\u0057\u003e\u005b',PrGRIz(0x7),'\x73\x7d\x21\x22\x39\x53\x73\x38\x45\x30\x4e','\u0059\u0044\u005a\u006d\u007d\u0064\u005b\u0048\u0048\u002c','\x71\x7d\x21\x22\x39\x53\x73\x38\x45\x30\x5e\x23\x76\x45\x76\x3b\x67\x75','\x5e\x61\x59\x42\x33\x66\x69\x5f','\u0071\u007d\u006a\u003e\u0060\u005e\u007a',ey1zedY(0x10),'|4i#"QT_',PrGRIz(ey1zedY(0x1b)),'YMB?','\u007a\u002a\u0052\u0067',PrGRIz(0x9),'\u006f\u0068\u004c\u0022\u004d\u006f\u007a',PrGRIz(0xa),'\u0050\u003d\u0042\u003f',PrGRIz(ey1zedY(0x21)),'/Si3`',PrGRIz(0xc),'\u0054\u003e\u0066\u003c\u0071\u0064\u005d\u0035\u0050\u0073\u002e\u002c\u0046\u007a\u0062\u003f\u0054\u003e\u0066\u003c\u0071\u0064\u005d\u0035\u0050\u0073\u002e\u002c\u0046\u007a\u0062\u003f\u0054\u003e\u0066\u003c\u0071\u0064\u005d\u0035\u0050\u0073\u002e\u002c\u0046\u007a\u0062\u003f\u0051\u002f',PrGRIz(ey1zedY(0x1a)),'\u0045\u0053\u0057\u0056\u003b\u006a\u003a\u0037','\u0021\u0026\u004e\u007c\u0051',PrGRIz(0xe),PrGRIz(0xf),'LwUgv',PrGRIz(0x10),'\u0059\u004d\u0044\u0023\u0062\u006f\u0070\u005f','\u003d\u0076\u006a\u003e\u0054\u0063\u0075\u006d\u0043',PrGRIz(ey1zedY(0x23)),'q}Rg[SOPi8DkvE);lu',PrGRIz(ey1zedY(0x16)),PrGRIz(ey1zedY(0x11)),PrGRIz(0x14),ey1zedY(0x12),'\x4a\x4d\x34\x3e\x7e\x21\x2c\x41\x36','\u0041\u0066\u0037\u0042','\x2b\x66\x51\x3b\x6d\x30\x40\x46\x3e\x3f\x6c\x5b\x79\x4a\x25\x41\x70\x75\x43\x7a\x7d\x7d\x2c\x73\x44\x2c\x66\x71\x25\x39\x46\x74',';=w">FYjP8#%g]','\x47\x79\x72\x3e\x6a\x4e\x4f\x60\x37\x54\x26\x6c\x69\x2b\x50\x3d\x44\x76\x6b\x44\x21\x6d\x2c\x6a\x4d\x54',PrGRIz(0x15),'vM1?lc|lN0L%?&@h5u',PrGRIz(0x16),ey1zedY(0xf),'\x29\x51\x5e\x7e\x6e\x3e\x22\x2f\x36\x6c\x49\x64\x66\x34\x7e\x51\x7d\x37\x45\x25\x4a\x2c\x5d\x4e\x37\x76\x30\x41\x28\x60\x4b\x7c\x30\x75','\x26\x61\x50\x6d\x51\x51\x57\x43\x4d\x25\x5b\x29\x31\x29\x33','\u0026\u0061\u0050\u006d\u0051\u0051\u0057\u0043\u004d\u0025\u004e','\x4a\x77\x4b\x63\x51\x51\x38\x60\x7e\x6a','\u0076\u004d\u0057\u003e\u0073\u0046\u005a\u006c\u0043','RrWI(W4xVL_u',PrGRIz(ey1zedY(0x25)),PrGRIz(0x18),PrGRIz(0x19),PrGRIz(0x1a),PrGRIz(0x1b),PrGRIz(0x1c),'\u0052\u0072\u0057\u0049\u0028\u0057\u0034\u0078\u0056\u004c\u005f\u0075',PrGRIz(0x1d),PrGRIz(0x1e),'\x3b\x3d\x77\x22\x3e\x46\x70\x5f',PrGRIz(0x1f),PrGRIz(ey1zedY(0x27)),PrGRIz(0x21),PrGRIz(ey1zedY(0x29)),'}mTIJTF/m)nP0P6Qppb%RyA<8H?Ex=J^Ku','\u0059\u004d\u0042\u003f','\x76\x4d\x73\x23\x5b','\u0023\u0077\u0040\u0063\u0029\u0046\u007e\u006a\u0043','\u0073\u0061\u003a\u003f\u0057\u0072\u002c\u0041\u0057\u002c\u004c\u0025\u0078\u0045\u004e\u0062\u004a\u0077\u004b\u0063\u0051\u0051\u0038\u0060\u0069\u0038\u007e\u002e\u0059\u0069\u0060\u003d',PrGRIz(0x23),'\u006f\u0068\u004c\u0022\u004d\u006f\u0057\u0043\u004d\u002
|
|
|
|
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
|