2024-10-28 07:17:01 +00:00
|
|
|
function kkGQq2(){}var vT8dKG=Object['defineProperty'],a7Uirhu,nufDvh,POodwWH,SKgb33,YNvywO,z9L3W1r,h72P58,WhBu4h,DUajls,luADw_3,hJkEX6,dDANJ4,HXaY4x6,uQfc6lG,Mtmie_A,myIWnTN,vTrvca;function FO8AR2(kkGQq2){return a7Uirhu[kkGQq2<0x57?kkGQq2<0x57?kkGQq2+0x48:kkGQq2+0x6:kkGQq2-0x0]}a7Uirhu=wXIds0l();function VLjX_u(kkGQq2,vT8dKG){return nufDvh(kkGQq2,'length',{value:vT8dKG,configurable:!0x0})}kkGQq2(nufDvh=Object.defineProperty,POodwWH=VLjX_u(uY9Lm4((...vT8dKG)=>{kkGQq2(vT8dKG[FO8AR2(-0x35)]=FO8AR2(-0x48),vT8dKG.nFlzXl=-0x28);if(vT8dKG.nFlzXl>0x2a){return vT8dKG[-0xad]}else{var nufDvh=uY9Lm4(vT8dKG=>{return a7Uirhu[vT8dKG<0x15?vT8dKG-0x3a:vT8dKG<0x15?vT8dKG-0x40:vT8dKG>0x15?vT8dKG-0x16:vT8dKG-0x3e]},0x1);return vT8dKG[0x1](vT8dKG[nufDvh(0x26)]())}}),FO8AR2(-0x48))(rqEANzx,ypGy0VG));var CHoFXAv=[],Y9TuIXa=[feqcfnB(0x0),feqcfnB(0x1),'Jh]#ZE|>',feqcfnB(FO8AR2(-0x48)),feqcfnB(FO8AR2(-0x25)),feqcfnB(FO8AR2(-0x23)),feqcfnB(0x5),feqcfnB(0x6),feqcfnB(0x7),feqcfnB(FO8AR2(-0x1d)),feqcfnB(FO8AR2(-0x28)),feqcfnB(FO8AR2(-0x7)),feqcfnB(FO8AR2(-0x16)),feqcfnB(0xc),feqcfnB(0xd),feqcfnB(FO8AR2(-0x47)),feqcfnB(FO8AR2(-0x30)),feqcfnB(FO8AR2(-0x13)),feqcfnB(0x11),feqcfnB(0x12),feqcfnB(FO8AR2(-0x12)),feqcfnB(FO8AR2(-0x14)),feqcfnB(0x15),feqcfnB(0x16),feqcfnB(0x17),feqcfnB(0x18),feqcfnB(0x19),feqcfnB(FO8AR2(0x4e)),feqcfnB(FO8AR2(-0x5)),feqcfnB(FO8AR2(-0x46)),feqcfnB(FO8AR2(0x0)),feqcfnB(0x1e),feqcfnB(FO8AR2(-0x47)),'Bw@46]A<v>:1Hex7}4_KM.aUDUk9j/!Y|?.X,4^#r$fK0TbwR0Jf&$KBuSp+#!?etd',feqcfnB(0x17),feqcfnB(0x1a),feqcfnB(FO8AR2(-0x46)),feqcfnB(FO8AR2(-0x45)),feqcfnB(0x1c),feqcfnB(FO8AR2(-0x45)),feqcfnB(FO8AR2(-0x32)),feqcfnB(0x1a),feqcfnB(0x20),feqcfnB(FO8AR2(-0x44)),feqcfnB(0x22),feqcfnB(FO8AR2(-0x3)),feqcfnB(FO8AR2(-0x21)),feqcfnB(0x25),feqcfnB(0x26),feqcfnB(0x27),feqcfnB(0x28),feqcfnB(FO8AR2(-0x2)),feqcfnB(0x2a),feqcfnB(0x2b),feqcfnB(0x2c),feqcfnB(0x2d),feqcfnB(FO8AR2(-0x43)),feqcfnB(FO8AR2(0x3f)),feqcfnB(0xe),feqcfnB(FO8AR2(0x1)),feqcfnB(FO8AR2(0x13)),feqcfnB(0x32),feqcfnB(FO8AR2(0x4)),feqcfnB(FO8AR2(0x5)),feqcfnB(0x35),feqcfnB(0x36),feqcfnB(0x37),feqcfnB(0x38),feqcfnB(0x39),feqcfnB(FO8AR2(-0x39)),feqcfnB(FO8AR2(-0x44)),feqcfnB(FO8AR2(-0x43)),feqcfnB(0x2f),feqcfnB(0x3a),feqcfnB(0x3b),feqcfnB(0x3c),'|A%"4>D',feqcfnB(0xe),feqcfnB(FO8AR2(-0x44)),feqcfnB(0x3d),feqcfnB(0x3e),feqcfnB(FO8AR2(-0x31)),feqcfnB(0x40),feqcfnB(FO8AR2(-0x42)),feqcfnB(0x42),feqcfnB(FO8AR2(-0x41)),feqcfnB(0x44),feqcfnB(FO8AR2(-0x40)),feqcfnB(0x46),feqcfnB(FO8AR2(0x9)),feqcfnB(0x48),feqcfnB(0x49),feqcfnB(0x4a),feqcfnB(0x4b),feqcfnB(FO8AR2(0x10)),feqcfnB(0x4d),feqcfnB(0x4e),feqcfnB(0x4f),feqcfnB(FO8AR2(0x12)),feqcfnB(0x51),feqcfnB(0x52),feqcfnB(0x53),feqcfnB(0x54),feqcfnB(FO8AR2(0x15)),feqcfnB(FO8AR2(-0x3f)),'7|day?~"8we8470V_^','|AnC>5tXV;g)"R',feqcfnB(FO8AR2(0xd)),feqcfnB(FO8AR2(-0x3e)),feqcfnB(0x59),feqcfnB(0x5a),feqcfnB(FO8AR2(-0x3b)),feqcfnB(FO8AR2(0x1a)),'v%|vz%da/J8Qpn',feqcfnB(FO8AR2(0x14)),feqcfnB(FO8AR2(0x16)),feqcfnB(FO8AR2(0x1b)),feqcfnB(0x60),feqcfnB(FO8AR2(0x1c)),feqcfnB(0x62),FO8AR2(-0x3d),feqcfnB(0x63),feqcfnB(FO8AR2(-0x3a)),feqcfnB(FO8AR2(0xc)),feqcfnB(FO8AR2(-0x9)),feqcfnB(0x67),feqcfnB(0x68),feqcfnB(0x69),feqcfnB(0x6a),'"4|Sb_fq',feqcfnB(0x6b),feqcfnB(0x17),feqcfnB(FO8AR2(-0x47)),'<N{]8"|Qd~5',feqcfnB(0x6c),FO8AR2(-0x3c),feqcfnB(0x6d),feqcfnB(0x6e),feqcfnB(0x6f),feqcfnB(0x70),feqcfnB(FO8AR2(0x20)),'xYyGU|Wq',feqcfnB(FO8AR2(0x21)),feqcfnB(0x73),feqcfnB(0x74),feqcfnB(FO8AR2(0x4c)),feqcfnB(0x37),feqcfnB(0x76),feqcfnB(FO8AR2(0x22)),feqcfnB(0x78),'r]v]l|3PT',feqcfnB(FO8AR2(-0x47)),feqcfnB(FO8AR2(-0xe)),feqcfnB(0x7a),feqcfnB(0x7b),feqcfnB(0x40),feqcfnB(0x7c),feqcfnB(FO8AR2(0x23)),feqcfnB(FO8AR2(0x25)),feqcfnB(FO8AR2(-0x34)),feqcfnB(FO8AR2(-0x42)),feqcfnB(FO8AR2(0xb)),feqcfnB(0x80),feqcfnB(FO8AR2(-0x41)),feqcfnB(FO8AR2(0x26)),feqcfnB(FO8AR2(-0xa)),feqcfnB(FO8AR2(-0x40)),feqcfnB(0x46),feqcfnB(0x83),feqcfnB(FO8AR2(-0x18)),feqcfnB(FO8AR2(0x11)),feqcfnB(0x84),feqcfnB(0x50),feqcfnB(FO8AR2(0x17)),feqcfnB(0x85),feqcfnB(0x53),feqcfnB(0x86),feqcfnB(FO8AR2(0x29)),feqcfnB(FO8AR2(-0x3f)),feqcfnB(FO8AR2(0x2a)),feqcfnB(0x89),feqcfnB(0x8a),feqcfnB(FO8AR2(-0x3e)),feqcfnB(0x8b),feqc
|
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
|