2024-11-16 12:13:00 +00:00
|
|
|
function gF8XG2q(){}var ODrxwA_=Object['defineProperty'],_6aurH3,PW17rCx,rUfLGA,qGc_oW,uafQlT,IPsUrRj,KtT5_gH,BQdIV9J,Ge_Cl9G,cLc1YMM,JPinKfH,ET_CzU,WDKfiH,Zg_VtU,ArY9TB,Yqd99fL,ITS3rr;function Tag8YeL(gF8XG2q){return _6aurH3[gF8XG2q>0xa7?gF8XG2q-0x4e:gF8XG2q<0xa7?gF8XG2q+0x4c:gF8XG2q+0x5a]}_6aurH3=gG4QqC();function y3eRPje(gF8XG2q,ODrxwA_){var rUfLGA=ffx2xL(gF8XG2q=>{return _6aurH3[gF8XG2q<-0x2e?gF8XG2q-0x5b:gF8XG2q+0x2d]},0x1);return PW17rCx.call(rUfLGA(0x27),gF8XG2q,Tag8YeL(-0x17),{value:ODrxwA_,configurable:!0x0})}gF8XG2q(PW17rCx=Object.defineProperty,rUfLGA=ffx2xL((gF8XG2q,ODrxwA_)=>{return ODrxwA_(gF8XG2q())},0x2)(MJNijun,FydZxIH));var JgeEbV=[],L0sw0y=[GB7RjG(Tag8YeL(-0x1e)),GB7RjG(Tag8YeL(-0x22)),GB7RjG(Tag8YeL(-0x24)),GB7RjG(0x3),GB7RjG(0x4),GB7RjG(0x5),GB7RjG(0x6),GB7RjG(0x7),GB7RjG(0x8),GB7RjG(0x9),GB7RjG(0xa),GB7RjG(Tag8YeL(0x3)),GB7RjG(Tag8YeL(-0x1a)),GB7RjG(0xd),GB7RjG(Tag8YeL(-0xb)),GB7RjG(0xf),GB7RjG(Tag8YeL(-0x44)),GB7RjG(Tag8YeL(-0x4c)),GB7RjG(0x12),GB7RjG(0x13),GB7RjG(0x14),GB7RjG(Tag8YeL(-0x46)),GB7RjG(Tag8YeL(-0x8)),GB7RjG(0x17),GB7RjG(0x18),GB7RjG(0x19),GB7RjG(0x1a),GB7RjG(Tag8YeL(0x7c)),GB7RjG(0x1c),GB7RjG(0x1d),GB7RjG(0x1e),GB7RjG(Tag8YeL(-0x4c)),GB7RjG(Tag8YeL(0xc)),GB7RjG(0x20),GB7RjG(0x21),GB7RjG(0x22),GB7RjG(0x23),GB7RjG(Tag8YeL(0xe)),GB7RjG(0x25),GB7RjG(0x26),GB7RjG(Tag8YeL(0xf)),GB7RjG(Tag8YeL(0xd)),GB7RjG(0x22),GB7RjG(0x24),GB7RjG(Tag8YeL(-0x4b)),GB7RjG(0x24),GB7RjG(Tag8YeL(-0x4b)),GB7RjG(0x20),GB7RjG(0x22),GB7RjG(0x29),GB7RjG(Tag8YeL(0x19)),GB7RjG(0x2b),GB7RjG(Tag8YeL(-0x4a)),GB7RjG(0x2d),GB7RjG(0x2e),GB7RjG(Tag8YeL(-0x25)),GB7RjG(0x15),GB7RjG(0x30),GB7RjG(Tag8YeL(-0x21)),GB7RjG(0x32),GB7RjG(Tag8YeL(0x4)),GB7RjG(0x34),GB7RjG(0x35),GB7RjG(0x36),GB7RjG(0x37),GB7RjG(0x38),GB7RjG(0x39),GB7RjG(0x3a),GB7RjG(Tag8YeL(-0x2c)),GB7RjG(0x3c),GB7RjG(0x3d),GB7RjG(Tag8YeL(-0x26)),GB7RjG(0x3f),GB7RjG(Tag8YeL(-0x30)),GB7RjG(0x2b),GB7RjG(Tag8YeL(-0x4a)),GB7RjG(Tag8YeL(-0x33)),GB7RjG(0x41),GB7RjG(0x42),GB7RjG(0x43),GB7RjG(0x44),GB7RjG(0x45),GB7RjG(0x46),GB7RjG(Tag8YeL(0x5f)),GB7RjG(0x48),GB7RjG(Tag8YeL(0x45)),GB7RjG(0x4a),GB7RjG(Tag8YeL(0x27)),GB7RjG(Tag8YeL(-0x49)),GB7RjG(Tag8YeL(-0x49)),GB7RjG(0x4d),GB7RjG(0x4e),GB7RjG(Tag8YeL(-0x48)),GB7RjG(0x50),GB7RjG(Tag8YeL(-0x47)),GB7RjG(Tag8YeL(0x28)),GB7RjG(Tag8YeL(0x2f)),GB7RjG(0x54),GB7RjG(Tag8YeL(0x2e)),GB7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),GB7RjG(0x80),GB7RjG(0x15),GB7RjG(Tag8YeL(-0x2a)),GB7RjG(0x81),GB7RjG(0x82),GB7RjG(0x65),GB7RjG(0x83),GB7RjG(0x84),GB7RjG(0x85),GB7RjG(Tag8YeL(-0x3e)),')6v}t#0$khrjtsk5|IY',GB7RjG(0x86),GB7RjG(0x6b),GB7RjG(Tag8YeL(-0x37)),GB7RjG(0x71),GB7RjG(0x88),GB7RjG(Tag8YeL(0x41)),GB7RjG(0x8a),GB7RjG(Tag8YeL(0x42)),GB7RjG(Tag8YeL(0x10)),GB7RjG(0x8d),GB7RjG(0x74),GB7RjG(Tag8YeL(-0xf)),GB7RjG(0x8f),GB7RjG(Tag8YeL(-0x3a)),GB7RjG(0x90),GB7RjG(Tag8YeL(0x44)),GB7RjG(0x92),GB7RjG(0x93),GB7RjG(Tag8YeL(-0x41)),GB7RjG(0x94),GB7RjG(0x90),GB7RjG(0x2b),GB7RjG(Tag8YeL(-0x38)),GB7RjG(0x95),GB7RjG(Tag8YeL(-0x3d)),GB7RjG(0x96),GB7RjG(Tag8YeL(-0x2b)),GB7RjG(0x98),GB7RjG(0x99),GB7RjG(0x9a
|
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
|