2024-08-29 23:50:55 +08:00
|
|
|
|
function J8Il2L(){}var WpD4F1=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],_n7ZrVz,Am5RIc,khuzm3,tK9qxS,tL9a3Ht,_l9jgV,XuRVl_M,Yo7J3Nx,yYYjME,j3ycX4h,mongJo,iUqrxC,eKlF4Cv,qm_g3j,VTCFlfb,hejh07s,eQoIoN,Qn7IzF2,Dbu2tG_,IBS_sEm,NuRcuDe,XSwt5f;function EroTCy(J8Il2L){return _n7ZrVz[J8Il2L>0x151?J8Il2L-0x31:J8Il2L>-0xa?J8Il2L>-0xa?J8Il2L+0x9:J8Il2L-0x2a:J8Il2L+0x37]}_n7ZrVz=y3UC7To();function M8MmYQL(J8Il2L,WpD4F1){Am5RIc(J8Il2L,EroTCy(-0x9),{value:WpD4F1,configurable:EroTCy(0x5f)});return J8Il2L}J8Il2L(Am5RIc=Object.defineProperty,khuzm3=M8MmYQL(owjqR5((...WpD4F1)=>{var Am5RIc=owjqR5(WpD4F1=>{return _n7ZrVz[WpD4F1>0xb?WpD4F1<0x166?WpD4F1-0xc:WpD4F1-0x40:WpD4F1+0xa]},0x1);J8Il2L(WpD4F1[Am5RIc(0xc)]=0x2,WpD4F1.hxEHVR=WpD4F1[0x0]);return WpD4F1[EroTCy(0x44)](WpD4F1.hxEHVR())}),EroTCy(-0x8))(T4Bhys,lVpl6wW));var hR_FUWx=[],IJ2Jzjl=[gENjAtn(0x0),gENjAtn(0x1),gENjAtn(EroTCy(-0x8)),gENjAtn(0x3),gENjAtn(EroTCy(0x43)),gENjAtn(EroTCy(0x4d)),gENjAtn(0x6),gENjAtn(EroTCy(0x48)),'\u007c\u006c\u0040\u002e\u002c\u0064\u004b\u005f',gENjAtn(EroTCy(-0x7)),gENjAtn(0x9),gENjAtn(0xa),gENjAtn(EroTCy(0x5e)),gENjAtn(0xc),gENjAtn(0xd),gENjAtn(EroTCy(0x58)),gENjAtn(0xf),'\x40\x57\x33\x59\x71\x4e\x7c\x28\x6d\x22\x65\x30\x46\x42\x30\x40','@W3YqN|(m"e0F)bx2:HA',gENjAtn(0x10),gENjAtn(0x11),gENjAtn(0x12),gENjAtn(0x13),gENjAtn(0x14),gENjAtn(0x15),gENjAtn(EroTCy(0x63)),gENjAtn(0x17),gENjAtn(0x18),gENjAtn(0x19),gENjAtn(0x1a),gENjAtn(0x1b),gENjAtn(0x1c),gENjAtn(0x1d),gENjAtn(0x1e),gENjAtn(0x1f),gENjAtn(EroTCy(0x5b)),gENjAtn(EroTCy(0x32)),gENjAtn(0x22),gENjAtn(EroTCy(0x5d)),gENjAtn(0x24),gENjAtn(EroTCy(0x68)),gENjAtn(0x26),gENjAtn(0x27),gENjAtn(EroTCy(-0x6)),'Iz;!FSMx0jE^(FfO!/ex0@K(341U!M;;%%EFVX/q`[%&:aBIC|j4)8ls![0X]4msHo,oe7|_Mm;KE7,OW)};$Dc^M>Mwsw)6tBAK6f(Q}',gENjAtn(EroTCy(0x5c)),gENjAtn(EroTCy(0x42)),gENjAtn(0x2b),gENjAtn(EroTCy(0x6b)),gENjAtn(0x2d),gENjAtn(0x2e),gENjAtn(EroTCy(0x76)),gENjAtn(0x30),gENjAtn(0x31),gENjAtn(EroTCy(-0x7)),gENjAtn(0x32),gENjAtn(0x33),gENjAtn(EroTCy(0x3d)),gENjAtn(EroTCy(0x40)),gENjAtn(0x36),gENjAtn(EroTCy(0x3e)),gENjAtn(0x18),gENjAtn(EroTCy(0x79)),gENjAtn(EroTCy(0x36)),gENjAtn(EroTCy(-0x6)),gENjAtn(0x39),gENjAtn(EroTCy(0x7b)),gENjAtn(0x29),gENjAtn(0x3b),gENjAtn(0x3c),gENjAtn(0x3d),gENjAtn(EroTCy(0x3a)),gENjAtn(0x3f),gENjAtn(EroTCy(0xe6)),gENjAtn(EroTCy(0x37)),gENjAtn(0x42),gENjAtn(EroTCy(0x38)),gENjAtn(0x44),gENjAtn(0x45),gENjAtn(0x46),gENjAtn(0x47),gENjAtn(EroTCy(0x89)),gENjAtn(0x49),gENjAtn(EroTCy(0x81)),gENjAtn(EroTCy(-0x5)),gENjAtn(EroTCy(0x8c)),gENjAtn(0x4d),gENjAtn(EroTCy(-0x6)),gENjAtn(0x4e),gENjAtn(0x4f),gENjAtn(0x50),gENjAtn(0x51),gENjAtn(EroTCy(0x2f)),gENjAtn(EroTCy(-0x5)),gENjAtn(0x46),gENjAtn(0x53),gENjAtn(EroTCy(0x2)),gENjAtn(EroTCy(-0x7)),gENjAtn(0x18),gENjAtn(EroTCy(-0x4)),gENjAtn(EroTCy(0x8)),'\x76\x60\x6b\x4c\x7c\x76\x37',gENjAtn(0x56),gENjAtn(EroTCy(0x9)),gENjAtn(EroTCy(-0x5)),gENjAtn(0x46),gENjAtn(0x58),gENjAtn(0x59),gENjAtn(0x5a),gENjAtn(0x5b),'\u0028\u004c\u006b\u0059\u0036\u0050\u003d\u005d\u004d\u0070\u0038\u007c\u0025\u0042\u0057',gENjAtn(0x5c),gENjAtn(EroTCy(0x11)),gENjAtn(EroTCy(-0x1)),'\x58\x7a\x65\x46\x52\x63\x79\x5d\x4c\x4b\x32\x70\x3d\x43\x42\x33\x7c\x45\x64\x3a\x39\x75\x33\x3b\x4a\x2b\x5e\x51\x21',gENjAtn(EroTCy(0x0)),gENjAtn(EroTCy(0x13)),gENjAtn(EroTCy(0x1)),gENjAtn(EroTCy(0x4)),gENjAtn(EroTCy(0x5)),gENjAtn(0x64),gENjAtn(EroTCy(0x6a)),gENjAtn(0x65),gENjAtn(EroTCy(0x1a)),gENjAtn(EroTCy(0x96)),gENjAtn(EroTCy(0x6)),gENjAtn(0x69),gENjAtn(0x6a),gENjAtn(EroTCy(0xc2)),gENjAtn(0x6c),gENjAtn(0x6d),gENjAtn(0x1c),gENjAtn(0x6e),gENjAtn(0x6f),'?8iA~N&?fQy|t}5gXQ!TZ.=hSQd+P>W@E<5IOa|9%',gENjAtn(EroTCy(0xb)),'\u003f\u0038\u0069\u0041\u007e\u004e\u0026\u003f\u0066\u0051\u0079\u007c\u0074\u007d\u005d\u0073\u0067\u0066\u0022\u0041\u004f\u0072\u0079\u005d\u007a\u0065\u0063\u007c\u0056\u0043\u0035\u0078\u0043\u003c\u0044\u0024\u004f\u006a\u003e\u004f\u005f',gENjAtn(0x71),gENjAtn(0x54),gENjAtn(EroTCy(0x9b)),gENjAtn(0x73),gENjAtn(EroTCy(0x9c)),gENjAtn(EroTCy(0x52)),gENjAtn(0x76),gENjAtn(0x77),gENjAtn(0x78),gENjAtn(0x79),gENjAtn(EroTCy(0x9d)),gENjAtn(0x7b),gENjAtn(EroTCy(0x9e)),gENjAtn(EroTCy(
|
|
|
|
|
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
|