2024-11-22 13:42:28 +00:00
|
|
|
function LjAMSMk(){}var N8YTBqN=Object['defineProperty'],YA047U,KmKLCZ,uHNELk,LxAyCz,rYjrX5,P3H89_l,EkV63ii,kI913N,pO7WN4,cDPBq9p,Oe8HRGR,OVRsK5f,FGiJY0t,dTTyEX,s8qKHxN,cyyPZG,tpTq8JM,n2jlRgk,YXPmnn,IzSG1YA,SvM2MY;function KtYP3t(LjAMSMk){return YA047U[LjAMSMk<0x2b6?LjAMSMk<-0x1?LjAMSMk+0x58:LjAMSMk>0x2b6?LjAMSMk-0x36:LjAMSMk-0x0:LjAMSMk+0x16]}YA047U=DqTlAnh();function MgnXXU8(LjAMSMk,N8YTBqN){return KmKLCZ(LjAMSMk,KtYP3t(0x0),{value:N8YTBqN,configurable:KtYP3t(0xa6)})}LjAMSMk(KmKLCZ=Object.defineProperty,uHNELk=MgnXXU8(OrWa1S((...N8YTBqN)=>{var KmKLCZ=OrWa1S(N8YTBqN=>{return YA047U[N8YTBqN>-0x4e?N8YTBqN+0x4d:N8YTBqN-0x51]},0x1);LjAMSMk(N8YTBqN[KtYP3t(0x0)]=KtYP3t(0x3),N8YTBqN[KtYP3t(0x1)]=KmKLCZ(-0x4b));if(N8YTBqN[KmKLCZ(-0x4c)]>KmKLCZ(-0x2d)){return N8YTBqN[-KtYP3t(0xb)]}else{var uHNELk=OrWa1S(N8YTBqN=>{return YA047U[N8YTBqN<-0x5b?N8YTBqN+0x40:N8YTBqN<-0x5b?N8YTBqN+0x24:N8YTBqN+0x5a]},0x1);return N8YTBqN[uHNELk(-0x56)](N8YTBqN[N8YTBqN[N8YTBqN[uHNELk(-0x59)]+KtYP3t(0x29)]-uHNELk(-0x58)]())}}),KtYP3t(0x3))(zbJZUc,j0qmTz7));var H3xMY3=[],qToDqN=[QLoUUZK(KtYP3t(0x67)),QLoUUZK(KtYP3t(0x4)),QLoUUZK(KtYP3t(0x3)),QLoUUZK(KtYP3t(0x72)),QLoUUZK(KtYP3t(0x92)),QLoUU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0x1f),QLoUUZK(KtYP3t(0xa7)),QLoUUZK(KtYP3t(0x17)),QLoUUZK(KtYP3t(0xf3)),QLoUUZK(KtYP3t(0x12)),QLoUUZK(KtYP3t(0x23)),QLoUUZK(KtYP3t(0x21)),QLoUUZK(KtYP3t(0x48)),QLoUUZK(KtYP3t(0x80)),QLoUUZK(KtYP3t(0x22)),QLoUUZK(KtYP3t(0x85)),QLoUUZK(KtYP3t(0xf5)),QLoUUZK(KtYP3t(0xf6)),QLoUUZK(KtYP3t(0x84)),QLoUUZK(KtYP3t(0x74)),QLoUUZK(KtYP3t(0xf7)),QLoUUZK(KtYP3t(0x2)),QLoUUZK(KtYP3t(0x5c)),QLoUUZK(KtYP3t(0x94)),QLoUUZK(KtYP3t(0xe)),QLoUUZK(KtYP3t(0xf)),QLoUUZK(KtYP3t(0x10)),QLoUUZK(KtYP3t(0x11)),QLoUUZK(KtYP3t(0xfb)),')%|HXh3',QLoUUZK(KtYP3t(0x4b)),QLoUUZK(KtYP3t(0x7e)),QLoUUZK(KtYP3t(0x90)),QLoUUZK(KtYP3t(0x33)),QLoUUZK(KtYP3t(0x3d)),QLoUUZK(KtYP3t(0x12)),QLoUUZK(KtYP3t(0x13)),QLoUUZK(KtYP3t(0x103)),QLoUUZK(KtYP3t(0x104)),QLoUUZK(KtYP3t(0x8a))
|
2024-11-04 23:48:55 +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
|