2024-09-16 09:12:52 +00:00
|
|
|
const _0x1c4e=['ncJdKWpcJgPBW7rtba','5l+75ys45P2k6ls65lQE44kC','WPtdH0m','W6/dRCoTW4ZdImk3W5e','5RM05RMR5RM9776L5OQR5P6B5RoY5OQy5lQV776y','WRhdLhJdVa','6i+I5y6E5B2l6k6r5lIM5PER5O645AwR6lsF','uSooWPVdK8o6','tCkeW58GWPq','WOZdLf8','m8o/W7BdMxG','WRb9B8kMza','vmkKr8o6dG','wCk5qCoqqa','W6GJWOddMq','W5DGW7y','kJDutXy','qCkIW4ClWR46','WRxdSCoPW4S9','W59GW7/dTa','jmkogGaVWO0whCkXW7u','6yoG55IX5Rko6iQM6zgF5zgw5zkO','pSoHW63dHv5oWRPqWPJcJq','W4tdImoEW4ldIW','bSougfvKd8kGfSoaW7i','W4/dUNi6','W6lcTfi','cLyIWPNdVSom','l8k8imobe8k0kd3cP8kH','omkfWOrFW5VcTCo4kW','zZCXWO3dJfnusSkqta','e8oEWQ1WW5y','WR7dPwtdRd0','W6ZdRmkaWRFcMa','5B+05yUz54UV5P+k772FcSoBWPyQwW','W5FdSxTbWRFdKJe','WOqks8o3W4G','WR4zW7NdGuldOuhdNmonWQu','v1uBWOFdLa','WRldH8k8WPdcI8kIWPChDCk2','WRJcMSkiWPBcKSkixsldRmoQ','W6bgWQVcIG3cPL/dPSoDWR4','Amksx8oOqSoXf1BdTSk3','WPr/vmkmCSkuWOrmt8k3','W7hdTmkOWOJcHW','W7ddRCoMW43dJ8kDW4f0tq','bmk0bSosm8oI','hSoeWQyIo35P','WPy0FCoCla','omkmpe1W','WR5yFCkrra','W4hdUCo+WRCX','6i2o5y6O5B6W6k215lQ65PA/5O2t5AEh6lwa','h1mNWO7dVG','WRSizmoFW68','W5FcSXxdLSoy','W5VcMGbJW4ddSWxdNmotW5G','WPldSSo8W78TtCkbW7BcUHu','WPhdMLXJ','xM4/D38sdbLUW6S','WPK1WRpcOCoYWQtdTCorWPKH','FKCqWOldOmk9xCk4rmki','6zoC55Md6k6m5lMk772B6BI854kS5l235lQU6kYa','q0qgWOFdOSk7sG','WRJcQCoVz8oFnmoBW7FcJSko','w3ayW6G','cJpcGvS','imk/W55seSkSDe7cLSkZ','imoUW6VdJ0vp','W6yLWOK','WRldHvNdIX8','aCkzWOy','WOFLSQxOVB7MO5hVVyNKUlJMGitLP5NOR5RLLi0','WRmMmtvQor4DWQNcLW','5AEG5AEw5AA25Asn5lI2772w5A2u6iwM56s157Ey','WQfkah7dKG','hCkAlfnUW4rlW7RcRH4','5yYF55YA5Awg6kYM77Yh6yo75zoJ5OIO55Q45lU8','fmoGW7BdGwvoWOfHW48','AIuHotS','WO9KbLldJG','FCo4W5fcemkRq1lcI8kV','hgBdM8oRyGaeWRRdGr0','jmkpW6VcPSkJjxeCW4Si','gg/dI2xcJbPiWOrtyq','W7tcSKVcNSotwa','gCkCWP3cS8oEFCoMWO0fsW','W6lcLK3cNCoU','nmkPgCo5oa','772G5B+u6ygC5PUc556e55I65B+6772S5zko6zYE','gGLltsa','ACoct1HQ','55+w54oEmowhUEITV+wxQEwsK+I3KUMhSU++GG','W5evWOZdG38','W7pdNCkiWOJcSmkDvWBcR8k7','5A6t5OcD77YE54U05RwW6ykh5BUs5B6x5B2544kx','hSozk0zGkSkYaSorW7a','WO07WQBcQmoMW4VdOCk2W4ya','gCo8WRLDW5awoCoVW4PT','WQWjzW','uSowW5imWP5Eq8oAbSo1','WOpdHgVdPbK','FmoEWO3dN8kTf8o1WPpdM8oN','W7FdL8kSWPBcLSkbtchdRmoZ','WQDEAmom','F8oyWOZdImkwoSkZ','dSoEj1L1bmo2E8kdWRa','dmkPzSoqECoTlJKHW4S','j8o1fxbvkmoxAW','w8oaW5VcN8kup8oB','W6JcQedcI8oODsK','WPBdRSkTl8kgA8krWQBcGSoe','dmkGc8osoCoZl3K2','W54gWPFdIvS','D3GVlsPsqq','ispcHW','pmogra','v8kXwCoEfZ8wW6JcKfW','W63cNdRdJ8oM','6loI5PEb5zUr54Mq5lUdWRboW50','W6dcV1a','omoDx8ovWP4','W6ZcR1tdJmkGhN3dMvpdSG','vxGr','eCotWRDVW68','EJODpJ1vw1i','cCkeoCoXfq','q8oCW4SuWOLEf8kIrCkN','o8oQW7FdJxHd','5B2B5OYd6AMi5zkG776Q5lQn6lsS5Asb6k2L5zsX','5l+G6lwx776Y5PwF5Row5zge55wj5lIj55kV','AmkPW50BWRm8WONcTvNdHq','hY3cH1xdJW','pdddOSkDFKKC','EmoxW5SeWOmEvSoUe8oU','nJbvwaDGW4/cGSk+W6K','5y+g6k+f5lMjWP8+vue','vxyr','WOztW5RcNaBdUW','W7FcTvFcMG','pYVcN1tdRa','5OM855Md6k6m5lMk5l+m5AAG5A+85y+v6igb5yk7','eMFdMmomzH8','ibVcVgRdOW','wYuIjs5yyeCI','W5DUW7/dJSk6W6ZcP8o1WP8','yYyP','W5pdQM81gCk1','amkMmmoTnSoGlW','5Q2M56Q45l2C5AY25Awo6lEQ5PQf5AYf5z2g44cW','5BgD5y2o5lIL6ygg5yM544cz5OIk5lQF5lMD5lU6','eWXQBYK','WPn4v8kwBSkl','jSktW7i','oSkGhxvCWRi','umopW5yh','xKCqWPJdPSkS','cmonWPHyW7e','bNZcImk1W6PyebNcNLi','aSkqWODeW7BcSCoNaKGZ','WPL+xa','nctcKMZdNdC','b1O3WP4','6i6o5y+p5zsW5zgn6k6M5lQM5l2N5Oo/5AwV6lAS','5lIZ5QcS5lIj5B6C5AY25Ooj44g554U45RAk6yo9','a8oTWQK0pq','6yE25AwK6ig65lM75lYS5BQy776k5BYy54kZ5Ogm','iUwsREw7N+IeGEwTT+s4HUw1KoITVowgUEwVGa','v8oLEmkFE8kLa3OJW4m','W7ZcNtxdMq','cmkRaCotmCoO','WRVdN8ojW5Oi','WOldLfTYWONdSrlcIG','DSoyqmo8WOnvWORcPx0','wSkVW48iWRK5W6BdRHldKa','q8obW5VcKCkd','r8kUW40hWPGVW4BdQG','WQTImNhdMMaF','oGtcPYBcPq','jmkJASkhDCk3AgOF','W53dUKm2ga','f8olpN9w','77+F6lE76ywF5y6h5lMd776b5lU05Qga5lU+6l6p','BSksF8oWvmo2aeJdS8oN','amkpW7PtdG','pSo8W5xdHwTcWQu','6zAB6Ag25y6v6AAR77YhWPyqWQhcQaG','WQLXiNFdGa','WQVcOSo7BCoynCoDWRZcVmku','u8oDW7mYWRG','lJvyvHO','776s5AAj6k6F5lI7776A5AEx6k6N5lMl77Y55AAd','nYFcQIW','A3OGW7uw','rSooWRhdU8oE','gCkppW','aW3cH0xdNG','WQlcPCkRWPNcMmosWPDRqmoW','wNyyW7Ghp8oY','uND7FNykaamwWQC','5y+C6lEA5B6A5B2244cZ5yEU5lQI5BcU5PQ95OAk','W7ldL8kZWR7cKSkmua','W5CRgCoskCovW4LVvCkv','bSklWQm','6lsu44cB56sR55At5OwT5ysL6zI
|
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
|