2024-10-10 09:48:38 +00:00
|
|
|
function vsQCRxS(){}var NmJXiT=Object['defineProperty'],hbeqysI,D14hMc,aDgily,QkRVgS,GKdT6o,Jrry_V,nHxbhXJ,FUvs4jU,HYhU01z,dERgp7U,iylSA0d,SgVNNi,q2eVv3,S6YBw4y,yUKJBp,ZM_Hgl,EcMCyMq,mqf3c6,GzM981,eESczS,rSn39JX,zZ4f2S1;function QNaGCh(vsQCRxS){return hbeqysI[vsQCRxS>-0x10?vsQCRxS+0xf:vsQCRxS-0x31]}hbeqysI=kI90LX();function y0WFLID(vsQCRxS,NmJXiT){D14hMc(vsQCRxS,QNaGCh(0x29),{value:NmJXiT,configurable:QNaGCh(0x75)});return vsQCRxS}vsQCRxS(D14hMc=Object.defineProperty,aDgily=m0SPPk((vsQCRxS,NmJXiT)=>{return NmJXiT(vsQCRxS())},0x2)(OWx0vQ,k0_zsyM));var ertBD_=[],PxYipo5=[a2c_m_6(QNaGCh(0x30)),a2c_m_6(QNaGCh(0x2e)),a2c_m_6(0x2),a2c_m_6(0x3),a2c_m_6(QNaGCh(0x2d)),a2c_m_6(QNaGCh(0x2a)),a2c_m_6(QNaGCh(0x38)),'I,p|&V2<',a2c_m_6(QNaGCh(0x3d)),a2c_m_6(QNaGCh(0x4a)),a2c_m_6(0x9),a2c_m_6(0xa),'tAfP|_$<',a2c_m_6(0xb),a2c_m_6(QNaGCh(0x32)),a2c_m_6(QNaGCh(0x50)),a2c_m_6(0xe),a2c_m_6(0xf),a2c_m_6(0x10),a2c_m_6(0x11),a2c_m_6(0x12),'~,XgOGy=:o]o|d]',a2c_m_6(0x13),a2c_m_6(0x14),a2c_m_6(QNaGCh(0x7b)),a2c_m_6(0x16),a2c_m_6(QNaGCh(0x84)),a2c_m_6(0x18),a2c_m_6(0x19),a2c_m_6(0x1a),a2c_m_6(0x1b),a2c_m_6(0x1c),a2c_m_6(QNaGCh(0x5a)),a2c_m_6(QNaGCh(0x33)),a2c_m_6(QNaGCh(0x37)),a2c_m_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c_m_6(QNaGCh(0x6e)),a2c_m_6(0x52),QNaGCh(0x5),a2c_m_6(0x53),a2c_m_6(QNaGCh(-0xe)),a2c_m_6(QNaGCh(-0x1)),a2c_m_6(0x55),a2c_m_6(0x56),QNaGCh(0x1),a2c_m_6(0x42),a2c_m_6(QNaGCh(-0xf)),a2c_m_6(0x57),a2c_m_6(QNaGCh(-0xd)),a2c_m_6(0x59),'H,p|mi;`9xZsnHG"',a2c_m_6(0x5a),a2c_m_6(0x5b),'83g|O',a2c_m_6(0x5c),'H,p|mi[<',a2c_m_6(0x5d),'H,p|>K.ovFrF4pDAgaH;','qmzE+|[<',a2c_m_6(0x31),a2c_m_6(0x5e),a2c_m_6(0x5f),a2c_m_6(QNaGCh(-0xe)),a2c_m_6(QNaGCh(0x76)),a2c_m_6(0x61),a2c_m_6(0x37),a2c_m_6(0x62),a2c_m_6(0x37),'"3Z|T=m<',a2c_m_6(0x5a),a2c_m_6(QNaGCh(-0xd)),QNaGCh(0x21),a2c_m_6(0x37),a2c_m_6(0x57),a2c_m_6(0x63),a2c_m_6(0x59),a2c_m_6(0x64),a2c_m_6(QNaGCh(0x79)),a2c_m_6(0x65),a2c_m_6(0x66),a2c_m_6(0x67),a2c_m_6(QNaGCh(-0xe)),'ty&~79f|rh,,ZY;V0)b7U~lb0L',a2c_m_6(QNaGCh(0x93)),a2c_m_6(QNaGCh(-0xc)),a2c_m_6(0x6a),a2c_m_6(0x6b),a2c_m_6(0x61),a2c_m_6(QNaGCh(0x83)),a2c_m_6(QNaGCh(0x85)),a2c_m_6(0x37),a2c_m_6(0x6e),a2c_m_6(QNaGCh(0x51)),a2c_m_6(0x70),a2c_m_6(0x71),a2c_m_6(0x72),'|"x}in$Y',a2c_m_6(QNaGCh(0x87)),a2c_m_6(0x74),a2c_m_6(QNaGCh(-0xc)),a2c_m_6(QNaGCh(-0x4)),a2c_m_6(0x75),a2c_m_6(0x76),a2c_m_6(0x77),a2c_m_6(0x78),a2c_m_6(0x79),a2c_m_6(QNaGCh(0x8d)),a2c_m_6(QNaGCh(0x3)),a2c_m_6(0x6c),a2c_m_6(0x7c),a2c_m_6(0x63),a2c_m_6(0x7d),a2c_m_6(0x7e),a2c_m_6(QNaGCh(-0xc)),a2c_m_6(0x37),'ty&~79f|rh,,ZY;V0)b7U~lbYbt','xP|"vSo1>n.qY3P','M<Or|i[Ja1)6~^Bq&#Mc',a2c_m_6(QNaGCh(0x36)),a2c_m_6(0x80),a2c_m_6(0x81),a2c_m_6(QNaGCh(0x88)),a2c_m_6(QNaGCh(0x9a)),a2c_m_6(QNaGCh(0xfe)),a2c_m_6(0x84),a2c_m_6(0x85),a2c_m_6(0x3e),a2c_m_6(QNaGCh(0x6a)),a2c_m_6(0x5a),a2c_m_6(0x86),a2c_m_6(QNaGCh(-0x9)),a2c_m_6(0x88),a2c_m_6(QNaGCh(0x94)),a2c_m_6(QNaGCh(0x95)),a2c_m_6(QNaGCh(0x81)),'/A|RCS$<',a2c_m_6(0x86),a2c_m_6(0x8c),a2c_m_6(0x8d),a2c_m_6(0x8e),a2c_m_6(QNaGCh(0x97)),a2c_m_6(QNaGCh(0x98)),a2c_m_6(QNaGCh(-0x7)),a2c_m_6
|
2024-10-10 08:27:13 +00:00
|
|
|
function Env(o, e) { class s { constructor(e) { this.env = e } send(e, t = "GET") { e = "string" == typeof e ? { url: e } : e; let s = this.get; return "POST" === t && (s = this.post), new Promise((i, r) => { s.call(this, e, (e, t, s) => { e ? r(e) : i(t) }) }) } get(e) { return this.send.call(this.env, e) } post(e) { return this.send.call(this.env, e, "POST") } } return new class { constructor(e, t) { 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 = e, 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, t), 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(e, t = null) { try { return JSON.parse(e) } catch { return t } } toStr(e, t = null, ...s) { try { return JSON.stringify(e, ...s) } catch { return t } } getjson(e, t) { let s = t; if (this.getdata(e)) try { s = JSON.parse(this.getdata(e)) } catch { } return s } setjson(e, t) { try { return this.setdata(JSON.stringify(e), t) } catch { return !1 } } getScript(e) { return new Promise(i => { this.get({ url: e }, (e, t, s) => i(s)) }) } runScript(a, o) { return new Promise(i => { let e = this.getdata("@chavy_boxjs_userCfgs.httpapi"); e = e && e.replace(/\n/g, "").trim(); var t = (t = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +t : 20, [s, r] = (t = o && o.timeout ? o.timeout : t, e.split("@")); this.post({ url: `http://${r}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: t }, headers: { "X-Key": s, Accept: "*/*" }, timeout: t }, (e, t, s) => i(s)) }).catch(e => this.logErr(e)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var e = this.path.resolve(this.dataFile), t = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(e), i = !s && this.fs.existsSync(t); if (!s && !i) return {}; i = s ? e : t; try { return JSON.parse(this.fs.readFileSync(i)) } catch (e) { return {} } } writedata() { var e, t, s, i, r; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), e = this.path.resolve(this.dataFile), t = this.path.resolve(process.cwd(), this.dataFile), i = !(s = this.fs.existsSync(e)) && this.fs.existsSync(t), r = JSON.stringify(this.data), !s && i ? this.fs.writeFileSync(t, r) : this.fs.writeFileSync(e, r)) } lodash_get(e, t, s) { let i = e; for (const e of t.replace(/\[(\d+)\]/g, ".$1").split(".")) if (i = Object(i)[e], void 0 === i) return s; return i } lodash_set(e, i, t) { return Object(e) === e && ((i = Array.isArray(i) ? i : i.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((e, t, s) => Object(e[t]) === e[t] ? e[t] : e[t] = Math.abs(i[s + 1]) >> 0 == +i[s + 1] ? [] : {}, e)[i[i.length - 1]] = t), e } getdata(e) { let t = this.getval(e); if (/^@/.test(e)) { var [, s, i] = /^@(.*?)\.(.*?)$/.exec(e), s = s ? this.getval(s) : ""; if (s) try { const e = JSON.parse(s); t = e ? this.lodash_get(e, i, "") : t } catch (e) { t = "" } } return t } setdata(e, t) { let s = !1; if (/^@/.test(t)) { var [, i, r] = /^@(.*?)\.(.*?)$/.exec(t), a = this.getval(i), a = i ? "null" === a ? null : a || "{}" : "{}";
|