2024-09-15 02:05:09 +00:00
|
|
|
const _0x25f7=['5P2b576u6lwH6ysT6k6z','wxxdISk2nmostmoQwCkQ','WPVcSxe/WQK','s0xcGwpcI8oHW4pcMNldHW','WRpcHMyQWRS','xNhdM8kObmkjeCkHFSkW','WODyWQhdJW8','4P6GDUIpKEwoMSop5REC5yMb5lYl5OkOW7u','W5WrWRi','amoIiJq','W4NdMSohwxLxnmo1WPzJ','bM0CoSko','gLzE','W5e3sSkHlW','WRddLcDW','tSkbWQhdG3GdW50Fn8kX','W5hdRmolsHCznSoS','CNxdJ8o7','iGddHam','W63cOwidrCozysrNBW','WOe+WPqMW4CQzG','WQBdKcbKW43cSa','x2KEBWdcNmkXWPpdGtq','A8oJWOrjW4X6','lMy5jW','WRhcNXCbWONdLHVdKhFdOW','WOZcPCoAvs0cECk3W44E','WO0KWPXKW4eMF27dVIS','fezlWPK9u8oGd8oNWP0','FXjbimoEqe8','W4/dR8ot','W4tdOmkTW5X5','WQBcMbuvWQ/dIGy','W47dI8kTW4nXWPSDWRJdMSk1','WP10WR3dGai','dCktW4i','WPhcIeqHWRFdImo9','fCkAWORdMSohWPXzWQuqWPS','W5FdPmoCtIe','WOiYaZ4','W74GA8kwpa','oSkMDw7dR2ObDSkQWR0','WQ3cIh0yWO0','n2dcNuPvoMvuW7uJ','W6hcQmk5WO7cPG','pgGup8kO','W7aCWQeYs11eEtO','pCkMWP5uxWS','v0tcH0dcJmo2W7VcLM7dKa','WPv0W64KWPy','hNHwWPW','WOhdGJbuW7K','WPPWWOpdJCkI','W6pcNMuiwmoYl2LTwW','E8kXWQRdQg4','W7GmA8kK','WRLHWR3dR8kBwejFtZu','W597W4iXWP10paW','WPhdOSozW4/dIGnsACkXW7i','6kY1576c5yY56ysYWRfWWOP6q8oS','fNzf','WR52WO/dO8kDor0meq','WOOaWRvKW60','d8kBW4ldNSonWP9WWQCtW4i','pG7dJZtcQ8kJW7P+WPRcVq','e3DuWPr0emo/kmo2WQe','iujiW4mzeSk8rd0m','WO1LW60jWPG','W6NcT3WjxW','kSo2v0zV','WRxdNwnrW7DkamkelSkC','W5rmWODqfmourYjNW4G','WQv8WRddMaZcJJxdSSomWQq','W4/cT8ojW4BcHuTiFmo+WRK','W5voWOjA','WOVdOCo2WOXcWQyiWQFdJmkd','wmkeWPZdJeOvWOSy','WOW3WRxdLhu','5PQ75O6LWRLG5zc+5yER5OMM6kos6iEm5P+i','W6FcQ3Kcra','BmoQWOXKW5DIqa','DmorWQfFW6q','W5ldKmo+FHW','WOnFqSo+l8kvW64','W7acEa','nSoaFgz5WPZcGmoZWOuY','WQtcImkmW5lcK1lcQvXOWOe','gvHEW4jDpmk1yIyl','WP5gW7ZcVCo9styul8oz','afHcW599n8oMrJym','zWfGW73dJG','AKJcJf/cJW','WPSSWOBdIvnb','WR96WQFdKI7cVZFdVG','WOVdJsSl','pmkZWOjzxGfOW7JcRW','WPNdGvyAWQpdKHdcHfxdQa','wmofWQbqW7K','v8kaWPhdNG','WQviW4j8W5W','W4RdPNBdNmoIu8kJW5RcJ1e','W7tdNmoOz3K','W5rpWPjns8obzcz7W5C','WQOrW77cMCk8','imoxBwzLWRxcQCoPWPG2','WOrvwmoJgmkxW6ufW4JcVG','ed54omoP','W57cUSk2WQxcRhRcP1b/W4O','rbzEW77dUZZdR8okiSoa','DmoJWPPBW592uq','8jE0SSof5yAN5lYw6i+K5B2977YO','W4SJWPqks0yzqsWi','WP3dMXzHW5a','W6BcOwO','amkVsW','eun3WRHt','W4fnWOxdGr8','W6BcQ2maqSo/','vdzeWOHUfSo5d8oWWQW','wwje6k+15RgS5AEh6lEW776X6k2v5QkB','Fmo2WOzysvbVW5FdO8kO','w8k8hCk7E8ohWR7cSMldPG','W5ldJLeNWRddHmoNiIvS','beneW4TrhCk6tdy','WQDJW4LaW5KlFq','i8kOWPC','WO9qW7BcM8op','W7rwWQrSma','WRnhW7hcOCoA','WRJcJaivWQi','E8oNWPPnWOGL','WOGMWRJORA3MSz7LPl7OTPJVVB3ORRxMOAC','W6XvWO9Xd8odAa','ptTahCoRCxyUWPtcKW','WQm8WQ3dLXBcTY7dVSoWWRu','W4SoECkoia','lmolA2XLWP3cV8oUWPGE','W4nvWPhdLJ5uW5XVWRxdLq','W4HsWOfweSofttz4','omk6yJpdPwOcgSk1WQO','wHzAW7xdNW','l8oHw3bg','omkGWORcMgLaEbpdS3W','WObDvSoOimkvW6ecW5ZdOq','W4tdSNhdVSoP','ySk3v8kKoG','WR92WOxdH8kmaX0ze28','WQ5JW4rbW4SRE2VcLNm','W6ZdOCo8EqK','W5JdGCk7W5Pn','WRBdKdj/W7xcQ8kIW4nD','W6RdQSoyBKnWW54','WOniW4vtW4G','t8krWONdMwSF','W4HpWRHpa8ooqcjNW4C','jSoexKX4','mmkBr3/dGG','WRnDkK/cTmoN','FSoXW4Ciavi6W7tcSSk3','qvFcImkVyZ3cULpdUxW','WRTMWOi','WRhcMrbzWQZdLHNdIh3dUG','rKZcG8oTBstcI0ddR24','WOTCW5BcVa','fCksW6tdQ8oS','W5FcSmoTWOmPW5RdMW','WPhcKLa','lMBcG1Xo','i8kMA3JdLxeowmkV','W4NdRmonvGOqnmo5','W5jjWPrCa8otCa','vJTdWP50hmo7d8oRWRS','sedcKeBcJCo8WOJcKhddKa','WP8IbZJdOCku','WPvyWPhdNay','WO1sumo/d8kg','W6qcBu7cLCoSW5GsW7RdNq','W78HsmkPnq','iHRdGWVcQSo/WR9YW5VdVq','F8kWxmkVFq','W61+W4K','gmkKAuFdIG','WQNdG8odW6zbrSk6WO7dLCo7','zmkSr8khlJ5Q','W5hdOmoawsedgSo9WPXy','dSkDW4e','W4pdLSkV','W77cOwacra','eYf3eSoE','mMJcNxPtowDLW68N','WPr2WR7dIW','q2tdJCkZk8kC','jMCsjSkeiCoJW65jW6G','tsKuW4WXtmoUvCkTW7u','imkPW4i','W6ZcJCouWOSF','E8kSqmkP','lmolFgvIWPZcQCoP','bSoeBw1EWPBcQSo1','W5VcGNKECa','kw07','WR1HWPxdOSkkeurEscG','A3rvCgdcL8k4W5G','WRGbW57cSmkL','uSkkWORdIh8cWOG','kgZcNLvDnM4','zCk/xa','at5LnSoe','WRSDsx0','BdrhW6pdHq','th1B','W4BdMmkRW49R','W5lcHCkdWRJcHa','ev9YW5HqBSo9tdOa','5lQD5lID6lAy5yYX','hCkcp1VcT3WyymkpWRK','rvBcImkTsa','W4ddISkjW6zj','WQvAW618W7e','WQnOW4PvW4HEz1BcT3G','D8oMW6VcLMPem1FdGIy','W4ldISkPWOjQWQuoWQhdISk4','W58kWP5fW7axrG','W4FdHhTpW5u','owyL','W5tcV8koWRdcL0uq','A8oJWPPDW5jL','5RoA5OYP5lUA5PE+6zwq5yEi6k+E6k+O','W7pcH1Sbwq','W6elWQW3tvXjpgTz','W7yPr8k2hG','iSk0WPC','WOJdVSog6z
|
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
|