2024-10-17 17:14:20 +00:00
|
|
|
function EPqbfO(){}var hiD21kt=Object['defineProperty'],H4I3nZV,buCuR0D,mhwedg,TvwaQjh,tUrlfI0,hw_TuK,a2ibWeH,a7UIv6,rbIv7mK,QNb_Hk,M_AxnF,NBMXVNi,R3eb2o_,H1CsUJ,RyU1AIR,joKJ6sB,o9ipvcP,WQeHUcO,vQwTSAu;function agiZa1(EPqbfO){return H4I3nZV[EPqbfO>0x55?EPqbfO>0x55?EPqbfO-0x56:EPqbfO-0x2c:EPqbfO-0x22]}H4I3nZV=OsEo9B();function k5aLol3(EPqbfO,hiD21kt){return buCuR0D.call(null,EPqbfO,agiZa1(0x56),{value:hiD21kt,configurable:agiZa1(0xf5)})}EPqbfO(buCuR0D=Object.defineProperty,mhwedg=k5aLol3(GRRZ30U((...hiD21kt)=>{var buCuR0D=GRRZ30U(hiD21kt=>{return H4I3nZV[hiD21kt>0x14f?hiD21kt+0xd:hiD21kt<0x14f?hiD21kt>-0x5e?hiD21kt+0x5d:hiD21kt+0x47:hiD21kt+0x36]},0x1);EPqbfO(hiD21kt[buCuR0D(-0x5d)]=0x2,hiD21kt.dWkZTX=0x95);return hiD21kt[agiZa1(0x57)]>0xfc?hiD21kt[-0xca]:hiD21kt[0x1](hiD21kt[hiD21kt[buCuR0D(-0x5c)]-(hiD21kt[buCuR0D(-0x5c)]-0x0)]())}),0x2)(N4NoX7A,vWXIgtT));var _JaQIh9=[],lBm0P3=[gSoZ7Z(0x0),gSoZ7Z(0x1),gSoZ7Z(agiZa1(0xb0)),gSoZ7Z(0x3),gSoZ7Z(0x4),gSoZ7Z(agiZa1(0x98)),gSoZ7Z(0x6),gSoZ7Z(0x7),gSoZ7Z(agiZa1(0xbe)),gSoZ7Z(0x9),gSoZ7Z(0xa),gSoZ7Z(0xb),gSoZ7Z(0xc),gSoZ7Z(agiZa1(0xba)),gSoZ7Z(0xe),gSoZ7Z(agiZa1(0xa5)),gSoZ7Z(0x10),gSoZ7Z(0x11),gSoZ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7Z(0x7f),gSoZ7Z(0x80),gSoZ7Z(agiZa1(0x73)),gSoZ7Z(0x82),gSoZ7Z(agiZa1(0x11a)),gSoZ7Z(0x84),gSoZ7Z(agiZa1(0x5b)),gSoZ7Z(0x86),gSoZ7Z(0x87),gSoZ7Z(0x88),gSoZ7Z(agiZa1(0x66)),'5=RU|dx',gSoZ7Z(agiZa1(0x5c)),gSoZ7Z(agiZa1(0x5d)),gSoZ7Z(agiZa1(0x74)),gSoZ7Z(0x8d),gSoZ7Z(0x8e),gSoZ7Z(0x8f),gSoZ7Z(0x90),gSoZ7Z(0x91),gSoZ7Z(0x92),gSoZ7Z(agiZa1(0x5e)),gSoZ7Z(agiZa1(0x126)),gSoZ7Z(0x95),gSoZ7Z(0x96),gSoZ7Z(agiZa1(0x79)),gSoZ7Z(0x57),gSoZ7Z(agiZa1(0x70)),gSoZ7Z(0x99),'PK|.',gSoZ7Z(0x9a),gSoZ7Z(0x9b),gSoZ7Z(0x9c),gSoZ7Z(0x9d),gSoZ7Z(0x9e),gSoZ7Z(0x9f),gSoZ7Z(agiZa1(0x123)),gSoZ7Z(0xa1),gSoZ7Z(0xa2),gSoZ7Z(0x2c),gSoZ7Z(agiZa1(0x12b)),gSoZ7Z(0x2c),'`ffA|T]z',gSoZ7Z(0xa4),gSoZ7Z(agiZa1(0x72)),gSoZ7Z(0x7c),gSoZ7Z(0x7d),gSoZ7Z(agiZa1(0x63)),gSoZ7Z(0x7f),gSoZ7Z(0x80),gSoZ7Z(agiZa1(0x64)),gSoZ7Z(agiZa1(0x165)),gSoZ7Z(0x84),gSoZ7Z(agiZa1(0x5b)),gSoZ7Z(agiZa1(0x65)),gSoZ7Z(agiZa1(0x12c)),gSo
|
2024-10-17 08:37:39 +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
|