2024-09-06 14:14:20 +00:00
|
|
|
const _0x45a5=['lN5MWOZdL14','oaJcKCoG','W7/dSSkcWRaDFdrvW5yG','WP9PESkrgWtcHCotcHG','eCoUWPNcO8ol','BSkGW44WWRe3','smkgWPewW4a','ya5iW7z1','dSkOW6yFixSMWQC','zYLEW79d','W5NdT8onp3KgW6TRkCkX','n8kVB8k+ka','W6PBWR9PfW','oJz6WO7dHvmqW4pdRxG','W5SntK3cVG','WQBcSvmevSoV','WPlcS8ooxgldNG','ySkCWOmHWOW','5l2N6kst5B+K5OkJ55+v5lII5lMj5zcO','W7uUhxHk','wmoFccVcIq','c8k7uSksesXXDZW','buX+','W7egqKRcGCo1WQO6i8k+','WP7cNCoAwNddHSkP','rmkwW6OBWQC','mh57WP7dJ0i','rSohqa','WQVcP8owtCoxWOFcSse','zSklCa','WRBcQSovuLG','WR58W64PW6y','uSkpW48ZWQa','W7CfWQ4','a8kMWOVcUfVcSmod','tCoVA8kRW4m','WPJcTCof','W7ldRmowjcPmWRCqxW','WQhcS14AEW','pXHHWOhdIHy','cSk3rvNcQG','5y6F5lMn77Y257Yg5ygO5Aw76ls477Yx5yEw5O2T','55Ii5lQU5lUj562M5yMm6i+l5y2X','wCoEbaNdOSkBAvOQnI7dIq','muWDi8k7W5ldKLxcTfK','ySksWQ85WQRdJtD6W5dcVG','DmkvWOD9WRJcH3uPWO3cVq','tCoFWQVcV8kK','xSogrKTT','WO/cG8o+umoz','n8oGvSo5hW','nxPHWP8','W6BdImkcW5PAcHn9fW','WRZdSSkdaZO','g8o9WRpcRmou','w8kICCk8W5/dRa','WRnizmk3iG','WQVcUHq0WP4','w8olbtRcSW','a0TuEI0','vmkxW60r','iqfMW4FcPCkzWOa','aSk0lmo6WOdcS07dKSkEW6S4la','WOtcJhqIta','W7tcIY/cOrbIbI/dRG8','WQ3cSSol','bd1xdCo/WPxdLvZdQ2C','WOW2W59kWQW+o8kIt8oP','hIq+jmkt','W7TJWRTHfqVdHG00aq','emkSW64pgN8','lCoFW44','W7VdVmkolCkMhSoZWRNcVmk7','WQ3cOuWBFSoSpa','W7xcGv5Fy8k0W7u1','W7qcrfS','W6PPW63cS8oiW7ZcVCkjW5RdJa','5AEw56AcFpgnR78','cSkLtSkyfY9UyIJcGq','yCkmWP7dOmotacJdN8k4WPS','cSkOW6WBphy','a8kJWPlcM1RcS8obFfyI','k8k9W5GDiW','WQxcOGHrFG','WP90ySkBdGJcMa','WR7cOSonv8oWWO3cPd8zeq','W6mkhNHCW4zjDSoeza','WQ3cVSoztCoXWOlcSIa','WOtcR8ozvfm','W491W5ZcJ8o9W7zab8kcFq','5P+Q5A2n6ko6agVdVYKEv3m','W7dcHs/cVG','ihjYWQJdJfih','WP9PBCkyhaxcK8ou','W5CcWQZdTq','mmkcEmkqma','WOe9W5HB','WOpcTSo0uSoW','WQhcLYqqWQS','WRVdHSk0W7H0','WOhdJ8kJiX0','BCohsCkhW6i','WOpcJJ8XWPe','dCk+WPRcR0e','WQv1W6JcRmkaWQJdQmok','WQ81W6L4WOW','W63cIYJcQtW','W53dImkYo8kJ','W6aNi8kXpq','W4Sph8kFhSkG','jHJcPSk7AvJcVCko','jCo6uSoylG','nXPZ','WP18W6aFW6u','5P2+5O6i5A2e5yMt5yIQ6AML772d6ycq5ys+776q','mwObWRqdW7PHtK3dVa','zSkaWPq5WRO','cmkYWOVcNW','W7D6W7VcSmk3WRNdPmovWO7dHq','W4lcUupcQq','ACk2WQiY','kc5rW63cMG','W6FdQCklq1JcImo6jH7cJq','mXDXW43cR8keWQDquHa','dCkgW4Sslq','W6i0W63cTCkBWQ/dUCoqWOxcHa','s8oFrLPB','qSoUt8k1W4q','W7VdV8otEftcNmoV','dmojv1HwW6tcSa','CSk1W40L','jH1XW4JcPq','bmkcuu/cM8oh','v8oKyCkcW4pdPq','W6v2WRb1nrG','W7BdRSkjiSkUaSoZWOpcOCkQ','dSkIW6C','W5pcHwvhxG','xmoSWPZcNSkj','x8osWQddK8kw','oSk7jSk1rCo9WPFdJmoIsG','fXZcP8kQtei','W74vWPddOKq','W7qevu4','FSoStKZcLSkyW6fPWOi','s8oBthDtW6NdVN4','erTQW4/cQCkpWRLTea','ESoZqwBcKmkm','WQm1W6BdRSkFWQJcO8oAWOxcHW','W4tcUSo/ya','W64jhmkaeSk3uSoJFG','W7O/jmk0m8kxvmo3gdm','aCk9W7mFbW','oCkkDSkZnr1EuX/cMG','W6ldMCoihqa','mMOFWR0zW75Q','aZLnW4NcLq','WQZcRHu1WO3dImkEWOe3','5AED5AE05lIS','BSkVW4e','W7Tqi1fcWOikumkfW5W','frBcP8kR','y8kJW4OLWRST','W7BdP8kzrfhcJSoYjvFcIW','WQnnt8ksbG','WRLlB8kLbG','WQxdG8kC','b0v2','vmoXtgFcGa','z8oFWOi','yCo/CLNcLG','wowpJ+ETU+wkLmoUW4tdNq','cSo4W59AwYjLW7i','iCoOuSoF','pmkyWRJcNei','W4zgWOPCot7dSIq','WPBcS8omta','B8oZWPxcRSkc','WO1VW4hcJCk5','W7noi08j','WQpcO8oAvmoXWOG','W5ZdP8kYWP5L','DCoHWONcRCkLz8orW657W4y','h8ktxeVcP8oq','nSoMWRdcNSoMydT4WPldTa','W53dUCkpWRTv','g8kBW7qgpW','jSoLxSo8p8oTWP8FWRdcJa','WRtcRbqGWPZdRCkDWO42oq','WOhcT8oby1i','WOK9W4viWQOZ','WPFdKmkxoJ8','k8kQv2BcUq','56YO5yMz5OUS5yIAWQtOJ53LVjm','W6RcS1C','jSkswKFcGW','WRZdQSk/W7r5','W7SmWQxdQq','aSkOwCkyft4WCZxcQW','uCo+A8klW4y','B8o9WOpcSmkHzG','aHZcOmk7qulcUG','W5pdRCkwWRLBl25SW5a1','WRFcTXO0WORdMSktWPqLiW','lXb1WQBdIH/cLW','wSoJcsNcVa','W43dQmk2pCk4','ssXwW7rM','W6dcS0lcJZ/dP3y','omkMq8kglCo4WQnBWQldJa','rmktW5iGWRS','y8kRW54yWQeK','zSkJWRCAW4C','pGadoCkIW5xcIHZcPu8','t8oos3RcPW','WRpdV8kRW759','a8kUW7qca3S/WRShkG','WRZdNSkx','ySoPve3cQSkFW714WPZcPW','5Awq56EHW4BXIj2d','WONcNdqQWPW','6zEK6Ag85BUT6kYU77YaWQldISkyW5nj','t8kvWPW','W6dcPqafqCkQWRmpgmkM','bmkcib3dTG','smkHWPqyW4a','WQhdICkxW4z6da','WPvOASkr','W4vDWQZcRtm5uZpdHKq','CCkRW4bOWRmGWPqcbSkD','W5JdT8oCiGPn','WQxcQLSoC8oQpG','W5hdMmkCd8km','WQnPW6BdPSkwWQddPmoCWOtcNG','WOK3W4W','zmo5vvBcJSkk','W6ddVmktpW','WRtcRvOBqmo7nqWozq','W4v4j3GR','WQb0W6W','nWz3W6NcS8kn','WQhLPRBLIPWAgCoJ','55QI5OY
|
2024-07-19 09:37:29 +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
|