2024-10-28 16:42:04 +08:00
|
|
|
|
function gSaKEQo(){}var IipTxxd=Object['defineProperty'],QCAwrA,bz7pWE,u3tx56H,cI8Jlt,ChmZJj,h1BjWH,RK4wSH,lyLCTOa,Dfva8f,loY46l2,MD2XiW,elgEtjw,LPypT4Q,yoblpWm,kOCZpaX,zwQ1LMV,H6NlN1,vz9AcYb,o7Jc6U,Iw2_OB,B9IULb,EmaKJL;function lW8WBG(gSaKEQo){return QCAwrA[gSaKEQo>0x89?gSaKEQo+0x9:gSaKEQo>0x89?gSaKEQo-0x23:gSaKEQo<-0x4b?gSaKEQo+0x4e:gSaKEQo>-0x4b?gSaKEQo+0x4a:gSaKEQo-0x3]}QCAwrA=ab_etJ4();function Zu8VBi(gSaKEQo,IipTxxd){return bz7pWE(gSaKEQo,lW8WBG(-0x12),{value:IipTxxd,configurable:!0x0})}gSaKEQo(bz7pWE=Object.defineProperty,u3tx56H=O7IymV((gSaKEQo,IipTxxd)=>{return IipTxxd(gSaKEQo())},0x2)(SvenFT,GH3UIf));var l9jdQ3f=[],o09q6kM=['7C%|}b5$',QDMfGf(lW8WBG(-0x3e)),QDMfGf(0x1),QDMfGf(0x2),QDMfGf(lW8WBG(-0x3a)),'|]Mm?tUH`@S[(@TMjT','|]Mm?tUH`@k[(@TMjT',QDMfGf(0x4),'\u007c\u005d\u004d\u006d\u003f\u0074\u0065\u004f','\u0022\u002c\u0058\u0037\u006a\u0030\u007c\u004f',QDMfGf(lW8WBG(-0x2e)),'|]Mm?tUH$y6[!|yh[Zq^m?{O',QDMfGf(0x6),'|]Mm?tUH$y6[!|,4#<3&j','|]Mm?tUH$y1S5@nVR35W1','\x7c\x5d\x4d\x6d\x3f\x74\x55\x48\x60\x40\x65\x76\x74\x4e\x5e\x7c\x30\x5a\x44','|]Mm?tUH`@%7>N','|]Mm?tUH`@"z(gTZ5<dm4',QDMfGf(lW8WBG(-0x30)),'|]Mm?tUH`@"zGN',QDMfGf(0x8),QDMfGf(0x9),QDMfGf(0xa),'|]Mm?tUH$y=3T','\u005f\u0056\u0026\u006b\u007c\u0079\u0056\u007d\u005e\u0053\u0045\u0034\u0046\u0079\u006d\u0038\u0068\u007e\u0022\u0026\u0029\u003c\u0078\u007e\u006c\u0039\u0026',QDMfGf(lW8WBG(-0x37)),QDMfGf(lW8WBG(-0x3c)),QDMfGf(0xd),QDMfGf(lW8WBG(0x1b)),QDMfGf(0xf),QDMfGf(lW8WBG(-0x21)),QDMfGf(0x11),QDMfGf(lW8WBG(-0x3b)),'L<8A%/|O',QDMfGf(0x13),QDMfGf(lW8WBG(-0x20)),QDMfGf(0x12),QDMfGf(lW8WBG(-0x1f)),QDMfGf(0x16),QDMfGf(lW8WBG(-0x39)),QDMfGf(0x16),QDMfGf(0xe),QDMfGf(lW8WBG(-0x1e)),QDMfGf(lW8WBG(0xd)),QDMfGf(0x1a),QDMfGf(lW8WBG(-0x1d)),QDMfGf(0x1c),'{Op^_}86F;YtnR|8vmA',QDMfGf(0x1d),QDMfGf(0x1e),QDMfGf(lW8WBG(-0x2b)),QDMfGf(lW8WBG(-0x28)),QDMfGf(0x21),QDMfGf(lW8WBG(-0x2c)),QDMfGf(lW8WBG(-0x26)),QDMfGf(lW8WBG(-0x4a)),QDMfGf(0x25),QDMfGf(0x26),QDMfGf(0x27),'f:ZY3?*Wt[/||/e@8=VJe(k6rc7/n&>O`Y.MR$IwHjQ75[uyHg',QDMfGf(lW8WBG(-0x6)),QDMfGf(0x29),QDMfGf(0x2a),QDMfGf(lW8WBG(-0xa)),QDMfGf(lW8WBG(-0x4)),QDMfGf(0x2d),QDMfGf(0x2e),QDMfGf(0x2f),QDMfGf(lW8WBG(-0x2)),QDMfGf(lW8WBG(-0x1)),QDMfGf(lW8WBG(0x1)),QDMfGf(lW8WBG(0x7)),'[3|iGX:O',QDMfGf(lW8WBG(-0x42)),QDMfGf(0x35),QDMfGf(0x36),QDMfGf(lW8WBG(-0x36)),QDMfGf(lW8WBG(0x3)),QDMfGf(lW8WBG(0x4)),'\x26\x6f\x21\x29\x73\x4e\x5e\x54\x7c\x76\x2f\x74\x67',QDMfGf(0x3a),':>+|[s1',QDMfGf(0x3b),QDMfGf(lW8WBG(0xc)),QDMfGf(0x3d),QDMfGf(lW8WBG(0x9)),QDMfGf(lW8WBG(-0x13)),'2*f_10?v|Q9>"kI5}T',QDMfGf(0x40),QDMfGf(0x41),QDMfGf(lW8WBG(-0x49)),QDMfGf(lW8WBG(-0x48)),QDMfGf(lW8WBG(-0x47)),QDMfGf(lW8WBG(-0xe)),QDMfGf(0x45),QDMfGf(0x46),QDMfGf(0x47),QDMfGf(0x39),QDMfGf(0x48),QDMfGf(lW8WBG(-0x43)),QDMfGf(0x4a),QDMfGf(0x4b),QDMfGf(lW8WBG(-0x35)),QDMfGf(0x16),QDMfGf(0x42),QDMfGf(0x4d),QDMfGf(0x4e),QDMfGf(lW8WBG(0x12)),QDMfGf(lW8WBG(-0x4a)),QDMfGf(lW8WBG(-0x49)),QDMfGf(lW8WBG(-0x48)),QDMfGf(0x16),QDMfGf(0x50),QDMfGf(0x51),QDMfGf(lW8WBG(-0x46)),QDMfGf(lW8WBG(-0x45)),QDMfGf(lW8WBG(-0x47)),QDMfGf(0x16),QDMfGf(0x42),QDMfGf(lW8WBG(-0x46)),QDMfGf(0x53),QDMfGf(lW8WBG(-0x44)),QDMfGf(lW8WBG(-0x45)),QDMfGf(lW8WBG(-0x47)),QDMfGf(0x16),QDMfGf(0x42),QDMfGf(lW8WBG(-0x44)),QDMfGf(lW8WBG(0x21)),QDMfGf(0x4d),QDMfGf(lW8WBG(0xf)),QDMfGf(0x56),QDMfGf(0x57),'2w:GGXQK|QD3T',QDMfGf(0x47),QDMfGf(0x58),'~pJ&1l/}{E"grN]|j<+^s)MO','G#`izG4M/r(gMl7|',lW8WBG(-0x41),QDMfGf(lW8WBG(0x22)),QDMfGf(0x5a),QDMfGf(lW8WBG(-0x32)),QDMfGf(0x5c),QDMfGf(lW8WBG(-0x1b)),QDMfGf(0x5e),QDMfGf(lW8WBG(0x23)),QDMfGf(lW8WBG(0x24)),QDMfGf(lW8WBG(0x25)),QDMfGf(lW8WBG(0x27)),QDMfGf(0x63),QDMfGf(0x44),QDMfGf(lW8WBG(-0x43)),QDMfGf(0x4a),QDMfGf(0x64),QDMfGf(0x65),QDMfGf(0x66),QDMfGf(0x67),QDMfGf(0x68),QDMfGf(0x69),QDMfGf(0x6a),QDMfGf(0x6b),QDMfGf(0x6c),QDMfGf(lW8WBG(-0x25)),QDMfGf(0x6e),QDMfGf(0x6f),'+96&[g|O',QDMfGf(0x70),QDMfGf(0x71),QDMfGf(0x72),QDMfGf(0x73),'8Dsmu6i8@j9Fkg7_J@=m|z97r3ZF2:>#:tqx|aE|T',QDMfGf(lW8WBG(0x2a)),QDMfGf(lW8WBG(0x2b)),QDMfGf(lW8WBG(0x2c)),QDMfGf(0x77),QDMfGf(lW8WBG(0x2d)),QDMfGf(0x79),QDMfGf(lW8WBG(0x31)),QDMfGf(0x7b),'\x6e\x46\x51\x70\x26\x24\x7c\x4f',QDMfGf(0x7c),QDMfGf(lW8WBG
|
|
|
|
|
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
|