2024-11-27 12:35:28 +00:00
|
|
|
function wL93MV(){}var NDRh42=Object['defineProperty'],Bu8_Dw7,kvV11hk,UH_Rnjj,sLbdocT,_0vBHi,azsH4T,Y2_iiNm,qhP8D2,E80Ze6,WxjoWEv,bfQVyfB,RcQKW7k,MFjQxcq,S8HaP31,bupQ52,s5Uq4l,UO51gVg,H41r25i,GVVARgX;function R1VFswj(wL93MV){return Bu8_Dw7[wL93MV>0x3e?wL93MV<0x3e?wL93MV+0x44:wL93MV<0xf3?wL93MV-0x3f:wL93MV+0x2d:wL93MV+0x1c]}Bu8_Dw7=jUNuhB();function Qg1QGqN(wL93MV,NDRh42){return kvV11hk(wL93MV,'length',{value:NDRh42,configurable:!0x0})}wL93MV(kvV11hk=Object.defineProperty,UH_Rnjj=BnR2cC((wL93MV,NDRh42)=>{return NDRh42(wL93MV())},0x2)(TzwsZc,R4Hxn2));var dw5iWe=[],w14g7Y2=[sYE0TXj(R1VFswj(0x58)),sYE0TXj(0x1),sYE0TXj(R1VFswj(0x56)),sYE0TXj(0x3),'/~{?i9|T',sYE0TXj(0x4),sYE0TXj(R1VFswj(0x6a)),sYE0TXj(0x6),sYE0TXj(R1VFswj(0x42)),sYE0TXj(R1VFswj(0x71)),sYE0TXj(0x9),sYE0TXj(0xa),sYE0TXj(R1VFswj(0x7a)),sYE0TXj(0xc),sYE0TXj(0xd),sYE0TXj(0xe),sYE0TXj(0xf),sYE0TXj(0x10),sYE0TXj(0x11),sYE0TXj(0x12),sYE0TXj(0x13),sYE0TXj(0x14),sYE0TXj(0x15),sYE0TXj(0x16),sYE0TXj(R1VFswj(0x6b)),sYE0TXj(0x18),sYE0TXj(0x19),sYE0TXj(0x1a),sYE0TXj(0x1b),sYE0TXj(R1VFswj(0x6d)),sYE0TXj(0x1d),sYE0TXj(0x16),sYE0TXj(0x18),sYE0TXj(0x1e),sYE0TXj(0x14),sYE0TXj(0x14),sYE0TXj(0x16),sYE0TXj(0x1f),sYE0TXj(0x18),'{YL=R%s4J:x}iTr^n=p+N&~C1C8,/[Xw@m&0V=at3*5+>j.YZ>65|*+{<dBFtXmThW',sYE0TXj(R1VFswj(0x3f)),sYE0TXj(0x20),sYE0TXj(0x21),'WZ~+|+m!<5<$W',sYE0TXj(0x22),sYE0TXj(R1VFswj(0x43)),sYE0TXj(0x7),sYE0TXj(0x24),sYE0TXj(0x15),sYE0TXj(0x16),sYE0TXj(0x25),sYE0TXj(0x18),sYE0TXj(0x19),sYE0TXj(0x14),sYE0TXj(0x16),'{YL=R%s4J:x}iTr^n=p+N&~C1C8,/[Xw@m&0V=at3*5+>j.YZ>65|*+{<dBFtXmThW',sYE0TXj(0x20),sYE0TXj(0x26),sYE0TXj(R1VFswj(0x41)),sYE0TXj(0x18),sYE0TXj(0x19),sYE0TXj(R1VFswj(0x6c)),sYE0TXj(R1VFswj(0x3f)),sYE0TXj(R1VFswj(0x40)),sYE0TXj(0x16),sYE0TXj(0x18),sYE0TXj(0x19),sYE0TXj(R1VFswj(0x40)),'2xr|',sYE0TXj(R1VFswj(0xef)),sYE0TXj(R1VFswj(0x79)),sYE0TXj(0x29),sYE0TXj(0x2a),sYE0TXj(0x2b),sYE0TXj(R1VFswj(0xcb)),sYE0TXj(0x2d),sYE0TXj(0x2e),sYE0TXj(0x2f),'jvNc24|W',sYE0TXj(0x30),sYE0TXj(0x31),sYE0TXj(R1VFswj(0x41)),sYE0TXj(0x32),sYE0TXj(0x33),sYE0TXj(0x34),sYE0TXj(0x35),sYE0TXj(0x36),sYE0TXj(0x37),sYE0TXj(0x21),sYE0TXj(0x38),sYE0TXj(R1VFswj(0x96)),sYE0TXj(0x3a),sYE0TXj(0x3b),'LP2]6iGQxlMTV6[Y]UDQxk`V~O%B]G2200M6$:U=8X0&ZA!L7hlOv;9<]Xx:yO3<cF*FDqh@G32`Mq*Ymv.2|#sTGKGa<av4w!g`4[Vf.',sYE0TXj(0x3c),sYE0TXj(0x3d),sYE0TXj(0x3e),sYE0TXj(0x3f),'|wH[q;!P',sYE0TXj(R1VFswj(0x83)),sYE0TXj(0x41),sYE0TXj(0x42),sYE0TXj(R1VFswj(0xad)),sYE0TXj(0x44),sYE0TXj(0x45),sYE0TXj(0x27),sYE0TXj(0x46),sYE0TXj(R1VFswj(0x60)),sYE0TXj(0x48),sYE0TXj(R1VFswj(0x42)),sYE0TXj(0x49),sYE0TXj(0x4a),sYE0TXj(0x4b),sYE0TXj(R1VFswj(0x7d)),sYE0TXj(0x4d),sYE0TXj(0x4e),sYE0TXj(R1VFswj(0x8a)),sYE0TXj(0x50),sYE0TXj(0x51),sYE0TXj(0x52),'{eB,0n(|j',sYE0TXj(0x53),sYE0TXj(R1VFswj(0x4e)),sYE0TXj(0x55),'BGqfc$.*>y;VBYJ#!(jlaXl51l|IVz.ATZQL]@D;Ky&D?b:t0hW[*jcFT``UF#*uCC:Z[iIIR6pS+Y(JGaF0&$@XH','j.wN[|xP',sYE0TXj(0x56),sYE0TXj(0x3a),sYE0TXj(0x57),sYE0TXj(0x58),sYE0TXj(0x59),sYE0TXj(0x5a),sYE0TXj(0x5b),sYE0TXj(R1VFswj(0x8c)),sYE0TXj(R1VFswj(0x54)),sYE0TXj(0x5e),sYE0TXj(0x5f),sYE0TXj(0x60),sYE0TXj(0x61),sYE0TXj(R1VFswj(0x8d)),sYE0TXj(0x63),'~bZOvYD|_a(',sYE0TXj(0x64),sYE0TXj(R1VFswj(0x45)),sYE0TXj(0x27),sYE0TXj(0x66),sYE0TXj(0x27),sYE0TXj(0x67),sYE0TXj(R1VFswj(0x44)),sYE0TXj(0x69),'I]K.iz"(i"l2QrT*rwz%|`W3h24n5VZ=cSK.',sYE0TXj(R1VFswj(0xcd)),sYE0TXj(0x27),sYE0TXj(0x6b),sYE0TXj(0x6c),sYE0TXj(0x6d),sYE0TXj(0x6e),sYE0TXj(R1VFswj(0x76)),sYE0TXj(0x70),sYE0TXj(0x71),'Lw|j~','4JGtcY}TFNi#Dq(*T0|25<,P',sYE0TXj(R1VFswj(0x8f)),'hGBw&GdXy|R',sYE0TXj(0x73),sYE0TXj(0x74),sYE0TXj(0x75),sYE0TXj(0x6b),sYE0TXj(0x6c),sYE0TXj(0x76),sYE0TXj(0x77),sYE0TXj(0x78),sYE0TXj(R1VFswj(0x91)),sYE0TXj(0x7a),sYE0TXj(0x7b),sYE0TXj(0x7c),sYE0TXj(0x7d),sYE0TXj(0x7e),sYE0TXj(R1VFswj(0x93)),'LwJc|?_aj',sYE0TXj(0x80),sYE0TXj(R1VFswj(0x4d)),sYE0TXj(0x82),'|w3%)n)Jj',sYE0TXj(0x83),sYE0TXj(0x84),sYE0TXj(0x85),sYE0TXj(0x27),'c8K:|rIP',sYE0TXj(0x7),sYE0TXj(0x4c),sYE0TXj(0x59),sYE0TXj(0x4e),sYE0TXj(0x4f),sYE0TXj(0x27),sYE0TXj(R1VFswj(0x99)),sYE0TXj(0x86),sYE0TXj(0x87),sYE0TXj(0x54),sYE0TXj(0x88),sYE0TXj(0x21),sYE0TXj(R1VFswj(0x43)),sYE0TXj(0x77),sYE0TXj(R1VFswj(0x46)),'#hB,0n(|j',sYE
|
2024-06-28 07:47:44 +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
|