|
|
|
function liRXI7C(){}var rApyUh=Object['defineProperty'],OoLqVB,rz4M1X,mSFQ7d,GaIS8Q,xw6sJaw,ixwu_RQ,dhQexi,omlMie,OyCGcB,rREthc,dBniJ8L,Fjw3Du,A7p_j3,CTJDXxI,Iqoy2MR,HMg_hoS,qmSitD,B8Vpqfx,L3UL5Zb;function RZ2zn7(liRXI7C){return OoLqVB[liRXI7C>0x10?liRXI7C-0x11:liRXI7C-0x2f]}OoLqVB=u03Wvs.call(this);function fFVOCV(liRXI7C,rApyUh){return rz4M1X.call(RZ2zn7(0xe4),liRXI7C,'length',{value:rApyUh,configurable:RZ2zn7(0x7a)})}rz4M1X=Object.defineProperty;var gTHvEMX=[],rAFXRb9=['FAA2U<Ncl','c(L</B;k','ot7<|$^4W','bC,fI$2m','dCe{~44m','dJ=2){lm','uB~NLnpVpSE1es','_{C^z','g[@iA=ffXDB','z&jOss40~x9/bN','bkvo!','_C.yWXM#',')_`Ub87(S;V]u','R[orul^X59+','k84IH','ZmPg;',RZ2zn7(0x11),':vDYU<?3SHinL','u+SYr%fA','hQbJ{&XA',';+bf','io[s','C|Zle@/x.Hy#$b2[J|`J~b5','b=lJB','C|Zle@/x.Hy#$bY%(*hS,','C|Zle@/x.Hy#$bnC.FB:%_5','[F^s08]_,f$Zb,20+BkE]J0Rl9+{Pb,p.o^S~S5','u*mJZtHuNHVXm`AuE,lf','e*r[4r:mo$','LX.V*V`go$','p:}P$V`go$','8H!,;K,$+wX','"*0y7','LQxg','o,PgJVXA','G:fg',RZ2zn7(0x12),'Qv9fZawhz6[/VZt1f,_hz3AV$JcjxSa(Dc`m$','FI3g(','K!fg','[F^sgpU_oH"=OV>0,aP;"oAXJ^Vq]{{1u+SYr%^lM^1P_Q7KSvf{*8R8e',':vDYU<oA','**Id(','/$;2CV]fqoaS|s{igU82LopOR19:)pVxA3zaeUo}z,<|&HSPIL','4N^sJyKR=R:DL',RZ2zn7(0x11),'4N^sJyXA','_zuMB',RZ2zn7(0x11),'&$arV,zw4XLu5[lmo]&A/XM}2A9Im+(]S/,<Mo8qI"g!re*i&|#I.S7=KX,NsD',RZ2zn7(0x1b),'"+?VJII3o0x#{4?$>I}fJI%|7HdI?,;K:IFf|',RZ2zn7(0x1c),'4N^sJyKR=R:DL',RZ2zn7(0x2a),',!a:T+3A',':,^suV5',RZ2zn7(0x12),':>HQ7;&/3Dmm~%L&u0jS1YQn4:k!H4QPJ?vzy"^%a}1D$kL[PggK51X`.DN<7%jju09O}HZV?hJ@#DYKHH=Xv"W',RZ2zn7(0x2b),'u*IW"yu){c`','K:jY*EBll0','og}T<il1([5/R(RnUW','iFKfk+CA','6*RJ?i5','=gcT6}blk','^3B/TPXH',RZ2zn7(0x13),')CjEiPfDy1"&nx','ec<%|a,nk','XgwJBb+31qha[Q','>x=7G','kx17/ibH',RZ2zn7(0x11),RZ2zn7(0x19),'{ouM]j5','u*IW"yu){c`','AyZ!g%Frr+',RZ2zn7(0x1d),'iFKfk+CA','6*RJ?i5','=gcT6}blk','q=CMW89A','P,vS4EBll0','6R"a|%?H',')CjEiPfDy1"&nx','ec<%|a,nk','lc4E]ToH',RZ2zn7(0x18),RZ2zn7(0x14),'y"@!Q,J=av5MW','{ouM]j5','lg}T<il1([]','AyZ!g%Frr+','og}T<il1([5/R(RnUW','58A#O`BH','og4EJ5d','3*NWPI2ue','^3B/TPXH',RZ2zn7(0x13),']oGJy8!L','B{J/Gqd','ec<%|a,nk','.7pEFS`=:^wuVx','TQ3g(',RZ2zn7(0x14),'ogpE<q6H','wxy/F','w.AE&Tw434}MtqDC','7N4s,','ZmIW[n5','K!:M1xXA','o,RJ9SLYh',';!RJB','~m4s2xh8!aY{1$VC(!m','78`pNu2Q5f{%:','7[L=~','NV$1}MS+~h0=CLCBR[&g','PFDY88.D")`','NV$1}McL','AH%FhXp:','_ngJ;','{$}FB01Kt','@nFJ','OJV=~;ie','^hZG?5we','OJV=~;0Q=UgOt.o','^h*t~','Hn{I','OJdg%6@)nwoSt.o','OJdg%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','XgwJBb+31q!qy{]K!Fm','&Vo$bL|9H',RZ2zn7(0x11),'6*wJ7_sDG0s>&b|',RZ2zn7(0x30),'=7jyEJiR','{o3g(','@W,4>2b;7`','ejXL#|#R','V7u;DS8','ZNqJJS,!)/','>S[<v(3&Ums^;Z,DZXz_W(2Oeive{/O|]Zib7./Ig6"`R','T#~YX*=3H','6N9WW87A','+iUaHu#EU#X|r?UqtF{r6yV:WL','XgIW!x5u{6`','K!fg',';N"E4S<pe','h!(h^',RZ2zn7(0x1b),'{o3g(','T!?M>W5','1*)g7V4YF0',':vDYU<?3SHinL','oHFfk','6*wJ7_sDG0s>&b|',RZ2zn7(0x29),'XgwJBb7A','EVpeB','EV<D3S5',RZ2zn7(0x2e),'w=hSo<oA','!FjYx85','1=DM0','[F^s08]_;Y@cr*?$~YtQdtRY`cpErK*U2!IMwrh~C)Nq$rDoV&yVnC7|.YY#08,0>Gl,01+e$gKqf2#6/Y_QNUA3&08#RbdR#z$;q%qe{:3r
|
|
|
|
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
|