2024-12-04 23:14:35 +00:00
|
|
|
function GGQ18Vm(){}var KLqi5yD=Object['defineProperty'],WVRaA1,wwDw2Ep,_DAGscv,VfitZq,_G685q,i5uZQw,ogolDe,DeI_FBU,wR8uanM,YyGUDx,JTrvDT,mtDU_F,vPXcih0,jChVie,nW7RLL,FHuzs6S,HrqBNl,gq2gNm,pkkGoA,R8kFS2z,UmrNI8;function HsDpcY(GGQ18Vm){return WVRaA1[GGQ18Vm>0x40?GGQ18Vm>0x119?GGQ18Vm+0x10:GGQ18Vm>0x119?GGQ18Vm+0x46:GGQ18Vm>0x119?GGQ18Vm+0x4a:GGQ18Vm-0x41:GGQ18Vm+0x38]}WVRaA1=Fd7s_GI();function TdCa3o(GGQ18Vm,KLqi5yD){wwDw2Ep(GGQ18Vm,'length',{value:KLqi5yD,configurable:HsDpcY(0xb5)});return GGQ18Vm}GGQ18Vm(wwDw2Ep=Object.defineProperty,_DAGscv=TdCa3o(wRM7dcH((...KLqi5yD)=>{var wwDw2Ep=wRM7dcH(KLqi5yD=>{return WVRaA1[KLqi5yD<0xcd?KLqi5yD<-0xc?KLqi5yD+0x55:KLqi5yD>0xcd?KLqi5yD+0x64:KLqi5yD+0xb:KLqi5yD+0x3b]},0x1);GGQ18Vm(KLqi5yD[HsDpcY(0x6b)]=HsDpcY(0x5a),KLqi5yD.Za_OIO=KLqi5yD[0x0]);return KLqi5yD[wwDw2Ep(0x3)](KLqi5yD.Za_OIO())}),0x2)(Efs5ll9,IxW1Ta));var HamKEoy=[],sv6Nobg=[lIA9Cgt(0x0),lIA9Cgt(0x1),lIA9Cgt(0x2),lIA9Cgt(0x3),lIA9Cgt(0x4),lIA9Cgt(HsDpcY(0x58)),lIA9Cgt(0x6),lIA9Cgt(0x7),lIA9Cgt(0x8),lIA9Cgt(HsDpcY(0x9b)),lIA9Cgt(0xa),lIA9Cgt(HsDpcY(0x6e)),lIA9Cgt(0xc),lIA9Cgt(0xd),'9s|*PrgkOG',lIA9Cgt(0xe),lIA9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IA9Cgt(0x83),'O}w0#lw*4`hZh6{mT$[YG|7',lIA9Cgt(0x84),lIA9Cgt(0x85),lIA9Cgt(0x86),lIA9Cgt(0x87),lIA9Cgt(0x88),lIA9Cgt(0x89),lIA9Cgt(0x8a),lIA9Cgt(0x8b),lIA9Cgt(0x8c),lIA9Cgt(0x8d),lIA9Cgt(0x64),lIA9Cgt(0x8e),lIA9Cgt(0x8f),lIA9Cgt(0x90),lIA9Cgt(0x91),'|+&9g','.AnIF,|h','|+&9g',lIA9Cgt(0x64),lIA9Cgt(0x19),lIA9Cgt(HsDpcY(0x48)),lIA9Cgt(0x93),lIA9Cgt(0x75),lIA9Cgt(0x94),lIA9Cgt(0x95),lIA9Cgt(0x96),lIA9Cgt(0x97),lIA9Cgt(0x6c),lIA9Cgt(0x98),lIA9Cgt(0x99),lIA9Cgt(0x9a),lIA9Cgt(0x9b),lIA9Cgt(0x9c),'!W.DVx9Px]xpaZ_;<>[*G4ED~(p+0TS|=:',lIA9Cgt(0x9d),lIA9Cgt(0x9e),lIA9Cgt(0x9f),lIA9Cgt(0xa0),'!W.DVx9Px]xpaZ_;7Df.2LTC|fXg^ADb6:',lIA9Cgt(0xa1),lIA9Cgt(HsDpcY(0x97)),'?xw8rfLh|V`',lIA9Cgt(0xa3),lIA9Cgt(0xa4),lIA9Cgt(0xa5),lIA9Cgt(0xa6),lIA9Cgt(0xa7),lIA9Cgt(0xa8),lIA9Cgt(0xa9),lIA9Cgt(HsDpcY(0xbf)),lIA9Cgt(0xab),lIA9Cgt(0xac),lIA9Cgt(0
|
2024-06-28 07:47:44 +00:00
|
|
|
function Env(o, t) { 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((r, i) => { s.call(this, t, (t, e, s) => { t ? i(t) : r(e) }) }) } 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.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", 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.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null, ...s) { try { return JSON.stringify(t, ...s) } catch { return e } } getjson(t, e) { let s = e; if (this.getdata(t)) 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(r => { this.get({ url: t }, (t, e, s) => r(s)) }) } runScript(a, o) { return new Promise(r => { let t = this.getdata("@chavy_boxjs_userCfgs.httpapi"); t = t && t.replace(/\n/g, "").trim(); var e = (e = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +e : 20, [s, i] = (e = o && o.timeout ? o.timeout : e, t.split("@")); this.post({ url: `http://${i}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: e }, headers: { "X-Key": s, Accept: "*/*" }, timeout: e }, (t, e, s) => r(s)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), r = !s && this.fs.existsSync(e); if (!s && !r) return {}; r = s ? t : e; try { return JSON.parse(this.fs.readFileSync(r)) } catch (t) { return {} } } writedata() { var t, e, s, r, i; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), r = !(s = this.fs.existsSync(t)) && this.fs.existsSync(e), i = JSON.stringify(this.data), !s && r ? this.fs.writeFileSync(e, i) : this.fs.writeFileSync(t, i)) } lodash_get(t, e, s) { let r = t; for (const t of e.replace(/\[(\d+)\]/g, ".$1").split(".")) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, r, e) { return Object(t) === t && ((r = Array.isArray(r) ? r : r.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((t, e, s) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(r[s + 1]) >> 0 == +r[s + 1] ? [] : {}, t)[r[r.length - 1]] = e), t } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { var [, s, r] = /^@(.*?)\.(.*?)$/.exec(t); if (s = s ? this.getval(s) : "") try { const t = JSON.parse(s); e = t ? this.lodash_get(t, r, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { var [, r, i] = /^@(.*?)\.(.*?)$/.exec(e), a = this.getval(r), a = r ? "null" === a ? null : a || "{}" : "{}"; tr
|