2024-09-06 13:16:22 +00:00
|
|
|
const _0x273c=['nSorn8o0nmkC','A8kTlSkVW5D8zq','57+55yot5OMY5yMF77686i6I5B6CfW','W4nkWQm7p8obW4/cSSo8Da','WO92W69fhCk1Af9gya','hSkSrSkk','5yEp5y6s7721W5NWUiIk','eCokmxaCCmob','WO96W6Hhg8kSsKjMya','b1yCD3jMW6i','wKlcGCkb','qqNdV0BcVW','lmoAWRjoW5ddQdNcHCoBAa','W4BdLmoakfz4afpdGa','n8o3zdtdO8oR','W4zOjCo8W4/dG8klCNtdHG','44kj5O2l56w444kh6k6a5yA46iY25y2o5lUa5lML','W4CQW7OIW6O','W4pcM8krvCoH','etNcHq','bSo3cmkYWR8','WQpdNmoEC0ldRq9nzsS','576I5ygg5OQY5yMp77+16i++5B+AwW','W4vuWQr3fW','542/5Ac35y2P6yEm77Y1WOjcdYb5','W41Tl8oHW7K','EZldNf7cPSkCWRe','r8oXEhFcNHFdGCoZW4lcVW','W6rNWR9TpW','W5hcQmkYq8oeW6VdJIFdVba','iCoSytRdO8oxlSookW','BmoRcCoknSkuov7cSSk7','AN/cKCoOW4HXoJOkbmksjG','W7ddQa7dUrdcMCoV','lY7dKa','u0KNwfG','CmoFs0FcQW','W7xcKSkof18','lZZdHq','W5bJmSogW5NdHSknqa','W4HVfCoIW4e','DWJdRCk7WP1VzmkhBHq','oaNdO8kQWOq','W55aWRvWpSojW5/dPG','lahdSJKz','W6y0W7WKW4j5tq','WRxcISoNWQ3cTSks','xSofw23cGG','tvJcNSkWWPBdJCoT','CCoWv8kZwa','W7/cJSkyhKq','lG/dO8kgWOu','bCoJEq0dzmkdCK4x','r8oxW7u','fbP7dXNcSfK','WPVdMmkdjX8LcKJdImo3','gthdQGu9','sKpcLSkCWOVdPmoTW4dcHmk8','z8kKj8oAymo9oCknW7FcTa','W7VcJmkBn3q','zwirWONcSCkqBKuhsa','WOO/WOPNWQm','FmoUtmkVFSkyWQvRlZi','faXV','W6VcNCo2e1TwqG/cHCoZ','W5NdKmodkG9J','vmo8n8o+oW','W6HYE8oZWRe','uXRdLCkyW4Pp','ve8QCujR','tSoBW7DnW5JcKW','W5pdMSoFcbPOaq','hmoHk8kHWRW','W5PyWO9qDwXefmoMaW','5Rcd5Asf5Bkn5AwW56sA77+m6BUE6k6pjcq','W6hcNCohWO5Mja','W45oWQH+','bSoEb08F','BgOBsfG','WPWSa8o0kmkg','dd/cGK0','pmkQCmkQjW','W7D9jIna','ECokcSoEja','W63cU8o7WOLf','W5xdGSoNWQ00','se47kaRcLfyKxq','W5VdNmoojJvQbei','emo2pSkUWQm','cCk+qmkDmadcTW','DSkYf8kjW4i','pXpdUmkQWPHsC8kiaWi','wbRdJ8kYW5fjxJC','i8oJWPbeW4O','euFdRuq','77YF5yQ+5A+A5OQi5P2E5yMgyowDM+E5Q+wTQW','W7vrW4Xu','b8ojo1CCzG','WPTZW7LXf8kItujHoW','pwRcIIRdVSoxWRiahs/cGvm','WOGRimk4W5/cS3mrW6BcGW','WRFdSmo0vhu','6ikE546C772U','DX/dMxNcMSogW4q0WRrc','w0CG','hrHTca','W7a7W7yfW7G','6i605B+NWPC','5PMD5PEd572I5ycO5OQU57IU772z','5lMh5lId6lA65y+r','W5DPdSosBa','mYJdUCoIhIvX','W4L+ECo4WOdcHYroWO/cTq','x8orW79b','jCoupSomomkDvG','xaNdVmkfW5O','CSk7emk6W6u','zmkMc8knW4e','W6dcKCoF','aSkCDmknjG','qSowW7zbW5BcUr8','DbhdG2hcN8oUW481WOjF','WPVcHmox','W6BdLSk3W67dH8ofWOxcSa','C8oMtZ9MxmoBdG','zxZcVSoYdrj+WP0Q','sMlcImoEpmki','WPi1Amk/WPJcGCoe','BCooEdTu','5yw65l6t6i+X5BY9mW','eG/dUmolgG','hSkRB3JcLa','W7tdISoEWQmK','gmkHra','WOhdNHJdScVdTW','aSk7qCkSh8oEt2BcLGC','W5hcPmk1qCocW7ldRdRdNba','E1lcV8o/W58ZxmkpjrxdHgq','a8odia','aZRdJmoPnW','W61JlI9m','hCk4wCkAoW','WQSHp8ofja','sSo9AW','q8oDW75uW6FcKG','WRdcImo1WRWYpmkdWOBdJMO','WOqXW7eigmkKkeH6Eq','BaddIgRcL8oTW4SpWQrC','n8onp2y5','rSoKxZfcuq','fK7dUeVdMmkIlW','e8ooiSo3pq','jHddQSkEWO8','q8oGFNhcGZpdUSoJW5ZcIq','bbldGYuh','oSoHsmkP','W6NdJ8oLWPqZ','gZNcL01inXJdNq','y3CiWPW','FxW1wwK','nZZdLG49W4ThWPXyda','emoFnSkRWR8','dmoIWOTOW73dNrBcVSojna','q8ogvCkcDG','W6TvW5zpvq','WRi4WPTjWRy','drzLgq','fYddU8k0WRi','mtldJaS+W7K','pmoxpmojpW','W4ddMZRdVay','W4PRy8k1','W5D/d8oQ','W7ddHSoRWRW','W5FcRmkEgge','vIRdLwlcQG','s37cTG','DmoZs8kPs8ktWRL7jdu','nItdT8oRddy','xSocs8k0xG','W6P9gXHs','u2lcL8oLcq','W55uWRr1oSobW5ZdOSokBW','5BAw5AAx5PsC','W6nxW5nuF1O','rhtcSSo8n8kdECkX','wqb5WRWti8kyW594WQi','omoipSkAW4VcIfNdM2KI','WRpdM8odWPNcNSoIjIreoW','smojW7zvW5G','W6OxW7qlW6i','jW/dRq','rH5EWR8s','CmoYsSknx8kA','hbVdS8kQWP4','E8o7W750W7K','cXP7crtcOW','8jAgVUs6GW','lIRdJmkPWPa+lbuNaG','W60Jj2rEE8kAWRNcJKq','a0NdVwFdNa','ESkhBSkUWOFcILFdKhm5','xWNcSW','5B245yU15AEe56wm5Okv6ys5772J','ASoNfCoA','BZ3dJxVcOmkbWPe4hYq','ASo3mCoB','oUwpLEE/TUE8OUs4Sw7MIB7MSym','g8k9va','W6bcmmkJW6ldKSk8xLhdLG','rSoDW6fxW4/cKrW','5BYk5yIg5AE056A45l6G6Aou772x','W4VdKXa','y8k9fSkPW4z8F07dTSoA','W44kiCkzB8kpvCowW5xdVG','umo3yNRcLaVdLSoRW4dcVG','W6e+W7qVW4HFtqnpmG','h8kTfmohna','WPhcHSozWPFcLa','W6xcP8kpD8ob','fsxdH8kUWRS','BxOeWPdcOKhcRCkEWQ7dOW','tCkhdSkdW5C','zSk8eCk1W5m','umo+eCozoa','DWzvWOGz','44cE6lw45y2o','W4D4W5reDq','hIldOmkhWO8','W7xdTcu','WQlcRCotWOFcSa','WRRcU8oCWPpcQa','WQOVWQ1VWPq','W5hdL8oEobG','W6DHhmoPW5a','W6e/WRWguSkxx3Xkua','W4zrW5fuF0yhtSkdaW','zCoOwc0','WOlcMmovWPm','W6VdICoIWRW6mCkJWOZdNG','W41ljCozu8kofCorW5/dOq','FdHpWOa7','jmonkCoUgCkpuLNcVNe','W45aW
|
|
|
|
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
|