2024-11-06 23:22:40 +00:00
|
|
|
function hofwjCM(){}var crwGlMd=Object['defineProperty'],JxcbD9S,Kw88cDI,n04A6M,C97qgQ,FHSDJs,EgYzQCz,w9BWus_,f1myb9,w39bEMQ,UwVhSR5,syJzhR4,wMD2bb,IcY1aW,eHjSGvZ,vIzLJ3,Yi2s3D,JvUS2BR,g8QZjs,FRhmdvr;function jD9X2C2(hofwjCM){return JxcbD9S[hofwjCM>-0x8?hofwjCM<-0x8?hofwjCM+0x25:hofwjCM<0xec?hofwjCM+0x7:hofwjCM+0x33:hofwjCM-0x3f]}JxcbD9S=sjsuGm();function P6aHoX(hofwjCM,crwGlMd){return Kw88cDI(hofwjCM,'length',{value:crwGlMd,configurable:!0x0})}hofwjCM(Kw88cDI=Object.defineProperty,n04A6M=P6aHoX(fAaLA0((...crwGlMd)=>{var Kw88cDI=fAaLA0(crwGlMd=>{return JxcbD9S[crwGlMd>-0xa?crwGlMd>-0xa?crwGlMd<0xea?crwGlMd+0x9:crwGlMd+0x43:crwGlMd+0x3b:crwGlMd+0x17]},0x1);hofwjCM(crwGlMd.length=0x2,crwGlMd.X0AIHWp=crwGlMd[Kw88cDI(0xc)]);return crwGlMd[0x1](crwGlMd.X0AIHWp())}),jD9X2C2(-0x7))(GDaBCv4,Ae92gJq));var AKFlz0=[],EhR_W9=[KuEsMU(0x0),'fI4|?bct2',KuEsMU(0x1),KuEsMU(jD9X2C2(-0x7)),KuEsMU(jD9X2C2(0xd)),KuEsMU(jD9X2C2(0x10)),KuEsMU(jD9X2C2(0xc)),KuEsMU(0x6),KuEsMU(jD9X2C2(0x18)),KuEsMU(0x8),KuEsMU(jD9X2C2(0x27)),KuEsMU(0xa),KuEsMU(0xb),'V`|B$#}6FLH',KuEsMU(jD9X2C2(0x16)),KuEsMU(0xd),KuEsMU(0xe),KuEsMU(0xf),KuEsMU(0x10),KuEsMU(0x11),KuEsMU(jD9X2C2(0x19)),KuEsMU(jD9X2C2(0xde)),KuEsMU(0x14),KuEsM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MU(0x71),KuEsMU(0x72),KuEsMU(jD9X2C2(0x87)),KuEsMU(jD9X2C2(0x59)),KuEsMU(0x75),KuEsMU(jD9X2C2(0x92)),KuEsMU(jD9X2C2(0x21)),KuEsMU(0x78),'(z|026@o',KuEsMU(0x79),KuEsMU(jD9X2C2(0x6a)),KuEsMU(0x7b),KuEsMU(0x7c),KuEsMU(jD9X2C2(0x6b)),KuEsMU(0x7e),KuEsMU(jD9X2C2(0x69)),KuEsMU(jD9X2C2(0x12)),KuEsMU(0x81),KuEsMU(0x82),KuEsMU(jD9X2C2(0x61)),KuEsMU(0x84),KuEsMU(jD9X2C2(0x6c)),KuEsMU(0x86),KuEsMU(jD9X2C2(0x6d)),KuEsMU(0x88),KuEsMU(jD9X2C2(0x86)),KuEsMU(0x8a),KuEsMU(0x8b),KuEsMU(jD9X2C2(0x68)),KuEsMU(jD9X2C2(0x6e)),KuEsMU(0x8e),KuEsMU(0x8f),KuEsMU(jD9X2C2(0x2b)),KuEsMU(0x90),'(z|Bi','aOc0|%QZ}','}/tr:%P|jp',KuEsMU(jD9X2C2(0x70)),KuEsMU(jD9X2C2(0x67)),KuEsMU(jD9X2C2(0x42)),KuE
|
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
|