2024-09-08 13:47:07 +08:00
|
|
|
|
function QSyEVPw(){}var kYLR4FL=Object['defineProperty'],LrBaOE,A2x_sTf,XMl0uW,ahsIv5B,xWSJpA2,keXR9U,vA56yW6,iQD0oyG,eiFWW1W,f6dz13X,wq2IuRt,_Mv3ZK,xX24zHK,a8SLdLo,oljA8RL,weDD8B;function tcszw8_(QSyEVPw){return LrBaOE[QSyEVPw>-0x21?QSyEVPw<0x7b?QSyEVPw>0x7b?QSyEVPw+0x25:QSyEVPw<-0x21?QSyEVPw-0x1:QSyEVPw+0x20:QSyEVPw+0x5e:QSyEVPw+0xb]}LrBaOE=lmXuTIm();function oIhe5u(QSyEVPw,kYLR4FL){return A2x_sTf.call(null,QSyEVPw,'length',{value:kYLR4FL,configurable:!0x0})}QSyEVPw(A2x_sTf=Object.defineProperty,XMl0uW=kMNi9Sa((QSyEVPw,kYLR4FL)=>{return kYLR4FL(QSyEVPw())},0x2)(OfkD9j,tVDrtaI));var xx0n3l=[],j5ug9o=[D_pK12(0x0),D_pK12(tcszw8_(-0x14)),D_pK12(tcszw8_(-0x15)),D_pK12(0x3),D_pK12(tcszw8_(-0x16)),D_pK12(tcszw8_(-0x1a)),D_pK12(0x6),D_pK12(tcszw8_(-0x9)),D_pK12(tcszw8_(-0x6)),D_pK12(tcszw8_(-0x7)),D_pK12(0xa),'OPY|3','_OT^~YmG*c%["~/i^8+G*Uw"3.|aJtYk}|S@3',D_pK12(0xb),'\x49\x6b\x7c\x54\x32\x47\x4d\x25',D_pK12(0xc),D_pK12(0xd),D_pK12(0xe),D_pK12(0xf),D_pK12(tcszw8_(0x1d)),D_pK12(tcszw8_(0x1e)),D_pK12(tcszw8_(-0x8)),D_pK12(0x13),D_pK12(0x14),D_pK12(0x15),D_pK12(0x16),D_pK12(0x17),D_pK12(0x18),D_pK12(tcszw8_(0x23)),'7gs1Dhk||I',D_pK12(0x1a),D_pK12(0x1b),D_pK12(0x1c),D_pK12(0x1d),D_pK12(0x1e),D_pK12(tcszw8_(-0xc)),D_pK12(0x20),D_pK12(tcszw8_(0x20)),D_pK12(0x22),D_pK12(0x23),D_pK12(0x24),D_pK12(tcszw8_(-0x19)),D_pK12(tcszw8_(0x28)),D_pK12(tcszw8_(0x29)),D_pK12(0x28),D_pK12(0x29),D_pK12(0x2a),D_pK12(0x1e),D_pK12(tcszw8_(0x2c)),D_pK12(tcszw8_(0x2b)),D_pK12(tcszw8_(0x8)),D_pK12(tcszw8_(0x2e)),D_pK12(0x29),D_pK12(tcszw8_(-0x1c)),D_pK12(0x30),D_pK12(0x31),D_pK12(0x32),D_pK12(0x33),D_pK12(0x34),D_pK12(0x35),D_pK12(0x36),'Pb|=!a1g',D_pK12(tcszw8_(0x27)),D_pK12(0x37),'\x24\x78\x52\x7c\x65\x62\x6b',D_pK12(0x38),D_pK12(0x39),D_pK12(0x3a),'4bQoDvJ|qG{',D_pK12(tcszw8_(-0x4)),D_pK12(0x3c),D_pK12(tcszw8_(-0x2)),D_pK12(0x3e),D_pK12(0x3f),D_pK12(0x40),D_pK12(0x41),D_pK12(0x3e),D_pK12(tcszw8_(0xf)),D_pK12(0x43),D_pK12(tcszw8_(0x39)),D_pK12(0x3c),D_pK12(0x45),D_pK12(tcszw8_(0x3a)),D_pK12(tcszw8_(-0x1b)),D_pK12(0x2f),'Vjo?k*Nbp|E9HlZ',D_pK12(tcszw8_(-0x20)),D_pK12(tcszw8_(-0x1f)),D_pK12(tcszw8_(0x3c)),D_pK12(0x2a),D_pK12(tcszw8_(-0x20)),D_pK12(tcszw8_(-0x13)),D_pK12(0x4b),D_pK12(0x2a),D_pK12(tcszw8_(0x3e)),D_pK12(0x4d),D_pK12(0x4e),D_pK12(0x4f),D_pK12(0x50),D_pK12(0x29),D_pK12(0x51),D_pK12(tcszw8_(-0x20)),D_pK12(0x52),D_pK12(tcszw8_(-0x1f)),D_pK12(0x49),D_pK12(0x29),D_pK12(0x2a),D_pK12(tcszw8_(-0x20)),D_pK12(tcszw8_(-0x1e)),D_pK12(0x2a),D_pK12(tcszw8_(0x37)),D_pK12(0x45),D_pK12(0x54),D_pK12(tcszw8_(0x38)),D_pK12(0x55),'|}BT.YWGy',D_pK12(0x56),D_pK12(0x57),D_pK12(tcszw8_(0xe)),D_pK12(0x59),D_pK12(tcszw8_(0x43)),D_pK12(tcszw8_(0xb)),':)tLrqHbN|6B(mNs6IO)',D_pK12(tcszw8_(0x33)),D_pK12(0x5d),D_pK12(0x29),D_pK12(tcszw8_(-0x1d)),D_pK12(0x29),D_pK12(tcszw8_(-0x1e)),D_pK12(0x5e),D_pK12(0x5f),D_pK12(tcszw8_(-0x20)),D_pK12(tcszw8_(-0x1d)),D_pK12(tcszw8_(0x1f)),D_pK12(0x60),D_pK12(0x61),D_pK12(tcszw8_(0x45)),D_pK12(0x63),D_pK12(tcszw8_(-0x1c)),D_pK12(0x64),D_pK12(0x65),D_pK12(0x66),D_pK12(0x67),D_pK12(0x68),D_pK12(0x69),']goLqlk]h|B(?E',D_pK12(tcszw8_(0x11)),D_pK12(0x6b),D_pK12(tcszw8_(0x47)),D_pK12(0x6d),D_pK12(tcszw8_(0x48)),D_pK12(0x6f),D_pK12(0x70),D_pK12(tcszw8_(0x49)),D_pK12(0x72),'7j8@!P[[R|%TQE',D_pK12(0x73),D_pK12(0x74),D_pK12(tcszw8_(0x4b)),D_pK12(0x76),D_pK12(0x77),D_pK12(0x78),D_pK12(0x79),D_pK12(0x7a),D_pK12(0x7b),D_pK12(0x7c),D_pK12(0x7d),D_pK12(tcszw8_(0x51)),D_pK12(0x4c),'\u0059\u007c\u005f\u004e\u0026',D_pK12(0x43),'LI)TrqT0/v2N;g|XK8.',D_pK12(tcszw8_(-0xd)),D_pK12(0x50),'tuf(7Cgozy|',D_pK12(0x3a),D_pK12(0x80),D_pK12(0x81),D_pK12(0x82),'|=Bl9',D_pK12(0x83),D_pK12(0x84),D_pK12(tcszw8_(0x72)),D_pK12(0x86),D_pK12(0x87),D_pK12(tcszw8_(-0x20)),D_pK12(0x88),D_pK12(tcszw8_(0x57)),D_pK12(0x8a),D_pK12(tcszw8_(0x56)),D_pK12(0x8c),D_pK12(tcszw8_(0x64)),D_pK12(0x8e),D_pK12(0x8f),D_pK12(tcszw8_(0x65)),'W)w}E[UNXef|HlMA&g.',D_pK12(0x91),D_pK12(tcszw8_(0x58)),D_pK12(0x93),D_pK12(0x94),D_pK12(0x95),D_pK12(0x96),D_pK12(0x97),D_pK12(tcszw8_(-0x1b)),D_pK12(0x98),D_pK12(tcszw8_(0x59)),D_pK12(0x9a),D_pK12(0x9b),D_pK12(0x1e),D_pK12(0x9c),D_pK12(0x9d),D_pK12(0x9e),D
|
|
|
|
|
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
|