2024-11-04 10:33:35 +08:00
|
|
|
|
function vrr72E(){}var yGHY4I=Object['defineProperty'],HwWD0yI,KQFU9R,xf94SQ,Ey5gok,BoDjdZ9,Dt6nEo,dyMGkbA,N5otbva,iiN7yjt,uAfCgt,Vx6eu0l,DpP59gQ,cGnKbM,HGUgO2r,bnCs_3,PLLHAHa,KPtXP3I,Gg1NzU;function rAoPao(vrr72E){return HwWD0yI[vrr72E>-0x63?vrr72E+0x62:vrr72E+0xe]}HwWD0yI=cveGR4Q();function hmCFPz(vrr72E,yGHY4I){KQFU9R(vrr72E,'length',{value:yGHY4I,configurable:rAoPao(0x1f)});return vrr72E}vrr72E(KQFU9R=Object.defineProperty,xf94SQ=hmCFPz(rC4TIx((...yGHY4I)=>{var KQFU9R=rC4TIx(yGHY4I=>{return HwWD0yI[yGHY4I<-0x43?yGHY4I+0x51:yGHY4I<-0x43?yGHY4I-0x3d:yGHY4I>0x136?yGHY4I-0x14:yGHY4I>0x136?yGHY4I+0x4e:yGHY4I+0x42]},0x1);vrr72E(yGHY4I[KQFU9R(-0xa)]=0x2,yGHY4I[KQFU9R(-0x42)]=KQFU9R(-0x3b));if(yGHY4I[0x4f]>0xa1){return yGHY4I[rAoPao(0x17)]}else{var xf94SQ=rC4TIx(yGHY4I=>{return HwWD0yI[yGHY4I<-0x1f?yGHY4I-0x1f:yGHY4I+0x1e]},0x1);return yGHY4I[yGHY4I[xf94SQ(-0x1e)]-(yGHY4I[0x4f]-0x1)](yGHY4I[xf94SQ(0x16)]())}}),0x2)(aj1v1g,cDKe23));var d8cVizc=[],OCurwI=[RJZCi72(0x0),RJZCi72(rAoPao(-0x2f)),RJZCi72(rAoPao(-0x25)),RJZCi72(0x3),RJZCi72(0x4),RJZCi72(0x5),RJZCi72(rAoPao(-0x2c)),'\x74\x37\x6c\x6a\x6a\x67\x69\x70\x3f\x4d\x7c\x33\x4d\x3d\x2b\x3e\x2a\x4f\x5d\x59\x7d\x40\x34','\x74\x37\x6c\x6a\x6a\x67\x69\x70\x3f\x4d\x7c\x33\x5f\x52\x69\x4a\x79\x64\x4f\x46\x7e','\u0074\u0037\u006c\u006a\u006a\u0067\u0069\u0070\u003f\u004d\u007c\u0033\u005f\u0052\u0037\u004a\u0079\u0064\u004f\u0046\u007e',RJZCi72(0x7),'t7ljjgip?M|33d~>dK~FC',RJZCi72(rAoPao(-0x28)),RJZCi72(0x9),RJZCi72(rAoPao(-0x61)),RJZCi72(rAoPao(-0x1c)),'t7ljjgip?M|33d~>zd_?',RJZCi72(rAoPao(-0x61)),RJZCi72(0xc),RJZCi72(0xd),RJZCi72(0xe),RJZCi72(0xf),RJZCi72(0x10),RJZCi72(rAoPao(-0x5c)),RJZCi72(rAoPao(-0x60)),RJZCi72(0x13),RJZCi72(rAoPao(-0x5f)),RJZCi72(rAoPao(-0x5e)),RJZCi72(rAoPao(-0xe)),RJZCi72(0x17),RJZCi72(0x17),RJZCi72(0xe),'\x77\x30\x6b\x73\x40\x4c\x39\x46\x24\x68\x64\x79\x54\x7c\x5f\x50\x42\x36\x4d\x72\x5d\x25\x7b\x38\x59\x4e\x59\x65\x54\x4d\x4e\x2c\x53\x63\x34\x4b\x45\x3a\x7b\x38\x43\x41\x25\x71\x72\x33\x40\x75\x41\x71\x41\x28\x7b\x67\x39\x2c\x39\x62\x62\x79\x23\x22\x61\x5f\x3a\x34',RJZCi72(rAoPao(0x76)),RJZCi72(rAoPao(-0xd)),RJZCi72(0x1a),RJZCi72(0x1b),rAoPao(-0x5d),RJZCi72(0x1c),RJZCi72(rAoPao(0x29)),'>y|&q)7Q',RJZCi72(0x11),RJZCi72(rAoPao(-0x60)),RJZCi72(0x1e),RJZCi72(0x1f),RJZCi72(rAoPao(-0x5)),RJZCi72(rAoPao(-0x9)),RJZCi72(0x22),RJZCi72(0x23),RJZCi72(0x24),RJZCi72(rAoPao(0x0)),RJZCi72(0x26),RJZCi72(0x27),RJZCi72(0x28),RJZCi72(rAoPao(-0x5f)),RJZCi72(0x29),RJZCi72(0x2a),RJZCi72(rAoPao(0x86)),RJZCi72(0x2c),RJZCi72(rAoPao(-0x5e)),rAoPao(-0x5d),RJZCi72(rAoPao(-0x5c)),RJZCi72(rAoPao(-0x60)),RJZCi72(0x2d),RJZCi72(rAoPao(-0x5b)),RJZCi72(rAoPao(-0x51)),RJZCi72(0x21),RJZCi72(0x30),RJZCi72(0x1a),RJZCi72(rAoPao(-0x5a)),RJZCi72(rAoPao(-0x50)),RJZCi72(0x32),RJZCi72(rAoPao(-0x5f)),RJZCi72(rAoPao(-0x53)),RJZCi72(0x34),RJZCi72(0x35),RJZCi72(rAoPao(-0x2)),RJZCi72(rAoPao(-0x27)),RJZCi72(rAoPao(-0x59)),RJZCi72(0x39),RJZCi72(0x3a),RJZCi72(0x3b),RJZCi72(rAoPao(-0x58)),RJZCi72(rAoPao(0xf)),RJZCi72(rAoPao(0x4)),RJZCi72(rAoPao(-0x2b)),RJZCi72(rAoPao(-0x56)),RJZCi72(0x41),RJZCi72(0x42),RJZCi72(rAoPao(0x12)),RJZCi72(rAoPao(-0x57)),RJZCi72(rAoPao(-0x44)),'~gcOt|4yiM<.3f3]Eg?2','~gcOt|I87M+E7fpQDZH',RJZCi72(0x46),RJZCi72(rAoPao(0x15)),'~gcOt|V|ZMg',RJZCi72(0x16),RJZCi72(0x48),RJZCi72(rAoPao(-0x5f)),RJZCi72(0x49),RJZCi72(0x4a),RJZCi72(0x4b),RJZCi72(rAoPao(-0x26)),RJZCi72(rAoPao(-0x4c)),RJZCi72(rAoPao(0x6)),RJZCi72(0x4f),RJZCi72(rAoPao(-0x55)),RJZCi72(0x51),RJZCi72(0x52),RJZCi72(0x53),RJZCi72(rAoPao(-0x5f)),RJZCi72(rAoPao(-0x54)),RJZCi72(rAoPao(-0x4f)),RJZCi72(rAoPao(0x5)),RJZCi72(rAoPao(0x9)),RJZCi72(0x57),RJZCi72(rAoPao(-0x4e)),RJZCi72(0x58),RJZCi72(0x59),RJZCi72(0x5a),RJZCi72(rAoPao(-0x5f)),RJZCi72(0x14),RJZCi72(0x13),RJZCi72(0x5b),'\u006b\u0064\u007c\u0026\u003a\u0068\u006c\u0051',RJZCi72(0x5a),RJZCi72(0x17),RJZCi72(0x31),RJZCi72(0x32),RJZCi72(0x16),RJZCi72(rAoPao(-0x5a)),RJZCi72(rAoPao(-0x49)),RJZCi72(0x14),RJZCi72(0x11),RJZCi72(0x12),RJZCi72(0x33),RJZCi72(0x35),RJZCi72(0x36),RJZCi72(rAoPao(-0x4b)),RJZCi72(0x37),RJZCi72(rAoPao(-0x59)),RJZCi72(0x39),RJZCi72(0x3f),RJZCi72(rAoPao(-0x58)),RJZCi72(0x3
|
|
|
|
|
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
|