2024-11-12 01:27:28 +00:00
|
|
|
|
function i2tYRj0(){}var eatuO9=Object['defineProperty'],UqP1trj,VAFNa05,TtwsTyK,BqsBzm,XhWdto,WAMCc9P,WB9fxm,rXXya6D,rukuEfO,zjxI8lI,XyWSSZw,XvF2EA,fpX10Y,uLieHdD,PnyAxqv,jRucdO_,pZY763,Oww3IOB,KJyCb8H,B6BYIb8,Ngsv0I;function D7ERaN(i2tYRj0){return UqP1trj[i2tYRj0<0xd?i2tYRj0-0x12:i2tYRj0>0xd?i2tYRj0-0xe:i2tYRj0+0x35]}UqP1trj=XfGP5kh();function mK8M46q(i2tYRj0,eatuO9){var TtwsTyK=XKZ6JW(i2tYRj0=>{return UqP1trj[i2tYRj0<0x9b?i2tYRj0>-0x2d?i2tYRj0>-0x2d?i2tYRj0>-0x2d?i2tYRj0+0x2c:i2tYRj0-0x44:i2tYRj0-0x25:i2tYRj0-0xa:i2tYRj0+0x2b]},0x1);return VAFNa05(i2tYRj0,TtwsTyK(-0x22),{value:eatuO9,configurable:!0x0})}i2tYRj0(VAFNa05=Object.defineProperty,TtwsTyK=XKZ6JW((i2tYRj0,eatuO9)=>{return eatuO9(i2tYRj0())},0x2)(vl09xj,NfrLLy));var sxVquY=[],uSWTfF=['8Lz/P(Q|',yyjrcW(D7ERaN(0x20)),yyjrcW(D7ERaN(0x1a)),yyjrcW(D7ERaN(0x1e)),yyjrcW(0x3),yyjrcW(0x4),'2E|Z?,bw^]D^mu&r9Uu;8I2W"Tl',yyjrcW(D7ERaN(0x1f)),yyjrcW(0x6),yyjrcW(D7ERaN(0x32)),yyjrcW(D7ERaN(0x37)),yyjrcW(0x9),yyjrcW(0xa),yyjrcW(0xb),yyjrcW(D7ERaN(0xe)),yyjrcW(0xd),yyjrcW(D7ERaN(0x35)),yyjrcW(0xf),yyjrcW(D7ERaN(0x3c)),yyjrcW(D7ERaN(0xe)),yyjrcW(0x10),yyjrcW(0xf),yyjrcW(D7ERaN(0x14)),yyjrcW(0xf),yyjrcW(0xa),yyjrcW(0xc),yyjrcW(0x11),yyjrcW(0x12),yyjrcW(D7ERaN(0x3e)),yyjrcW(0x14),yyjrcW(D7ERaN(0x3f)),yyjrcW(D7ERaN(0xf)),yyjrcW(D7ERaN(0x17)),yyjrcW(D7ERaN(0x62)),yyjrcW(D7ERaN(0x40)),yyjrcW(0x1a),yyjrcW(0x1b),yyjrcW(0x1c),yyjrcW(0x1d),yyjrcW(D7ERaN(0x42)),yyjrcW(D7ERaN(0x23)),yyjrcW(0x20),yyjrcW(0x21),yyjrcW(0x22),yyjrcW(0x23),yyjrcW(0x24),yyjrcW(D7ERaN(0x5b)),'f9|_gn_;t',yyjrcW(0x26),yyjrcW(D7ERaN(0x45)),')*B|Yu)4t',yyjrcW(D7ERaN(0x3a)),yyjrcW(D7ERaN(0x47)),'j,"~k|MQlbL',yyjrcW(0x2a),yyjrcW(D7ERaN(0x53)),yyjrcW(D7ERaN(0x52)),yyjrcW(0x2d),yyjrcW(0x2e),'#fp;`|2+',yyjrcW(0x2f),yyjrcW(0x30),yyjrcW(D7ERaN(0x55)),yyjrcW(0x32),yyjrcW(0x33),yyjrcW(D7ERaN(0x56)),yyjrcW(0x35),yyjrcW(0x36),yyjrcW(D7ERaN(0x28)),yyjrcW(0x28),yyjrcW(D7ERaN(0x57)),yyjrcW(D7ERaN(0x58)),yyjrcW(0x3a),yyjrcW(0x3b),yyjrcW(D7ERaN(0x61)),yyjrcW(0x3d),yyjrcW(D7ERaN(0x5f)),yyjrcW(0x16),yyjrcW(0x22),'*N/"H|S_a',yyjrcW(D7ERaN(0x25)),yyjrcW(D7ERaN(0xf)),yyjrcW(0x40),yyjrcW(D7ERaN(0x5d)),'&jiYh|1/eH','LNx|kf6&e!EXS',yyjrcW(D7ERaN(0x51)),'LNx|kfIo','=>|Y9',yyjrcW(D7ERaN(0x11)),yyjrcW(D7ERaN(0x60)),yyjrcW(D7ERaN(0x63)),yyjrcW(D7ERaN(0x64)),yyjrcW(D7ERaN(0x66)),yyjrcW(0x46),yyjrcW(D7ERaN(0xf)),yyjrcW(0x47),yyjrcW(0x48),yyjrcW(D7ERaN(0x30)),yyjrcW(D7ERaN(0x5c)),yyjrcW(D7ERaN(0x68)),D7ERaN(0x10),yyjrcW(D7ERaN(0x6e)),yyjrcW(0x4d),yyjrcW(0x16),'tUeN8q`N/PSCD"MLHGH<A:X_f9q[|MquXmT!djS',D7ERaN(0x10),yyjrcW(0x4e),'D|jSiPO4',yyjrcW(0x10),yyjrcW(D7ERaN(0x34)),yyjrcW(D7ERaN(0xf)),yyjrcW(D7ERaN(0x11)),yyjrcW(0x50),yyjrcW(0x51),yyjrcW(0x52),'Qip|lqU/a',yyjrcW(D7ERaN(0xf)),yyjrcW(0x53),yyjrcW(0x54),yyjrcW(D7ERaN(0xf)),yyjrcW(D7ERaN(0x4e)),'HGH<A:X_f9q[|Md{](T!djS',yyjrcW(D7ERaN(0xf)),yyjrcW(0x4e),yyjrcW(0x56),yyjrcW(D7ERaN(0x71)),yyjrcW(0x58),yyjrcW(D7ERaN(0x41)),yyjrcW(0x5a),yyjrcW(D7ERaN(0x33)),yyjrcW(0x5c),yyjrcW(0x5d),yyjrcW(0x5e),yyjrcW(D7ERaN(0x73)),yyjrcW(D7ERaN(0x74)),yyjrcW(D7ERaN(0x75)),yyjrcW(D7ERaN(0x54)),yyjrcW(0x51),'w%hy=8|[a',yyjrcW(D7ERaN(0x15)),yyjrcW(D7ERaN(0x12)),'~3q|AZOo','U>m01u]PN&4^UX(Of9|_gn_;t',yyjrcW(D7ERaN(0x4b)),yyjrcW(D7ERaN(0x13)),yyjrcW(0x66),yyjrcW(0x67),yyjrcW(0x68),yyjrcW(D7ERaN(0x79)),yyjrcW(0x6a),yyjrcW(D7ERaN(0x94)),yyjrcW(0x6c),yyjrcW(0x16),'aaV|*/e',yyjrcW(0x6d),yyjrcW(0x6e),yyjrcW(D7ERaN(0x7c)),yyjrcW(0x70),yyjrcW(0x71),yyjrcW(0x6d),'m.]5"d|f48u,@R/3nn4Xmj/LS._k+ij',yyjrcW(D7ERaN(0xf)),yyjrcW(0x4e),yyjrcW(0x72),yyjrcW(0x73),yyjrcW(D7ERaN(0x82)),yyjrcW(0x62),yyjrcW(0x5b),yyjrcW(0x4e),yyjrcW(D7ERaN(0x12)),'~3q|AZOo',yyjrcW(0x75),yyjrcW(D7ERaN(0x81)),yyjrcW(0x77),yyjrcW(D7ERaN(0x83)),yyjrcW(0x64),yyjrcW(D7ERaN(0x13)),yyjrcW(D7ERaN(0x16)),yyjrcW(0x3b),yyjrcW(0x79),yyjrcW(0x7a),yyjrcW(0x69),yyjrcW(0x7b),yyjrcW(D7ERaN(0x14)),yyjrcW(D7ERaN(0xf)),yyjrcW(D7ERaN(0x11)),yyjrcW(0x50),yyjrcW(0x52),'&jiYh|1/eH',yyjrcW(0x56),yyjrcW(D7ERaN(0x15)),yyjrcW(0x5b),yyjrcW(D7ERaN(0x6c)),yyjrcW(0x7d),yyjrcW(D7ERaN(0x12)),yyjrcW(0x7e),yyjrcW(0x7f),'~3q|AZOo',yyjrcW(D7ERaN(0x22)),yyjrcW(0x81),yyjrcW(0x82),yyjrcW(0x83),yyjrc
|
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
|