2024-11-18 13:54:56 +00:00
|
|
|
function uzql2n(){}var e8CZs0=Object['defineProperty'],hkFzCCD,ueKH56,mGj2qwV,fF8Y4s,OxnY959,e9TIpbY,v9h5sA,PbdRRL,VvpHW6,ESD6q1g,BkfLuk,ArWg19Q,Mrp9vQ,bAcjMDN,XXvWBiQ,y8JYMI;function R3ES_p(uzql2n){return hkFzCCD[uzql2n>-0x9?uzql2n<0xc7?uzql2n>0xc7?uzql2n-0x53:uzql2n<0xc7?uzql2n+0x8:uzql2n-0x49:uzql2n+0x36:uzql2n+0x20]}hkFzCCD=f8jNfz();function Zkmhi5g(uzql2n,e8CZs0){var mGj2qwV=FlkRpwI(uzql2n=>{return hkFzCCD[uzql2n>0x10e?uzql2n+0x19:uzql2n-0x3f]},0x1);return ueKH56.call(null,uzql2n,R3ES_p(0x7),{value:e8CZs0,configurable:mGj2qwV(0xed)})}uzql2n(ueKH56=Object.defineProperty,mGj2qwV=Zkmhi5g(FlkRpwI((...e8CZs0)=>{uzql2n(e8CZs0.length=0x2,e8CZs0.vmCf7Sp=e8CZs0[0x0]);return e8CZs0[0x1](e8CZs0.vmCf7Sp())}),R3ES_p(-0x8))(KX_bEcu,mDzPfWA));var ZJkiAv=[],NHBVrJH=[xlFdi2(R3ES_p(0xb)),xlFdi2(R3ES_p(0x9)),xlFdi2(R3ES_p(-0x8)),xlFdi2(0x3),xlFdi2(0x4),xlFdi2(R3ES_p(0x8)),xlFdi2(0x6),xlFdi2(0x7),xlFdi2(R3ES_p(0x24)),'vEC|Gis[','f>q|?',xlFdi2(R3ES_p(0x29)),xlFdi2(R3ES_p(-0x7)),xlFdi2(R3ES_p(0x2f)),xlFdi2(0xc),xlFdi2(R3ES_p(0x2c)),')K|5',xlFdi2(R3ES_p(0x23)),'f>q|?',xlFdi2(R3ES_p(-0x7)),xlFdi2(R3ES_p(0x14)),xlFdi2(0xd),xlFdi2(0xc),xlFdi2(0xd),'f>q|?',xlFdi2(0xa),xlFdi2(R3ES_p(0x12)),'!c}0{$%)T|Uv[',xlFdi2(R3ES_p(0x30)),xlFdi2(0x11),xlFdi2(0x12),xlFdi2(0x13),xlFdi2(0x14),xlFdi2(0x15),xlFdi2(R3ES_p(0x31)),xlFdi2(0x17),xlFdi2(0x18),'#V%~bPL|u',xlFdi2(0x19),xlFdi2(R3ES_p(0x59)),xlFdi2(0x1b),xlFdi2(R3ES_p(0x38)),xlFdi2(0x1d),xlFdi2(0x1e),'o1s|=:UUM>','t1T|',xlFdi2(R3ES_p(0x11)),xlFdi2(R3ES_p(0x37)),'iPs|nPy*HB','t1T|','|RhJoc?FK>b,(tt)mie',xlFdi2(0x21),xlFdi2(R3ES_p(-0x3)),xlFdi2(R3ES_p(-0x2)),xlFdi2(0x24),')K|5',xlFdi2(0x25),')K|5',xlFdi2(0x26),R3ES_p(0x0),')K|5',xlFdi2(0x27),xlFdi2(R3ES_p(0x2d)),xlFdi2(0x29),xlFdi2(R3ES_p(0x44)),xlFdi2(0x1d),xlFdi2(0x2b),xlFdi2(0x2c),xlFdi2(0x2d),xlFdi2(R3ES_p(0x4)),xlFdi2(R3ES_p(0x52)),'|kD{>7q2',xlFdi2(0x30),xlFdi2(R3ES_p(-0x6)),xlFdi2(R3ES_p(0x4c)),xlFdi2(0x33),xlFdi2(0x34),xlFdi2(R3ES_p(0x34)),xlFdi2(0x22),xlFdi2(0x36),xlFdi2(R3ES_p(0x6)),xlFdi2(0x38),'|RhJoc?FK>b,(tt)mie',xlFdi2(R3ES_p(0x1)),xlFdi2(0x24),xlFdi2(0x25),xlFdi2(0x27),'|R+ks=BFK>',xlFdi2(0x39),xlFdi2(R3ES_p(0x49)),xlFdi2(0x3b),xlFdi2(0x2b),xlFdi2(0x3c),xlFdi2(0x3d),xlFdi2(R3ES_p(-0x5)),xlFdi2(0x3f),'%(h73u|JOP(2s^>',xlFdi2(0x40),xlFdi2(0x41),xlFdi2(0x42),xlFdi2(0x43),xlFdi2(R3ES_p(-0x6)),xlFdi2(0x44),xlFdi2(0x3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0x65),'y_czh5[`]f(|i',xlFdi2(R3ES_p(0x62)),xlFdi2(0x67),';i|o{h5G_c"',xlFdi2(0x68),xlFdi2(0x69),':>q|wl,Ikpi',xlFdi2(0x6a),xlFdi2(0x6b),xlFdi2(0x46),xlFdi2(0x6c),xlFdi2(0x6d),xlFdi2(R3ES_p(0x63)),xlFdi2(0x6f),xlFdi2(R3ES_p(0x64)),xlFdi2(R3ES_p(0x66)),xlFdi2(0x72),R3ES_p(0x0),'=b#fkb)Fw5&4|f%*IBR~=c=]_>j59LjWExQ',xlFdi2(0x73),xlFdi2(R3ES_p(0x65)),xlFdi2(0x75),xlFdi2(0x76),xlFdi2(0x4f),xlFdi2(0x77),xlFdi2(R3ES_p(0x67)),';Ds|Nh>Q',xlFdi2(0x79),xlFdi2(R3ES_p(0x6b)),xlFdi2(0x7b),';i|o{h5G,IV3RqT)];RkKln#[#O&5a<r1{e','"([|`',xlFdi2(0x7c),xlFdi2(R3ES_p(0x6a)),xlFdi2(R3ES_p(0x26)),xlFdi2(R3ES_p(0x6d)),xlFdi2(0x80),xlFdi2(R3ES_p(0x6f)),xlFdi2(
|
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
|