2024-09-09 15:10:35 +08:00
|
|
|
|
function bvyBlw(){}var ANf0F4=Object['defineProperty'],etPAi7,kvA0Jh,ZNSJLrA,N7_9yNm,fYV_99,Ig3WVS5,kqrQAy,KkaTZj,zORoSIM,S_LW15y,t57Wz3,QB34C_X,OqZEAI,qLVCpJ,TlobvEP,mSZGZ3,tb1O3L8,ophUeRR,dvy34A,Q3R4lN1,mG0VN6w,xB4ezCp;function WagiVJV(bvyBlw){return etPAi7[bvyBlw<0x1e6?bvyBlw>0x1e6?bvyBlw-0x15:bvyBlw+0x40:bvyBlw-0x48]}etPAi7=zIxN_u();function ubNfhTo(bvyBlw,ANf0F4){var ZNSJLrA=UNzizr(bvyBlw=>{return etPAi7[bvyBlw>0x1db?bvyBlw-0x4d:bvyBlw<0x1db?bvyBlw+0x4b:bvyBlw-0x12]},0x1);kvA0Jh(bvyBlw,ZNSJLrA(0x2),{value:ANf0F4,configurable:!0x0});return bvyBlw}bvyBlw(kvA0Jh=Object.defineProperty,ZNSJLrA=ubNfhTo(UNzizr((...ANf0F4)=>{var kvA0Jh=UNzizr(ANf0F4=>{return etPAi7[ANf0F4>0x2?ANf0F4-0x3:ANf0F4+0x2b]},0x1);bvyBlw(ANf0F4.length=0x2,ANf0F4[kvA0Jh(0x5)]=kvA0Jh(0xa));if(ANf0F4[0x10]>0xda){return ANf0F4[0x15]}else{var ZNSJLrA=UNzizr(ANf0F4=>{return etPAi7[ANf0F4>0x24f?ANf0F4+0x39:ANf0F4<0x28?ANf0F4+0x64:ANf0F4>0x28?ANf0F4>0x28?ANf0F4-0x29:ANf0F4+0x20:ANf0F4-0x57]},0x1);return ANf0F4[WagiVJV(-0x40)](ANf0F4[ZNSJLrA(0x75)]())}}),WagiVJV(-0x3f))(ojJa4X,ehOhrs));var lTYMTXt=[],mYL_bL=[j5KIwT(0x0),j5KIwT(WagiVJV(-0x40)),j5KIwT(WagiVJV(-0x3f)),j5KIwT(0x3),j5KIwT(0x4),j5KIwT(WagiVJV(0x7)),j5KIwT(WagiVJV(0xf)),j5KIwT(WagiVJV(0x14)),j5KIwT(WagiVJV(0x28)),j5KIwT(0x9),j5KIwT(0xa),j5KIwT(WagiVJV(-0x3c)),j5KIwT(0xc),j5KIwT(WagiVJV(0x2d)),j5KIwT(0xe),j5KIwT(0xf),j5KIwT(WagiVJV(-0x3e)),j5KIwT(0x11),j5KIwT(WagiVJV(0x15)),j5KIwT(WagiVJV(0x36)),j5KIwT(0x14),j5KIwT(WagiVJV(0x126)),j5KIwT(0x16),j5KIwT(0x17),j5KIwT(WagiVJV(0x1ae)),j5KIwT(0x19),'/G}ddv^w@te;8LG|Aa(pI',j5KIwT(WagiVJV(0x38)),'\u0077\u0041\u006e\u0056\u0035\u0028\u002a\u003b\u0030\u0068\u0058\u004d\u005d\u007a\u007d\u0052\u0028\u0067\u007d\u0024\u006d\u007c\u0022\u0036\u0021\u0050\u0056',j5KIwT(WagiVJV(0x39)),j5KIwT(0x1c),j5KIwT(WagiVJV(0x75)),WagiVJV(-0x3d),j5KIwT(0x1e),j5KIwT(WagiVJV(-0x3a)),WagiVJV(-0x3d),j5KIwT(WagiVJV(0x3a)),j5KIwT(WagiVJV(0x6)),WagiVJV(-0x3b),j5KIwT(0x22),WagiVJV(-0x3d),j5KIwT(0x23),j5KIwT(0x24),j5KIwT(WagiVJV(0x50)),j5KIwT(0x25),j5KIwT(0x26),'A{M[|W%Z',j5KIwT(WagiVJV(0x43)),j5KIwT(WagiVJV(0x4a)),j5KIwT(0x29),'lZYP^Omx+?{9z^LuPb;x+=HzR$VK!%O|#VUpR',j5KIwT(0x2a),j5KIwT(WagiVJV(0x92)),j5KIwT(0x29),j5KIwT(0x2c),j5KIwT(WagiVJV(-0x3c)),j5KIwT(WagiVJV(0x6b)),j5KIwT(0x9),j5KIwT(WagiVJV(0x49)),j5KIwT(WagiVJV(0x41)),j5KIwT(0x30),j5KIwT(WagiVJV(0x2c)),j5KIwT(0x32),j5KIwT(WagiVJV(0x48)),j5KIwT(0x34),j5KIwT(0x35),j5KIwT(0x36),'Fg[CbenW^~|qJ',j5KIwT(WagiVJV(-0x2e)),j5KIwT(WagiVJV(0x1e1)),j5KIwT(WagiVJV(0x7c)),j5KIwT(0x3a),'*8)NU"ol%S|0V',j5KIwT(WagiVJV(0x4b)),j5KIwT(0x3c),j5KIwT(WagiVJV(0x77)),j5KIwT(0x3e),j5KIwT(0x3f),j5KIwT(0x40),j5KIwT(WagiVJV(0x4)),j5KIwT(0x42),j5KIwT(WagiVJV(0x82)),j5KIwT(WagiVJV(0x1b)),j5KIwT(WagiVJV(0x84)),WagiVJV(-0x3d),WagiVJV(-0x3b),j5KIwT(0x22),j5KIwT(WagiVJV(-0x3a)),'\u0041\u007b\u004d\u005b\u007c\u0057\u004e\u0029\u0046\u0042\u006c\u0054\u004a',j5KIwT(0x46),j5KIwT(0x47),j5KIwT(0x48),j5KIwT(0x49),j5KIwT(WagiVJV(0x85)),j5KIwT(WagiVJV(0x8c)),j5KIwT(WagiVJV(-0x33)),j5KIwT(WagiVJV(0x60)),j5KIwT(WagiVJV(0xcf)),j5KIwT(0x4f),j5KIwT(WagiVJV(-0x2b)),j5KIwT(WagiVJV(-0x37)),j5KIwT(0x52),j5KIwT(0x53),j5KIwT(0x54),j5KIwT(0x55),j5KIwT(WagiVJV(0x1e5)),j5KIwT(0x57),j5KIwT(0x58),j5KIwT(WagiVJV(0x8d)),j5KIwT(WagiVJV(-0x39)),j5KIwT(0x5b),j5KIwT(0x5c),j5KIwT(0x4e),j5KIwT(0x5d),j5KIwT(WagiVJV(0x9f)),j5KIwT(WagiVJV(0x1e4)),j5KIwT(0x60),j5KIwT(WagiVJV(-0x2d)),j5KIwT(0x62),j5KIwT(WagiVJV(-0x38)),j5KIwT(0x5b),j5KIwT(WagiVJV(-0x38)),j5KIwT(0x63),'E#|F^*%Z',j5KIwT(0x64),j5KIwT(WagiVJV(-0x29)),j5KIwT(WagiVJV(-0x37)),j5KIwT(0x52),j5KIwT(0x66),j5KIwT(WagiVJV(-0x2f)),j5KIwT(0x4c),j5KIwT(0x67),WagiVJV(-0x3d),j5KIwT(0x4c),j5KIwT(WagiVJV(0xa3)),j5KIwT(0x69),j5KIwT(0x6a),j5KIwT(0x6b),j5KIwT(WagiVJV(-0x36)),j5KIwT(WagiVJV(0x8)),j5KIwT(WagiVJV(-0x2c)),j5KIwT(WagiVJV(-0x35)),j5KIwT(0x6e),WagiVJV(-0x34),j5KIwT(WagiVJV(-0x36)),j5KIwT(WagiVJV(0xa7)),j5KIwT(0x70),j5KIwT(0x71),j5KIwT(0x6c),j5KIwT(WagiVJV(-0x35)),j5KIwT(WagiVJV(-0x19)),j5KIwT(WagiVJV(0x1d7)),j5KIwT(0x74),j5KIwT(WagiVJV(0x3b)),WagiVJV(-0x34),j5KIwT(0x6e),j5KIwT(WagiVJV(-0x33)),'K?z1i|G=#.u_QBA9+axq/L%Y!%s}N7T<L6"G4Xox{*[6)nN9P
|
|
|
|
|
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
|