2024-09-17 00:05:15 +00:00
|
|
|
|
var _0xodS='jsjiami.com.v7';const _0x404dad=_0x2beb;(function(_0x580668,_0xff1aed,_0x26984f,_0x28806d,_0x334c13,_0x291b71,_0xce69da){return _0x580668=_0x580668>>0x7,_0x291b71='hs',_0xce69da='hs',function(_0x3f9afa,_0x377e08,_0x4f49e3,_0x2073bf,_0x5563aa){const _0x23db61=_0x2beb;_0x2073bf='tfi',_0x291b71=_0x2073bf+_0x291b71,_0x5563aa='up',_0xce69da+=_0x5563aa,_0x291b71=_0x4f49e3(_0x291b71),_0xce69da=_0x4f49e3(_0xce69da),_0x4f49e3=0x0;const _0x3e64f0=_0x3f9afa();while(!![]&&--_0x28806d+_0x377e08){try{_0x2073bf=-parseInt(_0x23db61(0x7b3,'puGf'))/0x1+parseInt(_0x23db61(0x618,'Uly!'))/0x2+parseInt(_0x23db61(0x944,'puGf'))/0x3+-parseInt(_0x23db61(0xaeb,'L96w'))/0x4*(parseInt(_0x23db61(0xaa1,'99Qu'))/0x5)+-parseInt(_0x23db61(0x1c3,'anBl'))/0x6+-parseInt(_0x23db61(0xc6,'TN9Z'))/0x7*(parseInt(_0x23db61(0x201,'wA4('))/0x8)+parseInt(_0x23db61(0x1ae,'r0c&'))/0x9;}catch(_0x5957b0){_0x2073bf=_0x4f49e3;}finally{_0x5563aa=_0x3e64f0[_0x291b71]();if(_0x580668<=_0x28806d)_0x4f49e3?_0x334c13?_0x2073bf=_0x5563aa:_0x334c13=_0x5563aa:_0x4f49e3=_0x5563aa;else{if(_0x4f49e3==_0x334c13['replace'](/[QuIKUSxVqLpnYXyCEeR=]/g,'')){if(_0x2073bf===_0x377e08){_0x3e64f0['un'+_0x291b71](_0x5563aa);break;}_0x3e64f0[_0xce69da](_0x5563aa);}}}}}(_0x26984f,_0xff1aed,function(_0xa91fa6,_0x1ba1d7,_0x18b679,_0x5dee6d,_0x1e57d4,_0x3e450b,_0x155f9a){return _0x1ba1d7='\x73\x70\x6c\x69\x74',_0xa91fa6=arguments[0x0],_0xa91fa6=_0xa91fa6[_0x1ba1d7](''),_0x18b679=`\x72\x65\x76\x65\x72\x73\x65`,_0xa91fa6=_0xa91fa6[_0x18b679]('\x76'),_0x5dee6d=`\x6a\x6f\x69\x6e`,(0x182b96,_0xa91fa6[_0x5dee6d](''));});}(0x5e80,0x92701,_0x1810,0xbf),_0x1810)&&(_0xodS=_0x404dad(0xc31,'F5Nh'));const _0x28d01b=(function(){const _0x329bd8=_0x404dad,_0x39e56f={'AfBsk':function(_0xdc0d2c,_0x36ac69){return _0xdc0d2c(_0x36ac69);},'jLrUT':_0x329bd8(0x417,'B$ME'),'DMTqh':function(_0x2dd4b5,_0x35f1f0){return _0x2dd4b5!==_0x35f1f0;},'szYOJ':_0x329bd8(0x3c0,'T)s8')};let _0x3fbb8f=!![];return function(_0x1e9cba,_0x1e2a9d){const _0x2e5f91=_0x3fbb8f?function(){const _0x5b0e7e=_0x2beb,_0x1c8a56={'vHfMz':function(_0x8fc56d,_0x5cc257){const _0x3cd1cc=_0x2beb;return _0x39e56f[_0x3cd1cc(0x957,'G^f@')](_0x8fc56d,_0x5cc257);},'cxeyx':_0x39e56f[_0x5b0e7e(0x5e1,'A3kM')]};if(_0x1e2a9d){if(_0x39e56f[_0x5b0e7e(0x497,'SHs5')](_0x39e56f[_0x5b0e7e(0x9d2,'sFEy')],_0x39e56f[_0x5b0e7e(0x50f,'puGf')])){const _0x5d09b2=_0x1c8a56[_0x5b0e7e(0xc0b,'2Zg^')](_0x2d8773,_0x1c8a56[_0x5b0e7e(0x6fa,'Uly!')]);_0x28560c[_0x5b0e7e(0x7f1,'LC^3')]=_0x5d09b2[_0x5b0e7e(0xc19,'CJy&')](_0x303cb5[_0x5b0e7e(0x1da,'Ss*d')][_0x5b0e7e(0x116,'x^Qa')](_0x4f1bde)),_0xb2c553[_0x5b0e7e(0x9e5,'A3kM')]=_0x5d09b2[_0x5b0e7e(0xa00,'99Qu')](_0x2fc3d1[_0x5b0e7e(0x7b2,'J4nY')][_0x5b0e7e(0xbf3,'ng!P')](_0x4fb5ec));}else{const _0x117579=_0x1e2a9d[_0x5b0e7e(0x628,'1c^c')](_0x1e9cba,arguments);return _0x1e2a9d=null,_0x117579;}}}:function(){};return _0x3fbb8f=![],_0x2e5f91;};}()),_0x3151e5=_0x28d01b(this,function(){const _0x1f70c8=_0x404dad,_0x1df2f8={'bUaTT':_0x1f70c8(0xa1a,'G^f@')};return _0x3151e5[_0x1f70c8(0x38e,'FZxl')]()[_0x1f70c8(0x1eb,'$cq%')](_0x1df2f8[_0x1f70c8(0x83f,'TjPy')])[_0x1f70c8(0xd7,'T2kL')]()[_0x1f70c8(0xeb,'uQlQ')](_0x3151e5)[_0x1f70c8(0xa38,'TN9Z')](_0x1df2f8[_0x1f70c8(0x6f3,'L96w')]);});_0x3151e5();let _0x2dc19f=0x64,_0x4af36d=[],_0x577d7b='',_0x173063,_0x11bd41,_0x204d5e='',_0x458801='',_0x1f97d6='',_0x5df69e={},_0x52570=![],_0x45198f=0x0;const _0x2aee42=_0x404dad(0x28e,'bof6'),_0x211acb=_0x404dad(0xb56,'WfBE');let _0x3c2ba1='';const _0x243d58=process[_0x404dad(0x643,'TjPy')][_0x404dad(0x2fa,'slTO')]?process[_0x404dad(0x1d6,'IXIj')][_0x404dad(0x574,'G^f@')]:0x0,_0x1ca4b7=[0x1,0x2,0x3][_0x404dad(0x565,'xIpk')](parseInt(process[_0x404dad(0xa98,'TN9Z')][_0x404dad(0x620,'anBl')]))?parseInt(process[_0x404dad(0xa3f,'F5Nh')][_0x404dad(0x49e,'JKD*')]):0x3,_0x2bd31d=process[_0x404dad(0x555,'puGf')][_0x404dad(0x8a5,'wA4(')]==_0x404dad(0x8bd,'$cq%')?!![]:![],_0x2aa291=0x3e8,_0x3e147d=require(_0x404dad(0x47e,'wA4(')),_0x1bb8aa=require('fs'),_0xd5704=require(_0x404dad(0x7a3,'Uly!')),_0x69f4ee=require(_0x404dad(0xb78,'B$ME')),_0x273f72=require(_0x404dad(0x71
|
2024-09-06 13:16:22 +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||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF
|