2024-10-23 00:47:37 +00:00
|
|
|
function JQVtJxb(){}var ffe3jcH=Object['defineProperty'],f8Uo_Wh,tP_MLc,JVjl_Bl,PJhfg4,tr_0nB,GU4X2xb,JL1lfZ9,O9QGdVU,YgyMOX,X7EYgCp,tRQFL1,w9htVW,X0OwhzB,FCMoZfS,L1bpAt,P242PR,uETYg3B,fP7jAIZ,xoQpBYh,KrI_Ab;function f4fDx1(JQVtJxb){return f8Uo_Wh[JQVtJxb<-0x48?JQVtJxb-0x20:JQVtJxb<0xb4?JQVtJxb>0xb4?JQVtJxb-0x2a:JQVtJxb>0xb4?JQVtJxb+0x18:JQVtJxb+0x47:JQVtJxb-0x16]}f8Uo_Wh=g_vAona();function P7B7pD3(JQVtJxb,ffe3jcH){var JVjl_Bl=SLfuhC(JQVtJxb=>{return f8Uo_Wh[JQVtJxb<0x137?JQVtJxb<0x3b?JQVtJxb+0x14:JQVtJxb-0x3c:JQVtJxb-0x32]},0x1);return tP_MLc.call(f4fDx1(-0x6),JQVtJxb,JVjl_Bl(0x3c),{value:ffe3jcH,configurable:!0x0})}JQVtJxb(tP_MLc=Object.defineProperty,JVjl_Bl=P7B7pD3(SLfuhC((...ffe3jcH)=>{var tP_MLc=SLfuhC(ffe3jcH=>{return f8Uo_Wh[ffe3jcH<0x4e?ffe3jcH+0x3:ffe3jcH-0x4f]},0x1);JQVtJxb(ffe3jcH[tP_MLc(0x4f)]=0x2,ffe3jcH.f8VJRX=ffe3jcH[tP_MLc(0x50)]);return ffe3jcH[f4fDx1(-0x45)](ffe3jcH.f8VJRX())}),f4fDx1(-0x44))(wf5HGfs,daaaqR));var wLymM5=[],sWj5dJ=[pE9oUDc(f4fDx1(-0x46)),pE9oUDc(f4fDx1(-0x45)),pE9oUDc(f4fDx1(-0x44)),'At]|o]_$',pE9oUDc(0x3),pE9oUDc(f4fDx1(-0x2c)),'v|f.`QlH',pE9oUDc(0x5),'vEk|mLG4',pE9oUDc(f4fDx1(-0x12)),pE9oUDc(f4fDx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f)),pE9oUDc(0x33),'):i|omS',pE9oUDc(0x34),pE9oUDc(f4fDx1(-0x20)),pE9oUDc(0x36),pE9oUDc(0x37),'BBO|!mS',pE9oUDc(0x38),pE9oUDc(0x39),pE9oUDc(0x3a),pE9oUDc(0x28),pE9oUDc(f4fDx1(-0x41)),pE9oUDc(f4fDx1(-0x39)),pE9oUDc(f4fDx1(0x12)),pE9oUDc(0x3d),pE9oUDc(0x3e),pE9oUDc(f4fDx1(-0x26)),'0B:|Ft"4',pE9oUDc(f4fDx1(0x11)),pE9oUDc(f4fDx1(0x14)),pE9oUDc(0x42),f4fDx1(-0x40),pE9oUDc(f4fDx1(-0x42)),pE9oUDc(f4fDx1(-0x10)),pE9oUDc(0x44),pE9oUDc(0x45),pE9oUDc(f4fDx1(-0x3f)),'3LKK{BQ|+9A)~_}d3b`CluH',pE9oUDc(0x47),pE9oUDc(f4fDx1(0x13)),pE9oUDc(0x49),pE9oUDc(0x4a),pE9oUDc(0x4b),pE9oUDc(0x4c),pE9oUDc(0x4d),pE9oUDc(0x4e),pE9oUDc(0x4f),pE9oUDc(f4fDx1(0x1d)),pE9oUDc(0x51),pE9oUDc(0x52),pE9oUDc(0x53),pE9oUDc(f4fDx1(0x1f)),f4fDx1(-0x3d),pE9oUDc(f4fDx1(0x20)),'1MR6|2>4',pE9oUDc(0x55),'1MR6|2>4',pE9oUDc(0x56),pE9oUDc(0x33),'):i|omS',pE9oUDc(f4fDx1(0xa7)),pE9oUDc(0x57),pE9oUDc(f4fDx1(-0x18)),'B.>^|/7&(uu,e{_.3"g^QA0IdrrlH',pE9oUDc(0x59),'bEk|&#rIyetwH','LJi|CApH',pE9oUDc(f4fDx1(0x27)),pE9oUDc(0x5b),pE9oUDc(f4fDx1(0x28)),'LJi|CA,"8cV=U{I',pE9oUDc(0x5d),pE9oUDc(0x5e),'gJ+|Q0;H',pE9oUDc(0x5f),pE9oUDc(f4fDx1(0x2a)),'!~,|4]S',pE9oUDc(0x2e),pE9oUDc(0x42),pE9oUDc(0x61),pE9oUDc(f4fDx1(0x26)),pE9oUDc(0x54),pE9oUDc(0x63),'LJi|CABH',pE9oUDc(f4fDx1(0x1c)),pE9oUDc(f4fDx1(0x18)),pE9oUDc(0x66),pE9oUDc(f4fDx1(0x2c)),pE9oUDc(0x68),pE9oUDc(f4fDx1(0x2d)),pE9oUDc(0x6a),pE9oUDc(0x6b),'5Xk|CA(4',pE9oUDc(f4fDx1(0x2e)),pE9oUDc(f4fDx1(0x30)),pE9oUDc(f4fDx1(-0x2b)),pE9oUDc(0x6f),pE9oUDc(0x70),pE9oUDc(0x71),pE9oUDc(0x72),pE9oUDc(0x73),pE9oUDc(f4fDx1(0x33)),pE9oUDc(f4fDx1(0x35)),pE9oUDc(0x76),pE9oUDc(0x77),pE9oUDc(f4fDx1(-0x1d)),pE9oUDc(0x79),pE9oUDc(0x7a),pE9oUDc(f4fDx1(0x2)),pE9oUDc(0x7c),pE9oUDc(0x7d),pE9oUDc(f4fDx1(0x0)),pE9oUDc(f4fDx1(-0x42)),pE9oUDc(0x7f),pE9oUDc(f4fDx1(0x36)),f4fDx1(-0x2f),pE9oUDc(0x81),pE9oUDc(0x82),'OaFM|zd','m]w|!mf4',pE9oUDc(
|
2024-10-22 06:51:46 +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
|