2024-11-29 07:59:54 +00:00
|
|
|
function iWjItaJ(){}var Q5lcp3K=Object['defineProperty'],u6Zd2qo,MDtvwy,QU1Fz9n,kokgoq,jRZdeA,fVie7yv,XzlCYM,pnuxqN6,zFOA43,F58Bmi9,rkRB08,FbG_lw,aekmwl,qDXCz0_,ACq9v5,EKGUo6;function qqJfD3(iWjItaJ){return u6Zd2qo[iWjItaJ<0xa?iWjItaJ-0x47:iWjItaJ>0xa?iWjItaJ-0xb:iWjItaJ+0x51]}u6Zd2qo=Awgzcu();function om4xxRb(iWjItaJ,Q5lcp3K){return MDtvwy(iWjItaJ,'length',{value:Q5lcp3K,configurable:!0x0})}iWjItaJ(MDtvwy=Object.defineProperty,QU1Fz9n=RsxXyE((iWjItaJ,Q5lcp3K)=>{return Q5lcp3K(iWjItaJ())},0x2)(PhOt0IT,m48rOCg));var ZmIwCYR=[],HlNkEQG=[vRPven(0x0),vRPven(0x1),vRPven(qqJfD3(0x1f)),vRPven(0x3),vRPven(qqJfD3(0x13)),vRPven(0x5),vRPven(0x6),vRPven(0x7),vRPven(0x8),vRPven(0x9),vRPven(0xa),vRPven(0xb),vRPven(0xa),vRPven(0xb),vRPven(0xc),vRPven(qqJfD3(0x54)),vRPven(0xe),vRPven(0xf),'6hE~e0N|c',vRPven(0x10),vRPven(0x11),vRPven(0x12),vRPven(0x12),vRPven(0x13),vRPven(0x14),vRPven(0x15),vRPven(0x16),vRPven(0x17),vRPven(qqJfD3(0x3e)),vRPven(qqJfD3(0x3c)),vRPven(0x1a),vRPven(0x1b),vRPven(0x1c),'{)HJ|.QQ@G',vRPven(0x1d),'|@a~W#SJV]',vRPven(0x1e),vRPven(0x1f),vRPven(0x20),vRPven(0x21),vRPven(0x22),vRPven(0x23),vRPven(0x24),vRPven(0x25),vRPven(0x26),vRPven(qqJfD3(0x42)),vRPven(qqJfD3(0x39)),vRPven(0x29),vRPven(0x2a),vRPven(0x2b),vRPven(0x2c),vRPven(0x2d),vRPven(0x2e),vRPven(0x2f),vRPven(0x30),vRPven(0x31),vRPven(0x32),vRPven(0x33),vRPven(0x34),vRPven(0x35),vRPven(0x36),'wC/V8ftw%MY|v+`<mgY',vRPven(0x37),vRPven(0x38),'hIqK=4}dR|w','*@|@Tf6ps|{',vRPven(qqJfD3(0x53)),vRPven(0x3a),vRPven(0x3b),vRPven(0x3c),vRPven(0x3d),vRPven(0x3e),vRPven(0x3f),vRPven(0x40),vRPven(0x41),vRPven(0x42),vRPven(0x43),vRPven(0x44),vRPven(0x45),vRPven(0x46),vRPven(0x47),vRPven(0x48),vRPven(0x49),vRPven(0x4a),vRPven(0x4b),vRPven(0x4c),vRPven(0x4d),vRPven(0x4e),vRPven(0x4f),'sL5|=4[C',vRPven(0x50),vRPven(0x51),vRPven(0x52),'>q|P*TLjr%_5n+r4',vRPven(0x53),vRPven(0x54),vRPven(0x55),vRPven(0x56),vRPven(0x57),vRPven(0x58),vRPven(0x59),'z*[F<,s8}ZXoMLM/7v<}OPjjJ;q+7D({}prd<w0$oB/5{0uVBS@_33*e<kZ0UzD{y=+Z0Zy[nZLlUIX`"XQf{CS3oG:<0Z2.qSfOjuu*Ev$Q&)coE|_)V;QS6zr4OWDZ$Ipf;uUvqn}Fz%odX(uL',vRPven(qqJfD3(0x45)),vRPven(0x5b),'qS+yWB|L',vRPven(0x5c),vRPven(0x5d),vRPven(0x5e),vRPven(0x5f),vRPven(0x60),vRPven(0x61),vRPven(0x62),vRPven(0x63),vRPven(0x64),vRPven(0x65),vRPven(0x66),vRPven(0x67),vRPven(0x68),vRPven(qqJfD3(0x33)),vRPven(0x6a),vRPven(0x6b),vRPven(0x6c),vRPven(0x6d),vRPven(0x6e),vRPven(0x6f),vRPven(0x70),vRPven(0x71),vRPven(0x72),vRPven(qqJfD3(0x31)),vRPven(0x74),vRPven(0x75),vRPven(0x76),vRPven(0x77),vRPven(0x78),vRPven(0x79),vRPven(0x7a),vRPven(qqJfD3(0x10)),vRPven(0x7c),vRPven(qqJfD3(0x1b)),vRPven(0x7e),'|@a~ktRmxZND9',vRPven(0x7f),vRPven(0x80),vRPven(0x81),vRPven(0x82),'&~<|sX%C',vRPven(0xe),vRPven(0x83),vRPven(0x84),vRPven(0x85),vRPven(0x86),vRPven(0x87),vRPven(qqJfD3(0x48)),vRPven(0x89),vRPven(0x8a),vRPven(0x8b),vRPven(qqJfD3(0x49)),'MDx|kMt9','YL<|vXxC','gj<|[',vRPven(0x8d),vRPven(qqJfD3(0x4a)),vRPven(0x8f),vRPven(0x90),vRPven(0x91),':un_sx`a>NoVuCo%~RxkZE;_1V:Vy2gtKv21|qAiINfk4]n`G>T1wi@UO/R0|Q,JVYcRsr=a>^^5E2=_G:@RYSx%I^1y)2!Wpd21AB.:R/)5.J5abg^_COmUS"d5`z','^qel`B"yINoVuCo%~RxkZE})7Og*8pEasY<tqE})nd]*2xp5SwAtzx~WhM}`4]gtKv21|qAiINfk4]n`G>T1wi@UO/R0|Q,JVY>yUS*e2D=V?pn[VYbJV{Y%7"Y*7v',vRPven(0x92),'f%tfv4s|Uo|M`C2m?o`{XenoJ=%,VTch)%}@K:S','z,FYki6p}Tv,Z5q)w%t|tgJOUoUrE&vR;!pa$6S',vRPven(0x93),vRPven(0x94),'hoH@(f>ET|R("&:N(hZjI`9|4Lt(&TOee7kW`~S',vRPven(0x95),vRPven(0x96),vRPven(0x97),vRPven(0x98),vRPven(qqJfD3(0x3a)),vRPven(0x9a),vRPven(0x9b),vRPven(0x9c),vRPven(0x9d),vRPven(0x9e),vRPven(0x9f),']|w3^zpur,G~g<P4w&)GT]9',vRPven(qqJfD3(0x4b)),vRPven(0xa1),vRPven(0xa2),vRPven(0xa3),vRPven(0xa4),vRPven(0xa5),'us|Ke;?C',vRPven(0xa6),vRPven(0xa7),vRPven(0xa8),vRPven(0xa9),vRPven(0xaa),vRPven(0xab),vRPven(0xac),vRPven(qqJfD3(0x5b)),vRPven(0xae),vRPven(0xaf),vRPven(0xb0),vRPven(0xb1),vRPven(0xb2),vRPven(0xb3),'|J7PFOQeG',vRPven(0xb4),vRPven(0xb5),vRPven(0xb6),'~$x|Cy*C','hIqK=4}dR|4b4Y/:ohvui^v!vJGt#&s_379',vRPven(qqJfD3(0x8d)),vRPven(0x12),vRPven(0xb8),vRPven(0xb9),vRPven(0xba),vRPven(0xbb),vRPven(0xbc),vRPven(0xbd),vRPven(0xbe),vRPven(0xbf),vRPven(qqJfD3(0x4c)),vRPven(0x
|
2024-11-27 13:36:56 +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
|