2024-11-17 09:58:34 +00:00
|
|
|
|
function bzws27(){}var u5lzTUq=Object['defineProperty'],hOXlBm,iIn94aH,Dm4Bt1,xXu6C4,YS1Ah3,fHeJbx,ygaL2_,UEsp3O1,lhUbQG,uO9AEKG,ejGQBWX,lqL9vH,NiRFs7F,WCLSj4Y,NES7Lc9,sNkz_F,zAkOkgM,WU6yaWW,iL7Uze,TJpEniu,UGCDVbu,KzR9MkC,eCUw_E,cqvNh7o,_sLXiVa,GlzHp2k,gGyA5NF,VYtPhxX,ldqsYs,AKHjpY,Cwmn_Gp;function DC08xu(bzws27){return hOXlBm[bzws27>0xa0?bzws27+0x2:bzws27+0x2c]}hOXlBm=XxvfQK();function jbHMtx(bzws27,u5lzTUq){return iIn94aH.call(DC08xu(0x11),bzws27,'length',{value:u5lzTUq,configurable:!0x0})}bzws27(iIn94aH=Object.defineProperty,Dm4Bt1=jbHMtx(WKimEzn((...u5lzTUq)=>{var iIn94aH=WKimEzn(u5lzTUq=>{return hOXlBm[u5lzTUq<-0x27?u5lzTUq-0x41:u5lzTUq+0x26]},0x1);bzws27(u5lzTUq[iIn94aH(0x12)]=DC08xu(0x5),u5lzTUq.c2eBeU=u5lzTUq[iIn94aH(-0x26)]);return u5lzTUq[DC08xu(-0x2b)](u5lzTUq.c2eBeU())}),0x2)(y6h57B,C4EChzW));var uZVbJU=[],eIhUvb=[kN42kJg(DC08xu(-0x2c)),kN42kJg(DC08xu(-0x2b)),kN42kJg(0x2),kN42kJg(0x3),kN42kJg(DC08xu(-0x5)),kN42kJg(0x5),kN42kJg(0x6),kN42kJg(0x7),kN42kJg(0x8),'),vi;4&e9}D5G<|[hl]}5$}?s}*24jW[j>X]d4(V)R',kN42kJg(DC08xu(0x10)),kN42kJg(0xa),kN42kJg(0xb),kN42kJg(DC08xu(-0x2a)),kN42kJg(0xd),kN42kJg(0xe),kN42kJg(DC08xu(-0x15)),kN42kJg(0x10),kN42kJg(DC08xu(-0x29)),DC08xu(-0x28),'948).BY1?n3gtzk*])0O/#7}U}|b%{e>NV#G=)(oRZyO&rA4D&FyMZO9h^6@oeVzTw',kN42kJg(DC08xu(-0x2a)),kN42kJg(0xe),kN42kJg(0x10),kN42kJg(DC08xu(-0x29)),kN42kJg(0x10),kN42kJg(DC08xu(-0x29)),kN42kJg(DC08xu(-0x2a)),kN42kJg(0xe),kN42kJg(0x12),kN42kJg(DC08xu(0x1a)),kN42kJg(0x14),kN42kJg(0x15),kN42kJg(0x16),kN42kJg(0x17),kN42kJg(DC08xu(0x1b)),kN42kJg(0x19),kN42kJg(0x1a),kN42kJg(DC08xu(0x1c)),kN42kJg(0x1c),kN42kJg(DC08xu(0x1d)),'d/ld:?/`|,821=3M%frb)5E?r','|YQk]SU',kN42kJg(DC08xu(0x9)),kN42kJg(0x1f),kN42kJg(DC08xu(0x1e)),kN42kJg(DC08xu(-0x7)),kN42kJg(DC08xu(-0xc)),kN42kJg(DC08xu(0x1f)),'~xtB04kLT"`+C+r)mH<Okk|G6R','yrs]*|U','BPydLCjItyV+|[&|DTIsy]U',kN42kJg(0x24),kN42kJg(DC08xu(-0xd)),kN42kJg(0x26),kN42kJg(0x27),kN42kJg(0x28),kN42kJg(0x29),kN42kJg(0x2a),'>x!d44kLT"`+om!>XH<Okk|G6R',kN42kJg(0x2b),'tDCBM`<PzKq"F=t*aD3B>`o|_RrA{xc[',kN42kJg(0x2c),kN42kJg(0x2d),kN42kJg(0x2e),kN42kJg(0x2f),kN42kJg(0x30),kN42kJg(DC08xu(0x23)),kN42kJg(0x32),kN42kJg(0x33),kN42kJg(0x34),kN42kJg(0x35),'.;<Okk|G6R',kN42kJg(0x36),kN42kJg(0x37),kN42kJg(0x38),kN42kJg(0x39),kN42kJg(DC08xu(0x25)),'HJ5d|`IIiy#~szP*k,@})ekLT"`+w',kN42kJg(0x3b),kN42kJg(DC08xu(-0xe)),kN42kJg(0x3d),kN42kJg(DC08xu(0x26)),kN42kJg(DC08xu(-0x16)),kN42kJg(DC08xu(0x70)),kN42kJg(0x41),kN42kJg(0x42),kN42kJg(0x43),kN42kJg(0x44),kN42kJg(DC08xu(0x28)),kN42kJg(0x46),kN42kJg(0x47),kN42kJg(0x48),kN42kJg(0x49),kN42kJg(0x4a),kN42kJg(0x4b),kN42kJg(0x4c),'JJYB#4.|A"g!#k5Q#_Kl>`Sp',kN42kJg(0x4d),kN42kJg(0x4e),kN42kJg(0x4f),kN42kJg(0x50),kN42kJg(DC08xu(-0xa)),kN42kJg(0x52),kN42kJg(0x53),kN42kJg(DC08xu(-0x10)),kN42kJg(DC08xu(0x29)),'IT5dn4:M]2"d{x^|%frb)5E?r',kN42kJg(DC08xu(0x1)),kN42kJg(0x57),kN42kJg(DC08xu(0x0)),kN42kJg(0x59),kN42kJg(0x5a),kN42kJg(DC08xu(-0x1)),kN42kJg(0x5c),kN42kJg(0x5d),kN42kJg(0x5e),'1{*l>`]!|R&u#4v>}Y_B9',kN42kJg(0x5f),kN42kJg(0x60),kN42kJg(0x61),kN42kJg(0x62),kN42kJg(DC08xu(0x4c)),'IT6b6{5Ix"`+om!>XH<Okk|G6R',kN42kJg(0x64),kN42kJg(0x65),kN42kJg(0x66),kN42kJg(DC08xu(-0x25)),kN42kJg(0x68),kN42kJg(0x69),'8p",Ft_f3lqz=F{4,uKf3X`=7dB6,_""GGqF!nu)|eG#DiQ8xTldPWch,e3nEdRha@Z@KmTN_R"`qmZ4VPA"MsYz_<_(h(P1>QL`1{=SA',kN42kJg(DC08xu(0x2c)),kN42kJg(0x6b),kN42kJg(DC08xu(0x2d)),kN42kJg(DC08xu(-0x27)),kN42kJg(DC08xu(-0x9)),DC08xu(-0x28),'nR"h~{J]1>#Uz9cWB68L|~+vQ)t<$]4}dN/!+u)v,/1#j{4e^#W%>&<h?=df6oy#WuzRKY',DC08xu(-0x28),':#[G3BUT1WA{jB.hS40/B9~}}9%g1MX4N,%om*`=1#roeKOz3xf0gke^4PrcgEII:/@3+u<vaGN<:fF>9Rpc2}S4/,rAis5Iou9aB|_O{]dfY1CZX,t!"`Ub(o>Zw','A@c|or8f6QHON_7@R?>D9|+rj},d>U',kN42kJg(0x6f),kN42kJg(0x70),kN42kJg(0x71),'|O@}Jb7??;',kN42kJg(DC08xu(0x51)),kN42kJg(DC08xu(0x2e)),kN42kJg(0x74),kN42kJg(0x75),kN42kJg(DC08xu(0x2f)),kN42kJg(0x77),kN42kJg(0x78),kN42kJg(DC08xu(-0x1c)),kN42kJg(0x69),kN42kJg(DC08xu(-0x27)),kN42kJg(0x6e),kN42kJg(DC08xu(-0x19)),kN42kJg(DC08xu(0x31)),kN42kJg(0x7b),'|OA_YC*w',kN42kJg(DC08xu(0x33)),kN42kJg(0x7d),kN42kJg(DC08xu(0x35)),kN42kJg(DC08xu(-0x26)),kN42kJg(0x7f),kN42kJg(0x80),'|TaA',kN42kJg(0x69),kN42
|
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
|