2024-12-15 15:17:31 +08:00
|
|
|
var TJb9wUk,xwZ_wfX,KyTu5N,IFMpFiE,Dr_6MFO,_MRYyu,xPL15bm,fIWxAXs,DKK07d4,xHwpgYB,YBGUTcq;const MVdn4D=["length",0x1,"b",0x0,0xf9,0x89,"a",0xd2,"g",0x5,0x8e,0x4,0x8,0xff,"d",0xd0,"undefined",void 0x0,"c",0xee,0x10,0x3f,0x6,"fromCodePoint",0x7,0xc,0x3,"push",0xb7,0x2,"h",0x32,"i",0x5b,0x1fff,0x58,0xd,0xe,0xa2,0xe1,0x9,"e",!0x1,0xdc,0xc0,0x94,0xbc,0x6b,0xe9,"f",0xea,0x6e,0x8c,0x7c,0x86,0x77,0x88,0x78,0x4e,0x6f,0x2c,0x7f,0x80,0x7e,0x79,0xb4,0x43,0xd9,0x95,0x96,0x5f,0xe4,0xf7,0x30,0x2d,0xae,0x99,0x9d,null,0x7b,0x18,0xce,0x65,0xca,0x13,0x28,0x3c,0xa6,0xa9,0xa8,0xaa,0xab,0xaf,0xc9,!0x0,0xc8,0x53,0xc5,0xcc,0x1b,0xd5,0x8d,0x29,0xdf,0x71,0xb5,"&",0x87,0x14,0x2f,0xec,0xed,0xef,0xf6,"UA",0xf0,0xeb,0x73,0x9b," ",0x10a,0xe6,0x46,0x1e,"3",0x70,0x1c,"j",0x4d,0xc3,0x11e,0x11c,0x3e8,0xa,0x11d,0x124,0x125,0x1f4,0x93,0x69,0xa5,0x1f,0x12c,0x62,"0","(",0x12a,")",0x12b,0x134,0x135,0x115,0x12,0x137,0x7a,0xa0,0x13b,0x13f,0x116,0x4b,0xc6,0x56,0x31,0xf3,0x146,0x13e,0x7d0,0x33,0x152,0x74,0xfa,0xb,0x81,0x83,0x164,0x165,"2",0xf2,0xe3,0x16a,"$1",0x16d,0x16b,0x174,0xd8,0x5d,0x17d,0x91,0xb2,0x37,0xe8,0x11,0x148,0x17,0x40,0x186,0x188,0x189,0x9e,0x193,0x195,0x196,0x197,0x4c,0x44,0x76,0x21,0x192,0x1ac,"1","5",0x1b6,0x1b7,0x72,0x1c5,0x1cf,0x1d0,0x1be,0x90,0x45,0x1bf,0x1c1,0x1c2,0x1c3,0x1c4,0x1e0,0x1e1,0x92,0x1f3,0x2e,0xb8,0xf8,0x1a1,0xd7,"nb","10",0x211,0x21e,0xbf,0x3e,0x1a,0xd1,0x21f,0x220,0x221,0x222,0x223,0x224,0x225,0x226,0x228,0x22b,0x47,"4",0x23d,0xe0,0xac,0xf1,0x59,0x24a,0x24b,0x24c,0x24e,0x250,0x258,0x25b,0xdb,0x264,0x42,0x262,0x280,0x283,0x269,0x284,0x285,0x57,0x64,0x36,0x200,0x34,0x100,0xbd,0xf,0xbe,0x39,0x23,0x3ff,0x98,0x82,0x20,0xffff,0x289,0x28a,0x28b,0x2a3];R10QPSy(ak6Kt0G(g4L96ls),ak6Kt0G(EvV_l3,MVdn4D[0x1d]),ak6Kt0G(BsBpkT),ak6Kt0G(ImTfqq,MVdn4D[0x1a]),ak6Kt0G(kjr5Ad),ak6Kt0G(FFBDkR),ak6Kt0G(yspk1RQ));function ak6Kt0G(TJb9wUk,xwZ_wfX=MVdn4D[0x1]){Object.defineProperty(TJb9wUk,MVdn4D[0x0],{value:xwZ_wfX,configurable:MVdn4D[0x2a]});return TJb9wUk}function yspk1RQ(...TJb9wUk){R10QPSy(TJb9wUk[MVdn4D[0x0]]=MVdn4D[0x1],TJb9wUk[MVdn4D[0x6]]=";8*w9u=/#2{zBi>el^a~FrLMVX!xvg1RS\"$AT:yp5J+4b76s[D&ck@YCf,WqUH(%}tNdEO?InG_o]Z3|)m.QP0jK`<h",TJb9wUk[MVdn4D[0x2]]=""+(TJb9wUk[MVdn4D[0x3]]||""),TJb9wUk[-MVdn4D[0x5]]=TJb9wUk[MVdn4D[0x2]].length,TJb9wUk[MVdn4D[0xb]]=[],TJb9wUk[MVdn4D[0x9]]=MVdn4D[0x3],TJb9wUk[MVdn4D[0xa]]=MVdn4D[0x3],TJb9wUk[MVdn4D[0x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]=yspk1RQ(xwZ_wfX[KyTu5N[MVdn4D[0x3]]])}return TJb9wUk[KyTu5N[MVdn4D[0x3]]]}R10QPSy(TJb9wUk={},xwZ_wfX=["P>=k.,yT~B3@M*C55^oZ>&)6!t+kqWQJ8DHv5%OcaBV=C?ep)cvCX","]E9gJApsf^@v2[gTQ$N#]O(BE2)aK>RMSMg{v)|,\"%83KsB","yYH]d6p~z>A]bI8:f7o#/OuJw})6BsV+aY<cxqx@]zF{=mqg~%v/$EAsWtI%8","<>)=|Oi~4(;2H[iFUFF_[pwK;U&G<XXAw4L/^]K,A2#YQ*","MgiR1I]V6#]9c>n~9I4_<]V1=","rt%]/jW1lBA$1u","=4@_qWfWRNE%!H)pE(i{\"q$T@~6qc?|!EGIDPOwOfW{1+i/RiIO{","j?gk3yo8","[wl\"QQ*W2FX","vgM2v5mgv(8nP9daM,^xj]2/[%?aiPlFH^]Z]Tp/}By[w!*M","yFV3.(:,T,7qI>PJ{_IkV","}Y2xF5yVG^f","tGj/}Py)Q2b)gH|pJ583+)HMu","=gQSPOmc6qZ94*+RR5~S+GHo?}.Ss*?R!6v/",".GLkc:3BG(B.x.!
|
2024-11-12 11:17:55 +08: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
|