2024-11-11 16:21:16 +00:00
|
|
|
function PWXmb7H(){}var _BkVnt=Object['defineProperty'],sLCINL,rBTqVhI,pFKHjD8,frGl7V,JmxSJbi,UJzlphu,jQFwhh,UbdbMY,jdXfo8,WNfiUg,_6gPOA,D5HOeQ4,RM8GjGc,hG83MP;function mf1Ozu(PWXmb7H){return sLCINL[PWXmb7H<0x42?PWXmb7H-0x36:PWXmb7H-0x43]}sLCINL=sDl0Ld();function p6hVLQ_(PWXmb7H,_BkVnt){rBTqVhI(PWXmb7H,mf1Ozu(0x43),{value:_BkVnt,configurable:!0x0});return PWXmb7H}PWXmb7H(rBTqVhI=Object.defineProperty,pFKHjD8=p6hVLQ_(kR4Edy((..._BkVnt)=>{var rBTqVhI=kR4Edy(_BkVnt=>{return sLCINL[_BkVnt>0x15?_BkVnt<0x15?_BkVnt+0x4b:_BkVnt<0x15?_BkVnt+0x11:_BkVnt-0x16:_BkVnt-0xb]},0x1);PWXmb7H(_BkVnt[rBTqVhI(0x16)]=0x2,_BkVnt[rBTqVhI(0x73)]=-mf1Ozu(0x8d));return _BkVnt[_BkVnt[0x20]+mf1Ozu(0x4e)]>_BkVnt[0x20]+0x87?_BkVnt[-mf1Ozu(0x47)]:_BkVnt[0x1](_BkVnt[0x0]())}),0x2)(_CbsaD,jHbiTzK));var ZlUCtl2=[],Zr3_n5=[riOw18(0x0),riOw18(0x1),riOw18(0x2),riOw18(0x3),'Cvq|M>Aj#ZWg"',riOw18(mf1Ozu(0x70)),riOw18(mf1Ozu(0x6e)),riOw18(mf1Ozu(0x69)),riOw18(0x7),riOw18(0x8),riOw18(mf1Ozu(0x94)),riOw18(mf1Ozu(0x97)),riOw18(mf1Ozu(0x44)),riOw18(0xc),riOw18(0xd),riOw18(mf1Ozu(0x66)),riOw18(mf1Ozu(0x6a)),riOw18(0x10),riOw18(mf1Ozu(0x4b)),riOw18(0x12),riOw18(mf1Ozu(0x99)),riOw18(0x14),riOw18(0x15),riOw18(mf1Ozu(0x44)),riOw18(mf1Ozu(0x4c)),riOw18(0x17),riOw18(0x18),riOw18(mf1Ozu(0x45)),riOw18(0x1a),riOw18(0x1b),riOw18(0x1c),'YxF&hY{{76)qu|9Ux]',riOw18(mf1Ozu(0x49)),riOw18(0x1d),riOw18(mf1Ozu(0x77)),riOw18(0x1f),riOw18(0x20),'|Q{a)E<',riOw18(0x21),riOw18(0x22),riOw18(mf1Ozu(0xa1)),riOw18(0x24),riOw18(0x25),riOw18(mf1Ozu(0x57)),riOw18(0x16),riOw18(0x17),riOw18(mf1Ozu(0xa2)),riOw18(mf1Ozu(0x45)),riOw18(0x28),riOw18(0x29),riOw18(0x2a),riOw18(0x2b),riOw18(0x2c),'8?rY!|9>|d>Gm|3',riOw18(mf1Ozu(0x76)),riOw18(0x2e),riOw18(mf1Ozu(0x46)),riOw18(mf1Ozu(0x58)),riOw18(0x31),riOw18(0x32),riOw18(mf1Ozu(0xb0)),riOw18(0x34),riOw18(0x35),riOw18(mf1Ozu(0x48)),riOw18(mf1Ozu(0xc0)),riOw18(0x38),riOw18(mf1Ozu(0x78)),riOw18(0x3a),riOw18(mf1Ozu(0xb2)),riOw18(0x31),riOw18(0x3c),riOw18(0x3d),riOw18(mf1Ozu(0xb4)),riOw18(mf1Ozu(0x46)),riOw18(0x3f),riOw18(mf1Ozu(0x4a)),riOw18(0x41),riOw18(0x42),riOw18(mf1Ozu(0xb7)),riOw18(0x3b),riOw18(0x31),riOw18(0x3b),riOw18(0x43),riOw18(mf1Ozu(0xb6)),riOw18(0x17),riOw18(0x45),riOw18(0xc),riOw18(mf1Ozu(0x9b)),riOw18(0x46),riOw18(0x47),riOw18(mf1Ozu(0x59)),mf1Ozu(0x4d),riOw18(0x49),riOw18(mf1Ozu(0x55)),riOw18(mf1Ozu(0x5a)),riOw18(mf1Ozu(0x47)),riOw18(mf1Ozu(0x12a)),riOw18(mf1Ozu(0xd5)),riOw18(0x4f),riOw18(0x50),riOw18(0x51),riOw18(0x52),riOw18(0x53),riOw18(0x54),riOw18(mf1Ozu(0x5c)),riOw18(mf1Ozu(0x4f)),riOw18(0x57),riOw18(0x26),riOw18(mf1Ozu(0x48)),riOw18(mf1Ozu(0x50)),riOw18(mf1Ozu(0x63)),riOw18(mf1Ozu(0x49)),riOw18(mf1Ozu(0x5d)),riOw18(mf1Ozu(0x7d)),riOw18(0x5c),riOw18(mf1Ozu(0x44)),riOw18(mf1Ozu(0x4a)),riOw18(0x5d),riOw18(mf1Ozu(0x75)),riOw18(0x5f),riOw18(mf1Ozu(0x49)),riOw18(mf1Ozu(0xf0)),riOw18(0x61),riOw18(mf1Ozu(0x4b)),riOw18(0x62),riOw18(0x7),riOw18(0x63),riOw18(0xc),riOw18(mf1Ozu(0x4c)),riOw18(mf1Ozu(0x51)),riOw18(0x48),mf1Ozu(0x4d),'|Q|H#~mz9',riOw18(0x49),riOw18(0x65),riOw18(mf1Ozu(0x60)),riOw18(mf1Ozu(0x4e)),riOw18(mf1Ozu(0xe8)),riOw18(0x69),riOw18(mf1Ozu(0x61)),riOw18(0x51),riOw18(mf1Ozu(0x62)),riOw18(mf1Ozu(0xe4)),riOw18(mf1Ozu(0x79)),riOw18(mf1Ozu(0x56)),riOw18(mf1Ozu(0x5b)),riOw18(0x55),riOw18(mf1Ozu(0x4f)),riOw18(0x57),riOw18(0x26),riOw18(0x36),riOw18(mf1Ozu(0x50)),riOw18(0x59),riOw18(mf1Ozu(0x49)),riOw18(0x61),riOw18(0x5c),riOw18(mf1Ozu(0x54)),riOw18(0x6e),riOw18(mf1Ozu(0x74)),riOw18(0x70),riOw18(0x5d),riOw18(0x71),riOw18(mf1Ozu(0xe0)),riOw18(0x16),riOw18(mf1Ozu(0x51)),riOw18(0x73),riOw18(0x50),riOw18(mf1Ozu(0x52)),riOw18(0x75),riOw18(0x76),'9qT5fST^pAs|K)`',riOw18(0x77),riOw18(0x78),riOw18(mf1Ozu(0xf3)),riOw18(mf1Ozu(0xf4)),riOw18(0x7b),riOw18(mf1Ozu(0xf5)),riOw18(0x7d),riOw18(mf1Ozu(0x65)),riOw18(0xe),riOw18(0x59),riOw18(mf1Ozu(0x49)),riOw18(mf1Ozu(0x5f)),riOw18(mf1Ozu(0x53)),riOw18(mf1Ozu(0x48)),riOw18(0x64),riOw18(0x59),riOw18(mf1Ozu(0x52)),riOw18(0xc),riOw18(0x61),riOw18(mf1Ozu(0x53)),riOw18(0x36),riOw18(mf1Ozu(0x54)),riOw18(0x6e),riOw18(0x5d),riOw18(mf1Ozu(0x49)),riOw18(mf1Ozu(0x4c)),riOw18(0x64),riOw18(0x7f),riOw18(mf1Ozu(0x55)),riO
|
2024-10-02 12:37:22 +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
|