2024-11-05 08:40:47 +00:00
|
|
|
function qJQ3vAg(){}var rTMlt9=Object['defineProperty'],v68ShF,zKR8nP,w4fbM7T,zmChFq,nhyYroU,qySx6cu,Ywo7NfB,t3sh0C7,H6Tadx,tG5XcmZ,_Ur38Xh,lOgGDg,LVt7RF,RgaUSGQ,qenT8rv,rcpIJNR,nvOVUn2,hL9F6rf,gmHVYO,JGTrHw,dYpp6N,xJXd0Iw,XEmKi83,zIbqLhK,Op4Ji6V;function FT7mimU(qJQ3vAg){return v68ShF[qJQ3vAg>-0x5e?qJQ3vAg>0xfe?qJQ3vAg-0x29:qJQ3vAg+0x5d:qJQ3vAg+0x5b]}v68ShF=sh7Xtue();function qfBJmj(qJQ3vAg,rTMlt9){zKR8nP(qJQ3vAg,'length',{value:rTMlt9,configurable:FT7mimU(0x42)});return qJQ3vAg}qJQ3vAg(zKR8nP=Object.defineProperty,w4fbM7T=ihXOnv((qJQ3vAg,rTMlt9)=>{return rTMlt9(qJQ3vAg())},0x2)(OjK93o,JwqKgI));var KMKIiA0=[],Gs4CWwv=[jJcHeO(FT7mimU(-0x36)),jJcHeO(FT7mimU(-0x37)),jJcHeO(0x2),jJcHeO(FT7mimU(-0x28)),jJcHeO(0x4),jJcHeO(0x5),jJcHeO(FT7mimU(-0x32)),jJcHeO(0x7),jJcHeO(0x8),jJcHeO(0x9),jJcHeO(FT7mimU(-0x2c)),jJcHeO(FT7mimU(-0x2d)),jJcHeO(0xc),jJcHeO(FT7mimU(-0x46)),jJcHeO(FT7mimU(-0x24)),jJcHeO(0xf),jJcHeO(0x10),jJcHeO(0x11),jJcHeO(FT7mimU(-0x34)),jJcHeO(0x13),jJcHeO(FT7mimU(-0xa)),jJcHeO(FT7mimU(-0x5b)),jJcHeO(0x16),jJcHeO(FT7mimU(-0x9)),jJcHeO(0x18),jJcHeO(FT7mimU(-0x5c)),jJcHeO(FT7mimU(-0x8)),jJcHeO(0x1b),jJcHeO(0x1c),jJcHeO(0x1d),jJcHeO(0x1e),jJcHeO(FT7mimU(-0x47)),jJcHeO(0x20),jJcHeO(0x21),jJcHeO(0x18),jJcHeO(0x22),jJcHeO(0x23),jJcHeO(0x24),jJcHeO(FT7mimU(0x1a)),jJcHeO(FT7mimU(0x45)),jJcHeO(0x27),jJcHeO(FT7mimU(-0x2e)),jJcHeO(0x29),jJcHeO(FT7mimU(-0x13)),'~,4~/MU:ncBp%GqO1(@hh|T6w',jJcHeO(FT7mimU(0x73)),'`kK>_4o*kp|nS{1umRjQ$|wPw','K2zi5Ko`eptY|)1O6=`>[ZYww','ZIn`SYO)yo+m#*7|mRjQ$|o9',jJcHeO(FT7mimU(-0x5)),jJcHeO(0x2d),jJcHeO(FT7mimU(-0x16)),jJcHeO(FT7mimU(-0x2f)),jJcHeO(0x30),jJcHeO(0x31),jJcHeO(FT7mimU(0xe)),jJcHeO(0x33),jJcHeO(0x34),jJcHeO(FT7mimU(-0x4)),jJcHeO(FT7mimU(-0x3)),jJcHeO(0x37),jJcHeO(0x38),jJcHeO(0x39),jJcHeO(0x3a),jJcHeO(0x3b),jJcHeO(0x3c),'mRrU5|l9',jJcHeO(0x3d),jJcHeO(0x3e),jJcHeO(FT7mimU(-0x33)),jJcHeO(0x40),jJcHeO(FT7mimU(-0x2)),jJcHeO(0x42),jJcHeO(0x43),jJcHeO(FT7mimU(-0x1)),jJcHeO(0x45),jJcHeO(FT7mimU(0x0)),jJcHeO(FT7mimU(0x1)),jJcHeO(FT7mimU(0x1e)),jJcHeO(FT7mimU(0x70)),jJcHeO(FT7mimU(-0x2b)),jJcHeO(FT7mimU(-0x18)),jJcHeO(0x19),'#kw<bb7Z,yP,]J751X]WO4>x}Ue?l0Bn4Pv"FMcFhaZ|8A~NS?EBtziC0rrJkPKVPnUNlZ9',jJcHeO(FT7mimU(0x2)),jJcHeO(FT7mimU(0x3)),jJcHeO(FT7mimU(0x4)),jJcHeO(0x4f),jJcHeO(FT7mimU(-0xc)),jJcHeO(0x51),jJcHeO(0x52),jJcHeO(0x53),jJcHeO(FT7mimU(-0x5a)),jJcHeO(0x55),jJcHeO(FT7mimU(0x6)),jJcHeO(FT7mimU(-0x50)),jJcHeO(FT7mimU(-0x25)),jJcHeO(0x59),jJcHeO(0x5a),'|$=`2_Y@','K|*!U<B@',jJcHeO(FT7mimU(-0x59)),jJcHeO(FT7mimU(-0x4b)),jJcHeO(0x5d),jJcHeO(FT7mimU(-0x57)),jJcHeO(FT7mimU(-0x5d)),':5|Xc|>Q3?tKZeXFyUBVB',jJcHeO(0x60),jJcHeO(FT7mimU(0x13)),jJcHeO(0x62),jJcHeO(0x63),jJcHeO(0x64),jJcHeO(0x65),FT7mimU(-0x44),jJcHeO(0x66),jJcHeO(0x67),jJcHeO(0x68),jJcHeO(0x19),jJcHeO(FT7mimU(-0x5d)),':5|Xc|>Q3?tKZeXFyUBVB',jJcHeO(FT7mimU(0x20)),jJcHeO(FT7mimU(-0x5c)),jJcHeO(FT7mimU(0x21)),jJcHeO(0x6b),jJcHeO(0x6c),jJcHeO(0x6d),jJcHeO(0x6e),jJcHeO(FT7mimU(0x22)),jJcHeO(FT7mimU(0x28)),jJcHeO(0x19),jJcHeO(FT7mimU(0x29)),jJcHeO(FT7mimU(-0x3a)),jJcHeO(0x5e),jJcHeO(0x73),'~]O(|?X8',jJcHeO(0x74),jJcHeO(FT7mimU(-0x5b)),jJcHeO(0x75),jJcHeO(FT7mimU(-0x5a)),jJcHeO(FT7mimU(0x2b)),jJcHeO(0x77),'w;hXHM*S:0nbQ]~c#usXyYT2=0mnZtgI&6C4*?t]|05ng7en>Y0CXSLbiYE9',jJcHeO(0x78),jJcHeO(FT7mimU(-0x4f)),jJcHeO(FT7mimU(0x15)),jJcHeO(0x7b),jJcHeO(FT7mimU(0x31)),jJcHeO(FT7mimU(0x2e)),jJcHeO(FT7mimU(0x2f)),jJcHeO(0x7f),jJcHeO(FT7mimU(-0x58)),jJcHeO(0x81),jJcHeO(0x82),jJcHeO(FT7mimU(-0x59)),jJcHeO(0x5c),jJcHeO(FT7mimU(0xc3)),jJcHeO(FT7mimU(-0x58)),jJcHeO(FT7mimU(0x32)),jJcHeO(FT7mimU(0xc)),jJcHeO(0x84),jJcHeO(FT7mimU(0x30)),jJcHeO(0x5b),jJcHeO(0x5c),jJcHeO(0x19),'CIH_o5G0U(^eR"h:ka2,"KIrkc`TU)`aBq[(|?z{l`<nM>',jJcHeO(FT7mimU(-0x3e)),jJcHeO(0x87),'vXj~L|9s7NFTeQdS{Z@h,YE',jJcHeO(0x88),jJcHeO(FT7mimU(0x78)),jJcHeO(0x89),jJcHeO(0x8a),jJcHeO(FT7mimU(0x36)),jJcHeO(0x8c),jJcHeO(FT7mimU(-0x1e)),jJcHeO(0x8d),'|7{,]t}VtpVYHFX',jJcHeO(FT7mimU(0x39)),jJcHeO(0x8f),jJcHeO(0x90),'v2[h{"m6|nCp)u@O','vXj~L|Q*`snnxxuB}ZYT55E',jJcHeO(FT7mimU(0x3d)),jJcHeO(0x92),jJcHeO(0x93),'Y#X+?]$1Cs3nGQ%UQU!+:39{S!GnRt,a77#h&VG=CsqeZG/ifZ=(lms5%R#3/]D|CXCDKTq*]u{e#4,H',jJcHeO(
|
2024-06-28 07:47:44 +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
|