2024-12-10 14:44:55 +08:00
|
|
|
|
function fakerq34f9k(){}var fakerkqzao=Object['defineProperty'],fakert5h9y9,fakermbex5q,fakeric0llf,fakerpzq2kk,fakermxu3ho,fakerqfaywi,faker5feiy,faker3j8irr,faker6261on,faker21zoya,faker1f5z2f,fakerdz9hpq,fakerexwj9w,faker411b3,faker5s8rcw,fakerxxgod,fakervhudl,fakerp9pmef,faker9ufuv4,fakerlx0z5g,fakershch1c,fakeri579tb;function faker4spys(fakerq34f9k){return fakert5h9y9[fakerq34f9k<-0x18?fakerq34f9k-0x5b:fakerq34f9k+0x17]}fakert5h9y9=faker5bl7lr();var fakeredj0z=[],fakeretu6ze=['i=bjza<xo}Skd1','cy@qnfj(','<sETg','e6ZKRM+5','Xzsqq{A','+|C[=ab0!CqE5D!','>>BFAtQH`1R#OVwP~T','V"1JRKGH','Y"im','[zwFNjcr2{+H6X.$qG@`igDkx[Cf7knY)[#[ZK)Gu?=0UDIC','7LJcKr"JkxVJK.$j]HPQAq[DF~HjMf5[hq+YbDJ1^Xh3?Mi^CLCR','yP,`','hAr]f+1=RAC','hAr]f+Q~nApSpZ>7!l','hAr]f+iHy2r7MsXx#l','"#:8Mk18"AAx&,IGbl',faker4spys(-0x16),'m.LC8Q4F`4Re(p|LG$;Ob>@#2QN+~5[8>a_[Aa|gH','."U`8','~zYaFIkG&;S1i*r.NV;m','<J_[0tSvv?',faker4spys(-0x11),faker4spys(-0x14),'<n)+ojqTFi(}H#(XmOi.9$x`Nt2$ux','""wFktl',faker4spys(-0x17),'hAlmCX%6[;e3tEeLG$;Ob>W7@FoK|8=','G>nt/#C~]',faker4spys(-0x17),'XNkorRxzCkiJTroRR"wFktdc;VE[3?.L4)/Q(?B}j~8',faker4spys(-0x15),'m.LC8Q%VzIDyMAHC*|tH9`>a7S4y1Lr.yV.4K&EWkVp*_K@rBl',faker4spys(-0x16),'."U`8','~zYaFIkG&;S1i*&ciEz','EE:a_4/H',faker4spys(-0x12),'""wFktl','V"~FS','J63[.*wG4+yfT','6>QtbLVH','#:3t"jl','XNkorRxzK21$)>nYGTUQWr<`nKL:f=2pOKT',faker4spys(-0x15),'#:3t"jl','XNkorRxzK21$)>nYGTUQWr<`A82IV;JWV@MjSKs[sX]<3H','G>nt/#C~]',',"y`','hz<aG','."U`8','~zYaFIN%4?<$*hIC^P>EFbl','<J_[0tSvv?','EEntl_pUn?',faker4spys(-0x14),'ws@%|',faker4spys(-0x13),'#:3t"jl',faker4spys(-0x13),faker4spys(-0x17),'8#5JN;X+q/X^A&Uj7MNC5&*f`za',faker4spys(-0x15),'q>@`',faker4spys(-0x17),'197Yn(9>D0f{4mWPEeG`^y@<WorR[d?|^kD?DLR9Z5',faker4spys(-0x15),'8>:iB^v!v?','e#|4LL,%~@4^T','F/EtN{kGU+9^,DTCtQ0VWs:*Zi8D,DU','F/Et#!%LTp.M~USN|6i^>L%L]','e#<aktqH','g:_[RK{~mQJ',',e@`mN.XkiktHH&rh.~^.,?T"i','8>&M,Xl','BVRagLl','EE3tF|l','""wFktl','_:/m','~U;K1;9Qx|','~>3[X!VH`?E*:oZ','^shzo5dQP_]"(d','InM"aX*@M*:','w<qP',faker4spys(-0x12),'Zm&FEgWH','~UFS]JT~<v{HBG^wC<6S',']u0Pkg]ztHyTQG")','BcTcx','GVakj','`Ezaa|l','TE#t,fl','yeYaAtl','/e:iMs/H',',"<aHDnH','M|YaS','v#YaqLo~`Q','EE:a_4/H',faker4spys(-0x10),'<J_[0tSvv?',faker4spys(-0x11),'#:3t"jl',faker4spys(-0x17),'6>QtbLVH','7L(ZRduzCkiJTroRXNkorRPF]GM:Td.jZ0c{&b~;^pVD+eu/>G@Zd','vc/m','TEjm','yeYaAtl','t7x28Q/SEb][a?#jA3q1hi=W,S','sz#t,fl','#:3t"jl','H{yrRd6a.!_33?.L4)/Q(?B}j~8',faker4spys(-0x10),'XzwFNjP;!%KKyE','XzwFNj2HU+94SE','XzwFNj/PCJlJLE','1,p^)b_c_;t^k^H?','c/x8sCx~#e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qWl','56N7FJdPV+4i"ZN.*J/m"f0Yrm4q0GL7(/9FYA!8"i2="VVN',')Q`ah!*Ta@{f${u%J#]=zc88qnz,Pht%6nvatK?Uti!{T','JZJ=KCB3qJ}L97KSQ:7`','V|~fHDT%<mF!fS!q2Zsi5!#qt2|j"z','3/R`G3B;#;2j1Us.aK:[(4sG_JW4l','B|bfy,9G`+OKI0GcgcIJZ4l','[y$[jMRT@Jb{P/<,&Bk:EcaH','.JIJW#,vrnO<3rES','E#P:bo,p0Rvt+,fF2Q~x{/}=Fqm#OAi','7P"a#Mx~>>_isSOc(l','d:ibRo(BIeB=Tn^7#dOETL6N;q@geDkx','A?=3VAzN@k}LT','L]B=/v(K<e;jz7GNk+SJ|MqH','::63;M9Bu+XT{S}x5>`D*^oCDUK{GCe81c_t3tl','[J6I!gqk^>U`.{z~onq:9,%YYnXtb^<S!fz','Sa!KS4Kc
|
2024-12-10 14:44:55 +08: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
|