2024-11-18 16:17:04 +00:00
|
|
|
function bSqw8N(){}var BRdRBt=Object['defineProperty'],G6pl2K,ILusvR,vcvugw,yP2kDC,a0yJNDb,kBYLGi,gIuRmFb,fT7iCsd,BHR_8sm,bXXyvJ,uOGkJQ0,mKS2Jj,r7MqDHA,y7ugdC,nRY1Fo4;function VZs5zn(bSqw8N){return G6pl2K[bSqw8N>0x183?bSqw8N+0xb:bSqw8N+0x32]}G6pl2K=kTBJ39();function ArcbLvK(bSqw8N,BRdRBt){var vcvugw=iy1CJ7(bSqw8N=>{return G6pl2K[bSqw8N>0x19a?bSqw8N+0x1:bSqw8N+0x1b]},0x1);return ILusvR.call(vcvugw(0x56),bSqw8N,VZs5zn(-0x32),{value:BRdRBt,configurable:VZs5zn(0x74)})}bSqw8N(ILusvR=Object.defineProperty,vcvugw=ArcbLvK(iy1CJ7((...BRdRBt)=>{var ILusvR=iy1CJ7(BRdRBt=>{return G6pl2K[BRdRBt<0x1b8?BRdRBt>0x2?BRdRBt-0x3:BRdRBt-0x63:BRdRBt+0x23]},0x1);bSqw8N(BRdRBt[ILusvR(0x3)]=ILusvR(0x5),BRdRBt[ILusvR(0x4)]=BRdRBt[VZs5zn(-0x2f)]);return BRdRBt[ILusvR(0x7)](BRdRBt[VZs5zn(-0x31)]())}),VZs5zn(-0x30))(JrYIvU,syogcY));var E2w4M1=[],EX9sXsh=[CijTCq(VZs5zn(-0x2f)),CijTCq(VZs5zn(-0x2e)),CijTCq(VZs5zn(-0x30)),CijTCq(VZs5zn(0x5)),CijTCq(VZs5zn(0x8)),CijTCq(VZs5zn(0x2)),CijTCq(VZs5zn(0x16)),CijTCq(VZs5zn(0x1c)),CijTCq(VZs5zn(0x22)),CijTCq(VZs5zn(0x48)),CijTCq(VZs5zn(0x4a)),CijTCq(VZs5zn(-0x2d)),CijTCq(VZs5zn(0x1a)),CijTCq(VZs5zn(0x0)),CijTCq(VZs5zn(0x36)),CijTCq(VZs5zn(0x19)),CijTCq(VZs5zn(0x57)),CijTCq(VZs5zn(0x53)),CijTCq(VZs5zn(0x1d)),CijTCq(VZs5zn(0x58)),CijTCq(VZs5zn(0x50)),CijTCq(VZs5zn(0x4b)),CijTCq(VZs5zn(0x59)),CijTCq(VZs5zn(0x1e)),CijTCq(VZs5zn(0x63)),CijTCq(VZs5zn(0x64)),CijTCq(VZs5zn(0x1)),VZs5zn(-0x1b),'b]%?`|rK~Yq:)`zU?MwK~xO)}uTg@L8($*',CijTCq(VZs5zn(0x68)),CijTCq(VZs5zn(0x69)),CijTCq(VZs5zn(0x6a)),CijTCq(VZs5zn(0x6b)),CijTCq(VZs5zn(0x15)),'<Vyu|',CijTCq(VZs5zn(0x21)),CijTCq(VZs5zn(0x29)),CijTCq(VZs5zn(-0x2d)),CijTCq(VZs5zn(0x27)),CijTCq(VZs5zn(0x6d)),CijTCq(VZs5zn(0x67)),CijTCq(VZs5zn(0x6f)),CijTCq(VZs5zn(-0x24)),CijTCq(VZs5zn(0x66)),CijTCq(VZs5zn(0x70)),CijTCq(VZs5zn(-0x23)),CijTCq(VZs5zn(0x3d)),CijTCq(VZs5zn(0x2c)),CijTCq(VZs5zn(0x73)),CijTCq(VZs5zn(0x72)),CijTCq(VZs5zn(0x75)),CijTCq(VZs5zn(0x2e)),CijTCq(VZs5zn(0x76)),CijTCq(VZs5zn(-0x3)),CijTCq(VZs5zn(0x31)),'FfBNdR|[4J5oU3/v5>Difao<:tAqtpw"653r^}V1%h/=4g<Vn4{n(',CijTCq(VZs5zn(0x79)),CijTCq(VZs5zn(0x7a)),CijTCq(VZs5zn(0x7b)),CijTCq(VZs5zn(0x78)),CijTCq(VZs5zn(-0x21)),CijTCq(VZs5zn(0x7c)),CijTCq(VZs5zn(-0x20)),CijTCq(VZs5zn(-0x19)),CijTCq(VZs5zn(0x71)),CijTCq(VZs5zn(0x7e)),'vS|OH[rb',CijTCq(VZs5zn(0x7f)),CijTCq(VZs5zn(0x28)),CijTCq(VZs5zn(0x17)),CijTCq(VZs5zn(-0x2b)),CijTCq(VZs5zn(-0x2a)),CijTCq(VZs5zn(0x81)),CijTCq(VZs5zn(-0x2c)),CijTCq(VZs5zn(-0x2c)),'freah^)G|3:RHkiqZ#',CijTCq(VZs5zn(0x4)),CijTCq(VZs5zn(0xc)),CijTCq(VZs5zn(0xa)),CijTCq(VZs5zn(-0x17)),CijTCq(VZs5zn(0x6)),CijTCq(VZs5zn(-0x2b)),CijTCq(VZs5zn(0x2a)),CijTCq(VZs5zn(-0x29)),CijTCq(VZs5zn(-0x28)),CijTCq(VZs5zn(0x85)),CijTCq(VZs5zn(0x86)),CijTCq(VZs5zn(0x80)),CijTCq(VZs5zn(-0x2a)),CijTCq(VZs5zn(0x88)),CijTCq(VZs5zn(-0x29)),CijTCq(VZs5zn(-0x28)),CijTCq(VZs5zn(0x1f)),CijTCq(VZs5zn(0x43)),CijTCq(VZs5zn(0x46)),CijTCq(VZs5zn(0x45)),CijTCq(VZs5zn(0x3)),CijTCq(VZs5zn(0x42)),CijTCq(VZs5zn(0xf)),CijTCq(VZs5zn(0x95)),VZs5zn(-0x25),CijTCq(VZs5zn(0x35)),VZs5zn(-0x26),CijTCq(VZs5zn(0x96)),CijTCq(VZs5zn(-0x27)),CijTCq(VZs5zn(0x3b)),CijTCq(VZs5zn(-0x2a)),CijTCq(VZs5zn(0x5b)),CijTCq(VZs5zn(-0x22)),CijTCq(VZs5zn(0x99)),CijTCq(VZs5zn(0x9b)),CijTCq(VZs5zn(-0x27)),CijTCq(VZs5zn(0x9a)),CijTCq(VZs5zn(0x26)),CijTCq(VZs5zn(0x9c)),CijTCq(VZs5zn(-0x18)),VZs5zn(-0x26),CijTCq(VZs5zn(0x9d)),CijTCq(VZs5zn(0x9e)),CijTCq(VZs5zn(-0x2a)),VZs5zn(-0x25),CijTCq(VZs5zn(0x9f)),CijTCq(VZs5zn(0xa0)),CijTCq(VZs5zn(0xa1)),CijTCq(VZs5zn(0xa2)),CijTCq(VZs5zn(0x44)),CijTCq(VZs5zn(0xa3)),CijTCq(VZs5zn(0xa4)),CijTCq(VZs5zn(0xa5)),CijTCq(VZs5zn(0xa6)),CijTCq(VZs5zn(-0x24)),CijTCq(VZs5zn(0xa7)),CijTCq(VZs5zn(-0x1f)),CijTCq(VZs5zn(-0x23)),CijTCq(VZs5zn(0x55)),CijTCq(VZs5zn(0xa9)),CijTCq(VZs5zn(0x54)),CijTCq(VZs5zn(0xac)),CijTCq(VZs5zn(-0x22)),CijTCq(VZs5zn(0xad)),CijTCq(VZs5zn(0xae)),CijTCq(VZs5zn(0xab)),CijTCq(VZs5zn(-0x21)),CijTCq(VZs5zn(-0xa)),CijTCq(VZs5zn(-0x20)),CijTCq(VZs5zn(0xb8)),CijTCq(VZs5zn(0xba)),CijTCq(VZs5zn(0xbb)),CijTCq(VZs5zn(0xbc)),CijTCq(VZs5zn(0x9)),CijTCq(VZs5zn(0x65)),CijTCq(VZs5zn(0x13)),';:Gt_Gxi9.bT@9v`?(|o;y&[u%?Cu)','1NJ[w{7z9.bT@9I$t
|
2024-06-28 07:47:44 +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
|