2024-06-28 15:22:25 +00:00
|
|
|
const bdy_0x5747d8=bdy_0x2b26;(function(_0x2b3769,_0xe0a994){const bdy_0x186e4f={_0x332a50:'ZRve',_0x37a857:'0x29a',_0x351056:'NcGv',_0x18d4d4:'0x2cd',_0x2aa9ae:'0xe5',_0x708f3:'0xe8',_0x1b7f6a:'6WvY'},_0x846dab=bdy_0x2b26,_0x3b2d7d=_0x2b3769();while(!![]){try{const _0x2c583e=-parseInt(_0x846dab('0x2d3','GAI^'))/(0x31*-0x85+0x2518*-0x1+0x3e8e)+-parseInt(_0x846dab('0x30d',bdy_0x186e4f._0x332a50))/(0xd92+-0x1a*-0xee+-0x25bc)*(parseInt(_0x846dab(bdy_0x186e4f._0x37a857,'R^JJ'))/(0xd79+-0x1*0xe2d+0xb7*0x1))+-parseInt(_0x846dab('0x30a',bdy_0x186e4f._0x351056))/(-0x1*-0x71+0x9b6+0x361*-0x3)+-parseInt(_0x846dab('0x1cb','$%r5'))/(0x26ac+-0x1163*-0x1+0x9*-0x63a)*(parseInt(_0x846dab(bdy_0x186e4f._0x18d4d4,'9a#C'))/(0x745*0x5+-0x565*0x1+-0x1*0x1eee))+-parseInt(_0x846dab(bdy_0x186e4f._0x2aa9ae,'6aI5'))/(0x87*0x1+0x1*0xf05+-0xf85)+parseInt(_0x846dab('0x19a','V$JW'))/(-0x1*0x259+-0x20f7+-0x68*-0x57)*(-parseInt(_0x846dab(bdy_0x186e4f._0x708f3,'O6yN'))/(-0xb8b+0x1*0x1267+-0x6d3))+parseInt(_0x846dab('0x16a',bdy_0x186e4f._0x1b7f6a))/(0x1462+0x1529+0x11*-0x271);if(_0x2c583e===_0xe0a994)break;else _0x3b2d7d['push'](_0x3b2d7d['shift']());}catch(_0x4b84ba){_0x3b2d7d['push'](_0x3b2d7d['shift']());}}}(bdy_0x50cb,0x184c*0x18+-0x91bb6+-0x63*-0x2655));const bdy_0x5058e1=(function(){let _0x5ba8bb=!![];return function(_0x4da44f,_0x10b862){const _0x37d086=_0x5ba8bb?function(){const _0x59bddd=bdy_0x2b26;if(_0x10b862){const _0x15d4c4=_0x10b862[_0x59bddd('0x255','R^JJ')](_0x4da44f,arguments);return _0x10b862=null,_0x15d4c4;}}:function(){};return _0x5ba8bb=![],_0x37d086;};}()),bdy_0x5553bd=bdy_0x5058e1(this,function(){const bdy_0x2b7821={_0x16f4b4:'IUiM',_0x4b7f9b:'@0Vy',_0x3d08ee:'0x369',_0x5ac291:'Bgi$',_0x126e1a:'0x2c9',_0x5bcfd6:'0x271'},_0x2daba5=bdy_0x2b26;return bdy_0x5553bd[_0x2daba5('0x350',bdy_0x2b7821._0x16f4b4)]()[_0x2daba5('0x257',bdy_0x2b7821._0x4b7f9b)](_0x2daba5(bdy_0x2b7821._0x3d08ee,bdy_0x2b7821._0x5ac291))[_0x2daba5('0x25d','Dzhc')]()[_0x2daba5(bdy_0x2b7821._0x126e1a,'Iwu@')](bdy_0x5553bd)[_0x2daba5(bdy_0x2b7821._0x5bcfd6,'ZRve')](_0x2daba5('0xf5','V$JW'));});bdy_0x5553bd();const bdy_0x342372=(function(){let _0x173fac=!![];return function(_0x295824,_0x3026b8){const _0x5dee97=_0x173fac?function(){const _0x38601b=bdy_0x2b26;if(_0x3026b8){const _0x2361b3=_0x3026b8[_0x38601b('0x229','p^&&')](_0x295824,arguments);return _0x3026b8=null,_0x2361b3;}}:function(){};return _0x173fac=![],_0x5dee97;};}());(function(){const bdy_0x38a76e={_0x5409e7:'0x299',_0x5d8395:'0x380',_0x319ae5:'0x10c',_0x302819:'3k1j'},_0x3a610a=bdy_0x2b26,_0x300e46={'dIQXf':_0x3a610a('0x306','6WvY'),'EjYZJ':_0x3a610a('0x2b1','GAI^'),'ZUIsl':function(_0x5881dd,_0x46dc17){return _0x5881dd(_0x46dc17);},'YASmR':function(_0x1fb7f2){return _0x1fb7f2();}};bdy_0x342372(this,function(){const _0x1c9cad=bdy_0x2b26,_0x4ae43d=new RegExp(_0x1c9cad(bdy_0x38a76e._0x5409e7,'fx@6')),_0x38263d=new RegExp(_0x1c9cad('0x263','TztF'),'i'),_0x11665e=bdy_0x428032(_0x300e46[_0x1c9cad('0x24c',')e%p')]);!_0x4ae43d[_0x1c9cad('0x1e1','p^&&')](_0x11665e+_0x1c9cad(bdy_0x38a76e._0x5d8395,'ZRve'))||!_0x38263d[_0x1c9cad('0x215',')@o#')](_0x11665e+_0x300e46[_0x1c9cad('0x20c','b#Qi')])?_0x300e46[_0x1c9cad(bdy_0x38a76e._0x319ae5,'Iwu@')](_0x11665e,'0'):_0x300e46[_0x1c9cad('0x1f9',bdy_0x38a76e._0x302819)](bdy_0x428032);})();}());const bdy_0x36a257=bdy_0x5747d8('0x37b','3k1j'),bdy_0x2d39cb={};bdy_0x2d39cb[bdy_0x5747d8('0x36d','IUiM')]={};const bdy_0x321baa=bdy_0x2d39cb;function bdy_0x73f447(_0x387a87){let _0x5c9276='';switch(_0x387a87){case[_0x5c9276]:const _0x521571={};_0x521571['ed']=ed;const _0x1c9853=_0x521571;_0xf1f6le=_0x1c9853;break;case[_0x5c9276]:const _0x5a43cb={};_0x5a43cb['bd']=bd;const _0x37e0c1=_0x5a43cb;_0xf1f6lc=_0x37e0c1;break;case[_0x5c9276]:const _0x16dbe6={};_0x16dbe6['ed']=ed;const _0x2ebf71=_0x16dbe6;_0xf1f6lf=_0x2ebf71;break;case[_0x5c9276]:const _0x4e5f99={};_0x4e5f99['ed']=ed;const _0x32ac20=_0x4e5f99;_0xf1f6lg=_0x32ac20;break;case[_0x5c9276]:const _0x2b682f={};_0x2b682f['ed']=ed;const _0x19a02d=_0x2b682f;_0xf1f6lv=_0x19a02d;break;}}var bdy_0x24af2b=require(bdy_0x5747d8('0x102','pb2U')),bdy
|
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
|