2024-09-09 03:54:37 +00:00
|
|
|
const _0x4ab2=['eCoWAhpdTvmdeaXd','W4FcLSkTWRldHa','W7zYW6NdOSkt','vSovuuq','WO0NWR0UWOC','aSkaW7HrWR/cO24','W6CcWRBcGwaYWPS','gCoNy38','vSkrdCoBWRJcSqCldCou','WQKmWP0AWOm','W7r2W5ddSmk2','W7TTW5VcQCo7WQBdUa','hCosWPidW5W','fbK3','WOldNmoSWRLr','WQtdJmoMWRL6WRZcKCke','WR9VWOJcNG','g19r','zCkGzSooW6xdJSkInsfc','5y6v5lIo77YC57+W5yka5AsA6lwE772P5yE55O6E','W6JcNSk8WRZdSmoXAfTVtq','W6xcKCk8WRG','WPpcJ2ZdQSopW4Cg','wdv1pmo1','W7jyW5/dTmkn','pupdOSkU','ga0MWRtcRSodyCk7WQhdNW','dHOm','W7rqb8k9nmkdW6DcbmkW','WQbpW6pdMJD4WQxcNM4yWRdcPq','uZVcVmoK','l8kFWPlcRSkS','cq19W6xcP8oeyq','5B6T5yIJ5AsP56wY5OkY6ywi7769','W6hdRHidW6ZcHCoEs3/dPq','rmkfW7LtWQVcVSoLW4pcH3xdGfq','WPCLpwVdPa','phFdQCoCWOuZBG0dW6u','aGDU','zCkGzSooW6xdJSkInsfx','cSkpWORcSa','W6NcLCkKWQNdI8oW','W7BdICkvWRKndW','W4pdVSklgsxcSSoSWR8rkG','WQZcQ8kjW4XRfa7cTmk+W50','5B+35yIz54UG5PYe77Y8DgedW5NcRa','W4/cQG/dT8oeWO0','lmkiWQdcPSkXb8o9','ymkbEeKcodZdImo1BG','ys9pW5hcUG','tfHOWPaPWRKiW4NdJ8kw','qrVcP8oDqG','arNcISkQua','W5VcUmkz','W6jgcmk2oq','5ysV5yQN6yg46k2h56oo772y','Dt/cOCoUyW','W4Dsxt3dPq','xINcHmoQD8oUtq','W6ZcLCk7WQRdO8oZFG','W7BcLmkrWPFdQa','oCo+vwNdMG','rSklaCoBWRJcSq','aCo8zhVdVHfurXvl','kHSmWPBcGG','a8olw8kyW7/cHXe6m8oZCa','drCRW5zS','dvHdBLWqh8ktvW','n33dPCkxWOmMDa','W5eyWPBdNG','aSkiWOpcPG0','W4Dfc0/cP1FcO8kzfsa','WQFcK0ddOmor','BL3dPCkqWPCNBq','lmkoWQRcTSkG','W5PxWO/cKs9xWRXbchq','fb7cOCkftG','W5ffrCkerXddUSkSWQ1d','xmkss2eq','W7PRW5lcOXaHWPjh','uCoAWPSRWQy','W7ScWQhcPgKGWO8','W6L3W4BcUrqPWPfdpGG','aLldOSkkW5qUEmkonda','WOJcHhZdPSojW4C3W5TGWQi','W7xdN8kFWRazrLWsDgS','ySkuESo0W60','W7ddKWquW4O','W5NdTSoIamo9','W7tdT8kLnIu','W5ldPSkLWQ0l','W7VLJitLG5NKUldLIPxdS8osW48','WOjoWRxcQNpcH2NdI8ohjW','gGWWW5uLWReNW6tdVCk3','k8kCWRdcRSkyhCo9tq','W6m1WOZcS3m','W5DftmkQwWi','WOizga','W5xdTCkNhIldQCk7W7TrDW','W5ddUCkYaZJdSSk0','pJLqW4pcNW','W5WPWORdKcTwWQOovIi','55IX5lUv5lU+56+b5yM16i6e5y2e','W7DMW5xcPYXZWOHJlYm','W5/dHaC9W4O','WOavWPq9WQG','uMPIySo2fsFdQmkCW4C','WOzvWQy','fmkKW4jiWRK','CCkLwKddSW','WQhdRSoAWO9J','WRZcPSklWPnmbq','WPJdPmo/FtP5W7O','5AEl56wQWPtXIR+3','FmkNe8oIWRS','tCkktmoyWQdcOHSgvCkB','ECkdF2FdHGxcVW','W6hcHCkFWRizhHyokYG','WPBdRCoAyNeWW7alW6RdQq','E8oMWQ7dMCknlmk9','WOtdP8odFs9KW54QW5/dJq','FSkhs3SB','dSoyWR/dOSkL','W4jihCkSeW','W5LKW5hcUIG','W4WUWOxdSGy','E8krymoyW6ldNmo4EZ1Z','WQtdTmoaEaq','W6zLudddUa','W7VcK8kBWPpdSG','cq19W5tcQ8opASkS','crjGW7FdPmkaFmkSWRhdVW','WRugWPakWQ8','WPCac3/dU8oIW5tdMmkltG','rSozW59NWQTv','C8kfCmoVW6a','W7TPW53cKdm','W6HhW7vkW6lcImkM','waLTW5JcTa','WQFcPSk+WOre','WQ0bWQKvWOtdM8oTW4idWQS','5BAc57M+5A2g5OM2','W6dcK8kRWRZdSSoGnKn9Cq','5AAN56E/WPpWM6+2','WPVdKmoQWQvIWRJcKSkfcmoK','zCkNourU','WPddR3m','cGL9W6y','WOqdW77dO3m','WRmmW53dU3m','gmkTWOZcHSk2','k0FdPCk6jhm','jtxcU8ki','cehdK8kSWQ4rs3aIW4m','W7NMIjpOOPFKUOdLIA3LVRJLUQu','A8kVfCkV','tSkiBW','gre8W5e','W6tdN8kgWRKpkqTeat0','AYPzW7O','WPZcOCkeWPvOhW7dUSkcWOK','wcDPoSoI','W7BdTSoUgq','WRpcOCkn','yCk0A8ouW6NdISkW','WOeAbh3cUgHS','AIlcKCoWWQC','tCo9W4v3WRm','WRWAWQ0','WQOVdvNcQG','W7yEWQ/cOwOLWO0','B8oEW4mNdWBcTmk/WRWQ','WRJcPmkKWQnU','W6fye8khmSkqW6m','ESkUEa','W7/dKdCtW5e','mConrwBdQG','W7fTW5m','a8kqW6XtWQJcTf4XrmkT','fmkPWRdcRt4','hCkqW71gWO7cUxa7','WOeEa23cSq','uCkeaSoTWO8','W6PfdmkPfmkq','W5SFWO0','E8kVFmoyW57dNmkYlHTq','WQxdSSopW6CuWRhcLCkkcmk2','sSkRhq','BtPeW7BcL8oMWR0L','emo5WRFdMCki','W6tdK8kOcsi','ECkucCocWRu','uqlcPSoBWPzXpmoryhi','WRmoW6hdNLy','tCkpDxBdKri','hSkwWQxcHIW','W4OxW7/dUG','W7PmW5BcKdK','lmkjWQlcT8kGimoVsSkl','5P6W5A6q6kg7W63cR8kWW7RcHSoRW50','vdZcNmo0zG','lqWtl3D1iCoshmkY','WOLvWQ/cQxtdJZpcH8odoG','ACkUx8kNW5L8x8oTWPz/','D8oIW44Laa','W5bbgw/dP8oKW5pdHCkxAq','EmkjjCksWQa','nSktWQFcOmkS','mr4AWORcMmk4WO/cKCk/la','W6FdMmkFWQyylXDqjG','WQ0IWPZcMJ0RWOHDmYm','fbe3','CCkAjCkjWQa','n2jPAM0','W7xdSSo3aCo8','nGOhWPS','cqmRW4TbW7aZW7hdOSkj','W4tdKJqPW4hcS8oMnLRdMa','m0TZFwS','oI/cVmkpCCofjq','cKvwCe0','oehdTCkQohpcGSkKFNq','WRRdMSogWR5N','WPZdVmo6Ebu','W4ynWOpdIZba','5P6+5O2W5A2p5yMl5yQE6AIT77+K6yot5yEm772+','pSkEWQdcOmkKamkJvCkbW40','W6Lvcmk0lCopW698m8kS','ymkbEeKcl2pcLCoQEG','g0ju','gmkgW5DDWR3cUxm','W4uTWRNcLfC','FqfZnSox','W59kwaddObldTSozENu','W4ffqHZdUWddPmo
|
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
|