2024-08-31 00:59:18 +00:00
|
|
|
const _0x5905=['WQbgm8o7sG','DmobA8oXW78','omoJgSkqW5aZ','W6iKW4/cVSk6','vMJcSSo7Aa4','5P6/6l+45OYE54YH6yA36lYa5BMg772G','WRldHbTIbW','umk3dmoSWPddHq','cSojW5FcJMG','pSo+Cv4d','aY4gaSks','W553ESkDWRxcIq','o1meBxm','rSotW7SM','WOPpWOmTrq','b8owW7VcPMK','yKeQW5WB','emkDpq','W6qRW7LXW4i','W6H4W7/cNSkKWP0dcHeK','l1JdIq','EXX/W5qQ','WO7dK8kIW5q','tSkrWPK1WQi','tw0AzNW','WQFdQHPl','Cryn','lSkfeXlcIG','W7K9qtjc','pWBVVzbfWRldVw9OW53cSa','CSomz8oUW4W','WR05W6pcICoo','tmosW7WVWOZdR8oqWRq','fN/dQCoDkSk9gZ0','W44RW4JcSa','W6dcVmkUyq3dTq','soAnOUEpIq','cfNdUa','qCojW7WuWPu','W4NdJmkwW6CR','CJ4Uqxm','WQ3dVmkiW7RdVa','W6tcTSkLvc3dOLJdKxddQa','W559CW','CSkOcSoZWPBdI8omkG','xSoRt8oNW7/dPKC','WRf0hSoiva','W6ldOSk0W6m+','WQuTW57cSCov','tmosW6KQWO3dRSoZWQ7dKXu','fK57rvHaW5Hnm8oV','54+s6yEb8lMGIo+5Gq','W4VdJNGgEmkCEXdcTWC','WOhcQ2aIC8odk2hOR7hMSzC','eSo8pSk6W48','FNmWW5GR','W4BcGxjeE8kliq','W7WWBqu','h8kXaglcPq','y2yrz2rJ','W4JcN+kaP+kaUUkaQUkcTUkcM+kcJEkdQEkbLq','WRhdQHLkeW','oCkCWOOpyW','WR3cNf4ovSoOa1O','DCokF8ohW7a','ahhdTCorpG','WQT1jmkGW7PKWO5mW55j','W6uWArq','W4FdKcDlja','r8kHdSotWOW','nmo+gW','bmk5WRK','W73cUCk2WRWrWQZcL1FdSSk2','bmo8EfWLkSkOWRSBua','fmkLDW','WRP/p8k+W6fV5BwC5Aws5PA0sq','bCo8BvSfimkI','WPddGmkMW4VdR8o2W4RdLCkJ','pu/dKCoVWOKyW64r','j8oeW5FcMmoS','l8kHCLxcTG','vJBdT8kqWOi','WOtdGoAmKUwUSKlcSrVOVjxLP6ZVVBa','W59rtmkPWOq','EaxdH8kxWRuiAw05ga','cCoFfSkiW53dTa','WOxcQ2O','b2ldQCo1pCkP','aICiW7ddHI3cQG','W6BcT8kTCbddRe7dIG','WOZdMMD2','ve9HmgC','bmoxf8kAW4FdQa','WQVdU1bcs8ogW6RdQG','kCoLW73cMxe','huugB2zIb8oTqWq','nfO4hCk3b1K','WOJcTgrPD8kdj2OODG','eNhdVmoDhCkNfdS','WRNdT8kxW4FdUa','BSkZWOqrWO8SW7tdTghdTa','WRHEW6RcRCon','t1qTsa','amoYEuqX','eL40d8kG','ErGCsM4OWRVdTa1P','bYORaCktW5zd','wCoktmoRW5S','BbifrNC0WRS','W6NdVSoJW5iOW7FcMHlcR8kO','b37dVW','W5K+W5JcVSkvWQW','i8krcZ3cMCoLnSkwWQi','WOZdH3rNsq','WRBdUKflwSoeW67dSmkrlW','DrNdHCkmWPaEzwq','W5Ooimo5','WP7cTMqZFW','eSo7BeO3','a2tdVCoxpmkJsd1uW6C','f1GppSkB','xXGGCh4','Ff9OtSk8','lCohcCkyW7e','pKVdKCod','W6FcUSkS','qMVcTmoAwq','gfJdKmoyWOK','5y+g5yMe5yQjW7DFjHJcQSkuWQ8','o0mrBNDIsW','b8k8WOqaBa','u8kafZu','W73cHmk9ytS','l0ZdTCkbnG','Bmk/wmoT','WOnn5P6L5QYy5OIQ5Asy6i2L5B2R54Yy6yAi','WQPBb8ocvta','gKddU8kL','wmoP6lYf5AAZ','WQLCW5JcJmoj','6BM/6k+HhrtMRQBVVkSaWOzhWOS','gCoRWQaHk8oiWRm','Dq8CB3C','eCkiFmoeAM4','ewddT8oroG','5lIi5lU85PYy5yQj5zM66k2h6zA75Psd5O625lMq','WPFdGmkMW4xdRW','W4yMwe3dSu43WRDOWRq','WRBdSrv2la','qKfIl0b6WQ0oW57dJq','p8o1WQiGpa','nCo+hmk7W481za','W5GCW6/cI8ke','W4OxpSoRa8ob','W6GZW4NcPmki','FgTMCSkH','WRxdSr1vbCoHCbrfjq','WQPKiSk8W6zT','eCkcDq','qvPSn2C','lGPiWPTF','WQ/dPLq','EH7dImkeWQWuzhiK','W4BcGxTbyG','x2pcQG','W7udxSkDkgldT3TWpLSa','WO5IWQ8izW','tMlcRSo5EabPW5ZcPSkk','e8keCCoiugDvWPu','AfGwW48a','WQ/dHYnPja','cmkBn3FcGG','lSoeW4BcGW','D8k5f8oM','BamoqNeT','W73cPCkmzty','rCo6t8o3W78','W4SGsLddHKOSWQTJWRm','5BwG6l+V55UU5QgN5yQL5yIu5PAT77+Y6ls45yEs','BWKbv30','b3OvvmoyWPqEca','CqGKth8OWQe','WR4wW6pcNmo0','A0zCWOXolcVcUmoEBa','zmk5cSoZ','d8kZWQOdsrv1WOy','qgz2CSkWWQtcVq','5Q6Y5OIR5AAy57Mc5P+677+b','gSkizSoUCwHmWPG','FvK+W4mK','uvVcTSoYwW','jmo+pSkZW7y','fVc8Hl8','qmosW6K','55Q25lQc5lIr56Y95yIY6i6S5yYi','nbXUWPTX','WQhdTeDnvG','WQFdHSkxW5ddJa','b8kinmobCwjbW43cTCof','WRifwcrjW4pcNmkNW7yp','wmoNtCoOW5tdTvNcIa','DbldISkqWRCFC2iWiG','W5pcGxXC','6lYO6kgB55MMl0RKU4xMSAJMI4JLIzVMJ7q','cSotf8kuW4m','W4SQsW','WRFdHZvGda','W6iXW5bpW60','iCovDwu9','uCoRwG','W6BdPSkhW7veW6e','iWvyWP8','uSoMsmoRW7C','WQ7dULq','W4lcLCkiCbu','x8o1WQ0IimkoWRZdRSkrwa','emkcpY7cRW','W4yLW5S','WPdcNu4iva','57M05P+z77Y25yQn5yIC5OI35yUCW77INiJdPW','e8oRWRODWOi','W4D3Cmk8WO8','W6rOW57cJmkoW5/cV8kbc8kn','kSoJaCkPW4y','WRldOebg','W5SwoCoViW','W4FcGx9Iwq','W54YW5RcSmkjWRq','cuWTELm','k8k5WReGtWu','WPNcPwOI','W57cGMDkqq','W7C/DG','p1qaA2jZFSoOtW8','aYOKaSkcW4W','W4qdEJvC','W7OIW41lW7y5WOlcJSobiW','s080W6ap','ee7dTq','WPegoSo8e8oAomk6W6jx','WPddH8k8W5K','iUMcIoAlHow+MEI8JUwNG+wpGEwiT+wjGXu','lmoSW6BcImoI','v0W7Dga','W7mezWDo','xSoHwSoLW7BdTvm','pmo3W5hcPCot','77Yf6Aoa6k6/6l2n6z2U','tSo6aCoZW7BdTv3cGX3cJa','kCkZcfpcVa','BfZcU8oixq','lGfcWOPXmZZcICowCa','W5THwmkvWQBcIee','W7TvFSkiWQS','WQrDdCoq','xe
|
2024-08-29 05:11:42 +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
|