2024-11-26 04:35:52 +00:00
|
|
|
function oVikrW(){}var e1zoZbc=Object['defineProperty'],Uo2j_f,YWhRi7j,p9oouS7,uB03pS,WlHZ1BV,CSg32CX,wxkPOQ,cvj2b9,UjF3qjs,NWI2qio,fsjU2y,TfPwEYL,lTrAYG,pclC1r,fAbbWW,blzS0R,w7eTgL9,AsvEyWH,oq3zecA,I6cfOmD,tCep9N;function ewoEyRo(oVikrW){return Uo2j_f[oVikrW>0x2e?oVikrW>0xe2?oVikrW+0xe:oVikrW>0xe2?oVikrW+0x6:oVikrW<0xe2?oVikrW-0x2f:oVikrW-0xc:oVikrW-0x2a]}Uo2j_f=jDsIqma();function R0OTvVh(oVikrW,e1zoZbc){return YWhRi7j(oVikrW,'length',{value:e1zoZbc,configurable:!0x0})}oVikrW(YWhRi7j=Object.defineProperty,p9oouS7=hfYxfA2((oVikrW,e1zoZbc)=>{return e1zoZbc(oVikrW())},0x2)(QQhqzi2,rmGNDGE));var Ge4p3DL=[],hSkqxio=['$<OE_8|F',ryMKwbt(0x0),ryMKwbt(0x1),ryMKwbt(0x2),ryMKwbt(0x3),ryMKwbt(0x4),ryMKwbt(0x5),ryMKwbt(0x6),ryMKwbt(0x7),ryMKwbt(ewoEyRo(0x5c)),'VAL||?u',ryMKwbt(0x9),ryMKwbt(ewoEyRo(0xa5)),ryMKwbt(0xb),ryMKwbt(0xc),ryMKwbt(ewoEyRo(0x49)),'$o{|M(!U5',ryMKwbt(0xe),'@t|.',ryMKwbt(0xf),ryMKwbt(0x10),ryMKwbt(0x11),ryMKwbt(0x12),ryMKwbt(0x13),ryMKwbt(0x14),ryMKwbt(ewoEyRo(0x4b)),ryMKwbt(0x16),ryMKwbt(0x17),ryMKwbt(0x18),ryMKwbt(ewoEyRo(0x41)),'}C>v|?8p',ryMKwbt(0x1a),ryMKwbt(ewoEyRo(0xa3)),ryMKwbt(0x1c),ryMKwbt(0x1d),ryMKwbt(0x1e),ryMKwbt(ewoEyRo(0xa7)),ryMKwbt(0x20),ryMKwbt(0x21),ryMKwbt(0x1c),ryMKwbt(0x1e),ryMKwbt(0x20),ryMKwbt(0x21),ryMKwbt(0x20),ryMKwbt(0x22),ryMKwbt(0x23),ryMKwbt(0x24),ryMKwbt(0x25),ryMKwbt(0x26),ryMKwbt(ewoEyRo(0x59)),ryMKwbt(0x28),'^f0|R',ryMKwbt(0x29),'pA~|"','Wp;J&~{cl,mrY&?2JQDcle#Y"b|FJ{;;BBm&]wQMjOBxAVkWCo,b7:aIJOlw0b%I@Z4ZDyo*{%;#my42=7v;`^Lr{S{XIX7>}kt#>?Y)v','MJPV!2EOC@h]S?$&h}.vJ|]=FXt>X/:16h?+Ibd#Gq$3CB=dfCwfn',ryMKwbt(0x2a),ryMKwbt(ewoEyRo(0x35)),ryMKwbt(0x2c),ryMKwbt(0x2d),ryMKwbt(0x2e),'bR%|{b..5',ryMKwbt(0x2f),ryMKwbt(0x11),ryMKwbt(ewoEyRo(0x61)),ryMKwbt(0x31),ryMKwbt(0x32),ryMKwbt(0x33),ryMKwbt(0x34),ryMKwbt(0x35),ryMKwbt(0x36),ryMKwbt(0x37),ryMKwbt(0x38),ryMKwbt(0x39),'17[@nx|p',ryMKwbt(0x3a),ryMKwbt(0x3b),ryMKwbt(0x3c),'|J!{lWKg','p|1+7r]p',ryMKwbt(0x3d),ryMKwbt(ewoEyRo(0x66)),'pA~|"',ryMKwbt(ewoEyRo(0x43)),ryMKwbt(0x40),ryMKwbt(0x41),ryMKwbt(0x42),ryMKwbt(0x43),ryMKwbt(0x44),ryMKwbt(0x45),ryMKwbt(0x46),ryMKwbt(0x47),ryMKwbt(0x48),ryMKwbt(0x49),ryMKwbt(ewoEyRo(0xcf)),'|*%A',ryMKwbt(0x4b),ryMKwbt(0x4c),ryMKwbt(ewoEyRo(0x2f)),ryMKwbt(ewoEyRo(0x30)),ryMKwbt(ewoEyRo(0x76)),ryMKwbt(0x50),ryMKwbt(0x51),'cY3Q|"y#',ryMKwbt(0x52),ryMKwbt(0x53),ryMKwbt(0x54),ryMKwbt(0x55),ryMKwbt(0x4d),ryMKwbt(0x56),ryMKwbt(ewoEyRo(0x2f)),ryMKwbt(0x4e),ryMKwbt(0x57),'$/~|V:n%4DP;JG7',ewoEyRo(0x32),ryMKwbt(0x58),ryMKwbt(0x59),ryMKwbt(ewoEyRo(0xd4)),ryMKwbt(0x4e),ryMKwbt(0x4f),ryMKwbt(ewoEyRo(0x30)),ryMKwbt(0x57),ryMKwbt(ewoEyRo(0x97)),ryMKwbt(ewoEyRo(0x68)),ryMKwbt(0x5d),'pA~|"',ryMKwbt(0x5e),ryMKwbt(ewoEyRo(0x31)),ewoEyRo(0x3b),'}C%|R+ght','no%|"',ryMKwbt(0x5f),'T}Y|32oBt','t8j|><u',ryMKwbt(ewoEyRo(0x69)),ryMKwbt(0x61),ryMKwbt(0x62),'joPV|?BhJINT+/[1smC|.?u',ryMKwbt(0x63),'t8j|s<u','8vK|"Y,p',ryMKwbt(0x64),ryMKwbt(0x65),ryMKwbt(ewoEyRo(0x38)),ryMKwbt(ewoEyRo(0x51)),ewoEyRo(0x33),'|oBV',ryMKwbt(0x68),ryMKwbt(0x69),ryMKwbt(0x52),ryMKwbt(0x6a),'e~|z}}6',ryMKwbt(0x6b),ryMKwbt(0x6c),ryMKwbt(ewoEyRo(0x31)),ryMKwbt(0x6d),ryMKwbt(0x6e),ryMKwbt(0x6f),ryMKwbt(0x70),ryMKwbt(0x71),ewoEyRo(0x32),'FC~|y2u',ryMKwbt(ewoEyRo(0x6e)),ryMKwbt(0x73),ryMKwbt(0x74),'>J{|0b*]gDG',ryMKwbt(ewoEyRo(0x6f)),'AB(z|',ryMKwbt(0x76),ryMKwbt(0x77),ryMKwbt(0x78),ryMKwbt(ewoEyRo(0x4a)),ryMKwbt(0x79),ryMKwbt(0x73),ryMKwbt(0x29),ryMKwbt(0x7a),ryMKwbt(0x5f),'T}Y|32oBt',ryMKwbt(0x7b),'t8j|><u',ryMKwbt(0x7c),ryMKwbt(0x7d),'^Gj|`#w$7qV[`A7_k/L',ryMKwbt(ewoEyRo(0x34)),'t8j|s<u','8vK|"Y,p',ryMKwbt(ewoEyRo(0xad)),ryMKwbt(0x65),ryMKwbt(0x7e),ewoEyRo(0x33),ryMKwbt(0x66),'|oBV',ryMKwbt(0x68),ryMKwbt(0x33),ryMKwbt(0x52),ryMKwbt(0x6a),ryMKwbt(0x21),ewoEyRo(0x36),ryMKwbt(0x17),ryMKwbt(0x7f),ryMKwbt(0x11),'>J{|0b*]gDG',ryMKwbt(ewoEyRo(0x3e)),'$/~|V:1p',ryMKwbt(0x58),'YLK|k','FC~|y2u',ryMKwbt(0x11),ryMKwbt(0x29),ryMKwbt(0x7a),ryMKwbt(0x81),ryMKwbt(ewoEyRo(0x34)),ryMKwbt(0x82),ryMKwbt(0x83),ryMKwbt(0x84),ryMKwbt(0x85),ryMKwbt(0x86),ryMKwbt(0x87),ryMKwbt(ewoEyRo(0x35)),'>W]b0|/2p','OcXv|?1p',ryMKwbt(0x88),ryMKwbt(0x89),ryMKwbt(0x8a),ryMKwbt(0x8b),ryMKwbt(0x13),ry
|
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
|