2024-10-09 11:54:22 +00:00
|
|
|
function zzIzLX5(){}var M1_y009=Object['defineProperty'],G2PClRl,krimyCw,W92O5AR,WrRDPgx,INReBJw,wipvn5,BgkwbWl,uTWX43A,CtUPKh,d8HTRVv,Y8KnDcw,GNJ4SjM,RLoQMB,qPyPrPW,GP_uvVY;function T5sqGw(zzIzLX5){return G2PClRl[zzIzLX5<0x161?zzIzLX5<0x46?zzIzLX5+0x3f:zzIzLX5<0x46?zzIzLX5-0x62:zzIzLX5-0x47:zzIzLX5-0x57]}G2PClRl=sE_43Ll();function ihpCpW(zzIzLX5,M1_y009){return krimyCw.call(null,zzIzLX5,T5sqGw(0x47),{value:M1_y009,configurable:!0x0})}zzIzLX5(krimyCw=Object.defineProperty,W92O5AR=ihpCpW(owMI39((...M1_y009)=>{var krimyCw=owMI39(M1_y009=>{return G2PClRl[M1_y009>0x123?M1_y009+0x19:M1_y009>0x8?M1_y009>0x8?M1_y009>0x123?M1_y009+0x1b:M1_y009-0x9:M1_y009-0x0:M1_y009+0x6]},0x1);zzIzLX5(M1_y009[T5sqGw(0x47)]=T5sqGw(0x49),M1_y009[krimyCw(0xa)]=M1_y009[krimyCw(0x39)]);return M1_y009[T5sqGw(0x81)](M1_y009[krimyCw(0xa)]())}),0x2)(QCTau9B,FmBfvt));var zBXZzFE=[],U8Icp6x=[BiGTLSC(0x0),'<18n{!|rB',BiGTLSC(0x1),BiGTLSC(T5sqGw(0x49)),'=zf|f','PA|f^}o8NF+Dm',BiGTLSC(0x3),BiGTLSC(0x4),BiGTLSC(0x5),BiGTLSC(T5sqGw(0x7c)),BiGTLSC(0x7),BiGTLSC(T5sqGw(0x8c)),BiGTLSC(0x9),BiGTLSC(T5sqGw(0xd3)),BiGTLSC(T5sqGw(0x91)),BiGTLSC(T5sqGw(0x7d)),BiGTLSC(T5sqGw(0x74)),BiGTLSC(T5sqGw(0x9b)),BiGTLSC(0xf),BiGTLSC(T5sqGw(0x9e)),BiGTLSC(T5sqGw(0x5c)),Bi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FK*ysNP5})TkUgDmH`t]Bx`Kr@@l]','ag>]|64q#4f(]&',BiGTLSC(T5sqGw(0x85)),BiGTLSC(0x72),BiGTLSC(T5sqGw(0x5d)),BiGTLSC(0x74),BiGTLSC(0x75),BiGTLSC(0x76),BiGTLSC(T5sqGw(0xf4)),BiGTLSC(0x78),BiGTLSC(0x79),BiGTLSC(T5sqGw(0x53)),BiGTLSC(0x7b),BiGTLSC(0x7c),BiGTLSC(T5sqGw(0xf5)),BiGTLSC(0x7e),BiGTLSC(T5sqGw(0x5b)),BiGTLSC(T5sqGw(0x5f)),BiGTLSC(0x5d),BiGTLSC(0x1a),BiGTLSC(T5sqGw(0x6a)),BiGTLSC(T5sqGw(0x60)),BiGTLSC(T5sqGw(0x4a)),BiGTLSC(T5sqGw(0x56)),BiGTLSC(T5sqGw(0x15c)),BiGTLSC(0x84),BiGTLSC(0x1a),BiGTLSC(T5sqGw(0x75)),BiGTLSC(0x5d),BiGTLSC(0x86),BiGTLSC(T5sqGw(0xf6)),BiGTLSC(T5sqGw(0xef)),BiGTLSC(T5sqGw(0xf7)),BiGTLSC(0x8a),BiGTLSC(T
|
2024-06-28 07:47:44 +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
|