2024-08-29 23:50:55 +08:00
|
|
|
function alf6yE(){}var MxIHELk=Object['defineProperty'],mC_Sse,CQGZox,JnoEvLM,nxT4bz,yyJByQ,RiIg_wY,u8L0gbJ,tfa6Z8,UpABAA,C4K1wF,FIveKFT,JvkDQO,aRinBd,wNF8tTs,yfQViL,JW0i82C,WtjfaYa,yx1Rj9,kmroO_M;function ZRPNyT(alf6yE){return mC_Sse[alf6yE>-0x1d?alf6yE+0x1c:alf6yE+0x16]}mC_Sse=GbW6G3n();function jNyuaJ(alf6yE,MxIHELk){CQGZox(alf6yE,ZRPNyT(0xa),{value:MxIHELk,configurable:ZRPNyT(0x93)});return alf6yE}alf6yE(CQGZox=Object.defineProperty,JnoEvLM=jNyuaJ(EQHlpp((...MxIHELk)=>{var CQGZox=EQHlpp(MxIHELk=>{return mC_Sse[MxIHELk>0x22?MxIHELk>0x152?MxIHELk+0x49:MxIHELk<0x22?MxIHELk+0x1c:MxIHELk>0x152?MxIHELk+0x2d:MxIHELk-0x23:MxIHELk-0x2c]},0x1);alf6yE(MxIHELk.length=0x2,MxIHELk[CQGZox(0x2e)]=0x6);if(MxIHELk[0x96]>CQGZox(0x27)){return MxIHELk[0x4d]}else{var JnoEvLM=EQHlpp(MxIHELk=>{return mC_Sse[MxIHELk<0x24?MxIHELk+0x1f:MxIHELk>0x24?MxIHELk<0x24?MxIHELk-0x30:MxIHELk-0x25:MxIHELk+0x52]},0x1);return MxIHELk[MxIHELk[MxIHELk[0x96]+0x90]-(MxIHELk[0x96]-JnoEvLM(0x25))](MxIHELk[MxIHELk[MxIHELk[0x96]+0x90]-ZRPNyT(-0x1b)]())}}),0x2)(qqKBnPF,oT828PO));var FkgEuZ=[],SznNZ4R=['1|^MBKs,',NMvZzyZ(ZRPNyT(0x3)),NMvZzyZ(ZRPNyT(-0x1c)),NMvZzyZ(ZRPNyT(0xd)),'\x54\x57\x21\x50\x7c',NMvZzyZ(0x3),'.$E?Tt:n=*"]?<<I|8',NMvZzyZ(ZRPNy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),NMvZzyZ(0x67),NMvZzyZ(0x68),NMvZzyZ(0x69),NMvZzyZ(0x6a),NMvZzyZ(0x6b),NMvZzyZ(0x6c),NMvZzyZ(0x6d),NMvZzyZ(0x6e),NMvZzyZ(ZRPNyT(0xe)),NMvZzyZ(0x6f),NMvZzyZ(0x5e),ZRPNyT(-0xa),NMvZzyZ(ZRPNyT(0x1d)),'|S`GZY|U',NMvZzyZ(ZRPNyT(0x65)),NMvZzyZ(0x63),NMvZzyZ(0x71),NMvZzyZ(ZRPNyT(-0x17)),NMvZzyZ(ZRPNyT(0x69)),'\x30\x57\x30\x7c\x4c\x3c\x63\x78',NMvZzyZ(0x73),NMvZzyZ(0x6a),NMvZzyZ(0x6b),ZRPNyT(-0x16),NMvZzyZ(ZRPNyT(0xb)),NMvZzyZ(0x75),NMvZzyZ(ZRPNyT(0x10)),NMvZzyZ(ZRPNyT(-0x8)),'yG,O|',NMvZzyZ(ZRPNyT(-0x15)),NMvZzyZ(ZRPNyT(0x6b)),NMvZzyZ(0x78),NMvZzyZ(0x79),NMvZzyZ(ZRPNyT(0x6c)),NMvZzyZ(0xf),NMvZzyZ(ZRPNyT(-0x14)),NMvZzyZ(ZRPNyT(-0x7)),NMvZzyZ(ZRPNyT(-0x6)),NMvZzyZ(0x7d),'6jENm;e|WuH%xL2bg(#',NMvZzyZ(0x7e),NMvZzyZ(ZRPNyT(-0x12)),NMvZzyZ(0x80),NMvZzyZ(ZRPNyT(-0x13)),NMvZ
|
|
|
|
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
|