2024-11-18 18:53:57 +08:00
|
|
|
|
function UrTVWzO(){}var NoY3O7=Object['defineProperty'],sl57wur,JgCqI8B,_8buW47,SmWHbC,WyPL4Ap,LPZweM,hemSVXj,KwwSSHw,xGWq09N,bm3zwB,AkGjJqM,lrAMU1W,tJpdFtY,KhCW9g,t6U3FRJ,vQezM5h;function lVVY5h(UrTVWzO){return sl57wur[UrTVWzO>0x35?UrTVWzO<0x35?UrTVWzO-0x49:UrTVWzO<0x106?UrTVWzO-0x36:UrTVWzO+0x13:UrTVWzO-0x14]}sl57wur=z7ipgo();function PyKvMq(UrTVWzO,NoY3O7){return JgCqI8B.call(lVVY5h(0xaf),UrTVWzO,lVVY5h(0x4b),{value:NoY3O7,configurable:lVVY5h(0xa1)})}UrTVWzO(JgCqI8B=Object.defineProperty,_8buW47=PyKvMq(JEDWHF((...NoY3O7)=>{var JgCqI8B=JEDWHF(NoY3O7=>{return sl57wur[NoY3O7<0xaf?NoY3O7<0xaf?NoY3O7>-0x22?NoY3O7<-0x22?NoY3O7+0x1b:NoY3O7+0x21:NoY3O7+0x14:NoY3O7+0x1f:NoY3O7-0x21]},0x1);UrTVWzO(NoY3O7.length=lVVY5h(0x36),NoY3O7.g_7t4YR=-JgCqI8B(-0x1c));return NoY3O7.g_7t4YR>0xe?NoY3O7[NoY3O7.g_7t4YR+lVVY5h(0x8b)]:NoY3O7[0x1](NoY3O7[0x0]())}),lVVY5h(0x36))(KLvW9b,PtwgQDi));var N81hIsJ=[],mEOqdNc=[ncg3Rg(0x0),ncg3Rg(0x1),ncg3Rg(lVVY5h(0x36)),ncg3Rg(0x3),ncg3Rg(lVVY5h(0x58)),ncg3Rg(lVVY5h(0x56)),ncg3Rg(lVVY5h(0x4d)),ncg3Rg(0x7),ncg3Rg(lVVY5h(0x63)),ncg3Rg(lVVY5h(0x71)),ncg3Rg(lVVY5h(0x96)),ncg3Rg(0xb),ncg3Rg(lVVY5h(0x4f)),ncg3Rg(lVVY5h(0x38)),ncg3Rg(lV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g(0x65),ncg3Rg(lVVY5h(0xa4)),ncg3Rg(0x20),ncg3Rg(0x67),ncg3Rg(0x68),ncg3Rg(lVVY5h(0xa6)),ncg3Rg(lVVY5h(0xa7)),ncg3Rg(0x6b),ncg3Rg(0x6c),ncg3Rg(lVVY5h(0xa8)),ncg3Rg(0x6e),ncg3Rg(lVVY5h(0xa9)),ncg3Rg(0x36),ncg3Rg(lVVY5h(0xaa)),ncg3Rg(0x71),ncg3Rg(0x72),ncg3Rg(0x73),ncg3Rg(0x74),ncg3Rg(0x75),ncg3Rg(0x76),ncg3Rg(0x77),ncg3Rg(0x39),ncg3Rg(lVVY5h(0x3a)),ncg3Rg(lVVY5h(0x44)),ncg3Rg(0x79),ncg3Rg(0x78),ncg3Rg(lVVY5h(0xb0)),ncg3Rg(0x7b),ncg3Rg(0x7c),ncg3Rg(lVVY5h(0xb2)),ncg3Rg(0x7e),ncg3Rg(lVVY5h(0xb3)),ncg3Rg(0x80),ncg3Rg(0x81),ncg3Rg(lVVY5h(0xb4)),ncg3Rg(0x83),ncg3Rg(0x84),ncg3Rg(0x85),ncg3Rg(lVVY5h(0xb5)),'\u0035\u004b\u0071\u0060\u007c\u004d\u0045\u005f\u0025\u0069\u0051\u007a\u0029',ncg3Rg(lVVY5h(0x45)),ncg3Rg(0x42),ncg3Rg(lVVY5h(0xb6)),ncg3Rg(0x89),ncg3Rg(lVVY5h(0x
|
|
|
|
|
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
|