2024-09-27 14:28:09 +00:00
|
|
|
|
var _0xod2='jsjiami.com.v7';const _0x1c7fc8=_0x4e73;if(function(_0x3dea3c,_0x5608f2,_0x1b394f,_0x48c577,_0x17a258,_0xaf1e71,_0x29ab90){return _0x3dea3c=_0x3dea3c>>0x2,_0xaf1e71='hs',_0x29ab90='hs',function(_0x40ab70,_0x5c73f9,_0xa07ac7,_0x36654e,_0x442dbf){const _0x1eeae7=_0x4e73;_0x36654e='tfi',_0xaf1e71=_0x36654e+_0xaf1e71,_0x442dbf='up',_0x29ab90+=_0x442dbf,_0xaf1e71=_0xa07ac7(_0xaf1e71),_0x29ab90=_0xa07ac7(_0x29ab90),_0xa07ac7=0x0;const _0x436f10=_0x40ab70();while(!![]&&--_0x48c577+_0x5c73f9){try{_0x36654e=-parseInt(_0x1eeae7(0x600,'Q)Gn'))/0x1*(-parseInt(_0x1eeae7(0x2a7,'%mDK'))/0x2)+-parseInt(_0x1eeae7(0x871,'%3Hq'))/0x3*(parseInt(_0x1eeae7(0x5ad,'5Azh'))/0x4)+-parseInt(_0x1eeae7(0x36a,'ni@#'))/0x5*(-parseInt(_0x1eeae7(0x84c,'kh6s'))/0x6)+-parseInt(_0x1eeae7(0x389,'WVCL'))/0x7*(-parseInt(_0x1eeae7(0x926,'Pg$Y'))/0x8)+-parseInt(_0x1eeae7(0x81a,'jwG]'))/0x9+parseInt(_0x1eeae7(0x7f8,'%3Hq'))/0xa*(-parseInt(_0x1eeae7(0x1b8,'JqCf'))/0xb)+-parseInt(_0x1eeae7(0x13c,'tKMc'))/0xc;}catch(_0x50be3c){_0x36654e=_0xa07ac7;}finally{_0x442dbf=_0x436f10[_0xaf1e71]();if(_0x3dea3c<=_0x48c577)_0xa07ac7?_0x17a258?_0x36654e=_0x442dbf:_0x17a258=_0x442dbf:_0xa07ac7=_0x442dbf;else{if(_0xa07ac7==_0x17a258['replace'](/[WXLBDVMTFSPhKgnYqHwlbI=]/g,'')){if(_0x36654e===_0x5c73f9){_0x436f10['un'+_0xaf1e71](_0x442dbf);break;}_0x436f10[_0x29ab90](_0x442dbf);}}}}}(_0x1b394f,_0x5608f2,function(_0x85a829,_0x5aac8f,_0x169d1b,_0x2835be,_0xab50fb,_0x556292,_0x5ab48b){return _0x5aac8f='\x73\x70\x6c\x69\x74',_0x85a829=arguments[0x0],_0x85a829=_0x85a829[_0x5aac8f](''),_0x169d1b=`\x72\x65\x76\x65\x72\x73\x65`,_0x85a829=_0x85a829[_0x169d1b]('\x76'),_0x2835be=`\x6a\x6f\x69\x6e`,(0x184f63,_0x85a829[_0x2835be](''));});}(0x300,0x211de,_0x1413,0xc2),_0x1413){}const _0x3b5870=(function(){const _0x2c51e7=_0x4e73,_0x44133c={'PTMQE':function(_0x4f5a83,_0x5df2ef){return _0x4f5a83===_0x5df2ef;},'Ltxsu':_0x2c51e7(0x658,'Pg$Y')};let _0x2d5f80=!![];return function(_0x36cdaf,_0x1b68d6){const _0x200b35=_0x2c51e7,_0x20b234={'NxqTk':function(_0x2ebda7,_0x3dc7ac){const _0xc66d5b=_0x4e73;return _0x44133c[_0xc66d5b(0x402,'Sqhc')](_0x2ebda7,_0x3dc7ac);},'bxJjR':_0x44133c[_0x200b35(0x618,'E^04')]},_0x5b0d94=_0x2d5f80?function(){const _0x3dca43=_0x200b35;if(_0x1b68d6){if(_0x20b234[_0x3dca43(0x494,'Za!W')](_0x20b234[_0x3dca43(0x7ad,'jH07')],_0x20b234[_0x3dca43(0x54a,'Qz]#')])){const _0x5aab09=_0x1b68d6[_0x3dca43(0x3b3,'S$wU')](_0x36cdaf,arguments);return _0x1b68d6=null,_0x5aab09;}else{_0x14e16f[_0x3dca43(0x268,'rP$x')](_0x3dca43(0x84b,'S$wU'));return;}}}:function(){};return _0x2d5f80=![],_0x5b0d94;};}()),_0x5f2fc5=_0x3b5870(this,function(){const _0x42fc0c=_0x4e73,_0x2bea47={'hNzyS':_0x42fc0c(0x459,'kh6s')};return _0x5f2fc5[_0x42fc0c(0x948,'%mDK')]()[_0x42fc0c(0x3e2,'jH07')](_0x2bea47[_0x42fc0c(0x297,'c#Fp')])[_0x42fc0c(0x2a8,'6Ab!')]()[_0x42fc0c(0x515,'f)1R')](_0x5f2fc5)[_0x42fc0c(0x103,'clFB')](_0x2bea47[_0x42fc0c(0x1af,'Za!W')]);});_0x5f2fc5();let _0x34d3d6=0x64,_0x159f4c=[],_0xe15859='',_0x400388,_0x38633e='',_0x7d8ce0='',_0x36d60c='',_0x2ae000={},_0x37046d=![],_0x3b03b3=0x0;const _0x343aa4=_0x1c7fc8(0x3ee,'%mDK'),_0x30d377=_0x1c7fc8(0x58c,'fnb^');let _0x231d11='';const _0x4cc194=process[_0x1c7fc8(0x102,'7*SU')][_0x1c7fc8(0x464,'E^04')]?process[_0x1c7fc8(0x25a,'F#wy')][_0x1c7fc8(0x1e9,'%3Hq')]:0x0,_0x244589=[0x1,0x2,0x3][_0x1c7fc8(0x784,'2)I6')](parseInt(process[_0x1c7fc8(0x405,'clFB')][_0x1c7fc8(0x59f,'fnb^')]))?parseInt(process[_0x1c7fc8(0x588,'Pg$Y')][_0x1c7fc8(0x82b,'NDl1')]):0x3,_0x1058f1=process[_0x1c7fc8(0x7a7,'5DJ%')][_0x1c7fc8(0x474,'yUSg')]==_0x1c7fc8(0x80e,'JqCf')?!![]:![],_0x4e89f7=parseInt(process[_0x1c7fc8(0x90f,'E^04')][_0x1c7fc8(0x2a6,'7*SU')])||0x1,_0x710a1a=require(_0x1c7fc8(0x6fd,'bCfg')),_0x450319=require('fs'),_0x15bba7=require(_0x1c7fc8(0x760,'JqCf')),_0x39d06e=require(_0x1c7fc8(0x7d2,'DJgi')),_0x27b562=require(_0x1c7fc8(0x1fc,'FQ2s')),{H5st:_0x4fcc67}=require(_0x1c7fc8(0x6db,'Pg$Y'));if(process[_0x1c7fc8(0x7ee,'5Azh')][_0x1c7fc8(0x505,'5Azh')]){const _0x4f7a8b=require(_0x1c7fc8(0x4c4,'*UK0'));$[_0x1c7fc8(0x240,'ni@#')]=_0x4f7a8b[_0x1c7fc8(0x942,'jH07')]($[_
|
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
|