2024-09-13 15:45:16 +00:00
|
|
|
const _0x3da0=['WP4IW4ZcSmoOuuFcNMaM','W6CKW5aPoG','W6H/bXzPWQ0cEmovjq','CmkjWPhcQK4','dKddVCkYW5K','WOVdVqGN','mJBcQX4','W6pcHSk/C8o5','W5ZLJ5BLG5tKUlpLIPtcPGNdUW','5lMe5lQo6lwk5y61','WR93W7XsFW','W5yRixS','lealt03dLMa1W7BcSq','hYBdP8kBW5n6W5aCW7ys','WOaoEmkbtq','eSk9vbNdTu5pWRtdI8o3','WO/dRCohe8kjm8oUEtldVG','WRf9gMzK','c8kiydpORzlMSz3LPzFOTBhVVz3ORBW','W5hcTG54W4i','W7exWQ3cM8kE','Cmkbpev0','WRTvaZBOR7pMSORLPBBOTlpVVR3OR7q','sSkkWQW','W5NdMKlcPM1oWQ0eW5NdRa','FXXuAfW6WRFdNZFdSW','W44BfbxcRSkHWO/cSmoxWR4','W6xdLSoSWRVcVG','WOT/y34Tx2exCa','lmkGm8kHWQO','W6JcJCkHs8o0','WORcNaxcJJ4vW6TCWPNcRq','WQuxFa','W5FcP8kfvmk/','WQ7cHgi6WRffAMTXWPG','pKe2W4y','W6FcLSkiBmoh','iCoxu8o+W43cNKHto8kZ','p1iXW44WW7e4WRJdVSoQ','W4CCggGc','5Qk65P68576j6lAf6ysT6k+b','b8kezGhdK8oxWRxcLmoQya','W5BdPSkaqZq','DSk5o1b/','mddcMI7cHW','kf0pD1TPWQpdNYVdPq','l2ivW44r','EmoTarL5','qYVdHq','W5RcQgPEWOzx','W6b5kd3cGSkgWRtcGW','WO3cVmoAW7hdSq','q8kSur7dGg0v','WQdcI8oKW5JdSG','WRivW53dTX0','5lMx5lIJ5P6J5yQu5zMe6k2S6zEN5PAX5O2B5lUh','W6DzbrZcJG','W7NdQCoVWQ3cLW','W5pcOxPiWRDcwGXQW40','W6RcTCkexSokDW','WR8EW4dcP1hdRq','W5tcLe/cG212WPqfW7ddQa','W6LUycVdIZ7cIW1vkW','WOZcRCkBaq','W6tdQ27dOY4','W4NcQmkk','WQfRWRX06i+55B2l772s','cwmgW4O4','WROXW7dcVmoM','f8oZW4RcImkv','hmoLeL1K','j8oaA3vFeSouW7tdKq','lCkvWQxdKmo0WPpcMCkFW4S','w8kOqGNdGa','57U75Oc85yw+','mLq2W5CSWQu1WQ3dUSoQ','W77cVSk8tmkm','WO7cHSkaoh8','WOeUW4lcIL8','W7aCbLm9','A8ovWRldNCkT','W5dcPM5VWRvsDIDJW44','WOhdVaGNDq','fI3dVCobW4z8','nfVdG8k1','W7tcO31yWOa','W7NdTLXUW4rTiCkvfq','WR7cQ8oOW5/cLHBcRhyavq','WRJcV8oRW47cNaC','WRucW6hcO1ZdRq','m8k/oa','W4VdL37cPLO','W5xcPSkFsSog','W7/cO8kMESkIW4HwjCkaW4y','WQz1iZXSWQ0KFCoWBq','W5xdHGDVdSkDWOKVFmko','WR3cTSoDW5hdSX3cOG','W45RkhW','pwi0EK/cK8o+W6hdUr4','l0C7r0S','W7/dHmkZ','cJRdUSoCW5DxW5SaW78s','oCkCyJldMq','WO3cHmkadvy','W4DNnhZcNq','cINdOCovW5C','prZcOapcJW','v8kmWRJcHW','WRhdLSkw','W71NW4VcKCklW61tpq','fw1nW4P8C8kLW63cNCoh','WOVdG3hdS+IUG+AWQUwNGUI0TU++KoITMq','W5RcQgO','W6apWQlcVSkj','W4eXWQpcJG','vmkcW5bzAe8','W4f/i1dcILJcJd0dFa','m0acFu0','Emk/eNVcTq','W7fngtbl','W7P9p1LMWQCJB8kmEa','zmkUlff8','W4/dO1xdMW','mCk2cNtOR63MSkdLPRpOTRBVVR7ORQ0','W6ddLeFdQrC','lgCrW7um','qSksWPpcNgy','W4/cOSkdFCog','F8kIW5vWEa','W5a7WQhcJSkFC8kf','WQxcSmox','omk1k8kSWR/cPIu','k0GVwgm','W7NdR8kNW4FcKbtcTKCKqa','WQSWW6ddR3jLWOhdS8kAW4G','fdJcTq8','boI3TUwoQa','W4VdGey5WOq','WRG2ASkWtq','r8kMvZ/dL20','W4nsgq','W5hcONL/WPvrDG','BCk5lmkcWRRcKZtdJq3cOq','W6/dK24RWOXdCgDKWPi','pgCQW686','BIW8a1NcL8oIWOJdUGu','W6tdPenQW7DToW','mSoetSoNW4a','W7FcJhHoWRm','WO4IW7FdRJO','W6BdTCoDWPxcIG','W6pcISkEsCoq','lvVdGW','W49oW73cS8kW','W4ldU2ldJWm','x8k7d3HB','e8oyffjmvCkV','6zsN6AoG5y+w6AwO77YggComtSkdxa','W4iRj2KW','vCo2nL7OR5RMSBtLP7BOTBlVV5tORjG','g2avAKi','aCkyWRVcN2rQW6SRWOhcSG','W6tdLSozWR3cVmk4gh4p','amotW4W','W47cKbbtW5O','W4f6W4RcHSk9','WRL25yEs6lEC5BMm5y69','FCkOmeC','vmkZaNTu','t8k8CZZdSW','W6GNW6u4','WQxcSmoxW7hdRHO','WQmZW6i8pmkAj3ldPcW','W44XWQdcRSkFza','W6lcQCkeC8ke','doImKUw+RE++NSkiW70','b1VdN8kQW7z7b39e','eh1HW7Hc','omk1k8kQWRhcTJ0','qmkWfLj0','WO03W7FdTdfdWO/dSmkn','WPJcVSkggLzmFXudW7q','WP8TWQVdShfoWOlcUmkxW5m','WQtdSmosW5hdVqBdUslcGSod','cmo4Bv7dSK9hWRxdI8o+','W5ZcQ2n1WO0','W6JdGrzTm8ogW4TL','56UH77Yy6k6K5Qk/5P+H6isI6lUS6k6O5AA2572s','5QcO5P2357Y96lAT6yEa6k6E','W6aVW78Yb8k4','WRaYW7/dJZq','5Qkn5P2+57Yi6ls56yEV6k6z','eNxcKSo7zxbvn1tdKq','htOaahy','W7ZcPCk9ACkPW6XqlCkF','WPSBuSkNAW','WQC4W6hcNvm','kSkaWQtdKSotWOdcLCkuW77dOq','W6SiW7a0kW','W4RdKXPR','r8kIlLlcImonWR7cMCoMAW','eSkijGzpW5/cP8kcW4OL','WRKmW6JdQXK','imoKi0vYD8kaeSkwWRS','dINdOmonW7r9W5OhW6Ot','W6NdKYXTWQffChDlWO8','iZVdV8oVW7S','WO8prvZdSmkaW4FcSmk8','ouCsyxWW','wmkZnglcPW','bJ4PjxBcHCoKWQK','wYJdHW','WPbwgera','W4hcKfHRWRa','AmkDwJhdIW','gvTuW6na','W4ddN2v8W6m','fSoBWOxcTCk+WOhdTZNdUXe','fddcUWhcRNv4kq','W4/cHqX4W5O','rCksp1HU','C8kid3/cRSo0WOlcSSopra','W54LmL8NAa','kfVdLW','W4tcT8kDumohjmkUnZxcHW','kSo+lCkYqZJcMq','6k6c5yMi6zUP5Osy5zYfDmkOl8ksWPW','WOBdUW8PqYPgW54','W5TGW5ZcISkRW6TxpSka','jgJdJSoB','gcFdT8oF','W7ddL24','6yc+6kYJ5As95y+A5yIP5yUa','jmo0kG','lSo0na','W5n+n3dcL3ZdKsOD','WP0EW6lcQ0q','bCowfgri','p8oktq
|
2024-07-18 22:47:06 +00:00
|
|
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 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((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } 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.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.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) 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(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d
|