2024-10-31 03:19:52 +00:00
|
|
|
function VucyMR(){}var o9oV8n=Object['defineProperty'],DBcfvW3,CE5nKYH,FTaHxVK,ZmgHx_a,TvnlQp,lLKMP7,cyP2BS,_1NzkS,OPOXmx0,bbBfA8L,W29Pn5_,HoEPin,wqUSjbO,UoGMhO6,JFRW0wy;function Dz3BMOr(VucyMR){return DBcfvW3[VucyMR<0x110?VucyMR>0x110?VucyMR+0xa:VucyMR<0x110?VucyMR<0x4?VucyMR-0x20:VucyMR-0x5:VucyMR-0x5f:VucyMR-0x38]}DBcfvW3=Az3zgD();function MMwYwq(VucyMR,o9oV8n){return CE5nKYH.call(null,VucyMR,'length',{value:o9oV8n,configurable:Dz3BMOr(0xe0)})}VucyMR(CE5nKYH=Object.defineProperty,FTaHxVK=MMwYwq(mbonsa((...o9oV8n)=>{var CE5nKYH=mbonsa(o9oV8n=>{return DBcfvW3[o9oV8n>0xc7?o9oV8n-0x0:o9oV8n+0x44]},0x1);VucyMR(o9oV8n[CE5nKYH(-0x21)]=0x2,o9oV8n[Dz3BMOr(0x5)]=o9oV8n[CE5nKYH(-0x43)]);return o9oV8n[0x1](o9oV8n[Dz3BMOr(0x5)]())}),0x2)(lhZf1z,JvwPCyH));var wkMDk_=[],woUfAis=['A7#b|mTN',Z1BmR1H(Dz3BMOr(0x6)),Z1BmR1H(0x1),Z1BmR1H(Dz3BMOr(0x27)),Z1BmR1H(Dz3BMOr(0x22)),Z1BmR1H(Dz3BMOr(0x2a)),Z1BmR1H(0x5),Z1BmR1H(Dz3BMOr(0x1e)),Z1BmR1H(Dz3BMOr(0x1b)),Z1BmR1H(Dz3BMOr(0x36)),Z1BmR1H(0x9),Z1BmR1H(0xa),Z1BmR1H(Dz3BMOr(0x8)),Z1BmR1H(Dz3BMOr(0x7)),Z1BmR1H(0xd),Z1BmR1H(0xe),Z1BmR1H(0xf),Z1BmR1H(0x10),Z1BmR1H(0x9),Z1BmR1H(0x7),Z1BmR1H(0xb),Z1BmR1H(Dz3BM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dz3BMOr(0xd)),Z1BmR1H(Dz3BMOr(0x7f)),Z1BmR1H(0x6a),Z1BmR1H(0x6b),Z1BmR1H(0x6c),Z1BmR1H(Dz3BMOr(0x5e)),Z1BmR1H(Dz3BMOr(0x82)),Z1BmR1H(Dz3BMOr(0x43)),Z1BmR1H(0x70),Z1BmR1H(Dz3BMOr(0xb)),Z1BmR1H(0x71),Z1BmR1H(0x72),Z1BmR1H(0x73),Z1BmR1H(Dz3BMOr(0xfe)),Z1BmR1H(0x75),Z1BmR1H(0x76),Z1BmR1H(0x77),Z1BmR1H(0x78),Z1BmR1H(Dz3BMOr(0x5d)),Z1BmR1H(Dz3BMOr(0x89)),Z1BmR1H(Dz3BMOr(0x8c)),Z1BmR1H(Dz3BMOr(0x8d)),Z1BmR1H(0x7d),Z1BmR1H(0x7e),Z1BmR1H(0x7f),Z1BmR1H(Dz3BMOr(0x1d)),Z1BmR1H(0x81),Z1BmR1H(0x82),Z1BmR1H(0x83),'&x#o|;SX^W',Z1BmR1H(0x84),Z1BmR1H(Dz3BMOr(0x4c)),Z1BmR1H(0x86),Z1BmR1H(0x87),Z1BmR1H(Dz3BMOr(0xc5)),Z1BmR1H(0x89),Z1BmR1H(Dz3BMOr(0x8f)),Z1BmR1H(Dz3BMOr(0x90)),Z1BmR1H(0x8c),Z1BmR1H(0x8d),Z1BmR1H(Dz3BMOr(0x91)),Z1BmR1H(0x8f),Z1BmR1H(0x90),Z1BmR1H(0x91),Z1BmR1H(Dz3BMOr(0x92)),Z1BmR1H(0x93),Z1BmR1H(0x94),Z1BmR1H(0x95),Z1BmR1H(Dz3BMOr(0x15)),Z1BmR1H(Dz3BMOr(0x16)),Z1BmR1H(
|
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
|