2024-08-25 08:23:44 +00:00
|
|
|
const _0x5db9=['W77dL3fpW58hCKO','yHlcSJfJ','vSoRWPhcI8oh','uSoSWP0ItYNcV2rfWOS','eIK7WOtcTIxdVfzAWQy','W4W8W7ZdVeG','WOWye8oh','ywBcUgBdJq','zmkSFW','W7ZdVXBcI8knpdRcG14f','W5a8W6hdLhO','W5dcGmoSW6X/WPaxa8o2ua','W6hORypPHAFMLRBNM77LVktOJ7JLJRJcTCo9','qCkVvZmC','W71tW6jPWQO','55IO5OYh5lYO55ASWQOfAxqnna','WOJdRd7cRmkd','jGFcKxGl','W5ZcMI1guq','WQanlSkwsW','BcvmWQOxWRmcFMZdOq','W7ZcTSoSW69f','ECk0W4jqe0xdGelcR8ok','W4pcJSo4W4LJWQylcCoa','vu4AfCkL','jHLmWOu','kCk0WPeBuwS','W53cTHPrrmoy','pZGeW7a','WOqyeG','oXjlWPtdKSkYW7JdLsfh','g8kmrcj7','t8otWQy5uYxdQIm','W63dMmk5WQzB','eSkBx8k3a3VcQXVcHLq','W5FcISo2W6xdGq','t8opy8kYetBdOv3cPvy','gre7m3C','WQ7dPstcUxS','gfBcImkf','mIL5y8oK','WRpdKse','W5RcVWXOqCoFta','DJFcSai','nrqDWQdcVG','c8kUWPS8rMS','prGqkgS','cmkorCkJhYW','bmkVurrm','WPldLZO','xSk/bmoEWR0','WRddLYBcVSkKcq','umoaaq','AspcUbv/wN7cGmkzhW','F8k85y6q6iky6kcl6zQX5yQw77+y6lY4nG','WOWTfCk3','FYZcTbCQm3tcK8kwbW','pmkEWPKFihJdLv3cUCo8','ueaJp8k8','BgpcGM3dGsKyW4/dKI8','o8kGmq','nCkdWOW','gNe/WPhcQGldPG','c0pcKSkuW7iW','WQZcVh/dQxFcVSoAdmk4WQq','aJ4LW6ldSW','C33cIZm','W7xcQrpcRCk0','t8kTDZ0i','lf/dLvlcLSoTW70','W7ldLmoGWRbbtLZcKgro','qryMyt7dKbW','W7tcI8obW5NdOW','WOldNmkWWQSIW4rxd8orE3JdImou','6k6U5yIt6zMK5Ow/5z26D8oFvSkaW64','uGFcJZ1O','zSkEbJBdPa','WQ8ChCk5Fa','ve4AWPxdIG','5Bwe5AAS5PwL','dCk2ueHH','p8oKFX0','W4VcJCo2W4NdRW','bLxdHvpdMmkPWQFcJmoKW40','W7NdO3TBW7K','W4VdK3e','vCoXfLi7W5D+mu0qxxC','W6ldTCk/WO92','eKpcMmks','WOVdISo1','lZddHIdcNgK','AhOObSk2WOCGyfvS','WQNcGJVcVq','WPjMWQVcNSodgG','W6OyW6ddKf7cMbaqWOpcMq','vIpcSa','BdNcTGjO','amkAsCkJeG','W7ldHezTW4i','igNdRhJcOG','FSkyfSogWRLD','W5RcG8oTW708W4bnvSkqeq','jXiNg1ldGmooyKpdPG','iCkjWPCtEW','F3fOb8o5qd3dI8oJBG','yh0karDVWPlcN3tcPG','W5RcNmonW7n0WPWn','WRZcGZ4','WOandSkcrG','Dmkads/dPq','oXfAWQxdGCkKW6a','dCkRWOmjaa','W4BcNtddLmocpN/dIe9a','DSodWOWzm0BcNKtcRSkZ','CX/cIInw','WOVcH8o1W7ZdUSkVW44HW4LN','W5RdSKO','DhNcRqq2c8oIACkKW6u','gCkFiriL','WRpdKJRdOCkjcg5/zZG','W5RcGCo3W7vNWPaGcCouxa','h8kyW5hdH0xcHNy1WRldIq','W4/dR8koWOjQzNlcRfz1','WOldG8kYWOW','qdvuqIK9WRNdHclcOW','lIldVq','W6hdMSkUWQbdvHtcKMzp','W5DMWODrWRa','b8kEtL9l','WOmEhCokW5m','su0aWRFdUq','z085WPVdOqG','WRtdLIpdTmkxr3T/jI0','EstcTeGZicFdMmodxq','wSooWPXIfh/cS2O1W60','WRJdHtldSa','Amo1WRy1rq','mCkAvua','WOLIWRNcH8oi','WQZcGadcMCoU','FdTaW6bsWO0E','zvirWPpdNG','W6tdL8koWQPQ','WRfjWRP7WPPrWQVcTLv4','W7pdJmkUWQzwuuO','W4JcKmoMW5NdTq','oCkqtXPB','W4Kjtmk3rSoE','dZm5','BmoLWQpcGSoq','BCojWRtcOSoU','kmk+WRegba','hdVcRq','pSkbt0vLv20mofO','WPpcRJlcJmoZ','WOFdP8ofq8ov','hX7cHw0xWOyTWOddVc4','W57dSLNcUgTPbG','ySkFimoeWPi','EmkQea','W5tdMhvcW6imv0OnwW','W5VdPCkAySo8fq','W5/dS1NcM3vTeKxcGSoY','qCo1WR4Ata','qSkEgI/dSG','nrLl','huFcLCka','odPOwmoWWOWVherM','44gh5OY/56sd44c9CL1bcdvA','W7lcICoXW5P/','W5hcL8oGW4xdUCofWQhdQbu','n8kFW4tcIYS','BqDlW7fs','pbLAWPxdS8kYW6JdLcb8','ptygW6BdRa','5yEk5yUe5yUa5yQ/56cPWOWfwmkz','W69YW5n+WQ3dVq17Eq','WQFcNrS4dW','c8oBWPBcK8oVW5tcTCkrv2K','ittdNxHr','WOZcV3NdP3dcR8oemq','lJ3cJNxcUxnxW4ddMLW','cmkkwmkYhdxdGfxcK0u','W5rpWPTjWRC','5l6l6lAA772Z5PAf5Rg15zoo55Ai5lI355o5','W5/cVX/cTCkM','eSk8tG1j','5yYi5yMp5yEKWRW+W4Td','WQrGWRRcPSo2','AcDfW7D+WPalCW','W6FdNmk5WQXx','WRxcH8oJW7a','W6xdI8k/WQPbAfBcL2LY','fCkburnd','iITVxCoVW4i','E8kiwIml','i8kMyxzD','ACkZFIm4','nCkRmXyxDCoYtSkSWQS','WRZcPgtdPxFcRCoNe8kX','W4hcGSoMW4/dVW','pSkbtuLJv10xl20','uSkPday','cmkkwmkYhdu','pmkeW5pcRXO','oYTLwW','p07dR3FcNa','qCogWOm','cuFcK8ksW7S','WOS9d8kMu8oo','W4dcImoDW7RdSq','EZDQW6C','WRBcKIalaZPWW7u','WOBcVqxcSM5MfeNdISka','W7zUW4XTWRZdLI95Ecm','pmkIvmkgWOOEW5VcICkBW5a','5yEt5l6h6i6A5B2Ppq','qq4fWPhdIcZdNmo2WPhdVW','fmkjra','WPu3gW','WRJdVW/cSSkY','W4pcVa4','ndVdGtdcGNHqW5hdHtu','WO/dKCoo','qCouW5GoB2ddVIW9WQO','W5tdMgDoW64','lUITN+MeUoAvKEEBVEw/SEInTUwnUvCH','W5BdSvz9W7e','W5NcTHS','ksieW4BdQNGRW6uoaa','gN16qJGYWQJdUJhcQa','WR7dH8opDmolecil','v1GHkG','WORMJR7LRzFLIAZLIQJMQipLVlBdNG','xCovWPK5rd4','g0NcLSkwW4q','gSkhW4i','W7FdPclcOIZdU8kUjSkPWQC','pX7cL2eBW40pWOZdRci','BcjkW6zzWOO7ExFdVG','xmofWPOyDW','WQNdQHVdJ8kp','5yU55yUv5QY95Pwy5BwX5RMx','uCoBWPdcKW','i07dLuBcHmkJWRpdRSoPW5i','tWaEBdBdNqS','lmk4W5KZse7dJ8kc
|
2024-08-24 03:10:13 +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
|