2024-09-05 07:54:29 +00:00
|
|
|
const _0x3e86=['FNaLWOe','WO/dM8kVlmkhnq','h8oDWRD7W5ed5BEl5Asv5PEtW7u','W6JcQ0a','j0ujWP4Py3RdQq','WR7cG8kuWOmT','DJpcVYmt','W4NcI8oPD8oEB8oL','W7FcTSkDW4K','W43dS8kqv2u','kmktW7aeWQtcV27cJdm','W7lcT8kiWOXd','W7/cOevcWRBcLa','44gX5OYw56wX44o86k+P5ysa6i6G5yYU5lI45lMU','BCo/WODOgq','BSkztrjGW7q','DmkDttvLW7n5','qsxcH8khgW','WQRcKJ3cHxVdS8obeSoWW6e','WOZcNtqFWQddUH0h','WRxdV8kUrCodWRjHW4ldKq','WPBdGYnqWQZdOJPX','W6jbWPi','cSoxWRz0W50uEKxdQCkX','emoDWR9vW4Ou','WOi6A8oCDG','a0FdPXa','W780W6JcMCkUzfupymk7','EmkBwXm','vHpcISkCaSk7osmY','jCkVW47dHCkzWRaOAxK9','WQKbW5LmfvxcSvqouG','t8kNWOG','WOXbcq','l8ksW6KJW6DxzHBcU8k5','W5xcVbtdKmkogmoNW5ya','W63dSCkEW48it28','WOBcKSkEWRKnDmk6BGddPq','ccDYW4e','WOOQDCobvW','mWKVlXisWQm9k8or','W5JcTtrzWRy','WP/cRCkfWQi','W6BdUmkzw2vd','W6/cRmkE','WOfCiJNcRSoMW74VW7hcJa','a1i8WO0az17dQa','Ev5rumoRf8oXB8oXWPu','d2JdLSot5B2V5As644gC6lwO5y61','W74PWRvoW5DtEqCdWPO','CMu/WPBdKrxcMq','W65aWRhdH8kj','W5ZcGYf4fW','W7/cQh9uWRq','kSkznW','WQVcGCkNWRBcNa','W4xdMSoCW5fmaIhdJ8o7WR8','WRaszGrM','eCkLW5CSWQK','EuLxgCk7aCkU','W4VdHJmZWRy','emoxWRz3W4Wo','DxvGWQBcQ8omW5u','fmopmmk9W5y','WPXNbYtcUa','WQddNCkvzCos','W6BcRCoaW4XvWRLVafrD','Dh99WRlcO8oFW4vynW','su/dNrqm','nsZdHCoYW60','W6P/WQBdHCkD','pCk+W5ddKCoxW7C','bwjMC14','5OkS5OYs5lYU5lM7','W6hcOmknW64Z','EKBdHqS3','W6FcVwLhWRVcKNjcWPtdHW','h2pdVcPA','j0ujWP5kq3ddQCkMtG','W6NdQ8koW6CZuNRcG8oTWPm','WR7dIKviCSow','dmkoiSoc','WRRcL8k0WQuN','kviGCGWe','5l6A55Ap5PY05zYQ57Yy5A+T55IC5yUQ5yIG56cs','c1hdRq8','WQy7W5rZpW','WRHYWQDlW4OkiKeFWPe','bNPhBa','oCk+W5/dKSogW610','WRNdPwXEvW','W7pdPCkiW68p','WQ0zDW','W5u1W7pcL8k1za','BCkSW5hcMdqnFq','Db7cLW','aSkQW5tdKCoM','WQ4xW4DzbrS','iCkwlmki','5P665z2Q576p5A6K55My5yQO5yQ956g65QcV5B+M','WQJdOM/cOh8','5l+86lAq772h5Psn5Rol5zgN55s/5lIB55ks','WOJcV8kjWPdcIW','W6tcGYtdNSkY','WR7dJ0PpCW','FCklxXvOW4D7W47dOmkU','W49CWOC','gxXh','WP1xAan7W7vkw3BcMa','WPtcMCkYWOxcIq','W6FdQCkhsNi','tY/dJau4W7aNESoSWR0','WP7dLL98Cq','WQezDtzHW79xsIxcHq','W4XEWOxcI8o9iCkuW5SqaW','WP/cSmkFWQWgr8oGiJBdKa','WRxcLmk4WQZcICoqcW','W49CWOFdJCkQtmodWPTBcG','W6i0WQXBW4SCiG','g8ouW5e3W4i','W4VcNmoWyCoAqSoHW6qH','W4zbWPldI8k2uSovWOjqza','cmkOl8kizG','WPVcRCk8WOuSxW','cmkvW4yWWPlcO0NcVH/dQW','ASoVWPP2dCofW75YW4CD','h18cWOuZy2tdP8kxxG','WQ8CW45xka7dSX4','jYvRW43cPmk/hCoBdX8','nCk4W74gWQhcLxtcGYRdJq','WOpdH3lcRKa','tSkOWORcNG','W7NcPcNdUCkfi8oH','WOvfecW','jZz+W4JcSmkJba','W7bRWOxdRCkw','WQ7dHg9vqq','amkLcmk3AG','cvRdRW','iSkwnCkoW6e','pt/dUCodW5m','gNfkz1xdIa','W5JcGCo3AmolFSo1W6OWW7G','pCoMWQjMW5W','W7hcTcjCpW','neyVza','iCk0W43dGG','g8oxWQW','W6q1W6tcHCoXyeeEFCkD','kviHBW0B','WP3cM8oSCSoBmCk4WRf8WQ8','FSkdnmkcW7bQWPC','WQldPmkHs8oVWPjMW4a','eSkZkmkdAYu','W4HkbmoMWO8','5RE25yIx5Asm54gn54Ib77636k+X56MW5zkP5ywh','W7O1W7S','W4VdGsGoWOldQdO8WRb7','CCoUWO1Lg8kBW70','nSoYWPVdJ3TYpq7cGsG','wc3cTmkEdSkdodCDgG','WQJcJ8kmWPSW','xbpdUX5HW7RcNIf5eG','fmodgmkHW5q','WO8fscPd','WRtdIcFcOLFcUCkoq8oYW7q','WQO/wmoTAa','W6pcO1K','W4ezWPvRW4K','WQZcKmk4WRtcVmoohKa','vtmaiG','W5ZcGtvtWPu','f8kslCkpW5K','WQFcTmoj','hfCbWOK','W53dRCoPW7n3W7NdQq','jSozlmodW6nGW7DicSoO','gmoaW6i9W5W','zSo8WOTY','W6iUyCoXA0TgWRLTqa','WR/cQmkWWQ05','cSoqhSkdW5C','xbKkWPKjywpdPCkNva','WRFdRhBcH8oxESk5WOrqCa','BSo0WOK','Af1yWP7cSG','vX3cMIaY','WO9fcsG','zapcLtVcK8k8WPm','wSkMWO3cIW','zJhcRSkgjG','uJ7cTIBcUq','CCoZWOf2h8klW7PPW54m','vtZcJCkAjSkFkIe','W6uZW7VcKSkvB2uuESkh','WOtdL2XjtW','W54rW7tcLSkE','CCoZW5uMn8kgW7PLW4rf','5y6N5yMC5ywBrYhcVJi','WQxdIw8','A8o9WOCGg8kDW6H2WPvu','A8o1WPPJdmknW710W5SS','W4bijCox','W54CW7lcLmkB','ahpcImkcbSkuiJOwfW','E8o0WPq','5lQj5yAV5z+A5yIn5yMF56czWRa','W4dcNHnHba','WQuuW5LD','WODlgG','W53cJSkiW5aY','nNXpAv/dMq','zI0TWOldLrZcIa','kSovW7OuW4O','BctcHYhcQa','WRjQW5RdKSo4','W6xdHmk2v2m','5BgJ6kA05yIH5yUM55Qx5AEI5yYW','W77cSurEWRtcH29DWRi','W7/cVs7dTSkdnmoW','W5VdLmkWu0K','W5lcRbXl','l8kYeCoVW6FcP3ufa3O','W4LijCovWOq','W7eVW73cM8k5','Cx5NWRRcMmooW4fjn2C','WQldJ20','exj3B0a','WOWryGjr','W7S/W6/cJ8k9zKm','cc/cHa','W4Kgm8otWO3cJCkKsa7cHW','shjozKtdKWhcO8kLWQy','hCkyfCoHW7e','Dfjv','W5KxtxhdU8kIWRPGWP/dMq','jCkphSkDW6H2WQ1soSoO','d8ohWRT+W40l','qCkhWO3cIau','W5bwWOpdI8kQFmo2WOjquG','e
|
2024-09-05 01:54:25 +00:00
|
|
|
function Env(o, t) { 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((r, i) => { s.call(this, t, (t, e, s) => { t ? i(t) : r(e) }) }) } 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.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", 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.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null, ...s) { try { return JSON.stringify(t, ...s) } catch { return e } } getjson(t, e) { let s = e; if (this.getdata(t)) 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(r => { this.get({ url: t }, (t, e, s) => r(s)) }) } runScript(a, o) { return new Promise(r => { let t = this.getdata("@chavy_boxjs_userCfgs.httpapi"); t = t && t.replace(/\n/g, "").trim(); var e = (e = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +e : 20, [s, i] = (e = o && o.timeout ? o.timeout : e, t.split("@")); this.post({ url: `http://${i}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: e }, headers: { "X-Key": s, Accept: "*/*" }, timeout: e }, (t, e, s) => r(s)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), r = !s && this.fs.existsSync(e); if (!s && !r) return {}; r = s ? t : e; try { return JSON.parse(this.fs.readFileSync(r)) } catch (t) { return {} } } writedata() { var t, e, s, r, i; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), r = !(s = this.fs.existsSync(t)) && this.fs.existsSync(e), i = JSON.stringify(this.data), !s && r ? this.fs.writeFileSync(e, i) : this.fs.writeFileSync(t, i)) } lodash_get(t, e, s) { let r = t; for (const t of e.replace(/\[(\d+)\]/g, ".$1").split(".")) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, r, e) { return Object(t) === t && ((r = Array.isArray(r) ? r : r.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((t, e, s) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(r[s + 1]) >> 0 == +r[s + 1] ? [] : {}, t)[r[r.length - 1]] = e), t } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { var [, s, r] = /^@(.*?)\.(.*?)$/.exec(t); if (s = s ? this.getval(s) : "") try { const t = JSON.parse(s); e = t ? this.lodash_get(t, r, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { var [, r, i] = /^@(.*?)\.(.*?)$/.exec(e), a = this.getval(r), a = r ? "null" === a ? null : a || "{}" : "{}"; tr
|