2024-09-15 04:05:38 +08:00
|
|
|
|
function rd6uM1(){}var JNPUQo=Object['defineProperty'],rUs0Of,LrYj2S_,RhmnRT,M2I_4Z,jF1FFP,auZa0u,bZfO3y,V4x65R,KLm99dJ,JqnupX,PaE6na,c92_HnQ,xe28Nq,Cnd7GL8,dtsY4f,O6SF_i5,pdtibp,smY08w;function GQSD3Ag(rd6uM1){return rUs0Of[rd6uM1<0x18?rd6uM1-0x28:rd6uM1<0x18?rd6uM1+0x34:rd6uM1<0x18?rd6uM1-0x55:rd6uM1<0x18?rd6uM1-0x1f:rd6uM1-0x19]}rUs0Of=hzbn0uq();function g_rlnDy(rd6uM1,JNPUQo){return LrYj2S_(rd6uM1,GQSD3Ag(0x45),{value:JNPUQo,configurable:GQSD3Ag(0x9c)})}rd6uM1(LrYj2S_=Object.defineProperty,RhmnRT=g_rlnDy(yN8T7t((...JNPUQo)=>{var LrYj2S_=yN8T7t(JNPUQo=>{return rUs0Of[JNPUQo>-0x18?JNPUQo+0x17:JNPUQo-0x4d]},0x1);rd6uM1(JNPUQo.length=0x2,JNPUQo[GQSD3Ag(0x19)]=JNPUQo[0x0]);return JNPUQo[GQSD3Ag(0x1a)](JNPUQo[LrYj2S_(-0x17)]())}),GQSD3Ag(0x50))(JNSaW6N,qkZN7I));var kvXMg8Y=[],dfytrle=[fa5rfT(GQSD3Ag(0x3d)),fa5rfT(GQSD3Ag(0x1a)),fa5rfT(0x2),fa5rfT(GQSD3Ag(0x44)),fa5rfT(0x4),fa5rfT(GQSD3Ag(0x49)),fa5rfT(GQSD3Ag(0x42)),fa5rfT(0x7),fa5rfT(GQSD3Ag(0x5b)),'rW[>>lX]zEV"|N8%88v',fa5rfT(0x9),fa5rfT(GQSD3Ag(0x149)),fa5rfT(0xb),fa5rfT(GQSD3Ag(0x41)),fa5rfT(GQSD3Ag(0x4b)),fa5rfT(0xe),fa5rfT(GQSD3Ag(0x4a)),fa5rfT(0x10),fa5rfT(GQSD3Ag(0x83)),fa5rfT(0x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>|qJFZs"Q0(X%y:.Y/+{{8I',fa5rfT(0x50),fa5rfT(GQSD3Ag(0x1d)),fa5rfT(0x11),fa5rfT(GQSD3Ag(0x57)),fa5rfT(0x56),fa5rfT(0x11),fa5rfT(0x29),fa5rfT(0x5f),fa5rfT(GQSD3Ag(0x82)),fa5rfT(GQSD3Ag(0x27)),fa5rfT(GQSD3Ag(0x25)),fa5rfT(0x62),fa5rfT(0x63),fa5rfT(GQSD3Ag(0x133)),fa5rfT(GQSD3Ag(0x1b)),fa5rfT(0x29),fa5rfT(GQSD3Ag(0x92)),fa5rfT(0x66),fa5rfT(GQSD3Ag(0x93)),fa5rfT(GQSD3Ag(0x7d)),fa5rfT(0x69),fa5rfT(0x6a),fa5rfT(0x6b),fa5rfT(GQSD3Ag(0x26)),fa5rfT(0x23),fa5rfT(0x3d),fa5rfT(GQSD3Ag(0x95)),fa5rfT(0x6d),fa5rfT(GQSD3Ag(0x1b)),fa5rfT(GQSD3Ag(0x1b)),fa5rfT(0x60),fa5rfT(0x6e),fa5rfT(0x64),'Cv/Smth|Tx;','\u006b\u0038\u0074\u0053\u004a\u0055\u004b\u007c\u0029\u003d\u0070\u0036\u007e\u0075',fa5rfT(GQSD3Ag(0x1b)),fa5rfT(GQSD3Ag(0x23)),'k8tSJUK|)=p6~u',fa5rfT(GQSD3Ag(
|
2024-09-15 04:05:38 +08: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
|