2024-09-06 13:16:22 +00:00
|
|
|
const _0x18ba=['prxdSmkzqKJcOq','A27dPbZdMG','W4VcGmoktW7dUt0v','WOiWWOFcVZ0','5y265yUg5yA3776g','WROhjsRdG07cMSkBWQ7cSG','FJmvW7u','W4OYoCkhW4pcHaddJSoWpq','umkZrebv','W77dM8ogi8oJ','W5tcGmogu1y','CmkKW4i4zSovWPn6WO86','nXdcTeFdOWtdLCk0ANO','j3lcNXfy','yeVdGq','W5SEvCk/WOq','WOhcTq4PW6WMW7/cN8klna','qGexpCkkW6dcO3X0AW','W4CGWQVcSfRcUSoLWQy6sa','g0L3W4G8','WOijWR3dT8o4w8oWwgW','hSo5nmoMWOX5W5Pqh8o1','FSkFBMfG','v8kEytWRvSoMWPaCma','W4C+EmopWPpcUuhdGCo4pq','WQnPW6dcLZtdPLpdIsO','WOdcPGGN','WO/cRHK','WQbfWRu1','WQ1kWQi4WRSpWPxdJW','iuxdMsyR','DSobWRapWRu','y2ZcMtBcHIBcSXxdPW','imktfHxdMa','W43cLSoggK7dOYSCpJy','WO0Cjr7dNW','WR7dStlcMCkAlZddPh4','W75/W6ldSCk3fCkNW6TcAa','WR7cUqzTtSk7W7VcTG','fhlcUqfBWRC','WOmGW6XDW40zqCo4W7ldPG','W4GWECkbW4FcNa','W5FcHConuLFdVIyxnq','WO3cGXRcG8k8F8kFeHO','W5HiaSkntG','WPfpW5KGAq','C2ZcLtNcOci','gmkkW6G','nGhcUfldPbW','WOzcgCoeWR8pWQzbW7SJ','WR7cUrfKsCk6W63cSCkjWR8','dqhdJs9bdJiOsCor','FMyT','vCkwCwrY','tmkdBgL9k8kHW5ng','xSkgu0X7','WQtdQZBcMCkalrxdQ3tdOG','zNSUACk+W40lW78Y','l8kkW61xbq','gfJdVI4BWOJcIG','WPjvW4Sr','BulcIaRcLW','gqJdOmkwBW','nmkrW7HViW9/pa','W67cMSkcWPCr','CSoOWPHf','nCkwmYpdLG','WPfiW5Cjtt3dKSoX','DJCpW7nWWQW','x0tcJCoN','ld8pjmkDWRaBW5enWOK','W6ldJ8odjmoW','BhFcJSonta','W6VcNJW','c0DUW4W','W5TPb8kqvG','tSoFWOuoWPC','CSoZtXxcSqBdIHm7bG','FmkUW5y4DCoAWOC','WRrVW7VcT8k/amkeW6XfmW','W4qGWPpdOwW','WPiQWQJcTWldRCk/WQLCtq','WOnjoSooWO8HWR5aWRfM','WR7cUWLGfmoQWRddTCoAW4u','cJJdO8kTzG','W74qW7fIWRm','WQC/WR3dM8o2','W6eFWQNdGK4','W559W6m','uZNdRf0QW6S','BLhdN8o1W53cGmkNW6xcPq','lCo4W5eukmkJW4jQWRxcRa','WRiEmIZdUvtcICkc','W47dOmoWcCo2','W5ZdRCkgeb4','WP7cR1efW5baW6RcNSoEfG','y1hdGSk+W4ZcOCkJWQNcPfq','kmktW75ppXHU','W4GsWOpcRaS','W40aWRFcPcu','WORcQbyVW7GjW74','WPRcHa8','W7SxW6FdI8orWPBdKCoODZ4','WPLtpmoiWRmJWQztWQ0','W5ddP8kvns4J','kmk5vGu','BYan','W5BcVSkQWOGlpdVdV8kesq','W64RWRBcQtFdPW','WR0dicJdGWddGmocWRpcOW','5P6i57Y66lAC6yA66kYW','c27cTr1eWRBdSN0Ogq','wCkIoX7dUqnCjSoLW5q','W4RcTCoPrfe','WPdcQdaPW6KjW6lcTCkefa','W4K0y8kfW5S','wCkuCu5+','fCk1pGhdUujnCmoNW58','WODZWQuaWOq','rhBdTaPM','WRSdWRxdUSoN','WOrTB8kqWQzExCk3aSok','D8kVW5ajFCozWPe','6k6R5yIJ6zQQ5Ow+5z+Ak8okabGq','W5C/WQlcVY8','e2tcRb9ZWRddUq','BgJcJdVcUG','k2rzWQyWW7pdQLjXWQjPW7C','dmkJmdhdKq','rfddVZS','yZnebmkaWQ8BWPemWPu','W7zjWRpcN8keWPZdGW','W5FcHmoDse3dQYyFkW','WOS2WQDZW4ODxCodW4JdPW','WRZcUmoJ','Dha+Amk5W5ae','ce9PW5KRF8oRg8oRqq','6l2X5ywf5Qo+5l6x5Ps45yEr5AYyWO/LU5/ORRW','WRe7WQ7cLqS','bCkXoX7dQa','AvZdHCo4W47cOmkPW6m','W4VdSSkF','W6ldHCkidWm','EabFFmk/W49BuCkAWQG','W6NdGSozkCo4W70WWQ7cUmkG','WPmmnmkDbG','W7GSWRRcRrVcRe3dMrfw','W6LmwG','WOVcMSolA0ZdPse6m2S','W7tdP8oFcCoJ','WQhdQIC','zvKfqmkw','WRRcPai','W50NWRdcUXxdPSk4W6bNmq','WQKpa8kOoJK+ANnu','gmkUia','fSohCSoKW4X2WOvEp8ok','W6yeyCkGWQS','lM/cRdbe','WQWNWOZcGbZdKmotWP9SWP8','W7yRWRq','W4qOWRFcRqldSa','DMC4y8kQW6KaW6KLW4i','y3qTACkwW4S','W7CPWPJdPa','rCkrzmkXW5fMWRetmmokW5y','wt0oW79TWQhdUfnu','W5SIza','W4dcHmojdKldUY4lnMO','W6fVW7VdQ8k6xSkJW5icbG','W7/dJSohk8o+W6yqWQ/cHG','BJ0JW71QWQa','W4ddUSkueW4QEW','oUADVUATGoA3M+INJoInS+w8Na','bg/cVW','WQKiW6ddJ8ofW5RdU8kzqHa','bLvSWOmNFSoycCo8sa','gq/dH8kNtKxcIsnoha','W7PrWPlcOSkK','eWNdU8kwsf/cOZrvda','WOJdOsFdN8omF3FcSINcOG','aqqu','CSobWOLHBa','W4Chu8kiW4e','W5ldRXpdKSoO','i0fmCCkyW5m','nCkOnG3dNq','WOSobCkBbG','W7PziSkPya','kXhcSr3dTrJdU8o0zhS','WOlcPZzPvmkVWRZdV8koWP8','DKJdJCo6W50','W77dUKG','WQyemsddHG','aGVdI8kOea','veFcKrFcLq','WO0JWQnEW5qFtSotW7ldRq','CKZdJXLI','WRmdWQldSmoWxCoF','yKJdQZ7dVW','WOFcQbmTW7Cj','kGTxm8kJ','W4dcTN/dTfxcQmopq3DF','xK/cVSo3a2dcGHzXna','ymoiWQuzWPC','WOyIWPBdJSow','W5W8WO7dQwrakmk0','gqqEeSkx','WQ0ibmk+itmJxxvU','z2pdNmoQW4K','EL7dQGldUmklaCkDhW','5lQ55PMM5l+E5zkg','CsCUW5Ta','x8oiWQKeWPXByfmvia','W4NcG8oi','5Rs35yQm57M15P+p5Pwz6zs677+u','bNDoW5uO','WRXOW6G','W4e6WQhcReRdOSkSW7f6da','AvJdHcZdSq','W6K9WR7cUGZdQa','W7hdVdldHmou','8jQWPCom6BU86k6I5l+K55Eg5yAk57615RAS5yIC','WQ/cHJfrvq','WQlcR8obbSoR','WRtcPXbqqG','kCkWqd3cMXRdKq','WRHUhmoKWRa','W5G5WQhcVZFdRu/dHa','WRieb8kHkt8O','A+M7MEITUos5VUwbIoA2NoILLow6JUMsT++9PW','F8kOW4CUFCoBWPO','W6FdPCkhEG','zmodWQLXnCo3WOHdWRpdRW','W40XWQVcMbS','WQ/
|
2024-06-28 07:47:44 +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
|