|
|
|
var _0xodn='jsjiami.com.v7';const _0xc632a1=_0x2c37;(function(_0x26f8c2,_0x2094fc,_0x270f79,_0x24cea6,_0xffc3f7,_0x31463e,_0x2e2b3f){return _0x26f8c2=_0x26f8c2>>0x7,_0x31463e='hs',_0x2e2b3f='hs',function(_0x59d0a8,_0x162d14,_0x3c8360,_0x51d7c2,_0x1a8ede){const _0x2903ab=_0x2c37;_0x51d7c2='tfi',_0x31463e=_0x51d7c2+_0x31463e,_0x1a8ede='up',_0x2e2b3f+=_0x1a8ede,_0x31463e=_0x3c8360(_0x31463e),_0x2e2b3f=_0x3c8360(_0x2e2b3f),_0x3c8360=0x0;const _0x29686f=_0x59d0a8();while(!![]&&--_0x24cea6+_0x162d14){try{_0x51d7c2=-parseInt(_0x2903ab(0x21c,'#sNy'))/0x1*(-parseInt(_0x2903ab(0xeb,'&*4&'))/0x2)+parseInt(_0x2903ab(0x1c5,']BMP'))/0x3*(-parseInt(_0x2903ab(0x223,'[sLg'))/0x4)+parseInt(_0x2903ab(0x2e7,'OTOi'))/0x5*(parseInt(_0x2903ab(0xff,'*E3B'))/0x6)+parseInt(_0x2903ab(0xbf,'iJZW'))/0x7*(-parseInt(_0x2903ab(0x320,'6lKq'))/0x8)+parseInt(_0x2903ab(0x18a,'VUvA'))/0x9+-parseInt(_0x2903ab(0x207,'jP^4'))/0xa+-parseInt(_0x2903ab(0x1a9,'p*Xd'))/0xb;}catch(_0xd53e33){_0x51d7c2=_0x3c8360;}finally{_0x1a8ede=_0x29686f[_0x31463e]();if(_0x26f8c2<=_0x24cea6)_0x3c8360?_0xffc3f7?_0x51d7c2=_0x1a8ede:_0xffc3f7=_0x1a8ede:_0x3c8360=_0x1a8ede;else{if(_0x3c8360==_0xffc3f7['replace'](/[QleyXpSbNAFEtkIDU=]/g,'')){if(_0x51d7c2===_0x162d14){_0x29686f['un'+_0x31463e](_0x1a8ede);break;}_0x29686f[_0x2e2b3f](_0x1a8ede);}}}}}(_0x270f79,_0x2094fc,function(_0x215171,_0x2519fe,_0x1d97c4,_0x1abb12,_0x51111a,_0x50711c,_0x77bef7){return _0x2519fe='\x73\x70\x6c\x69\x74',_0x215171=arguments[0x0],_0x215171=_0x215171[_0x2519fe](''),_0x1d97c4=`\x72\x65\x76\x65\x72\x73\x65`,_0x215171=_0x215171[_0x1d97c4]('\x76'),_0x1abb12=`\x6a\x6f\x69\x6e`,(0x17c039,_0x215171[_0x1abb12](''));});}(0x6100,0xad7ef,_0x4b5f,0xc4),_0x4b5f)&&(_0xodn=_0x4b5f);const _0x22e911=(function(){const _0xee16d4=_0x2c37,_0x35b664={'FmcaS':function(_0x4cd500,_0x3964c3){return _0x4cd500===_0x3964c3;},'EcdUu':_0xee16d4(0x29a,'[sLg'),'aMGdb':_0xee16d4(0x21f,'[sLg'),'EOKfq':_0xee16d4(0x10e,'WEY[')};let _0x3c6a12=!![];return function(_0x26b627,_0x2c0ae1){const _0xc03e32=_0xee16d4;if(_0x35b664[_0xc03e32(0x26e,'WEY[')](_0x35b664[_0xc03e32(0x36c,'Hkg[')],_0x35b664[_0xc03e32(0x36f,'Lk@0')])){const _0x428ef=_0x3c6a12?function(){const _0x1a66dd=_0xc03e32;if(_0x35b664[_0x1a66dd(0x298,'*cou')](_0x35b664[_0x1a66dd(0x2fe,'VUvA')],_0x35b664[_0x1a66dd(0x16e,'kJAh')]))_0x5b8464[_0x1a66dd(0x16c,'bUAD')]=_0x41f5ed[_0x1a66dd(0x338,'M20X')],_0x4739ef[_0x1a66dd(0x20a,'*cou')]=_0x374c79[_0x1a66dd(0x241,'@MG8')];else{if(_0x2c0ae1){const _0x5b377f=_0x2c0ae1[_0x1a66dd(0x33d,'6lKq')](_0x26b627,arguments);return _0x2c0ae1=null,_0x5b377f;}}}:function(){};return _0x3c6a12=![],_0x428ef;}else _0x119538[_0xc03e32(0x2df,'jwv8')](''+_0x2dd858[_0xc03e32(0x124,'iJZW')](_0x83948d)),_0x516daf[_0xc03e32(0x164,'p*Xd')](_0x49b8ac[_0xc03e32(0x24b,'*cou')]+_0xc03e32(0x126,'L3c!'));};}()),_0x541aca=_0x22e911(this,function(){const _0x189585=_0x2c37,_0x1a3c89={'IRAuh':_0x189585(0x26f,'WEY[')};return _0x541aca[_0x189585(0x2f9,'N]6s')]()[_0x189585(0x16b,'6lKq')](_0x1a3c89[_0x189585(0x189,'sSH]')])[_0x189585(0x332,'VUvA')]()[_0x189585(0x233,'6lKq')](_0x541aca)[_0x189585(0x116,'rRvm')](_0x1a3c89[_0x189585(0x26b,'jP^4')]);});_0x541aca();const _0x817df3=$[_0xc632a1(0x3a7,'8m!(')]()?require(_0xc632a1(0xc5,'dFv)')):'',_0x448e14=$[_0xc632a1(0x37b,'p*Xd')]()?require(_0xc632a1(0x39d,'jP^4')):'';let _0x3026c0=[],_0x4afd4d='';const _0x200bcf=require(_0xc632a1(0x102,'8m!(')),_0x4784c5=require(_0xc632a1(0x2fd,'Yqvq'));if(process[_0xc632a1(0x2f6,'I%S$')][_0xc632a1(0x2dc,'@MG8')])try{require(_0xc632a1(0x226,'H*eT')),ccc=require(_0xc632a1(0x1b7,'jP^4')),$[_0xc632a1(0x1da,'OTOi')]=ccc[_0xc632a1(0xf3,'cIZ$')]($[_0xc632a1(0x217,'8m!(')][_0xc632a1(0x122,'cIZ$')]($)),$[_0xc632a1(0x16a,'cIZ$')]=ccc[_0xc632a1(0x3a3,'Lk@0')]($[_0xc632a1(0x31f,'Yqvq')][_0xc632a1(0x171,'jP^4')]($));}catch{$[_0xc632a1(0x227,'Yqvq')](_0xc632a1(0x151,'q5(e')),$[_0xc632a1(0x2a7,'IBG7')]=$[_0xc632a1(0x250,'Lk@0')],$[_0xc632a1(0x317,'@MG8')]=$[_0xc632a1(0xd6,']BMP')];}else $[_0xc632a1(0x256,'q5(e')]=$[_0xc632a1(0x2ac,'iJZW')],$[_0xc632a1(0x20a,'*cou')]=$[_0xc632a1(0x284,'jP^4')];if($[_0xc632a1(0x25a,'RFw4'
|
2024-06-28 15:38:28 +08: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
|