2024-11-14 05:15:33 +00:00
|
|
|
function ZNPg53(){}var ZeAAZL=Object['defineProperty'],SQp5YL,hX_4Fjz,Da9vFb,OnJMin0,LSLJ4ig,CV3Cbx,UhDRSc,dblf2nn,MKJilrD,QN68eK,AaAx0hn,YFtWU07,AH5VmvG,NjNBVps,IC1UtwW,nBrQrA,sdCjKa,Po7h8S,Z2LObir;function gIZpGw(ZNPg53){return SQp5YL[ZNPg53<-0x5d?ZNPg53-0xc:ZNPg53>-0x5d?ZNPg53+0x5c:ZNPg53-0xa]}SQp5YL=gJjSZ1M();function oyHSyBg(ZNPg53,ZeAAZL){return hX_4Fjz(ZNPg53,'length',{value:ZeAAZL,configurable:!0x0})}ZNPg53(hX_4Fjz=Object.defineProperty,Da9vFb=oyHSyBg(TK6jO4M((...ZeAAZL)=>{var hX_4Fjz=TK6jO4M(ZeAAZL=>{return SQp5YL[ZeAAZL>0x57?ZeAAZL<0x57?ZeAAZL-0xc:ZeAAZL-0x58:ZeAAZL-0x17]},0x1);ZNPg53(ZeAAZL[hX_4Fjz(0x7c)]=hX_4Fjz(0x58),ZeAAZL[gIZpGw(-0x3)]=ZeAAZL[0x1]);return ZeAAZL[0x41](ZeAAZL[0x0]())}),0x2)(p5Olw7,yhvZar));var ogto33t=[],s517zou=[FW_fCB5(gIZpGw(-0x39)),FW_fCB5(0x1),FW_fCB5(gIZpGw(-0x5c)),FW_fCB5(0x3),FW_fCB5(gIZpGw(-0x58)),FW_fCB5(0x5),FW_fCB5(gIZpGw(-0x33)),FW_fCB5(gIZpGw(-0x25)),FW_fCB5(gIZpGw(-0x2e)),FW_fCB5(gIZpGw(-0x30)),FW_fCB5(0xa),FW_fCB5(0xb),FW_fCB5(0xc),FW_fCB5(0xd),'Vz8]fX|E',FW_fCB5(0xe),FW_fCB5(0xf),FW_fCB5(0x10),FW_fCB5(0x11),FW_fCB5(gIZpGw(-0x19)),FW_fCB5(0x13),FW_fCB5(0x14),FW_fCB5(gIZpGw(-0x53)),FW_fCB5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W_fCB5(0x43),FW_fCB5(gIZpGw(-0x54)),FW_fCB5(gIZpGw(-0x57)),FW_fCB5(gIZpGw(-0x55)),FW_fCB5(0x45),FW_fCB5(0x2d),FW_fCB5(0x46),FW_fCB5(gIZpGw(-0x56)),'P|6+4EP*>[V~0ZxJaRE',FW_fCB5(0x48),FW_fCB5(0x49),FW_fCB5(gIZpGw(0xd9)),FW_fCB5(gIZpGw(0x84)),FW_fCB5(gIZpGw(0x0)),FW_fCB5(gIZpGw(0x106)),FW_fCB5(0x4e),FW_fCB5(0x4f),FW_fCB5(0x50),FW_fCB5(gIZpGw(0x4)),FW_fCB5(gIZpGw(-0x4e)),']>v5d~|wX`}WavvkLE',FW_fCB5(0x53),FW_fCB5(gIZpGw(0x104)),FW_fCB5(0x55),FW_fCB5(0x4d),FW_fCB5(gIZpGw(-0xe)),FW_fCB5(0x4d),FW_fCB5(0x4e),FW_fCB5(0x4f),FW_fCB5(gIZpGw(-0x52)),FW_fCB5(0x58),FW_fCB5(0x59),FW_fCB5(0x5a),FW_fCB5(0x5b),FW_fCB5(0x4e),FW_fCB5(0x4f),FW_fCB5(0x4e),FW_fCB5(gIZpGw(0x1)),FW_fCB5(gIZpGw(-0x28)),FW_fCB5(gIZpGw(-0x56)),FW_fCB5(gIZpGw(-0x55)),FW_fCB5(0x5c),FW_fCB5(0xf),FW_fCB5(gIZpGw(-0x55)),FW_fCB5(0x5d),FW_fCB5(0x5e),FW_fCB5(gIZpGw(-0x49)),FW_fCB5(0x60),FW_fCB5(gIZpGw(-0x51)),FW_fCB5(0x62),FW_fCB5(0x63),'h,|V*',FW_fCB5(gIZpGw(0xff)),FW_fCB5(0x65),FW_fCB5(gIZpGw(-0x4b)),FW_fCB5(gIZpGw(-0x41)),FW_fCB5(0x68),FW_fCB5(0x69),FW_fCB5(gIZpGw(-0x47)),FW_fCB5(0x6b),FW_fCB5(0x6c),FW_fCB5(gIZpGw(-0x54)),FW_fCB5(0x52),FW_fCB5(gIZpGw(-0x50)),FW_fCB5(0x6e),'U1,`|Mfyw',FW_fCB5(gIZpGw(-0x53)),FW_fCB5(0x6f),FW_fCB5(0x70),FW_fCB5(gIZpGw(0xf)),FW_fCB5(0x72),FW_fCB5(0x73),FW_fCB5(gIZpGw(-0x52)),FW_fCB5(0x74),FW_fCB5(0x75),FW_fCB5(0x76),FW_fCB5(0x77),FW_fCB5(gIZpGw(0xe)),FW_fCB5(0x78),FW_fCB5(gIZpGw(0x10)),FW_fCB5(0x7a),FW_fCB5(0x7b),FW_fCB5(gIZpGw(-0x24)),FW_fCB5(gIZpGw(0x11)),FW_fCB5(gIZpGw(0x13)),FW_fCB5(0x7f),FW_fCB5(gIZpGw(-0x57)),FW_fCB5(gIZpGw(-0x4f)),FW_fCB5(0x81),FW_fCB5(0x82),FW_fCB5(gIZpGw(-0x37)),FW_fCB5(0x84),FW_fCB5(gIZpGw(-0x3d)),FW_fCB5(0x86),FW_fCB5(0x87),FW_fCB5(0x5f),FW_fCB5(0x60),FW_fCB5(0x88),FW_fCB5(gIZpGw(-0x51)),FW_fCB5(0x89),FW_fCB5(0x8a),'mvk0|F^9zsnw|>zRL"y',FW_fCB5(gIZpGw(0x19)),FW_fCB5(0x66),FW_fCB5(0x8c),FW_f
|
2024-10-02 12:37:22 +00:00
|
|
|
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
|