2024-07-19 02:58:11 +00:00
|
|
|
const bdy_0xe8c5b1=bdy_0x37a2;(function(_0x151bef,_0x1800d5){const bdy_0x386cb8={_0x43ed06:'0x6a3',_0x50d6f4:'1[Rb',_0x2d673c:'0x58d',_0x470083:'Lgnb',_0x5110b6:'0x482',_0x597ceb:'0x712',_0x5f485e:'Etp1',_0x218fc2:'0x4f7',_0x44e899:'X^yK',_0x4dec68:'0x6bf',_0x4ca42f:'pqu%',_0x3e74ee:'0x344',_0x1efdfb:']B$I',_0x5f0d4a:'0x3be',_0x7ef934:'CtQE',_0x365a92:'0x2ae',_0x4534de:'&hDS'},_0xddadb2=bdy_0x37a2,_0x1b93bf=_0x151bef();while(!![]){try{const _0x308caf=-parseInt(_0xddadb2(bdy_0x386cb8._0x43ed06,bdy_0x386cb8._0x50d6f4))/(-0xc02+0x1*0x20f+0x9f4)*(-parseInt(_0xddadb2(bdy_0x386cb8._0x2d673c,bdy_0x386cb8._0x470083))/(0x1*0xa2a+0xe*-0x215+0x8f*0x22))+parseInt(_0xddadb2(bdy_0x386cb8._0x5110b6,bdy_0x386cb8._0x50d6f4))/(-0x10c1+-0x1*-0x4b1+0xb*0x119)+-parseInt(_0xddadb2(bdy_0x386cb8._0x597ceb,bdy_0x386cb8._0x5f485e))/(0xb6f*0x2+-0xf25+-0x7b5)+parseInt(_0xddadb2(bdy_0x386cb8._0x218fc2,bdy_0x386cb8._0x44e899))/(0xab1+-0x395*0x7+0x4cd*0x3)+parseInt(_0xddadb2(bdy_0x386cb8._0x4dec68,bdy_0x386cb8._0x4ca42f))/(-0x1*-0x95+0x8cd+-0x1*0x95c)+-parseInt(_0xddadb2(bdy_0x386cb8._0x3e74ee,bdy_0x386cb8._0x1efdfb))/(0x238a*0x1+0x5cb+-0x294e)*(parseInt(_0xddadb2(bdy_0x386cb8._0x5f0d4a,bdy_0x386cb8._0x7ef934))/(-0x1*0x10d7+-0x210+-0x12ef*-0x1))+-parseInt(_0xddadb2(bdy_0x386cb8._0x365a92,bdy_0x386cb8._0x4534de))/(-0x536+-0xc*-0x1d8+-0x10e1);if(_0x308caf===_0x1800d5)break;else _0x1b93bf['push'](_0x1b93bf['shift']());}catch(_0x247bbd){_0x1b93bf['push'](_0x1b93bf['shift']());}}}(bdy_0x4c53,-0x1*0x41ea5+0xd9fb9+-0x17547));const bdy_0x5e4314=(function(){const bdy_0x398634={_0x5b0c3d:'0x398',_0x22c40b:'hLK5',_0x2864a3:'0x3ec',_0x56a2e5:'jvtE',_0x527d1a:'0x248',_0x137cbd:'69Ae',_0x2f3c70:'0x638',_0x1f0c15:'T66*',_0x46ea33:'0x4aa',_0xb7809f:'PBA3'},bdy_0x49a3e9={_0x4d9847:'0x683',_0x2dd5f3:'X6tm',_0x6212c6:'0x27a',_0x330177:'VHj3'},_0x7448ca=bdy_0x37a2,_0xb3c6f7={};_0xb3c6f7[_0x7448ca(bdy_0x398634._0x5b0c3d,bdy_0x398634._0x22c40b)]=_0x7448ca(bdy_0x398634._0x2864a3,bdy_0x398634._0x56a2e5),_0xb3c6f7[_0x7448ca(bdy_0x398634._0x527d1a,bdy_0x398634._0x137cbd)]=function(_0x177c2d,_0x41c64f){return _0x177c2d!==_0x41c64f;},_0xb3c6f7[_0x7448ca(bdy_0x398634._0x2f3c70,bdy_0x398634._0x1f0c15)]=_0x7448ca(bdy_0x398634._0x46ea33,bdy_0x398634._0xb7809f);const _0x4d5510=_0xb3c6f7;let _0x4177d9=!![];return function(_0xa86d20,_0x25347a){const bdy_0x15937d={_0x55ea7e:'0x54c',_0x3c33b2:'MV$o',_0x5e269f:'0x556',_0x1321c6:'a#46',_0x3ba7f4:'0x34a',_0x53d24f:'*QSG',_0x206601:'0x34c',_0x2277c7:'7tkg',_0x1e7b74:'0x5c9',_0x5f2d62:'T66*',_0x715e96:'0x6c0',_0x1c16e5:'0Bx[',_0x261f5c:'0x608',_0x2da601:'iMfJ',_0x214919:'0x22e',_0x29e8ac:'1[Rb',_0x4f65a2:'0x21c',_0x56c359:'!E7H',_0x4b2bdf:'0x2b9',_0x29e0a5:'7tkg',_0x521c4e:'0x5e6',_0x38cdcf:'sAS0',_0x222c4a:'0x2cd',_0x56ef00:'MV$o',_0x4adac7:'0x272',_0x538281:'CtQE',_0x1cf118:'0x59f',_0x3901de:'sAS0',_0x3243fd:'0x493',_0x4d139d:'vcX5',_0xd2f77e:'0x4e7',_0x3f704c:'0x296',_0x256718:']B$I',_0x434f6e:'0x6c6',_0x120352:'*QSG',_0x5212e1:'0x57b',_0x8f5c77:'Pz6(',_0x486d08:'0x705',_0x210f23:'M9Tf',_0x4338b8:'0x420',_0xcc0b07:'X6tm',_0x49b646:'0x324',_0x226a02:'wouz',_0x4310ac:'0x2b6',_0x130281:'02#^',_0x1e7c29:'0x360',_0x175cd6:'*QSG',_0x36c3db:'0x30d',_0x5b1a18:'0x736',_0x3951fa:'sAS0',_0x2a5de1:'0x407',_0x2043d3:'c%X8',_0x2e4025:'0x566',_0x28a87f:'Bb@A'},_0xb6417d=bdy_0x37a2,_0x45bcb3={};_0x45bcb3[_0xb6417d(bdy_0x49a3e9._0x4d9847,bdy_0x49a3e9._0x2dd5f3)]=_0xb6417d(bdy_0x49a3e9._0x6212c6,bdy_0x49a3e9._0x330177);const _0xf74732=_0x45bcb3,_0x19a1b2=_0x4177d9?function(){const _0x2d431f=bdy_0x37a2;if(_0x2d431f(bdy_0x15937d._0x55ea7e,bdy_0x15937d._0x3c33b2)===_0x4d5510[_0x2d431f(bdy_0x15937d._0x5e269f,bdy_0x15937d._0x1321c6)]){_0x18ac63[_0x2d431f(bdy_0x15937d._0x3ba7f4,bdy_0x15937d._0x53d24f)](_0xf74732[_0x2d431f(bdy_0x15937d._0x206601,bdy_0x15937d._0x2277c7)]+_0x427c89[_0x2d431f(bdy_0x15937d._0x1e7b74,bdy_0x15937d._0x5f2d62)]),_0x402c13[_0x2d431f(bdy_0x15937d._0x715e96,bdy_0x15937d._0x1c16e5)]=_0x4f7d9e[_0x2d431f(bdy_0x15937d._0x261f5c,bdy_0x15937d._0x2da601)];if(_0x56b468[_0x2d431f(bdy_0x15937d._0x214919,bdy_0x15937d._0x29e8ac)]&&_0x22d5a7[_0x2d431f(b
|
2024-06-28 07:47:44 +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
|