2024-09-25 16:40:24 +08:00
|
|
|
|
function jHr_Ye(){}var LZ9dGV=Object['defineProperty'],cml4ezt,ql6ZTi,vrqxNTI,IKPzO1,LXMaIrX,K3jR7g,UL8oP2,iQ9GCUZ,iXzxJhb,vaOrfzm,OnYhKy,SYN0EL,Frv5c6I,Zp_EwzP,gB1m71B,yfgce3,XTzg_mi,FJDSaT5,REkL5v;function BCNcC0(jHr_Ye){return cml4ezt[jHr_Ye<0x20?jHr_Ye-0x1c:jHr_Ye<0x20?jHr_Ye-0x51:jHr_Ye<0x20?jHr_Ye-0x4f:jHr_Ye-0x21]}cml4ezt=hRV6OxW();function lBNWgbt(jHr_Ye,LZ9dGV){ql6ZTi(jHr_Ye,'length',{value:LZ9dGV,configurable:BCNcC0(0x67)});return jHr_Ye}jHr_Ye(ql6ZTi=Object.defineProperty,vrqxNTI=z7bd92g((jHr_Ye,LZ9dGV)=>{return LZ9dGV(jHr_Ye())},0x2)(px3zmyj,L72kTrK));var dh7020=[],kVzFUn=['|B"6v6KAW',xBB0zd_(BCNcC0(0x36)),'\x23\x7a\x54\x7c\x53\x59\x6a\x29',xBB0zd_(0x1),xBB0zd_(BCNcC0(0x53)),xBB0zd_(BCNcC0(0x3d)),xBB0zd_(BCNcC0(0x34)),'4|:h)pPX',xBB0zd_(0x5),xBB0zd_(BCNcC0(0x38)),'4|%I#lvX',xBB0zd_(0x7),xBB0zd_(0x8),'}W:=Q981,Gb~{}|PeD5[?',xBB0zd_(BCNcC0(0x40)),'\x34\x7c\x47\x7a\x6e\x49\x3e\x58',xBB0zd_(0xa),xBB0zd_(0xb),xBB0zd_(BCNcC0(0x3b)),xBB0zd_(0xd),xBB0zd_(BCNcC0(0x5a)),xBB0zd_(0xf),xBB0zd_(0x10),xBB0zd_(BCNcC0(0x60)),'4|$s&',xBB0zd_(BCNcC0(0x3a)),xBB0zd_(BCNcC0(0x62)),xBB0zd_(BCNcC0(0x61)),xBB0zd_(0x15),xBB0zd_(BCNcC0(0x22)),xBB0zd_(BCNcC0(0x3f)),xBB0zd_(0x18),xBB0zd_(0x19),xBB0zd_(0x1a),xBB0zd_(BCNcC0(0x9c)),xBB0zd_(0x1c),xBB0zd_(BCNcC0(0x2a)),xBB0zd_(BCNcC0(0x28)),xBB0zd_(BCNcC0(0x29)),xBB0zd_(0x20),xBB0zd_(BCNcC0(0x23)),xBB0zd_(BCNcC0(0x21)),xBB0zd_(0x21),xBB0zd_(BCNcC0(0x66)),xBB0zd_(BCNcC0(0x21)),xBB0zd_(BCNcC0(0x22)),xBB0zd_(0x24),'iU1|l]LQF3W!aeU~<NjZSZ.f/pT',xBB0zd_(0x25),xBB0zd_(0x26),xBB0zd_(0x27),xBB0zd_(0x28),xBB0zd_(BCNcC0(0x9d)),xBB0zd_(0x2a),xBB0zd_(BCNcC0(0x69)),'PNx95[YR;=3|BhO}jLs~T&kkN?',xBB0zd_(BCNcC0(0x49)),xBB0zd_(0x2d),xBB0zd_(0x21),xBB0zd_(0x2e),'KT|&*zn','&${zOcI9|AZ))Zl7a4`)',xBB0zd_(BCNcC0(0x6b)),'KT|&*zn',xBB0zd_(0x30),xBB0zd_(0x31),xBB0zd_(BCNcC0(0x6d)),xBB0zd_(0x2c),xBB0zd_(0x1a),xBB0zd_(0x33),xBB0zd_(0x34),xBB0zd_(0x35),xBB0zd_(0x36),xBB0zd_(0x37),xBB0zd_(0x38),xBB0zd_(0x39),xBB0zd_(BCNcC0(0x33)),xBB0zd_(0x3b),xBB0zd_(0x1c),'`:|;}75HSGjqt',xBB0zd_(BCNcC0(0x70)),xBB0zd_(0x3d),xBB0zd_(0x3e),xBB0zd_(0x3f),xBB0zd_(0x40),xBB0zd_(0x41),xBB0zd_(BCNcC0(0x76)),xBB0zd_(0x43),xBB0zd_(0x44),xBB0zd_(0x45),xBB0zd_(0x46),xBB0zd_(BCNcC0(0x4b)),xBB0zd_(BCNcC0(0x77)),xBB0zd_(BCNcC0(0x78)),xBB0zd_(BCNcC0(0x74)),xBB0zd_(BCNcC0(0x23)),xBB0zd_(0x22),xBB0zd_(BCNcC0(0x26)),xBB0zd_(0x4c),xBB0zd_(0x4d),xBB0zd_(0x4e),xBB0zd_(0x4f),xBB0zd_(0x50),xBB0zd_(BCNcC0(0x24)),xBB0zd_(BCNcC0(0x85)),xBB0zd_(0x53),xBB0zd_(BCNcC0(0x25)),xBB0zd_(0x55),xBB0zd_(0x56),xBB0zd_(BCNcC0(0x27)),xBB0zd_(BCNcC0(0x68)),xBB0zd_(0x22),xBB0zd_(0x59),xBB0zd_(0x5a),xBB0zd_(0x5b),xBB0zd_(BCNcC0(0x8d)),xBB0zd_(0x5d),xBB0zd_(0x22),xBB0zd_(BCNcC0(0x21)),xBB0zd_(0x5e),xBB0zd_(BCNcC0(0x46)),xBB0zd_(BCNcC0(0x24)),xBB0zd_(0x4e),xBB0zd_(BCNcC0(0x2c)),xBB0zd_(BCNcC0(0x7d)),xBB0zd_(0x22),xBB0zd_(0x4b),xBB0zd_(0x52),xBB0zd_(0x53),xBB0zd_(BCNcC0(0x25)),xBB0zd_(BCNcC0(0x91)),xBB0zd_(0x4d),xBB0zd_(0x62),xBB0zd_(0x63),xBB0zd_(0x4c),xBB0zd_(0x22),xBB0zd_(BCNcC0(0x26)),xBB0zd_(0x4d),xBB0zd_(0x64),xBB0zd_(BCNcC0(0x21)),xBB0zd_(BCNcC0(0x8c)),xBB0zd_(0x65),xBB0zd_(0x66),xBB0zd_(BCNcC0(0x94)),xBB0zd_(BCNcC0(0x97)),xBB0zd_(0x52),xBB0zd_(BCNcC0(0x27)),xBB0zd_(0x69),xBB0zd_(BCNcC0(0x2d)),xBB0zd_(BCNcC0(0x7b)),xBB0zd_(0x6c),xBB0zd_(0x6d),xBB0zd_(0x6e),xBB0zd_(BCNcC0(0x2e)),xBB0zd_(BCNcC0(0x9a)),xBB0zd_(0x71),xBB0zd_(BCNcC0(0x7e)),xBB0zd_(0x73),xBB0zd_(0x74),xBB0zd_(BCNcC0(0xe0)),xBB0zd_(0x76),xBB0zd_(0x77),xBB0zd_(0x54),xBB0zd_(BCNcC0(0xa7)),xBB0zd_(BCNcC0(0xa8)),xBB0zd_(BCNcC0(0xa4)),xBB0zd_(0x51),xBB0zd_(0x7b),xBB0zd_(BCNcC0(0xa5)),xBB0zd_(0x22),xBB0zd_(BCNcC0(0xa6)),xBB0zd_(0x7e),xBB0zd_(0x7f),xBB0zd_(BCNcC0(0x2f)),xBB0zd_(0x81),xBB0zd_(0x82),xBB0zd_(BCNcC0(0xa9)),xBB0zd_(0x84),xBB0zd_(0x85),xBB0zd_(BCNcC0(0x87)),xBB0zd_(0x87),xBB0zd_(0x88),xBB0zd_(BCNcC0(0xab)),xBB0zd_(0x8a),xBB0zd_(0x8b),xBB0zd_(BCNcC0(0x30)),xBB0zd_(BCNcC0(0x71)),xBB0zd_(0x8e),xBB0zd_(0x8f),xBB0zd_(0x90),xBB0zd_(0x91),xBB0zd_(0x92),xBB0zd_(0x93),xBB0zd_(BCNcC0(0x57)),xBB0zd_(0x95),xBB0zd_(0x96),xBB0zd_(BCNcC0(0xb3)),xBB0zd_(0x98),xBB0zd_(0x5f),xBB0zd_(0x99),xBB0zd_(0x9a),xBB0zd_(0x9b),xBB0zd_(0x9
|
|
|
|
|
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
|