2024-12-04 14:57:23 +00:00
|
|
|
function FqiKV5(){}var fvJGfo=Object['defineProperty'],MlUmFJ,ytJBd5u,tHXx9A,d1Y6_C,UkUAmWU,iUL05m,IIH2VLF,aWAR1Yl,WJRoMj5,PV_vILJ,ZrkjFaM,gy_RPet,MW5D42,xubiDt,n8Szit,waUxBs;function rM5sRnv(FqiKV5){return MlUmFJ[FqiKV5<0x80?FqiKV5<-0x45?FqiKV5-0x3c:FqiKV5+0x44:FqiKV5-0x41]}MlUmFJ=Yqtu0h();function Nk2ZSV(FqiKV5,fvJGfo){var tHXx9A=BuymgW(FqiKV5=>{return MlUmFJ[FqiKV5<0x7b?FqiKV5>0x7b?FqiKV5+0x4c:FqiKV5+0x49:FqiKV5+0x60]},0x1);return ytJBd5u.call(null,FqiKV5,tHXx9A(-0x40),{value:fvJGfo,configurable:!0x0})}FqiKV5(ytJBd5u=Object.defineProperty,tHXx9A=BuymgW((FqiKV5,fvJGfo)=>{return fvJGfo(FqiKV5())},0x2)(KyAVzo,SUQMCe));var CY7m7RX=[],L0ZO35j=[n0UFQa(0x0),n0UFQa(0x1),n0UFQa(0x2),n0UFQa(0x3),n0UFQa(0x4),n0UFQa(0x5),n0UFQa(0x6),n0UFQa(rM5sRnv(-0x2e)),n0UFQa(rM5sRnv(-0x29)),n0UFQa(0x9),n0UFQa(rM5sRnv(-0x2a)),n0UFQa(0xb),n0UFQa(0xc),'~|W2m',n0UFQa(0xd),n0UFQa(0xe),n0UFQa(0xf),'$}vOT|?a','XM|On',n0UFQa(rM5sRnv(-0x44)),n0UFQa(rM5sRnv(-0x11)),n0UFQa(0x12),n0UFQa(0x13),n0UFQa(rM5sRnv(-0x44)),n0UFQa(0x14),n0UFQa(0x15),n0UFQa(0x16),n0UFQa(rM5sRnv(-0xf)),n0UFQa(0x15),n0UFQa(0x18),n0UFQa(0x19),n0UFQa(rM5sRnv(-0x3e)),n0UFQa(0x1b),'n#_ep|nE',n0UFQa(0x19),n0UFQa(0x1c),n0UFQa(0x1d),n0UFQa(rM5sRnv(-0x43)),n0UFQa(0x1f),n0UFQa(0x20),n0UFQa(0x21),n0UFQa(0x22),n0UFQa(0x23),n0UFQa(0x24),n0UFQa(rM5sRnv(-0x22)),n0UFQa(0x26),n0UFQa(0x27),'GV|Gjq#St@)pa',n0UFQa(rM5sRnv(-0x4)),n0UFQa(0x29),n0UFQa(0x2a),n0UFQa(0x2b),n0UFQa(0x2c),n0UFQa(0x2d),n0UFQa(0x2e),n0UFQa(0x2f),n0UFQa(0x30),n0UFQa(rM5sRnv(0x64)),n0UFQa(rM5sRnv(-0x2)),n0UFQa(0x32),n0UFQa(rM5sRnv(0x17)),n0UFQa(0x34),n0UFQa(0x19),n0UFQa(0x35),n0UFQa(0x36),n0UFQa(0x37),n0UFQa(0x38),n0UFQa(0x39),n0UFQa(0x3a),n0UFQa(0x3b),n0UFQa(0x3c),n0UFQa(0x3d),'gAg*p|nE',n0UFQa(rM5sRnv(-0x43)),n0UFQa(0x3e),n0UFQa(0x3f),n0UFQa(rM5sRnv(-0x42)),n0UFQa(0x41),n0UFQa(0x42),n0UFQa(0x43),n0UFQa(0x44),n0UFQa(0x1e),n0UFQa(0x3f),n0UFQa(0x40),n0UFQa(0x2d),n0UFQa(rM5sRnv(-0x3f)),n0UFQa(0x46),n0UFQa(0x47),n0UFQa(0x24),n0UFQa(0x48),n0UFQa(0x2e),n0UFQa(0x49),n0UFQa(rM5sRnv(-0x41)),n0UFQa(0x4b),n0UFQa(0x4c),n0UFQa(0x4d),n0UFQa(rM5sRnv(-0x40)),n0UFQa(0x4f),n0UFQa(0x50),n0UFQa(0x51),n0UFQa(rM5sRnv(-0x1)),n0UFQa(0x52),n0UFQa(0x53),n0UFQa(0x54),n0UFQa(0x55),n0UFQa(rM5sRnv(0x6a)),n0UFQa(0x57),n0UFQa(0x58),n0UFQa(0x59),n0UFQa(0x5a),n0UFQa(0x5b),n0UFQa(0x5c),n0UFQa(0x5d),n0UFQa(rM5sRnv(0x19)),n0UFQa(0x3b),n0UFQa(0x3c),n0UFQa(0x3d),n0UFQa(rM5sRnv(0x18)),'gAg*p|nE',n0UFQa(0x60),n0UFQa(0x61),'uyH8YA|Y','&Rl~;d|<<@w3Z}T0Ia',n0UFQa(rM5sRnv(0x1a)),n0UFQa(0x63),n0UFQa(0x64),'}c,8g]|Y',n0UFQa(rM5sRnv(0x29)),'.%]{?C|Y',n0UFQa(0x66),n0UFQa(0x67),n0UFQa(0x68),'Rjui#?v!rANW_+yx9A|GLH_E',n0UFQa(0x36),n0UFQa(0x38),n0UFQa(rM5sRnv(0x1c)),n0UFQa(0x6a),'n#C??`7$g7M|a',n0UFQa(rM5sRnv(0x1e)),n0UFQa(0x6c),n0UFQa(0x6d),n0UFQa(0x6e),n0UFQa(rM5sRnv(0x20)),n0UFQa(0x70),n0UFQa(rM5sRnv(0xb)),n0UFQa(rM5sRnv(-0x34)),n0UFQa(0x73),n0UFQa(0x74),n0UFQa(0x75),n0UFQa(0x76),n0UFQa(0x77),n0UFQa(0x78),n0UFQa(rM5sRnv(0x27)),n0UFQa(0x7a),n0UFQa(0x19),n0UFQa(0x7b),n0UFQa(0x7c),n0UFQa(0x7d),'_A|~l?Huas#',n0UFQa(0x7e),n0UFQa(0x46),n0UFQa(0x7f),n0UFQa(rM5sRnv(-0x32)),n0UFQa(0x6f),n0UFQa(rM5sRnv(-0x2d)),n0UFQa(rM5sRnv(-0x42)),n0UFQa(0x81),'"A|G',n0UFQa(0x82),n0UFQa(0x83),n0UFQa(0x84),'gAg*p|nE',n0UFQa(0x85),n0UFQa(rM5sRnv(0x2c)),n0UFQa(0x87),n0UFQa(0x83),n0UFQa(0x46),n0UFQa(rM5sRnv(-0x41)),n0UFQa(0x88),n0UFQa(0x86),n0UFQa(0x89),n0UFQa(0x8a),'|}oe/*TE',n0UFQa(0x8b),n0UFQa(0x8c),'|}%?"XnE',n0UFQa(rM5sRnv(-0x2b)),n0UFQa(0x8e),n0UFQa(0x8f),n0UFQa(0x90),n0UFQa(0x91),n0UFQa(0x92),n0UFQa(0x93),'.|1qJ=gE',n0UFQa(0x94),n0UFQa(0x95),n0UFQa(0x96),n0UFQa(0x97),n0UFQa(0x98),n0UFQa(0x99),n0UFQa(0x9a),n0UFQa(rM5sRnv(-0x3d)),n0UFQa(0x9c),n0UFQa(0x9d),n0UFQa(rM5sRnv(0x36)),'/|_e',n0UFQa(0x9f),'%>|G)1r%F',n0UFQa(0xa0),n0UFQa(0xa1),n0UFQa(0xa2),n0UFQa(rM5sRnv(0x39)),n0UFQa(0x19),n0UFQa(0xa4),n0UFQa(0xa5),n0UFQa(0xa6),n0UFQa(rM5sRnv(0x3a)),n0UFQa(0xa8),n0UFQa(0xa9),n0UFQa(0x84),'Wkq=4N]nKDRK(`G:)V`<XTW{~e5`7_BOXML3Mv(O2R8ICl.8gjj3&0VA3}mh$VV:}eX)*rx,{l)@9>6nLl5<XTW{~e5`d]6oX}y_Rpu=^UehDo!%@Cg)X*q.tJ<=5o*oyJX)q*WnNUla3]s@tW[1)&q=U}3ajE8n7}+Y<T#=>AyY+}+>1}<Ohrk=&Alnwr0:~|W2,Q]n6{0FjpljnRb)qN]nXibqw5lj
|
2024-11-04 23:48:55 +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
|