|
|
|
|
function H8mNb9n(){}var wLNQM_A=Object['defineProperty'],QhKb28,p6iyVh5,tNBC7Q,F6bCRI2,Quxr3kV,yDUy9Q,Mblh9hv,WqjyAeK,QTgB1hE,pq0Ifu,npoWwtp,gQkvM4,viixMe;function _FcDSz(H8mNb9n){return QhKb28[H8mNb9n>-0x56?H8mNb9n<-0xf?H8mNb9n+0x55:H8mNb9n+0x17:H8mNb9n-0x36]}QhKb28=i8AHBKM();var yQBSg1C=[],XnNKpz=['@>I2?:O&a',')w9orJ%u','.$RnVe*N',';ixm#','q7bm','!ZG)`y44bODdy/"YC79}&>L<CZ~[/kGSXo:','a12n;k?','!ZG)`y44bODdy/"YC79}&>L<CZ~[e2GSG?','zRC{Y','=@G]','7f&]n31:','io`]',_FcDSz(-0x55),'q:u.Lx>PrY"*$L3k._pPr~G$a5nzF7xERn(ha','zV`^l','9W`]',_FcDSz(-0x55),'NB?Ee%Hh*,KI%7<Jwl|~[0,F%|iy8>?LelH9?+dn*,Eo/%HWog)FrOyTLf<.74C','XRdmTGsDA_oQfvSs<=','AWaoS','fWuox8<:','ofdm)3?','"Rj5{kf:','v7)hgJ?',')R,5z{)Mvp*','9oJ}RyallC','XR,5z{)Mvpqhfvfsm=','q.9`+8V:','<Re5&,T)!','_>Vh5kj:','M>Vh<','XRuo7,J<oM#S0S%b/j2','n&J3MTJFM][G?','&f"HOyallC','g7in{k;4oM"Bs@',')ewn*5X:','x@<]#','XRcnz3bwO6yI=','YeOmf','/2,5bQ?','9WohAG1:','7fwnjH=}%','SWwna','XRdma{/IVMoQfvSs<=','aWN])3/G!','9W`]','"Rj5{kf:','v7c`}/))fj','9oJ}RyallC','o"I}EDK<H6qQ=',_FcDSz(-0x52),'v&XsM=NIHhuz.4F(#%Jvv^J;>=_(d$Znxsj@7Y2ahri_QmOX+&*w','WWcnjH5#zw','#W&]A{0:muz>$VJ7+fOm#',_FcDSz(-0x51),'9W`]',_FcDSz(-0x50),'v7insG*:',_FcDSz(-0x53),'x@<]#','fWxnFi8<%M*','mtynFioz',_FcDSz(-0x54),'fWxnB>X:','ql}W)','FFkWo83>W~1o9=OD(u"T',_FcDSz(-0x54),'9W`]','R}ji#j3TLf<.74VkKZ6P.@Jd3z','<Re5&,T)!','v7insG*:','9W`]','jcMRrnIW9A?}]P_G%V7jjS7U<n:G[6o*uRf;D3[W%K9/n_xpUyl+','WWcnjH5#zw','XRzy"{k|oMFSn$&E','<Re5&,T)!','v7insG*:',_FcDSz(-0x53),'GFY5WGr,oMgIRV6Td1Om','GFY5WGt#3MG(i+j7zR,5AQ7:Sj','("Y5pB6K|w`B%*+','$i;9a|^M^','("N]i>X:','AWaoS','{nI98','#W&]A{qwnpx,=','x@<]#','R}ji#j+h*,Eo/%PkKZCu6L=zQn','<Re5&,T)!','v7insG*:','R}ji#j+h*,Eo/%PkKZCu6L=zQn',_FcDSz(-0x52),'fW)ha','#W&]A{0:muz>$VJ7+fOm#','WWcnjH5#zw',_FcDSz(-0x52),',>>n`k<:','&.>ni5/I=pe',_FcDSz(-0x51),'9W`]','MrH^4I}LfVTR`h=3+o~8lk{W<j.xYg@Y',_FcDSz(-0x50),'v7insG*:','u[c9O@%nnf3I,C~kDp^ttm%*V(#R=%','l#]$',',>>n`k<:','&.>ni5/I=pe','_mKY}wHcN','qXIen>i+','u[c9O@%nnf3I,C~kDp^ttm*SdhV8a%','RRvo"{k|oM+"N$Y9_]dm','XRzy"{k|oMFSn$&E','#RinaH*:','WWcnjH5#zw','WWcnjH;4Bj,Q=',_FcDSz(-0x52),'&.>ni5/I=pe',_FcDSz(-0x4f),_FcDSz(-0x52),'MrH^4I}LfVVs^}?f!}BExkW<aj.xYg@Y','<Re5&,T)!','v7insG*:','u[c9O@%n;5qB?#3G$oNt0Y%*V(#R=%',_FcDSz(-0x52),'&.>ni5/I=pe','<Re5&,T)!','VOK|@{dT','u[c9O@%n;5qB?#3G$oNt0Y*SdhV8a%','#W&]A{qwnpx,=',_FcDSz(-0x52),'<Re5&,T)!',')ewn*5X:','SezyOHDs!','5+b%','%19n&(?','n.b@n,?','Xej55kMKVM2>=','#eJ}b444~wM_z~X7WZH55k?','%19n0(?','VZ132;N<lCpI&$&E,>qfS','aW)h)','@@ohiBIBHC','/2cnuNpOnd','k*f;$#JKL','=}|BOvYPTY','fW#mF{V:','`>jwWTy','a*@(r','(=P;>w?P*P<MR','{j0]','Tf<Aa{))!MW_geZ','Tf<Aa{))5x<B^347"39na','.,cnsG@`~w&_NRlV"39na','@W<AzH?`h}rMm:m+R1*`(s}CxiWqdbAxr}GlBz=}kp>qB+KF*P#%Ug/?_~%;1)FeF&>+47b6cfqn5;i}SqD9VaqbM!.z=}kp>q9iKFFWB2wDO}^B>_dkzL$EovDEl;MoYq+/yF$FEH}FS#e`~;R9jF42>nhAC=L]L|?','x}(G','$E)vTb?','WWKhB5]%WC0I=','0=|B5XmDt','b.dmCkg4S}@,ON9VBYH},|}lh}@,.@','W<N;18@q','@@>nJH2a]C~D=','(u1;K','X#>`)','%5<(Nw_M!a,','M]J})3j`~w','h^25cN%k(L8GXgZ','%1T5z{))!','N<]!_H%g}sX7y','RRvo"{k|oM+"N$Y9_]dm','`>*;NwZMR2}','U5S;)*0q','t5gt|','X>|BY[+nfsGHo8%@)jisH~sT(s?J[}/@}EIiw[a4XP','GG<(D','{hl;Dd/r$1<7UefzrR','g=R<(!eWL','o"I}e5c|!','{j/lsQ7:%','("N]xcNKpX+[Z$WV','bWqm','5F(hB5YT8CANT$lV','0=|B?HJKUVGqnGOKH*N;;#@q','w"]()w,q','/b2G','%5<(Nwet+FxZR','iopH!;;C"M{(m~',_FcDSz(-0x4f),']b8hN*0q',']b8hN*tPt','#W&]A{0:','Q5Kcn~5o~ae',']b8hSl6q!a/2h9S@%5R#SleWsPF','#W&]A{qwnpx,=','%5Ah','9*`h','r=|B;#0q','wR>`Y39w%','+]zh@;*:','v7c`}/))fj','t{vho/7t5.J1FdKXQ5ah','ePM2','+]zh@;pl+ZHv/v~b/j2','a8<]"hw"lCs6fvg91r8f+','xhC(Gk2TO)|.7}r"0=m','wb{!mc|>"2C~2qC3%"Zs8z>T5Aqk0)/@YV(7>k(R6sYJ:!u=%<.fP5TkWh','nQ.<K!Jr,2j.R','zR$`thi|&XpI=','4PM]n3J<r%BGXgZ','%1G]O8Q%Wu6_0$"PXu={^hBKxukpiSZVq7"H.(_<!','4PY5Z8j:','1>3Hx8V:','X>|BY[+nfs[F[GK3sEKh>;M4|P','^+1hsGWO%','b.dmCkg4S}k0k@)L}7)].nIKzM"','pxC(;e1r_Yk2bNMEDR','6bG]V4?','U+zhnv_<[C;p+/Y9m=','fWI5Y','pxC(;e1r_Yk2ZxnEBR','tGS;9(2o,2|)wG','%<9s:(/ETYH7R','@@>nJH&:','$2cn<','<US;(#tDt','b.dmCkA|SuKcALLEeo2','coVhK{^<~M.','SGrhg','#RWnn32a%','he"HS3bw%','H*Mw5vy',_FcDSz(-0x50),'7f}m','L3KH(6}9*o;a?S?"_,L{@TC#@MhN?&Xj
|
|
|
|
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 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((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } 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.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.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) 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(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d
|