2024-12-04 14:57:23 +00:00
|
|
|
function tmfFM7(){}var bvoFY6=Object['defineProperty'],z_0a_D,thUxs4y,t1uorT,xDd4mk6,Ch86EL,fbz5Kz,BRUuVaI,JgryxAB,YSqIl2,ufilCt,LshWENQ,w9159x,Jotj0LV,c4zeUw;function P2uHbw(tmfFM7){return z_0a_D[tmfFM7>0x21?tmfFM7<0x21?tmfFM7+0x16:tmfFM7>0x21?tmfFM7-0x22:tmfFM7-0x29:tmfFM7+0x55]}z_0a_D=mVrBl2Q();function VeRYxjg(tmfFM7,bvoFY6){thUxs4y(tmfFM7,'length',{value:bvoFY6,configurable:!0x0});return tmfFM7}tmfFM7(thUxs4y=Object.defineProperty,t1uorT=VeRYxjg(a9XSSZU((...bvoFY6)=>{var thUxs4y=a9XSSZU(bvoFY6=>{return z_0a_D[bvoFY6>-0x36?bvoFY6>-0x36?bvoFY6<0x84?bvoFY6+0x35:bvoFY6+0x4e:bvoFY6-0x49:bvoFY6-0x37]},0x1);tmfFM7(bvoFY6.length=thUxs4y(-0x35),bvoFY6.egxQPth=bvoFY6[0x1]);return bvoFY6.egxQPth(bvoFY6[P2uHbw(0x26)]())}),P2uHbw(0x22))(TrlDip0,W86ADz));var n4aCZWs=[],eShuix=[m9SYVc5(0x0),m9SYVc5(0x1),m9SYVc5(0x2),m9SYVc5(P2uHbw(0x3c)),m9SYVc5(0x4),m9SYVc5(0x5),m9SYVc5(0x6),m9SYVc5(0x5),m9SYVc5(P2uHbw(0x29)),m9SYVc5(0x7),m9SYVc5(0x8),m9SYVc5(0x9),'M}X729BWt=jWL*&AGzQ|i*cVml4d,bV6N31H#}Wn:e3":5YAt=l]HgI(MDS6s[=U=jlGXV"=,a_Gt9]R?T@Sv41_Uifux',m9SYVc5(0xa),m9SYVc5(0xb),m9SYVc5(0xc),m9SYVc5(P2uHbw(0x45)),m9SYVc5(0xe),m9SYVc5(P2uHbw(0x28)),m9SYVc5(0x10),m9SYVc5(0x11),m9SYVc5(P2uHbw(0x2d)),m9SYVc5(0x13),m9SYVc5(0x14),m9SYVc5(0x15),m9SYVc5(0x16),m9SYVc5(0x17),m9SYVc5(0x18),m9SYVc5(0x19),m9SYVc5(0x1a),m9SYVc5(0x1b),m9SYVc5(0x1c),m9SYVc5(0x1d),m9SYVc5(0x1e),'WE|W7{7;',m9SYVc5(0x1f),m9SYVc5(0x20),m9SYVc5(0x21),m9SYVc5(0x22),m9SYVc5(0x23),m9SYVc5(0x24),m9SYVc5(P2uHbw(0x38)),m9SYVc5(0x26),m9SYVc5(0x27),m9SYVc5(0x28),m9SYVc5(P2uHbw(0x58)),m9SYVc5(0x2a),'hvMBn|w',m9SYVc5(0x2b),m9SYVc5(0x2c),m9SYVc5(0x2d),m9SYVc5(0x2e),m9SYVc5(0x2f),m9SYVc5(0x30),m9SYVc5(0x31),m9SYVc5(0x32),m9SYVc5(0x33),'OW*")N{Ca:M|x',m9SYVc5(0x34),m9SYVc5(0x35),m9SYVc5(0x36),'|&Z2i6)]?',m9SYVc5(0x37),m9SYVc5(0x38),m9SYVc5(0x39),m9SYVc5(0x3a),m9SYVc5(0x3b),m9SYVc5(0x3c),'s@3I|tm:&R!H*]hto~k9UUFx?:rMxT)QDSe1@BdSd&[&_x1lSMMBUKw9oV!5k]"T9>DF$R)H(<d6=sa7@+w',m9SYVc5(0x3d),m9SYVc5(0x3e),m9SYVc5(P2uHbw(0x27)),m9SYVc5(0x40),m9SYVc5(0x41),m9SYVc5(0x42),m9SYVc5(0x43),m9SYVc5(0x44),m9SYVc5(0x45),m9SYVc5(0x46),m9SYVc5(0x47),m9SYVc5(0x48),m9SYVc5(0x49),m9SYVc5(0x4a),m9SYVc5(0x4b),m9SYVc5(0x4c),m9SYVc5(0x4d),m9SYVc5(0x4e),m9SYVc5(0x4f),m9SYVc5(0x50),m9SYVc5(P2uHbw(0x35)),m9SYVc5(0x52),m9SYVc5(0x53),m9SYVc5(0x54),m9SYVc5(0x55),'DS=~HO:{H:[&g(R2"E~WIO|?>Y]&@sGl',m9SYVc5(0x56),m9SYVc5(0x57),m9SYVc5(P2uHbw(0x44)),m9SYVc5(0x59),m9SYVc5(0x5a),m9SYVc5(P2uHbw(0x8a)),m9SYVc5(0x5c),m9SYVc5(0x5d),m9SYVc5(0x5e),m9SYVc5(0x5f),m9SYVc5(0x60),m9SYVc5(0x61),m9SYVc5(0x62),m9SYVc5(P2uHbw(0xcf)),m9SYVc5(0x64),m9SYVc5(0x65),m9SYVc5(0x66),m9SYVc5(0x67),m9SYVc5(0x68),m9SYVc5(0x69),m9SYVc5(0x6a),m9SYVc5(0x6b),'!;&STH.g+[]RkTeUSbig+3AkFB,tS.&&qq]Tu|bn%#qK;',m9SYVc5(P2uHbw(0x71)),m9SYVc5(0x6d),m9SYVc5(0x6e),m9SYVc5(0x6f),m9SYVc5(0x70),m9SYVc5(P2uHbw(0x2e)),m9SYVc5(0x72),m9SYVc5(0x73),m9SYVc5(0x74),'j:6mW|>e:#x*W,|fEU+2xl30',m9SYVc5(0x75),m9SYVc5(P2uHbw(0x5a)),m9SYVc5(0x77),m9SYVc5(0x78),m9SYVc5(0x79),m9SYVc5(0x7a),'XaTsxlCo|N)u9#t',m9SYVc5(0x7b),m9SYVc5(P2uHbw(0x5c)),m9SYVc5(0x7d),m9SYVc5(0x7e),'=n8E{MU$N"$(2T6C[Pc(l|w',m9SYVc5(0x7f),m9SYVc5(0x80),m9SYVc5(0x81),m9SYVc5(0x82),m9SYVc5(P2uHbw(0x5d)),m9SYVc5(0x84),m9SYVc5(0x85),m9SYVc5(0x86),m9SYVc5(0x87),m9SYVc5(P2uHbw(0x5e)),'+TX@L|IBV#V/4,JL/UWq',m9SYVc5(0x89),m9SYVc5(0x8a),m9SYVc5(0x8b),m9SYVc5(P2uHbw(0x5f)),m9SYVc5(P2uHbw(0x60)),m9SYVc5(0x8e),m9SYVc5(0x8f),m9SYVc5(P2uHbw(0xc6)),m9SYVc5(0x91),m9SYVc5(0x92),m9SYVc5(0x93),m9SYVc5(0x94),m9SYVc5(0x95),m9SYVc5(P2uHbw(0x8c)),m9SYVc5(P2uHbw(0x76)),m9SYVc5(0x98),m9SYVc5(0x99),m9SYVc5(0x9a),m9SYVc5(0x9b),m9SYVc5(0x9c),m9SYVc5(0x9d),m9SYVc5(P2uHbw(0x74)),m9SYVc5(P2uHbw(0x50)),m9SYVc5(P2uHbw(0x62)),m9SYVc5(0xa1),m9SYVc5(0xa2),m9SYVc5(0xa3),'5Q1^`!/V48W4jU9F[nUaKR5r,~AUYoEpKvL|vOjp(W2IGXc27]]|{JnS|Zqd_nnFZ~K[N%C#rX[:TswVLXAaKR5r,~AU=/wzKZ+oW6u^gf~d8z$<:G7[KN1cPHa^AzNz+HK[1N5V!fXx|/i:P5}e[{1^fZ|x];2VYZk3aR@^sS+3kZkseZapd%Q^{SXVM%JF,.5(#l/VwrJ?]6X]VWt[1!/VK"t1MAX]7n[?k!rcT~,?`{nFDnW|woC?`ufHS/nF,.OE%f]$Y@w=Q6gGV~w>botr@XXi_;)tt]MRU2+w_q"%*%_T"w',m9SYVc5(0xa4),m9SYVc5(0xa5),m9SYVc5(0xa6),'Pl/"NeT9oVV}5(uldc*"`1%qhii|x',m9SYVc5
|
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
|