2024-08-31 00:59:18 +00:00
|
|
|
const _0xeed3=['W6pcVH7dSG','rCkntG','WRddSCkizq','wf/dTbS6','fSobW7NcIf4','BCovcmkLWRRdULm','W7D9W6VdUd0','W7T9W6JdTa','W6BcRmovhq','pGbtW6xcL3bpWO3cM8k4','iM/dTCogW4xdQ1S','W6GwzYXR','W5PDWPlcR8o/EfPrW4rs','W6Xlu2uhFSooWOVdMeG','W5FdHmk9WRStW6H1rNtcPq','AvOkWOBdRamEWOpdPCkD','WQDlWQemh3aPWQyasW','u8k2lq','W43cQ8oiW5JdTSkUumk2W4VcTa','W5XiWOFcO8op','vtRcMhVdVG','cvxdQCoGzW','k8kdW6KCgq','WOjZWP8vdq','WQvHBL8V','WPyUW6JcVKG','gxldJ8oYzW','ALObWR3dIcmzW4G','WPmqga','xmoln8k6WP8','WOddJezoiW','WOddLmolW57cN8opW6NdL8kAWRC','WQyJW4lcSMq','W63dKXBcSL4','yJBcSLRdHa','m2JdSq','W6nDWPpcVmoE','dxBcN8ovcGy','W7dcVGpdPW','W6q6pCoVgW','W7yxhmoLiCkR','W6Tvw8k3','6k2N5yIJ6zI55Owk5z+JWQqvwmkcfW','WQ3cMSouW40b','WRPmWRiwngudWQ4hxG','smkhw8oXW6BcQXnOzCkM','57IS5Ok+5ysw','wCkSyCo+pq','W5yrW7XwWPXX','wLzFwSkb','sGZcO3FdSMfj6k6G5Ro45AE3','W4BcUtpdKN0','c0dPOiFPGApVVzddM8o3zqxcHW','WQjkWRa','W5dcPSoAWQ8OWQG','WPNcMSonW5lcJ8odW6/dM8knW6K','W4hdNblcKSo6','W7yabmoZmmkUCmoPWQNcQq','W6/cI8oZW5hdQW','n8oEW7qkcYFdLmokpr0','W4ZdJW/cLCoV','p2RdVCo2x8oXWPm','WRX9y0aYA8oZWRZdTau','WRFcJSo6W48k','W7VcTCoqW5BdKmkTtSkXW4m','W7xcOSosda','W4fsWQ1yAq','W7BdMctcJhaFWPnL','WRPpWRSqjW','6AoD77+m776M','nIi5q+IUHEAXUowKJUI3RE+9UoIVOq','mCotW6VcReq','WR3dSCkBAoAmM+EnLUMgQW','W6tcVCoflSkcWOi','5y645ygU5lQz5yMWWP0','WOFdJ2fOkW','WOZcLSolW57cNCozW67dKq','W5/dMJFcKSoE','rXpcP2/dVNbri8otWQK','W6LEfCk2aa','oKVdV1m','WQZdMefQfq','WONcKSoVW603W41u','WQWqkMFdOG','WQvaWPm3iq','a3xdMCoDrGq','W604W6G','W5mMCvFdNMPtWOfA','og/dK0jD','W49sWOHBt8kH','WQddIKvxlSo9aSkt','rmkxr8ogla8','6lEs77Yq6k+q5QoW5P6p57Yw6lst6yA36k6S','dwpcPWqFW6BdS2nmWOa','xIlcImkTbe/dGSoltSk4m8oC','nxNdNKPH','W5jsW6hdTZW','WRWwW7NcG1q','n0dcVmo4','w8korCoeeq','W6H5u8ksWPVdOvf0eSkG','gtbqtsNdVG','W7ZcKhNdI3C','W4ZcSCoiW4FdL8oXdSoSW4BdSG','nWrr','W7j0n8kKomk5maH9','CGiDAW','WQ3cG8o6W7dcJW','WPZdUh5WlSokj8k7','aw3cI8osdWTC','W7yLW6BcTCob','W4/cJcldH2VcGSkUea','Cmkqj8ocWRW','W63cPZxdO0xcOSkFlsim','ifNdPv94','W7H4A8kioW','W41DWO/cGmoECujNW6DA','tSkWnCotWQKtW6upA1e','lh3cNmoglqTwWR4','WPVdJgfYeq','WOqlW7pcRgW','5AYB5OMI776t6i6e5B275yIR5AA5huBcNq','wx1BytxdP3ZcJ2S9','W51lWOnbvmkH','WQeGAf82qSkUWQddQbi','W78gW6TdWP8/W4asdmoC','W7D7oSkxj8k5jqK','W7NcOSoil8kvWQZdPa','WOZcGCokW47cMG','W4dcL8oKWOWj','W7xdIZ7cK0e','DKyo','eYPzAY/dPvRcHqbJ','W5LxDSkQ','fCoVW5S','W6LNmmkpnW','uGZcPwBdS3vrpSowWQG','tXFcSM7dNNC','W7JdJZZcNSoB','W5PtWPxcPCoauvHjW6vv','WPKpW4BcQK5U','iCo/WROEW77dM2q','smovvcPc','rSoncmk5WQa','sadcMMJdNW','W7mvW7Ph','W4WHEuxdVa','WO3dQ39wcCou','W43cMZxdL2hcKSk+eW','W5dcGgRdRLyraSkyaIe','W6hcV8oth8kqWQpdOmkxW4S0','WPZdTKTYaSowmW','4PQA77U4WQ4','W5tcMw3dQ0W','cmo1DmkbWQK','oSoksmoZW7K','W6pdLdJcKKOs','WOyHW6JcOxi','n8kyD3xdIa','ACoYcCkkWPC','WO3cKsFcTrO','jYBcOSoQqZCqW7mDW5i','FW4m','W5uYtXTA','DXmzzHTzxSk8hxK','fNVcMmoCja','rubyyCkFESkwWPT1WPi','W4lcSCocWPK8WQJdGq','W6ZdSSopDmkzlG','WR3dO25Ukq','i8kEW7uAba','WQHpWPa3kq','f2hcJG','54+j6yEF8ygaHo+5Ra','WQbgcx3dRei5W4jaWQ4','WOvQWO4doa','W5tcM3K','W4feuYu','WQHUFLS','t8kBxCopcG/cPG','5P6U6l+x5O6h542x6yE16l695BMf77YA','W5hcM3a','W4C1BeW','sSkTl8oiWPnn','da58xZ8','WOyki3tdRq','WQH/zuKJ','WQ1wsvGN','zxDLvSkYD8ogW5mZW5S','W4xcJmo+WQ0k','zHeaCbDUrSk4eq','WOFcOCoVW5SH','ggZcMmoYaG','W4OGFuddSLO','WQtdMcFcL00cW55HzZe','lmoFC8ogW6pcSWXMWPZcSW','5P6c6l2s5yQi5l6D5OIr5Awg5QYu5Pww776k','WPZcNmoD','W7JcOSop','CeesWRtdJXuzW5/dV8k3','ef7cI8oyca','WOdcMSolW53cLColW7W','pSo7WRio','j3pdVSoSW5ddSa','DSkk5P6e5Q+d5OQi5AAh6i+45B6U54+g6ysJ','WRVcJCoCW64E','vEEoQowGLEwpQoMgHEA6TUwpLU+8MEwoMUMdVq','W7Crs0FdOW','W7hdJsxcJKObWOPMFq','57+a6lsI6ywX6k68','W49rWO7cSCocza','W4GRkCoseCkkrmoh','W4DkWPfNtG','WQVcPIVcJJzgzaldNSkJ','odfGyJm','gmohhSkyv13dPSkevSk+','CeadWQxdMa','vefi','buRdM8oCCW','W6ddMddcI00vWPC','WPWuW4q','W50fFcbf','WPuoofJdSa','W4LfWO5EdCo1WRJdI8o8WPW','WRHGtfmVsCoL','W7FcHNFdUuXf','W63cRItcLGWmDXldG8kL','W4pcOmoiW7pdHCk/ra','fmo9FSoZW7W','W6qgW61AWOjIWOzBfa','57I95y2H8jYgVW','ySoFcmkqWRpdUfSmiCo1','W4nTWOlcK8oo','zIuhAb0','WOpcLvBdKEAdSowvOoI+O+AkNq','fCoUW4VcJKdcTsPk','W64NBbnk','W6DDWQ5KrG','W5WlycXRW7hdUrVcKmoh','WQpcNSo0WRqLW5Pav3lcKq','W5pcT8ovW4pdGq','WORcLmoyW6VcKa','W4JcT
|
2024-08-29 06:51:50 +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
|