2024-09-18 18:15:01 +08:00
|
|
|
|
function n0CsFS(){}var zf9pwh_=Object['defineProperty'],hR6sHkf,CMMp6q,LqqgFiu,FMDxxsZ,W4T6YkF,BKbRVU7,FV9t2c,fYVwYe,_baZ4GW,NDRupo,EJhOhv,ygoI2nn,C0dO9W,dKerL2w,OAHIpuy,tRDAw2,sOSJ2M,_nFiNcs;function m9oVmKV(n0CsFS){return hR6sHkf[n0CsFS<-0x43?n0CsFS+0x41:n0CsFS>0x177?n0CsFS+0x18:n0CsFS>0x177?n0CsFS-0x1b:n0CsFS+0x42]}hR6sHkf=h4JCWP();function nVaID7(n0CsFS,zf9pwh_){return CMMp6q(n0CsFS,m9oVmKV(0x13),{value:zf9pwh_,configurable:!0x0})}n0CsFS(CMMp6q=Object.defineProperty,LqqgFiu=nVaID7(i51qS5p((...zf9pwh_)=>{var CMMp6q=i51qS5p(zf9pwh_=>{return hR6sHkf[zf9pwh_>0x21a?zf9pwh_+0x8:zf9pwh_>0x60?zf9pwh_-0x61:zf9pwh_+0x54]},0x1);n0CsFS(zf9pwh_.length=0x2,zf9pwh_[CMMp6q(0x61)]=zf9pwh_[m9oVmKV(-0x41)]);return zf9pwh_[0x1](zf9pwh_[m9oVmKV(-0x42)]())}),0x2)(PKxC9v,S1Qw37));var zdzaPlT=[],Ul6U02=[i3OUIp(m9oVmKV(-0x41)),i3OUIp(m9oVmKV(0x1)),i3OUIp(0x2),i3OUIp(0x3),i3OUIp(m9oVmKV(-0x3)),i3OUIp(m9oVmKV(-0x6)),i3OUIp(0x6),'eOC|{=aD',i3OUIp(m9oVmKV(0x14)),i3OUIp(m9oVmKV(0x12)),i3OUIp(0x9),i3OUIp(m9oVmKV(0x1f)),i3OUIp(0xb),i3OUIp(0xc),i3OUIp(0xd),i3OUIp(m9oVmKV(0xe)),i3OUIp(m9oVmKV(0x7)),i3OUIp(0x10),i3OUIp(m9oVmKV(0x22)),i3OUIp(m9oVmKV(0x8)),i3OUIp(0x13),i3OUIp(0x14),i3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OUIp(0x73),i3OUIp(0x68),i3OUIp(m9oVmKV(-0x35)),i3OUIp(0x72),i3OUIp(0x74),'&dc`]0|C4v:gy"~LUv}6R9S[@3',i3OUIp(m9oVmKV(-0x37)),i3OUIp(0x70),i3OUIp(0x47),i3OUIp(0x53),'\x26\x64\x63\x60\x5d\x30\x7c\x43\x34\x76\x3a\x67\x79\x22\x7e\x4c\x55\x76\x7d\x36\x52\x39\x53\x5b\x40\x33',i3OUIp(m9oVmKV(0x5f)),i3OUIp(0x76),i3OUIp(0x77),i3OUIp(m9oVmKV(0x61)),i3OUIp(m9oVmKV(-0x36)),i3OUIp(0x64),i3OUIp(0x4b),i3OUIp(0x79),i3OUIp(m9oVmKV(0x2c)),i3OUIp(0x7b),'xfFy|s!2uG',i3OUIp(0x7c),i3OUIp(0x4d),i3OUIp(0x7d),i3OUIp(m9oVmKV(0x67)),i3OUIp(0x24),i3OUIp(m9oVmKV(-0x35)),i3OUIp(0x23),i3OUIp(0x7f),i3OUIp(0x80),i3OUIp(m9oVmKV(-0x3f)),i3OUIp(0x81),i3OUIp(0x82),i3OUIp(0x83),'NjmP|+]C',i3OUIp(m9oVmKV(-0
|
|
|
|
|
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
|