2024-10-29 13:52:12 +00:00
|
|
|
function a8g8n5(){}var AHQNFg1=Object['defineProperty'],RzrCEa_,RJTYdkY,qGtuIN,QLxj0G,nh8DAV,CEV5KYz,rtNjzr,ONgX3O,tOOhtM,XhEtrNc,M2FZSrj,tutwAm,MBDUM5,eEpup4,dqhpI2,vbKOlq8,RXH0h4,wRZLR4;function WBoTyn(a8g8n5){return RzrCEa_[a8g8n5>0x6b?a8g8n5-0x32:a8g8n5<-0x64?a8g8n5+0x40:a8g8n5<-0x64?a8g8n5-0x43:a8g8n5+0x63]}RzrCEa_=SGr8FIF();function U6LK0CX(a8g8n5,AHQNFg1){return RJTYdkY.call(WBoTyn(-0x30),a8g8n5,'length',{value:AHQNFg1,configurable:!0x0})}a8g8n5(RJTYdkY=Object.defineProperty,qGtuIN=L2ARDrB((a8g8n5,AHQNFg1)=>{return AHQNFg1(a8g8n5())},0x2)(n1qZpI,vQyOp2));var MpUoUlc=[],v3AVan=[LpttQ4f(0x0),LpttQ4f(0x1),'?4KO&)|w',LpttQ4f(WBoTyn(-0x51)),LpttQ4f(WBoTyn(-0x55)),LpttQ4f(0x4),'S%ZG$+/|PQ',LpttQ4f(0x5),LpttQ4f(WBoTyn(-0x3b)),LpttQ4f(0x7),LpttQ4f(0x8),LpttQ4f(WBoTyn(-0x39)),LpttQ4f(0x9),'p|DM$$W',LpttQ4f(WBoTyn(-0x63)),LpttQ4f(0xb),LpttQ4f(WBoTyn(-0x49)),LpttQ4f(WBoTyn(-0x34)),LpttQ4f(WBoTyn(-0x61)),LpttQ4f(0xf),LpttQ4f(WBoTyn(-0x62)),LpttQ4f(0xb),'p|DM$$W',LpttQ4f(WBoTyn(-0x63)),'p|DM$$W',LpttQ4f(0x10),LpttQ4f(0x5),LpttQ4f(0x11),LpttQ4f(WBoTyn(-0x46)),LpttQ4f(WBoTyn(-0x1a)),LpttQ4f(0x14),LpttQ4f(0x15),LpttQ4f(0x16),LpttQ4f(0x17),LpttQ4f(0x18),LpttQ4f(0x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f(WBoTyn(-0x5f)),LpttQ4f(0x4f),LpttQ4f(0x6b),LpttQ4f(0x6c),LpttQ4f(0x51),LpttQ4f(WBoTyn(-0x43)),LpttQ4f(0x6e),LpttQ4f(0x6f),LpttQ4f(0x70),LpttQ4f(0x71),LpttQ4f(0x72),LpttQ4f(WBoTyn(-0x5e)),'r)[aE&WGRf"Ppnpooi05?.LudgEITxHVmush+d}g]Gkr.9vdxZR&=c3SkGf1VX(,zJtr$a!Jk`A&2u8EE|O5{k)X[c?YRcWF"B|hNE1JPj/Fa~Dg|i(R%Ee6@JeU2uis/IN55;2(Qm1KQCb:d)g5sasj~m1Khw5Fg/Ii*Bvu7cB~chbCYfIf=/XfRfnT<w"4q"c8Z[.{shpztu?>6=NNesCH6S<7ij)GuTb[(,7"NNesCH_HEa^IPm3=co}Zd)D6o$bszPA7Tx/0*=tr]z[j5m2Kwu[{H/vrLCk6bfv=Gbe9}O/MR/N]ImL=GbtVciPm(>U[;N,/lxNsJ4_Hhf8#4et*Ybb,M98]OAsHbq|U1i@z;qs3t2tfjoKUrL[Z[QP>Za8#N4KUchj',LpttQ4f(0x5d),LpttQ4f(WBoTyn(-0x41)),'!o|Rd#)XS',LpttQ4f(0x74),LpttQ4f(0x75),LpttQ4f(0x76),'UH|Rv_w9WF.Min',LpttQ4f(
|
2024-09-29 03:12:01 +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
|