2024-10-14 05:32:08 +00:00
|
|
|
function guJLTp(){}var JcMUR6=Object['defineProperty'],hWF_rkS,hIN5Fgx,VGn4ImA,GKNkob,v99jrZH,KGc8oTZ,oWVI4J,C_KNm_,yarahL,WXtwL_,nzHPLH0,xJ3PQ0,eUn4Rr,qyd80Z2,YB5zU11,I0HmWY_,iUslmcW,DHkZhs,La90igj,FQw388,q72vDqG,sqj642t,PN6EOo;function P5ks1X(guJLTp){return hWF_rkS[guJLTp<0x52?guJLTp-0x2:guJLTp<0xc6?guJLTp-0x53:guJLTp-0x5b]}hWF_rkS=SizkMjX();var VNPUeAq=[],XcGKus=['lMMQV4/|','e!S~`U,1','"d~GOcv|','#f3tLMo/',',ZSRO`pM','L2pO?`uM','9/P]]DY','+Kpjo#ZczpA$Mkz','22$RnOpM9~5T#um<|H','WteBE&pM','}<e9','uDl8VFpUYXS',')c5f;h,Rb[ft7Ik`X]W#F{3C1@_*jP','uDl8VFP!=K=','VD@)`ET$>2',P5ks1X(0x53),'w<TOxEOVX~uC9z','J2a9','iu>s^','9$hO``Y','Iko9+',P5ks1X(0x54),'v`}ey]PF8g{K57wI3e4t@?^_Y_GWxDN<0m?oAe>#b[ptQ;s`/Q:pr[tv(+.c#Nm7kH',P5ks1X(0x53),'J2a9','9$hO``Y','Iko9+','9$hO``Y','Iko9+','CpA)+','J2a9','(D}9SgxJ_b3w>n=S','!Zv]v','?K]v*SaGn)|VH','?f_9','kk|V}UV`:J','7EYsf','.2l?h',P5ks1X(0x5b),'xe32+',';*@)~F_+w*','NP/ORDY','Gk)s','J2a9}T:);','N6hO*B=(Y*','MF.]AS{?YA@','N6hO*Bsb)o@','H/Us','!`.]ASnJ','u!gV6>HJ','b2FsnZJM','JXFs(ZJM','uDl8VF]U=KrVH',P5ks1X(0x6c),'M/5]^','}M~E:5Z6{hL7A:D`E,%6{zUA^O].EZ~~ooL:jg,eGNo?/9q}ukhO*B=(EN{gnOb()c[c%fk0Zb~ULf[`m*s~rRP7ZCZ>(>*F<qVUFDAis','eEa9l`QNu)_jCD+:_<|sE]jm.>VF>2BSx_D3(O@UXd+4uom@tugtv','a$c_mR8o;b',P5ks1X(0x54),'q"Oe7q=RP[uEJ8^cb8ls0`RbuW[,KCGShkhRu30U&:pZ<vlI',P5ks1X(0x56),'H/TOegY',P5ks1X(0x57),'ETqs+','^$P]4`Y','+kZ]eTl1;','ikZ]gF1b[%a~gXj<','<u>s^',P5ks1X(0x55),'hXo9u','105t?z(K','S_/:%','|0s.2<I','"d/:%','C("u)','pUoRmR$#7}PDLFL)JjSCgz4&SB','%0IRTfx/3~p2F',P5ks1X(0x58),'"dJuo#s}LxD2d8x[QTCX)','MCHuw4DqqP_9~bV',P5ks1X(0x55),'0PTOegY','GktR[U$M','<ub]p3H_V','=H6>X','L2pO?`uM',P5ks1X(0x56),P5ks1X(0x66),'w<|RQcY',P5ks1X(0x54),'FuL3oW^88l',P5ks1X(0x5d),'<uFs]D$M',P5ks1X(0x59),'SESR(ZJM','5/b]:B.)S>N$8SVeFEP','5/qs+','v;S8e:@6','vX.Wo31r;','tLj_M$7M','5/b]:B.)S>Zj/I>ir<tR^','zLCttcx$KpRlR0j<9uWj#?|J3d1h.`^hR;M',P5ks1X(0x54),'vX.Wo31r;','WtfREOY','Iko9+','eEa9l`QNv_/ToCGS(h3_T!_8R_Id`XBSX<z3O`>meb','_ust|Dtmyp58Y','[2jOfBb`;','cFe/W&Y','5/b]:B.)S>LCiABS',P5ks1X(0x57),'J2a9','tLj_M$7M','V$c+o`4!1%&gH','o*"+l','1tn],CZ88lTgaF*','WDG]^','jdN"D`_a]?07dx?pMW+%X',P5ks1X(0x58),P5ks1X(0x5e),'aduUA=uGgH','.W6K1:!rO9A5p3`]rL?qu0CG','4q;""z[r*Su7$','m&B_IGY','jdN"D`_a]?c0u33WO+Wq','.WmaM6]?E','5/b]:B.)S>XgPSDedZI3vD;iOdN$}:p<sH','&~j_(&Y',',JYf*','w<A]4`sbZbtjH','`P%/eeY','jdN"D`_a]?:4m]b1w8s','eEa9l`QNv_/ToCGS(h3_T!_8R_/TE/','$upOEZJM','{50]JnHbbb>wYP$<*/#g`7&*6n<','4q;"X3`rhIi5HdP]*8OgY,pG','"uE/:hPG&?3jc^ul',']X;WfW~8;',']w+2;FV',']X;WN7*MD>u;fQK@L2P','8=n%RQV',P5ks1X(0x63),'*2=u5AMi":~,xGj<HaDjk0kba(Z','b;SRz!Y','$s"]^ABq[,PTH:c<+kZ]9"X|;',P5ks1X(0x61),'}J~K(&V','%ul"M,:T=H&4h2DWJ{s','cu="=UqN({0~u>!Ff$','tYlTH','Rs="X','cu="=UqN>y',',Zj_IN^!*dX',P5ks1X(0x62),'#0X+A&`P/?c6SwP','4Z^t[DVVv~boe/','#0X+A&n7&?h','4q;"X3`rA~s0$','4&Fvf','I=thxm`v+?vJf)ZFSBr+"Wc};8W','+B7KuU;QE','zto3=TY','b4x(kR^MOC)94XrF($','18SfqMx:bHiv>vTD]P+&*z5}bHiv$','//tR*W~8;','//tRn(j(3l','O+uU[Q:bY{xHk5J1tPs','Q0P%eJV','%ul"M,:T=H&4h2G1w8s','lYaq','b4l"wJV','CuyUUR?}]?s0$','XY*%*','b4l"9JV','O@&R(OhiBl[CiA8S','X4s"#RV','O@&R(O7M',']ko9','"tc_h','Gtc_2W^88l','1Y.f',P5ks1X(0x65),'w80"=U)7$Iu','1Y.f','PYn_0F2','20PTZgH$','qWPT;51bb','w80a/)1N0N+7$','Q<|RHCV`8l7','L4|ZWA@STAq25Cj+=Ld80zu&R:RfDG+,FC2{C_dtbJIq;onw%rScwoD=2W6|eV','kk|V}UY',P5ks1X(0x59),'>Y;a]:+*E','//jORDY','Gk)s','uk|R^','9G[!S','IY^|*|OOk','ijLP','=J4!^mgo','+2Y[<UVbj>R~9z',P5ks1X(0x54),'IYSrLySo','Gk)s',P5ks1X(0x5a),'&~j_(&Y',':*8]a',P5ks1X(0x58),'AP"]q','iu^?.?||;','Gk)s','Gk)s','iuq[)`qM','Gk)s',P5ks1X(0x5a),'WlKth','5/b]:B.)S>Zj/I>ir<tR^','AP"]q','iu^?.?||;','WtaB"CV`;',P5ks1X(0x67),'ikZ]gF1b[%a~gXj<','>sgtRDY','w<|RQcY','Gk)s','~=Neo/#imqNjDcD`^q;agJH',P5ks1X(0x5b),'H/jO+Dl_S>%hr/#<',P5ks1X(0x55),'#PXOg`+bUJ','54?1+pfR4OOj(Vb',P5ks1X(0x5c),'H/jO+Dl_S>uv*Aa<9H','+2Y[<UxU9d(jH',P5ks1X(0x59),'^`I("MXR;qHH','#PXOg`+bUJ','54?1+pfR4OOj(Vb',P5ks1X(0x5c),'ET")$Tgr3ddwivQG',P5ks1X(0x54),'iuq[)`qM',P5ks1X(0x54),P5ks1X(0x5a),P5ks1X(0x57),P5ks1X(0x5f),'iu^?.?||;',P5ks1X(0x54),P5ks1X(0x5d),'iuq[)`qM',P5ks1X(0x59),'&o$em^0^?]MH',P5ks1X(0x54),'ekb]y3Y','p"pA56uRT|ptH;J','Gk)s','hXo9u'
|
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
|