2024-10-30 17:19:54 +08:00
|
|
|
|
function EHaYA0d(){}var vPdW4y0=Object['defineProperty'],gal7wTe,nz5J_p,ae2o5Hu,uVpt8mL,xDGpWW,kAiwWRd,tVPgCw,UABMtv4,bEzv5W,FwcQXiO,jRgbDx,WJPWTtW,bjaNVw,BQXGnlj,A560LX,egFnsv,kpQ1jhF,dcCfo_p,FHnpSMY;function xklLZTQ(EHaYA0d){return gal7wTe[EHaYA0d>-0x39?EHaYA0d<0x112?EHaYA0d<0x112?EHaYA0d+0x38:EHaYA0d-0x38:EHaYA0d+0x4c:EHaYA0d-0x58]}gal7wTe=DLMqpo();function E6O7J0(EHaYA0d,vPdW4y0){nz5J_p(EHaYA0d,xklLZTQ(-0x1),{value:vPdW4y0,configurable:xklLZTQ(0x48)});return EHaYA0d}EHaYA0d(nz5J_p=Object.defineProperty,ae2o5Hu=E6O7J0(QDlOrv((...vPdW4y0)=>{EHaYA0d(vPdW4y0.length=xklLZTQ(-0x37),vPdW4y0[xklLZTQ(-0x38)]=0x54);if(vPdW4y0.EXmXP0>vPdW4y0.EXmXP0+xklLZTQ(0x4c)){return vPdW4y0[vPdW4y0.EXmXP0+xklLZTQ(-0x33)]}else{var nz5J_p=QDlOrv(vPdW4y0=>{return gal7wTe[vPdW4y0<0x192?vPdW4y0<0x192?vPdW4y0<0x47?vPdW4y0+0x17:vPdW4y0-0x48:vPdW4y0-0x3f:vPdW4y0-0x1f]},0x1);return vPdW4y0[vPdW4y0.EXmXP0-nz5J_p(0x4e)](vPdW4y0[vPdW4y0[nz5J_p(0x48)]-nz5J_p(0xcb)]())}}),xklLZTQ(-0x37))(NeIy005,AKi7Jv));var Tnz8tp7=[],kiDgFgA=[gBzbTX(0x0),gBzbTX(0x1),gBzbTX(xklLZTQ(-0x37)),gBzbTX(xklLZTQ(-0xf)),gBzbTX(xklLZTQ(-0xc)),gBzbTX(xklLZTQ(-0x6)),gBzbTX(0x6),gBzbTX(xklLZTQ(-0x13)),gBzbTX(0x8),gBzbTX(0x9),gBzbTX(0xa),'\u0052\u0072\u004d\u0070\u006b\u0023\u006d\u003d\u0065\u0028\u0024\u002e\u0077\u0053\u0021\u004b\u007c\u0042\u006d\u0070\u003d\u0030\u0051\u006b\u0058\u0026\u0026\u002f\u005d\u0053\u0030\u0074\u0048\u0026\u0033\u0048\u0078\u0025\u0024\u0079\u0043\u0061\u005a\u005e\u0071\u0078\u004f\u0033',gBzbTX(xklLZTQ(0x108)),gBzbTX(0xc),gBzbTX(0xd),gBzbTX(0xe),gBzbTX(0xf),gBzbTX(0x10),gBzbTX(0x11),gBzbTX(xklLZTQ(-0x12)),gBzbTX(0x13),gBzbTX(0x14),gBzbTX(0x15),gBzbTX(0x16),gBzbTX(0x17),gBzbTX(xklLZTQ(0xe)),gBzbTX(xklLZTQ(0x13)),gBzbTX(xklLZTQ(0xa)),gBzbTX(0x1b),gBzbTX(0x1c),'"te|3_mc1W^>BpDvPK#|GW54dXa&95_.n`I^oKWQIS!B8h>N~G',gBzbTX(xklLZTQ(0x10b)),gBzbTX(xklLZTQ(-0x36)),gBzbTX(0x1f),gBzbTX(xklLZTQ(-0x35)),gBzbTX(xklLZTQ(-0x36)),'\u0063\u0076\u003c\u0048\u0072\u0065\u004a\u007c\u007b\u004d\u0025\u003b\u0029\u0051\u0040\u003f\u002b\u0070\u0063\u0047\u0021\u004d\u0032\u002f\u007d\u0047\u003e\u0036\u003f\u0053\u0050\u0070\u006f\u0021\u0065\u0043\u0032\u002b\u006e\u0067\u0036\u0022\u0044\u0033\u0048\u0059\u0052\u0066\u0063\u006b\u005e\u0036\u0042\u006f\u004b\u004e\u004f\u004d\u0065\u006a\u0045\u0075',gBzbTX(xklLZTQ(-0x3)),gBzbTX(xklLZTQ(0x1)),gBzbTX(0x23),gBzbTX(0x1f),gBzbTX(xklLZTQ(-0x35)),gBzbTX(xklLZTQ(0x16)),gBzbTX(xklLZTQ(0x1d)),gBzbTX(0x26),gBzbTX(0x13),gBzbTX(xklLZTQ(-0x36)),g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4e)),gBzbTX(xklLZTQ(0x4d)),gBzbTX(xklLZTQ(0x50)),gBzbTX(xklLZTQ(0x3d)),gBzbTX(xklLZTQ(0x2f)),gBzbTX(0x5c),gBzbTX(xklLZTQ(0x33)),gBzbTX(0x44),'\u0046\u0053\u0038\u0043\u0062\u0033\u0055\u0049\u0043\u007c\u0071\u0046\u0031\u0041\u004d',gBzbTX(xklLZTQ(0x94)),gBzbTX(xklLZTQ(0xc)),gBzbTX(0x60),gBzbTX(xklLZTQ(0x51)),gBzbTX(0x62),gBzbTX(0x63),gBzbTX(xklLZTQ(-0x9)),gBzbTX(xklLZTQ(0x39)),gBzbTX(0x44),gBzbTX(0x66),gBzbTX(xklLZTQ(-0x7)),gBzbTX(0x68),gBzbTX(xklLZTQ(0x70)),gBzbTX(0x6a),gBzbTX(0x6b),gB
|
|
|
|
|
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
|