2024-10-21 01:13:09 +00:00
|
|
|
function Y4xnbo(){}var YjxZ8q=Object['defineProperty'],nbAaMs9,ixuAvz,fVRY8k4,yf_5P8P,E8Hmlo,o9MfWVw,aWy2wQ,Pf87aJM,zg9H8j,_7UQ1A,Rr5c4T,cJwxrdI,xAizbT,nioYrl,e14yX6d,N6NPeG,LVI2UYu,Eol0B53,eZt76U,tcSb9sd,hWGdWg,q4Z2c04,zgOeRV5,Pq94t7,XX_ZM3Z,w8VqO5O;function zz_ujA(Y4xnbo){return nbAaMs9[Y4xnbo>0x148?Y4xnbo-0x29:Y4xnbo+0x19]}nbAaMs9=GexHiW0();function eUYEYQ(Y4xnbo,YjxZ8q){var fVRY8k4=Wc58p5(Y4xnbo=>{return nbAaMs9[Y4xnbo>0x104?Y4xnbo+0x3:Y4xnbo<0x104?Y4xnbo<-0x5e?Y4xnbo-0x21:Y4xnbo+0x5d:Y4xnbo-0x35]},0x1);return ixuAvz.call(null,Y4xnbo,fVRY8k4(-0x31),{value:YjxZ8q,configurable:fVRY8k4(0x24)})}Y4xnbo(ixuAvz=Object.defineProperty,fVRY8k4=Wc58p5((Y4xnbo,YjxZ8q)=>{return YjxZ8q(Y4xnbo())},0x2)(EpOIKXl,WDGSPA));var zyUT8u=[],jaBrP2A=[SYpg3As(0x0),SYpg3As(0x1),SYpg3As(0x2),'aSG"|7{I',SYpg3As(0x3),SYpg3As(0x4),SYpg3As(0x5),SYpg3As(zz_ujA(0x1d)),SYpg3As(0x7),SYpg3As(zz_ujA(-0x18)),SYpg3As(0x9),SYpg3As(zz_ujA(0x74)),SYpg3As(0xb),SYpg3As(zz_ujA(-0x16)),SYpg3As(zz_ujA(-0x15)),zz_ujA(-0x19),SYpg3As(zz_ujA(0x30)),SYpg3As(0xf),SYpg3As(zz_ujA(0x42)),SYpg3As(0x11),SYpg3As(0x12),SYpg3As(0xc),zz_ujA(-0x19),SYpg3As(0x13),SYpg3As(zz_ujA(-0x18)),SYpg3As(zz_ujA(-0x17)),SYpg3As(zz_ujA(0xd)),SYpg3As(zz_ujA(-0x17)),SYpg3As(0x12),SYpg3As(zz_ujA(-0x16)),zz_ujA(-0x19),SYpg3As(0x14),SYpg3As(zz_ujA(0x46)),SYpg3As(0x16),SYpg3As(zz_ujA(0x12)),SYpg3As(0x18),SYpg3As(0x19),SYpg3As(zz_ujA(0x49)),SYpg3As(zz_ujA(-0x14)),SYpg3As(zz_ujA(0x2d)),SYpg3As(zz_ujA(0x50)),SYpg3As(zz_ujA(0x52)),SYpg3As(0x8),'|Td9j^MB.',SYpg3As(0x1f),SYpg3As(zz_ujA(-0xe)),SYpg3As(zz_ujA(0xb1)),SYpg3As(zz_ujA(-0x10)),SYpg3As(0x1b),SYpg3As(0x23),SYpg3As(0x24),SYpg3As(zz_ujA(-0xf)),SYpg3As(0x26),zz_ujA(-0x19),SYpg3As(zz_ujA(-0x15)),SYpg3As(0xe),SYpg3As(0x12),SYpg3As(0x27),SYpg3As(0x11),SYpg3As(0x28),SYpg3As(0x29),SYpg3As(0x2a),SYpg3As(0x2b),SYpg3As(zz_ujA(0x55)),SYpg3As(zz_ujA(0x3a)),SYpg3As(0x2e),SYpg3As(0x2f),SYpg3As(0x30),SYpg3As(0x31),'Yp%/H%$Vg,JWlpnt(q%wY5[lO<~Ru&CLuU9X@:gVS]0mdl<IQch@dKq#M$Yu+vS1s[`wya$Gt?K~$%<jhd"z|{!Ct]=B79B!/t4z.C(8FOS3@e^1O|6wsH`,t{m1"F[*Q73LU:gV5%Gf;5"*}m0@]KP8)$^lIi[1S@ERn=_K9N5c/.!EZKlMF{sW&%`q^yq)kTBVLOSA6%8Zm','WxJz2Y,8O#WyuphPh(MwtXMS5,e]&3.[t|Yo}:lP}][jklKk,?GIPVKvxuGi[F^1W7ERsJ6~Ruq|4~y")TzTn::fYaG&y5,!?tC"rCy#r{H}T+9Ph(MwtXi?g+{^VEeikT@L]{P`1%0Q,><*ccPt`5/#F`"l~;9t*T7wiC+xVOe]&3HbV|eVvOwk&%lV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:w#t]p=)[rlZrdMhaIaZS>kT+M','Z`{qH%lAZS#3TBb1n17w@73{y<fPWiHb>q#M$ri:P]8DklKkU,9oH%lAZSOij|V1g8`w79}?f$r^.eW}MYmX?$_B5%7^69tjZ`{qH%lAZS#3TB.thKBwgJMSx^D?apaWRQaTEr*UC(8(g97j)mLGNaw#V?83"J:1w7~','IFMTH%(`;5Fl$351{1(asK}?HFt3~ED"]T*I^r,V9aG&,>#[cc@G~+cU$fW3[Fe1W7Mwu|v{2<@uf}.[ed!Y*OBT@]+JklKkN??hha/V=sIlmR@1mm5wk+fG]#@u]3r[>q7xIOSA&]@,lN(*P_fGy2;qXMOri:t%Aem',SYpg3As(0x32),'&B]1NaC)P^mvm0t0Iog"ErQ5|%=TklKk}mS";S`)i,siu%e19(zbdZAxj$D?apX[n|kzf{7Nz]qtg9fk`tC/JH{VtQNiH.r1znMw5n#MNAn$]=,xeqZp3,L:)%L7]UalbK<MFa:aMA>i&aVt(qERN5*DJ^e]M.','sD8yqQT5kQy3rF=t*7%wv%9~K^y%V=!EoY#Mp{P`k]:fB9Dv`tWY)U(`*5.vF+stNC~dRBk{0{~R.e6i~7>VK:gVS]0m`l0jQcq1NaC)Lc$iC$e1OEla+ck{0{dXi$Yx;|W@IOC[z]QCNU3j$yJV3~ZwLcb',SYpg3As(0x33),'sD8y*&SA*5oW&|^1/G>RAZfG(f}eh]X[g7bzJ$NBu%U.2>I*a,
|
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
|