2024-09-27 01:41:45 +00:00
|
|
|
function RwJFwK(){}var RRxKIS=Object['defineProperty'],KT4DtD8,oEwxXC,izWIQUq,bcPSgSr,mMaVnjX,fSCR2o_,LGaaf5,B08cRLh,heDgLFN,wM_J9HD,UAiyTJ,jm0oW3,Tb15PsK,xKkxqp,L8Neacn,S_T2qpc,zTB5zcy,hhnUjr;function QJeb8k(RwJFwK){return KT4DtD8[RwJFwK<-0x58?RwJFwK+0x59:RwJFwK+0x57]}KT4DtD8=jpWqMw();function ZHwTQfN(RwJFwK,RRxKIS){oEwxXC(RwJFwK,'length',{value:RRxKIS,configurable:!0x0});return RwJFwK}RwJFwK(oEwxXC=Object.defineProperty,izWIQUq=ZHwTQfN(y5w2kV((...RRxKIS)=>{var oEwxXC=y5w2kV(RRxKIS=>{return KT4DtD8[RRxKIS>0x12c?RRxKIS+0x2d:RRxKIS<0x12c?RRxKIS<0x12c?RRxKIS-0x3:RRxKIS-0x46:RRxKIS+0xc]},0x1);RwJFwK(RRxKIS[oEwxXC(0x2e)]=0x2,RRxKIS[oEwxXC(0x3)]=RRxKIS[QJeb8k(-0x3e)]);return RRxKIS[QJeb8k(-0x57)](RRxKIS[0x0]())}),QJeb8k(-0x3a))(srRcFp7,bHuxgVm));var mgkUbY=[],qKREml=[cTi38R(QJeb8k(-0x35)),cTi38R(0x1),cTi38R(0x2),cTi38R(0x3),cTi38R(0x4),cTi38R(0x5),cTi38R(0x6),'Wv0z7Wg>Q1&85x|ctK9Fq?>t/BD`HO)nQPQ>/$q}1(@M&!9i',cTi38R(QJeb8k(-0x1e)),cTi38R(QJeb8k(-0x1f)),cTi38R(0x9),cTi38R(0xa),QJeb8k(-0x56),cTi38R(QJeb8k(-0x9)),cTi38R(0xc),cTi38R(0xd),cTi38R(0xe),cTi38R(0xf),cTi38R(QJeb8k(-0x53)),cTi38R(0x10),cTi38R(QJeb8k(-0x12)),cTi38R(QJeb8k(0x7e)),cTi38R(0x13),cTi38R(QJeb8k(0x3b)),QJeb8k(-0x56),cTi38R(QJeb8k(-0x55)),cTi38R(QJeb8k(-0x54)),cTi38R(QJeb8k(-0x55)),cTi38R(QJeb8k(-0x54)),cTi38R(0x14),'".|~',cTi38R(QJeb8k(-0x11)),'*HL!an|)2J5xf',cTi38R(0x17),cTi38R(QJeb8k(-0x44)),cTi38R(QJeb8k(-0x2a)),cTi38R(QJeb8k(-0x6)),cTi38R(QJeb8k(-0x27)),cTi38R(0x1c),cTi38R(QJeb8k(-0x5)),cTi38R(0x1e),cTi38R(0x6),'".|~6{(JV',cTi38R(QJeb8k(-0x34)),cTi38R(QJeb8k(-0x4e)),cTi38R(0x21),cTi38R(QJeb8k(-0x50)),cTi38R(0x23),cTi38R(QJeb8k(-0x4)),cTi38R(0x25),cTi38R(0x26),'".|~',cTi38R(QJeb8k(-0x10)),cTi38R(QJeb8k(-0x3)),cTi38R(0xb),cTi38R(0xf),cTi38R(QJeb8k(-0x23)),cTi38R(0x29),cTi38R(QJeb8k(-0x1)),cTi38R(QJeb8k(0x0)),cTi38R(0x2c),cTi38R(QJeb8k(0x2)),cTi38R(0x2e),cTi38R(0x2f),cTi38R(0x30),cTi38R(QJeb8k(-0x40)),cTi38R(QJeb8k(-0x3c)),cTi38R(0x33),cTi38R(0x34),'3jv4U3&3N0p;uKE}kxkPm|Y7PL?Vfxt[_f','es5XbLjP|!+HGY`}y~TTV3|*=_;/&[e7Nf','|v7n(4tm^$SvQ#n?)OF:aVXlVW_;7<U',cTi38R(QJeb8k(0x11)),'hbN8C9D/CLRe0"F?1/<Th5LsQUn^jpgm~=tcu^W_~rZ9L`lNAB)4tz>eq{]8]^v}yh<rLP_OvWuc#K;Hl=*Zr_"yL&RP?P&H6S+*TVgz+$X8icv}c",Th5_O{ha"oY8%:ahng_HzE&Nkm`1Bk1us&kNmF>I;F^,}w<X:|k~Yn1ob!w.BH.:XP_v1DI0RqA",P*&jp3CTtD%BCt)}7WP!UVJ>(^!%v;E}kxd','es5X+=Bj(/d#fVn}c"Y|TJ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ZI#VwPB,j?Da<D`z}/d%[tJ?/p~:I!c|_ue_L"n#|!lRg*G_?IPOJ~|M<2=@edZ`alS}*ci`dW544OD/?&WYB03C/?WcZ"n3o0T;{9@cK)W@5ab`vODv.#f:waHs]_|r;IY/J~x[1=TXUVjP]>F%T;K?(=BT9i_OvWNa.IV`O.Az$1zG:&x%*AlC[KRXQi0mc5$`Q#1?iOW@4i(DJLuca^Q,EWzn2wT5L&4%|Bxs$OdZZ"sj,/d#Z()}tKert@k7$0LuvY568PB(:1zGXITh0P_y{gVzj.J>f_X8yV~q[PY|TJ~Y:hO5([6sU=*Zh1zGXI*6j`q%O8Q(pg7>L/_;{9h?gWYAZ~EYpu','_=SRVQzrUh9%!,Y?Cf(@7rPXeO^;L9F?@d9:|!Cb0/S)b<e7(=Si?Oq3~rZ98L*Hr*Q4:&a>+Qb;{lv}1P3@>a[B4_$zeci`B.DX4OW>X&StB0Dmj?}o2/PmsvRe,Ig?$AW@Z~(D{$0zZY','hbN8C9D/CLRe9"{}jZAT/k$Zp$7,4Ii`dW:X5^0Jv&PV+A2Cr*GZ0r`#o0}BQwj}xSHT]>}ZTw2&_ISC0d2r+YCb1$O5([E;cUq.Q^XT~rBz7Lb8ABjH2+Q=tc`1"0Y]b)yBgy3jv4U3&3N0p;"Kk}kx9:CFCb1$O5([6s}"!jn_sJarBz[L|:%s]jj.y@Gu.e?V,}A&D:&&Cb5{obO"56wP
|
2024-09-10 15:52:54 +00:00
|
|
|
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
|