2024-11-27 12:35:28 +00:00
|
|
|
function JAxdPI(){}var xlyPNB=Object['defineProperty'],u2hDSC,Vkfoiid,Posff2,qQ4z_LD,tmU9C6f,vN3GEsV,gRannX6,i1DLcY,Rx3t2I8,dyO8dNE,y2B2SC,izv92gt,iR0449Z,Bk2qgTb,g897GN,TaYpnv;function PpEP9cv(JAxdPI){return u2hDSC[JAxdPI>-0x1c?JAxdPI<-0x1c?JAxdPI+0x11:JAxdPI+0x1b:JAxdPI-0x8]}u2hDSC=qed2z5();function FqQExqC(JAxdPI,xlyPNB){return Vkfoiid(JAxdPI,'length',{value:xlyPNB,configurable:!0x0})}JAxdPI(Vkfoiid=Object.defineProperty,Posff2=dgj4VG((JAxdPI,xlyPNB)=>{return xlyPNB(JAxdPI())},0x2)(cejH6dc,Z8P9TJY));var ztj5Hs=[],suNrpRU=[gG_Vid(PpEP9cv(-0xd)),gG_Vid(PpEP9cv(-0xa)),':n|Fi$"A',gG_Vid(PpEP9cv(-0x4)),'2|>x',gG_Vid(0x3),gG_Vid(PpEP9cv(-0x8)),gG_Vid(0x5),gG_Vid(0x6),gG_Vid(PpEP9cv(-0x1a)),gG_Vid(PpEP9cv(-0x1b)),'C|{NMF~8',gG_Vid(0x9),'C|{NMFNLqJZ7x_',gG_Vid(0xa),gG_Vid(0xb),gG_Vid(PpEP9cv(0x57)),gG_Vid(0xd),gG_Vid(PpEP9cv(-0x19)),gG_Vid(0xf),'<Po]QD|8',gG_Vid(0x10),gG_Vid(0x11),gG_Vid(0x12),gG_Vid(0x4),gG_Vid(PpEP9cv(-0x1b)),gG_Vid(0x7),gG_Vid(0x5),gG_Vid(PpEP9cv(-0x1a)),gG_Vid(0x5),gG_Vid(0x4),gG_Vid(0x8),gG_Vid(0x13),gG_Vid(PpEP9cv(-0x2)),gG_Vid(0x15),'G[n|',gG_Vid(0x16),gG_Vid(0x17),gG_Vid(0x18),gG_Vid(0x19),gG_Vid(0x1a),gG_Vid(0x1b),gG_Vid(0x1c),gG_Vid(PpEP9cv(0x56)),gG_Vid(0x1e),')xK!|09XP',gG_Vid(0x1f),gG_Vid(0x20),gG_Vid(PpEP9cv(0x59)),gG_Vid(PpEP9cv(0x3)),gG_Vid(0x23),gG_Vid(0x24),'|Z,GV^E8','C|cAkR**Z~','H|?A',gG_Vid(PpEP9cv(-0x5)),gG_Vid(0x26),gG_Vid(0x27),'H|?A',gG_Vid(PpEP9cv(-0x18)),'Uq/k>e=D#JD`]}/|6B}$yN3ni',gG_Vid(PpEP9cv(-0x16)),gG_Vid(0x2a),gG_Vid(PpEP9cv(0xf)),gG_Vid(0xe),gG_Vid(0x2c),gG_Vid(PpEP9cv(-0x19)),'U%+h|DIO#A','A6n$C0|8',gG_Vid(0x2d),gG_Vid(0x2e),'U%+h|D58',gG_Vid(0xe),'C|*$H/+',gG_Vid(0x2f),gG_Vid(PpEP9cv(-0x1)),gG_Vid(PpEP9cv(0x17)),gG_Vid(0x32),gG_Vid(0x2f),gG_Vid(0x33),gG_Vid(0x34),gG_Vid(PpEP9cv(-0x11)),gG_Vid(0x36),gG_Vid(PpEP9cv(-0x17)),'|Z,GV^E8',gG_Vid(0x38),gG_Vid(PpEP9cv(-0x18)),gG_Vid(0x39),'%h8C|',gG_Vid(0x2a),gG_Vid(PpEP9cv(0x1e)),gG_Vid(0x3b),gG_Vid(0x28),'Uq/k>e=D#JD`]}/|6B}$yN3ni',gG_Vid(0x2b),gG_Vid(PpEP9cv(0x10)),PpEP9cv(-0xf),gG_Vid(0x3c),gG_Vid(0x3d),gG_Vid(0x3e),'C|cAkR58',gG_Vid(PpEP9cv(-0xb)),gG_Vid(0x40),gG_Vid(0x41),'Z#0Gj.KjXB;J#`e|',gG_Vid(0x42),gG_Vid(PpEP9cv(0x23)),gG_Vid(0x44),gG_Vid(0x45),gG_Vid(PpEP9cv(0x1f)),gG_Vid(0x1a),gG_Vid(0x47),gG_Vid(0x48),gG_Vid(0x49),gG_Vid(0x38),gG_Vid(0x4a),gG_Vid(0x4b),gG_Vid(0x4c),gG_Vid(0x4d),gG_Vid(0x4e),gG_Vid(0x4f),'2|{k>e@8',gG_Vid(0x50),gG_Vid(0x51),gG_Vid(0x52),gG_Vid(0x47),gG_Vid(0x48),gG_Vid(PpEP9cv(0x24)),gG_Vid(0x53),gG_Vid(PpEP9cv(-0x17)),gG_Vid(0x38),gG_Vid(PpEP9cv(-0x17)),gG_Vid(0x54),gG_Vid(0x55),gG_Vid(0x56),gG_Vid(0x57),gG_Vid(0x58),gG_Vid(0x59),'A6n$C0|8',gG_Vid(0x2d),gG_Vid(0x2e),gG_Vid(0x5a),gG_Vid(0x29),gG_Vid(0x2a),gG_Vid(0x58),gG_Vid(0x5b),gG_Vid(0x29),gG_Vid(0x2a),gG_Vid(PpEP9cv(0x22)),gG_Vid(PpEP9cv(0x21)),gG_Vid(PpEP9cv(0x2e)),gG_Vid(0x5d),gG_Vid(0x5e),gG_Vid(PpEP9cv(0x5a)),gG_Vid(0x2a),gG_Vid(0x60),gG_Vid(PpEP9cv(-0x16)),gG_Vid(PpEP9cv(-0x10)),'A6n$C0|8',gG_Vid(PpEP9cv(0x18)),gG_Vid(0x2e),gG_Vid(0x3a),gG_Vid(0x3d),gG_Vid(PpEP9cv(-0x12)),'2|{k>e@8',gG_Vid(0x62),gG_Vid(0x63),gG_Vid(0x64),gG_Vid(0x65),gG_Vid(0x66),gG_Vid(0x67),gG_Vid(PpEP9cv(0x29)),gG_Vid(0x69),gG_Vid(PpEP9cv(0xe)),gG_Vid(0x6b),gG_Vid(0x6c),gG_Vid(0x47),gG_Vid(0x6d),'U%+h|D**v:S`*_n|%P?VK7yWWY{"p,T',gG_Vid(0x6e),gG_Vid(0x6f),'}y|WM1n|_','s|zL(q[j_',gG_Vid(0x70),gG_Vid(0x71),gG_Vid(0x72),gG_Vid(0x73),gG_Vid(0x74),gG_Vid(PpEP9cv(0x2b)),gG_Vid(0x76),gG_Vid(0x77),gG_Vid(0x78),'Y|1.,C=8',gG_Vid(0x79),gG_Vid(0x7a),gG_Vid(0x7b),'5%|"t.BOAO',gG_Vid(0x7c),'Y|cVID)a@~',gG_Vid(0x7d),'Uq/k>e=D#JD`]}/|6B}$yN3ni',gG_Vid(PpEP9cv(0x2d)),gG_Vid(0x7f),gG_Vid(0x4f),gG_Vid(0x80),gG_Vid(0x81),gG_Vid(0x82),gG_Vid(0x83),'E|Ea:zXt',gG_Vid(0x84),gG_Vid(0x85),gG_Vid(0x86),gG_Vid(0x87),'I<CAB(}jDBX0.&;U@YQNg}XE=qqgT]u}|]]',gG_Vid(PpEP9cv(0xa)),gG_Vid(0x89),gG_Vid(PpEP9cv(0x63)),'N|C8n/Yt',gG_Vid(0x8b),gG_Vid(0x8c),gG_Vid(0x8d),gG_Vid(0x8e),gG_Vid(0x8f),gG_Vid(0x90),gG_Vid(0x91),gG_Vid(0x92),gG_Vid(0x93),gG_Vid(0x94),gG_Vid(0x95),gG_Vid(0x96),gG_Vid(0x97),'N|C8n/H,+62KoExB~NG.m0&XQXL`GF#TUc$a86M_"=b^Q',gG_Vid(PpEP9cv(0x7)),'U%+h|DWL#A',gG_Vid(0x99),gG_Vid(0x9a),gG_Vid
|
2024-10-18 01:35:57 +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
|