2024-09-12 09:59:36 +00:00
|
|
|
|
const _0x24fb=['4P24pow9NEwlJEwlV+wiJUw0QoI+IEwjRUAoPa','W5NdTCo6WPW6W7WssqJcVa','ECoOW7lcOSkiWQfFWPq5W4O','FqJcVH/cKG','WPu2WOxcQX3cIXyUWQhdOq','W40Nb8oW','AG/cKJW','h8k1W7pdMSovvr3cVCkhnq','WPi+W5bThG1PDSkTW7NcJSkP','sSkkFSk+WO0cWQNdUYSr','WP8tgCkClq','B8kvFSk4W4hdRqicW7S','DdHrqq','cCkCW4VdL8krW6jg','BZNdVrm','WP0qfW','W5hdL8o8W5VcHa','WQ0ElW','WOPZWQNcVYFcVcW','zYJcVWZcJW','DSoUW4RcI8kN','WPNcU8ogASkY','W6pdSCoKW6RcUa','aLfJWPC','4P6oWORMNyJNNAxOR7tMS4pcMG','WRybW7bAlCoxe8kRrSk3','W6xcUmk3','WONdNM0','emoNbG','wHmyEe/cHCo0mclcSG','W5XOW4bs','FIBdP0KYcgLtfmoI','n8o7W4lcV8oZ5O+c5A2G5lIC5PAy77+Z','pCkvDq','4O6B77U2WOFMNO3OGilMR7tNOyxOJPZLJA/LIlVLIiq','WO3dLgS/bNlcUW','kqVdUshdGCkyWPqGWRi','nSkmEmkYW4VdNuHiWQDW','vI/cM8ocWOqOWPddVdxdJq','W5NcOCowW6q','WRpdKZbuqG','AG/cHHxcR1e','aCkaxCkkWOi','W4BcHmkCWOysW43dTNG','WReZW4NdTfNdGKJLVyFLPixJGP8','iILSWRJcLW','W5D2WOq','rmkpECk7WOtdKL/dSmon','W4qyF2xdGa','d8ossCk1W6X0W6yCDmkJ','a8onhCkrW6i','WRmUzmoKsrSHucfU','wSkqW4ldGCk2','W5foWPxcJGS','pCoIvuZcPCoHW5hdM8kbW4m','WPWvW7zBcG','jtfyWO/cPq','fCkaW6ddR8o2','W6dcTmk5WPSZW6u','WOOujvSYW47cRuDJfW','6kYJ5yIO5yIq6lA/5yY75lUg','zGBdIYWn','WQpdMHldRgRdOSoBiMVcQW','g8oDm8oPW5pcG0FdQSowW5BcQ2q','W7DduCoUda','WQZdVYpdSNy','kCo0omkf','WOLnWP98bmkfsCkWWPFdKa','fLDHWOBdGb4zDG','kx5HW4zjvCoEra','umoiwCoNWP8hWRpdQ2Sl','W59+WOBcQG','kq9mWQ0D','v8kiW6tdSmkk','WRlcMCkOWQbaW5dcJrry','iIL8WRlcVCkxuXDAvq','fwH6W7aLWQ/dTrG/W5m','B8kDW4BdKSkE','sCoVW53cPSoNW7tcUCobWR7cU8k5gW','o8kMxK1E','W71AvCkuWRRcOmoiWP3dOSkB','WR4eW5bjlG','W7zwwmkQWPW','uCk9W7pdLa','jmkeEmk2','W4xdJSozW6pcGW','dwrQWQhdOa','fmondSk3ASoEy8o8W6bQ','ySo8W6VcOmkxWQTkWOuI','umkYW7pcImkXW7iQbrHP','eL95W5C7','CuVcNt/cUvHK','W7zCW7X9EG','dLD2WPpdQJmkDmo5uq','rmkDBa','gCoHomk8sa','rCoQAG','WOpcLsGCz1pdSSoJpcK','WRWUBq','W7HpEXPKWPpcJqf1nXtdHa','WQOtW7b9ea','wrvz','fmo7eG','iIL+WRtcM8kxua','xrToW7NdMt7cVhTgWPm','ssdcNmoZWOC','zIHm','5lMg5lQN6lwJ5y+f','iCkFymkyWQnhWOnboq','kmoZbSkdxG','xCkbwmkKWPm','WQVcOtBcJGe','WRKAiKG5WP3dVX9daW','vslcImovWOi','W7eTnmo9lW','WQLSA8oWwaCG','WRJdJGVdRNxdQmoom0hcQW','WQtcGZxcVWy','ymoZtZrW','nbFdOJZdMmkFWQ4WWPZdVW','v8o8W47cUmkJ','5PEY77+r6yod5ysS772b','tqlcTsJcIq','W7nyCSoxaq','WP/cHSk8WRGzW5FcHqnBsa','WRHDgdO','W6VdRSoS','WRTJWPDtjmkpra','hSk6W7FdHCo+DaxcR8kQkq','t8k0W5JdTSkE','W7rkW7P1zCk5ta','o8kJWQ7dH8kl','yIhcMrFcVq','W4eNa8oHeCkEW57cSuaw','rmkbd8kGWOXEWQFcQwa','W7jAxa','44ks5OYn56E544oh6k635yEk6iYz5y+3D8ka','oCoWjq','5A2y5yId5yU55lI65PwZ776n6yk65yAS77Yd','4P+KkEAEH+wHNowgUEApKowUSUwjTowjG+wpSq','W596W4O','WPjZWOrFia','WPRcTmk0','lIL+','WOObW4TWka','kqRcNbrEWPPBWOpcH04','WPfPWRfJkW','WR04y8o5sWaGvHzU','dmkyW5pdHmkx','icjXWQ4','W5aqbSoMcq','WRnTW5ynWRO','WPe6WRKCF190ra','WOike8k1dufD','CtZcRG7cMa','WO/cGmk+WOXhW5e','WQCxiMus','WPBdGwyYfW','W67cSSkK','bSoHDaj/c3a','W5pdJSoPW4dcOW','6yw077Yv5B+J5Asv5yUA5yMZ6lwe5y6WWPxcVG','WOmXWP0agCkdrmkTWRvIWRW','WO9vWQ5ud8kf','W5tdS8opW7ZcMW','WPLbWRrW','WO1JW4mCWOa','W55gCSoSlezU','W4xcL8k8umoc','WORcQmoCxSkOW4W','qstcMq','W6RdOColWOGx','WQZdMIZdShq','h8oGvNlcGq','yqJcIdFcJLnHoCotWQ0','WQqAoW','umkUW7xdUmkJW6u','iX1QWPJcMq','rG9DW6RdHqNcPG','DSo5W6/cQW','WQBdMG3dS3C','BCkzW4ldN8kr','W4f9W59EtSkWqCk7WQe','W5xdTCoO','CJZdVsmU','WP3cJmk2WRjBW5JcRbny','W6nMWOKetG','W5xcG2XJbW','sbLSWOFdKbGmEmoywW','W4XMt8o7ja','WQXZWPvMbW','zsPDuq','W55MW4O','kaxcMG1tWRTXWOVcQ04','xConW5dcRmk3','W4BcRSk2WPOT','cmkey2fQya','4P+9CUw0RUwIM+weHEAnIUwSKEs4KoAuKUwnKa','u8ovW6NcHSkT','EmkAw8kYWOC','W6zoWR8wAvzf','ur1BW70','W5JdUSoUWOK7WOCAtttcSa','cLLH','W60puxFdPSk2WPVcGq','w8kXW4tdVmkt','vSkguCk6WPe0WQ3cOuul','dY5TWOFcTq','gNL6','dqrFWP/cQSkCrG','vSkvDSkOWQO','sCoTvW','CfpdNfmEWOPEWPtcOMddHW','iCkfW43dJCo4W6ZdKCkpW4pcPa','bmkjD8kzWOjiWQbr','W5FdJtWNva','WRLtW7i','f8kOWOO','Fmo5W7BcRW','DZFdVHCMyMPqCSoK','4P+KkEw/VUwjUUA0M+wjV2hcME+/GG','krXDWPeS','lILbsq3dJG','5yMQ5l6E5OcF','CZNdQq','WOuYB8oLCWG5vG','tItcGmoAWOq','W7BcMSkbwCoEjse','wbTo','W5WrWOtcK8oW','hmo6b8kzW4iT','W59jCSo/','bgSOW7uIW7JcHvq/W44','zG/cNZpcKLD9kq','WQSVkgOn','6ysI77+L5O+d5A2B5lQo5PEgW4i9','AcnotbddICkT','u8kBW5ldNCkX','ySkTyCk9WQS','WQddJsrczq','4P2BWRxLVilLIRZLIOdLIjlLT5pOVj
|
2024-06-28 07:47:44 +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
|