2024-08-13 13:45:12 +00:00
|
|
|
var _0xodO='jsjiami.com.v7';const _0x5ef219=_0x1422;(function(_0x470062,_0x51a0f0,_0xe481a4,_0x50ba5c,_0x2a4620,_0x142020,_0x35807d){return _0x470062=_0x470062>>0x9,_0x142020='hs',_0x35807d='hs',function(_0x1f5451,_0x557b9c,_0x5ccf45,_0x1fc537,_0x16dce2){const _0x14c8ff=_0x1422;_0x1fc537='tfi',_0x142020=_0x1fc537+_0x142020,_0x16dce2='up',_0x35807d+=_0x16dce2,_0x142020=_0x5ccf45(_0x142020),_0x35807d=_0x5ccf45(_0x35807d),_0x5ccf45=0x0;const _0x305e5e=_0x1f5451();while(!![]&&--_0x50ba5c+_0x557b9c){try{_0x1fc537=parseInt(_0x14c8ff(0x380,'H]cD'))/0x1*(-parseInt(_0x14c8ff(0x1ed,'uZIv'))/0x2)+parseInt(_0x14c8ff(0x4c2,'!)!s'))/0x3+-parseInt(_0x14c8ff(0x33f,'dUnd'))/0x4*(-parseInt(_0x14c8ff(0x258,'1ONT'))/0x5)+parseInt(_0x14c8ff(0x3b7,'DDAe'))/0x6*(parseInt(_0x14c8ff(0x333,'kRZE'))/0x7)+parseInt(_0x14c8ff(0x360,'l%Zk'))/0x8+parseInt(_0x14c8ff(0x4b3,'*)A9'))/0x9*(parseInt(_0x14c8ff(0x1e9,'S7A!'))/0xa)+-parseInt(_0x14c8ff(0x4da,'txfT'))/0xb;}catch(_0x3e3ca0){_0x1fc537=_0x5ccf45;}finally{_0x16dce2=_0x305e5e[_0x142020]();if(_0x470062<=_0x50ba5c)_0x5ccf45?_0x2a4620?_0x1fc537=_0x16dce2:_0x2a4620=_0x16dce2:_0x5ccf45=_0x16dce2;else{if(_0x5ccf45==_0x2a4620['replace'](/[YgAHeDlhGQxOPdUyLNWw=]/g,'')){if(_0x1fc537===_0x557b9c){_0x305e5e['un'+_0x142020](_0x16dce2);break;}_0x305e5e[_0x35807d](_0x16dce2);}}}}}(_0xe481a4,_0x51a0f0,function(_0x87f53,_0x114df8,_0x3f36bc,_0x25bf64,_0x38e18b,_0x5d3cca,_0x5db06c){return _0x114df8='\x73\x70\x6c\x69\x74',_0x87f53=arguments[0x0],_0x87f53=_0x87f53[_0x114df8](''),_0x3f36bc=`\x72\x65\x76\x65\x72\x73\x65`,_0x87f53=_0x87f53[_0x3f36bc]('\x76'),_0x25bf64=`\x6a\x6f\x69\x6e`,(0x17df9a,_0x87f53[_0x25bf64](''));});}(0x18200,0x630b3,_0x5f21,0xc3),_0x5f21)&&(_0xodO=0x19ee);const _0x13a1b7=$[_0x5ef219(0x35f,'txfT')]()?require(_0x5ef219(0x45d,'o2wk')):'',_0xb4797d=$[_0x5ef219(0x4e4,'4Q6N')]()?require(_0x5ef219(0x39a,'H]cD')):'',_0x1690d2=require(_0x5ef219(0x561,'DDAe')),_0x4ef649=require(_0x5ef219(0x34b,'3$51')),_0x511480=require(_0x5ef219(0x4ec,'WVWw')),_0x2bac81=require(_0x5ef219(0x2d5,'$DJp'));let _0x42d851=!![],_0x54e59a=[],_0x11973a='',_0x11eb8f='',_0x41c3bf={};if(process[_0x5ef219(0x584,'TboT')][_0x5ef219(0x430,'%HDP')]){const _0x497281=process[_0x5ef219(0x1ec,'5&v&')][_0x5ef219(0x407,'7nM0')]?(process[_0x5ef219(0x44a,'IBmA')][_0x5ef219(0x557,'ZIF4')]+_0x5ef219(0x2cb,'5&v&'))[_0x5ef219(0x221,'H]cD')]('&'):'';if(_0x497281=='')try{require(_0x5ef219(0x485,'3v$q')),_0x41c3bf=require(_0x5ef219(0x472,'HX9J')),$[_0x5ef219(0x49a,'!Ilh')]=_0x41c3bf[_0x5ef219(0x56a,'%d$v')]($[_0x5ef219(0x362,'3v$q')][_0x5ef219(0x1fa,'7nM0')]($)),$[_0x5ef219(0x519,'V1FN')]=_0x41c3bf[_0x5ef219(0x1cb,'8v)x')]($[_0x5ef219(0x4a3,'S7A!')][_0x5ef219(0x4fd,'VjVD')]($));}catch{$[_0x5ef219(0x3c5,'txfT')](_0x5ef219(0x225,'3v$q')),$[_0x5ef219(0x3ea,'gYpl')]=$[_0x5ef219(0x1f6,'IBmA')],$[_0x5ef219(0x4e7,'!)!s')]=$[_0x5ef219(0x4bb,'8v)x')];}else{if(_0x497281[_0x5ef219(0x229,'HX9J')](_0x32e31b=>process[_0x5ef219(0x349,'5&v&')][_0x5ef219(0x32c,'8v)x')][_0x5ef219(0x521,'v(Gi')](_0x32e31b))[_0x5ef219(0x520,'eRg#')]!=0x0)try{require(_0x5ef219(0x390,'cyY$')),_0x41c3bf=require(_0x5ef219(0x2db,'7nM0')),$[_0x5ef219(0x369,'H]cD')]=_0x41c3bf[_0x5ef219(0x29a,'jY(p')]($[_0x5ef219(0x2ff,'VjVD')][_0x5ef219(0x211,'8v)x')]($)),$[_0x5ef219(0x3b4,'muJU')]=_0x41c3bf[_0x5ef219(0x356,'S7A!')]($[_0x5ef219(0x289,'2XD3')][_0x5ef219(0x27c,'olC)')]($));}catch{$[_0x5ef219(0x216,'8v)x')](_0x5ef219(0x481,'a7Ua')),$[_0x5ef219(0x405,'kRZE')]=$[_0x5ef219(0x38e,'DDAe')],$[_0x5ef219(0x444,'WVWw')]=$[_0x5ef219(0x32f,'&rxE')];}else $[_0x5ef219(0x376,'%d$v')]=$[_0x5ef219(0x342,'3$51')],$[_0x5ef219(0x3fa,'2Q5y')]=$[_0x5ef219(0x357,'HX9J')];}}else $[_0x5ef219(0x42d,'Pfph')]=$[_0x5ef219(0x2d1,'dUnd')],$[_0x5ef219(0x57f,'4Q6N')]=$[_0x5ef219(0x44b,'gYpl')];if($[_0x5ef219(0x389,'*)A9')]()){Object[_0x5ef219(0x330,'4Q6N')](_0xb4797d)[_0x5ef219(0x1f5,'V1FN')](_0x29cf6f=>{const _0x58ef6a=_0x5ef219;_0x54e59a[_0x58ef6a(0x367,'*)A9')](_0xb4797d[_0x29cf6f]);});if(process[_0x5ef219(0x36e,'8v)x')][_0x5ef219(0x4b0,'IBmA')]&&process[_0x5ef219(0x584,'TboT')][_0x5ef219(0x569,'$DJp')]===_0x5ef219(0x288,'cyY$')
|
2024-08-06 15:46: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
|