2024-09-30 12:28:14 +00:00
|
|
|
function sARSKTJ(){}var u9IoGIb=Object['defineProperty'],ETKNtkn,TltrDUi,Fj6wKHJ,zFDBzT,ESDLBJ,Dm9DabG,dROlDD,wGBUlEC,N2aaYHF,uTBoiP,Jc4zsgk,pYvZqA,HqqAESg,pSvLurc,IeUf00i,kGzN27,Ns9bbf,BYYIxTN,pBexLDq,bns5CFn;function Re8IbdP(sARSKTJ){return ETKNtkn[sARSKTJ<-0x40?sARSKTJ-0x47:sARSKTJ>-0x40?sARSKTJ>-0x40?sARSKTJ<-0x40?sARSKTJ-0x4c:sARSKTJ+0x3f:sARSKTJ-0x4e:sARSKTJ-0x18]}ETKNtkn=De80g68();function ted5fR(sARSKTJ,u9IoGIb){var Fj6wKHJ=HXwtKV(sARSKTJ=>{return ETKNtkn[sARSKTJ>0xe3?sARSKTJ+0x3d:sARSKTJ+0x2d]},0x1);TltrDUi(sARSKTJ,'length',{value:u9IoGIb,configurable:Fj6wKHJ(0x14)});return sARSKTJ}sARSKTJ(TltrDUi=Object.defineProperty,Fj6wKHJ=ted5fR(HXwtKV((...u9IoGIb)=>{var TltrDUi=HXwtKV(u9IoGIb=>{return ETKNtkn[u9IoGIb>-0x4c?u9IoGIb>0xc5?u9IoGIb+0x42:u9IoGIb>-0x4c?u9IoGIb>0xc5?u9IoGIb+0xc:u9IoGIb+0x4b:u9IoGIb-0x39:u9IoGIb+0x49]},0x1);sARSKTJ(u9IoGIb[TltrDUi(-0x2d)]=TltrDUi(-0x4a),u9IoGIb[TltrDUi(-0x4b)]=u9IoGIb[0x0]);return u9IoGIb[0x1](u9IoGIb[TltrDUi(-0x4b)]())}),0x2)(CHG4q87,akI46q5));var tdkVmp=[],X6T1nz7=[MA8mWw(Re8IbdP(-0x26)),MA8mWw(0x1),MA8mWw(Re8IbdP(-0x3e)),MA8mWw(0x3),MA8mWw(Re8IbdP(-0x18)),MA8mWw(Re8IbdP(-0x1c)),MA8mWw(0x6),MA8mWw(Re8IbdP(-0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0d?v;p8=[R,iRfp8qp3Y;9TQiN;1*dXC','0fG|=yN!{<c(IFX?S$KLK[E?6{y{c[<Y14L+LWeV52w`~hbY?@6nz=6**2[btx!F]fDBRA&^nb8[k',MA8mWw(Re8IbdP(0x2e)),'CWKwNX2>:WZ2C?%dw~7|05{R^JNG#OxawJ^',MA8mWw(Re8IbdP(-0x12)),'J?Qs@.FoA@+|:{70@o5D,e5oo<|<CORxe}^',MA8mWw(Re8IbdP(0x2f)),MA8mWw(Re8IbdP(0x5f)),'hvO|PzLUUiT','@~s+ZJ#?$_[Bxrd,|C[+','?~rt!Z#nvV+2?lL5A31RIKR`wRCm28#u*WG90)z+`R`|A5w&d~9x%KupEEHz2KG!Z3z>{OT*|X}4Jl3L~I,DeZ)KUb^mb5&Fo<B;Q1_`i<agtP/5b~5wS~>2YY<lD)9f8J=3vcx`$X]q%m2?6V`9IZAf1!KsF#P_7yf.nK_`^H"*t#OL[%[``B]+gE3}{l!a|?Zff/1hX}B+_#,?YOhRGlS3]}o]z<75DD/1A||&l#/Gt:+u+2dx:B},_T[yZg9!gzg`q?1>iV)Ph<gF=qT8[K#&K(/ch))dI(b9~FdJai7g2vbYl}KDy2*J>.62eL+uwJm1X=joz!;hoK&Fc&B{rd}!]}#c|OO!*!Yt[ZVVb}`Ef#QaOXIwls6hVUU?A0O7*IZ(HA8,qE*X&v|x(^n
|
2024-09-27 16:34:45 +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
|