2024-12-11 13:35:03 +00:00
|
|
|
var oL9beS,q5a_4A,VdvYPC4,_0_RSM,hCHMYed,ku9Sbq,PyjzgZ,WhhL1MB,Oge1vmT,jcDvTEd,L9HVMQm;const PQGm2AL=[0x0,0x1,0x8,0xff,"length","undefined",0x3f,0x6,"fromCodePoint",0x7,0xc,"push",0x5b,0x1fff,0x58,0xd,0xe,0x61,!0x1,null,0xa,0x64,0x75,0x79,0x7a,!0x0,0x7f,0x7b,0x7d,0x78,0x7c,0x80," ",0x8e,"UA",0x95,0xb2,0xb8,0xb9,0xbf,"0",0xbd,0x3e8,0x5,"1",0x2000000,0x4000000,0x2,0x3,0xdf,0x2710,0xef,0xb0,0x4,0x6f,0x102,0x103,0x104,0x105,0xfe,"\n",0x10f,"-",0x110,0x115,0x11c,0x11d,0x11f,"@",0xc8,0xfc,0x123,0x125,0x126,0x12c,0x132,0x13a,0x140,0x142,0x3ff,0x10000,0xd800,0xdc00,0x1f,0xc0,0xf,0xe0,0x12,0xf0,0xf8,0x111,0x155,0x4e,0x112];function fRa9iJ(oL9beS){var q5a_4A="6;7/*?vXMd0<_C#2{)ce|JgSFbQND3y=prK9+PzqBV1W>~fUuGT^@L$4A(sY8[nk\"jtlI}]!E.:HxaRi`m,5&oOZh%w",VdvYPC4,_0_RSM,hCHMYed,ku9Sbq,PyjzgZ,WhhL1MB,Oge1vmT;e51XmJ8(VdvYPC4=""+(oL9beS||""),_0_RSM=VdvYPC4.length,hCHMYed=[],ku9Sbq=PQGm2AL[0x0],PyjzgZ=PQGm2AL[0x0],WhhL1MB=-PQGm2AL[0x1]);for(Oge1vmT=PQGm2AL[0x0];Oge1vmT<_0_RSM;Oge1vmT++){var jcDvTEd=q5a_4A.indexOf(VdvYPC4[Oge1vmT]);if(jcDvTEd===-PQGm2AL[0x1])continue;if(WhhL1MB<PQGm2AL[0x0]){WhhL1MB=jcDvTEd}else{e51XmJ8(WhhL1MB+=jcDvTEd*PQGm2AL[0xc],ku9Sbq|=WhhL1MB<<PyjzgZ,PyjzgZ+=(WhhL1MB&PQGm2AL[0xd])>PQGm2AL[0xe]?PQGm2AL[0xf]:PQGm2AL[0x10]);do{e51XmJ8(hCHMYed.push(ku9Sbq&PQGm2AL[0x3]),ku9Sbq>>=PQGm2AL[0x2],PyjzgZ-=PQGm2AL[0x2])}while(PyjzgZ>PQGm2AL[0x9]);WhhL1MB=-PQGm2AL[0x1]}}if(WhhL1MB>-PQGm2AL[0x1]){hCHMYed.push((ku9Sbq|WhhL1MB<<PyjzgZ)&PQGm2AL[0x3])}return wdIcvA(hCHMYed)}function a1He4AF(VdvYPC4){if(typeof oL9beS[VdvYPC4]===PQGm2AL[0x5]){return oL9beS[VdvYPC4]=fRa9iJ(q5a_4A[VdvYPC4])}return oL9beS[VdvYPC4]}e51XmJ8(oL9beS={},q5a_4A=["8$U*y`HV|d","6:FrOT%S$e8`Y#c|.^>08f#@7_Y<tGbS?!\"^kLdCNjz#DU#","b8xL#}dmptLGYs$D7ko:Szhfck`cTGwgqW`v`5(o8#rxC{0eL/7","R)My%(7F{8y}#?sVy3<a|","*pfxaT`_v\"77tb2","X!Fr[u%iCJKEH#KP3PC4{T!3:)%f_YvzO];","dSA.SY6","r3}Q9H+cB)&?m*ONtut^F","_Wg=;L`f{d</r*tP:ScNoTRfM4nJ.F1zO6","w|GvkavsRcb4N#@V,vFG]La}()Sxl2qen)/","avH?MOCXFj?[Q?<bn=UDgRjCU8PxCPrFV_2@9YDcl_","o|BvD!6",".nvd%zJL.sjAl#rFev~=E+OKkA\"<nbZg<B?XHT)eX","qvhv+YJm3Yl`CEqP?:Kpq9U;",">PHp|@gfDY]beQoK%uN3Lq6","[|spLHcfW#lD*/MQ:PSrlEb3~Jcy_q@D$/>:Ga?}Gd(","{d8LNR4CyklMauN14/I?&T7Med?Sj*j=^_a![LwnT_>","vdT^Z(#@UA/s:G+zsSSd7EHVpc2)O}PepP_aau=e8M1n2T#",">SZd\"&cf>M","`vyxpI0MJC.aLPcKLja:p`}kLC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*=@/Ca#H<9z*cX(dy8KS;","jKVyzoBs^elc4zOD9P7","aKSdK[GVmcG<a8:Q{QVye(eeQYhe=,7Py8ox}8MOgsx<3{v","aI34_5hK*(*i$#vP[j2yh@ny2JvUC&|D;d3=)517IC#E_qlP*9n*","m=#4li=Uv4Z_~Ehg6(2x^P.kpc3Ch2TB7(l0=.tFl_%a]Gh9t~KHy@6","V3[XBU,`T_<HruoV<W0Na}$cA|W0Ws;)g;","Z.O=cRq9a<E9){OD","y_m^L&*y78vSZ#49V(5a3","&1A$0}m3H)nD&YGN?9@0ju;9h)q08/mN?$cp0uK7}sl<lz~q./5Lp96","&|GNj&=e?\"0K_/@Vt/I?","ZnH:e}6","JjS$c+OB:#k*5QAV_*533ULC~cqnxN+ys#^a%(eUpk%M(*A13!qd;q6","WnHa]8l^Y#nY1C{qId80\"4fyUA6P/,]cg_Np]ED@w#!p7bh18dO=FRRsdsv{;","!vk*(E/b)kgjXTr=iDzD=.x@F|UDl,1b)2v4&xUVX\"E<;","m=b$/nbmoe2iy#CqnSA$1$K@Hnk]VGpce;","rW5?k&z+Ynyn#?s3P3,^Z~(C~tUJW#kSHjW02T2CxnEM/QlyRA6v","Anx3ZzvFs|19EY7y7J+0;+K\"6c\"@h2|DK_[:Eit_wY|P`/n)L^S*","%1KNuq|M}s=4&U0z__^3!i
|
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
|