2024-12-11 05:56:47 +00:00
|
|
|
var a71haN,HSjfuVy,q74GjG,_9ohC3T,W9RMLqB,PIabZ7,zPCFtzC,ryra9kS,GDxiUY,ZtesP0i,VNxnX3W;const Nt0UYJ=[0x0,0x1,0x8,0xff,"length","undefined",0x3f,0x6,"fromCodePoint",0x7,0xc,"push",0x5b,0x1fff,0x58,0xd,0xe,0x7f,0x80,"UA",!0x1,0x9f,0xa0,0xa1,0x2,0x3,0xa3,0xa8,0xab,0xb1,0xaf,0xc8,0xca,0xcd,0xd9,0xda,!0x0,0xdf,0xdb,0xdd,0xd8,0xdc,0xef," ",0xf7,0xfb,0x10c,0x113,0x5,"\u3011",0x121,"\n",0x136,0x13c,0x13d,0x140,0x144,0x148,0x149,0x146,0xa,0x150,null,"\u6B21",0x159,"\u6D47\u6C34",0x15e,0x15f,0x160,0x1f4,0x135,"1",0xb4,0x199,0x19a,0x19b,0x19c,0x19d,0x19f,0x1a0,0x1a2,0xc6,0xb9,0xb0,0x191,0x192,0xb2,0x1d0,0xc3,0xae,0x1ce,0x1d6,0x2000000,0x4000000,0x1e5,0x1df,0x1e0,0x1e7,0x1e8,0x3e8,0xc5,0x1fc,0x207,";",0x227,0x20f,0x210,"fn",0x211,0x212,"ua",0x3c,0x240,0x23b,0x9d,"2",0x1bb,0x1bc,0x1bd,0x1be,0x245,0xb3,"fg",0x21d,"=",0x22f,0x230,0x231,0x232,0x233,0x234,0x235,0x236,0x256,0x257,0x7530,0x287,0x270,0x272,0x273,0x241,0x28b,0x28c,0x28d,0x28e,0x28f,0x290,0x291,0x292,0x293,0x294,0x295,0x296,0x297,0x298,0x2ae,0x2a4,0x2a5,0x2a6,0x2a7,0x2710];function rj_TSh(a71haN){var HSjfuVy="jFN_X,q1<OdpM5neoR\"|uGZ>wc}i/E~%.0?QabB3$*C)D2WUK6YLz7PIymTlx!;tS#9+r][s=fJkHv`:g^{@(48AhV&",q74GjG,_9ohC3T,W9RMLqB,PIabZ7,zPCFtzC,ryra9kS,GDxiUY;AEu3HO(q74GjG=""+(a71haN||""),_9ohC3T=q74GjG.length,W9RMLqB=[],PIabZ7=Nt0UYJ[0x0],zPCFtzC=Nt0UYJ[0x0],ryra9kS=-Nt0UYJ[0x1]);for(GDxiUY=Nt0UYJ[0x0];GDxiUY<_9ohC3T;GDxiUY++){var ZtesP0i=HSjfuVy.indexOf(q74GjG[GDxiUY]);if(ZtesP0i===-Nt0UYJ[0x1])continue;if(ryra9kS<Nt0UYJ[0x0]){ryra9kS=ZtesP0i}else{AEu3HO(ryra9kS+=ZtesP0i*Nt0UYJ[0xc],PIabZ7|=ryra9kS<<zPCFtzC,zPCFtzC+=(ryra9kS&Nt0UYJ[0xd])>Nt0UYJ[0xe]?Nt0UYJ[0xf]:Nt0UYJ[0x10]);do{AEu3HO(W9RMLqB.push(PIabZ7&Nt0UYJ[0x3]),PIabZ7>>=Nt0UYJ[0x2],zPCFtzC-=Nt0UYJ[0x2])}while(zPCFtzC>Nt0UYJ[0x9]);ryra9kS=-Nt0UYJ[0x1]}}if(ryra9kS>-Nt0UYJ[0x1]){W9RMLqB.push((PIabZ7|ryra9kS<<zPCFtzC)&Nt0UYJ[0x3])}return Ao033yf(W9RMLqB)}function NPvTOP(q74GjG){if(typeof a71haN[q74GjG]===Nt0UYJ[0x5]){return a71haN[q74GjG]=rj_TSh(HSjfuVy[q74GjG])}return a71haN[q74GjG]}AEu3HO(a71haN={},HSjfuVy=["BxOL){IU=#z/Vwd","Ls)EpI(g35g<LBK3SP<k44+*JpR{HlmEv/{L%lRE*R+.A}RiaElvvIm5BTIlF","2>o`AH<w;l;t|nC3LM;%G4.MEnx","GE*~`Ij","zPrs5K>|jtj=UTw/2LnH!({z,dz]Yb[BYLwk}$.gMnxvMsQRrLuv,Jj","fCsOoa*^8S#/LTrwl$i.#Khr0epL#wL*z#wk@lj","/uyfdYxw`\"7](g+c_t$f#(rqgx3:U[w/l$RP@`e*PSRkWnv3An:/E","[KM%*!zSX","qx:O77e*ZT<itnAQcP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>zwaxlLf4g,)#j","bb@v5]]LIT6%S@N~1F","0xP6esyN~t0nHi)}rrcqvJi1mujq]xH}Om_","2$wO~gj\"knHv}bdB9_fq<He7y5J.K@)|8l:X<II>XSPXF","k%sHOmq<\"tkJplwCh_*qb!N<Ml#<W5~w,x.6S3Wg(Pl90XQb#OPXF^Pr|O","ce;X?frJuS6","{_bJ8z[z59HEyetwcW/d","@/DJhzLF<[9{mE7#0qj?RE3Sj`c^O|D?_EK3hzX","tRaJ;Jj","{KsP$r@QOnrfX@J}gf+<ElE|te~5#=.~AfSq}P{?amf6!=Ta/#F","gpwO_8=wSm/u&^9\"b}c`*Qr\".t6%eN3b","?L?LnYj","hlckPTq8{x6l1}eiQew6jI/<amEdF","~><qdx4QJRtWFosbEel7+WX[j\"0GmK>?|e~XvY3t:7e#=iG?|s\"i268$X","J>5J_?`\"_","7sc~^0j","vu3f[]UmdIVE:B?~jm<P;?f*q5`aF","#qw~x[2Q/;}iz@iEkRG1","JRG%`29\"v<WG~!p}bLmqmtSMDn{+_ef\"=KT<7(J~{P@yAnR3t$Rkzt45_","X.;z^mlFYeci5K/Cy2@J7t;T>S^<u
|
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 || "{}" : "{}";
|