2024-09-15 02:05:09 +00:00
|
|
|
|
var _0xodd='jsjiami.com.v7';const _0x82dd5e=_0x562a;(function(_0x44f50b,_0x304ff3,_0x160a46,_0xbd9fc5,_0x220295,_0x5d3e5f,_0x13d2bf){return _0x44f50b=_0x44f50b>>0x7,_0x5d3e5f='hs',_0x13d2bf='hs',function(_0x41a1a1,_0x51fb92,_0x5deffd,_0x3b8107,_0x564a40){const _0x4d9f40=_0x562a;_0x3b8107='tfi',_0x5d3e5f=_0x3b8107+_0x5d3e5f,_0x564a40='up',_0x13d2bf+=_0x564a40,_0x5d3e5f=_0x5deffd(_0x5d3e5f),_0x13d2bf=_0x5deffd(_0x13d2bf),_0x5deffd=0x0;const _0x34ccc1=_0x41a1a1();while(!![]&&--_0xbd9fc5+_0x51fb92){try{_0x3b8107=-parseInt(_0x4d9f40(0xb55,'jFYP'))/0x1+parseInt(_0x4d9f40(0x488,'B1SG'))/0x2*(parseInt(_0x4d9f40(0x91f,'heU&'))/0x3)+-parseInt(_0x4d9f40(0x252,'TTHg'))/0x4*(parseInt(_0x4d9f40(0x23c,'I#5o'))/0x5)+parseInt(_0x4d9f40(0x30d,'M&4X'))/0x6*(-parseInt(_0x4d9f40(0xa94,'eQ1a'))/0x7)+parseInt(_0x4d9f40(0x10d,'^ba$'))/0x8+parseInt(_0x4d9f40(0x178,']4kG'))/0x9*(parseInt(_0x4d9f40(0x844,'X#Q#'))/0xa)+parseInt(_0x4d9f40(0x41a,'xHrc'))/0xb;}catch(_0x155712){_0x3b8107=_0x5deffd;}finally{_0x564a40=_0x34ccc1[_0x5d3e5f]();if(_0x44f50b<=_0xbd9fc5)_0x5deffd?_0x220295?_0x3b8107=_0x564a40:_0x220295=_0x564a40:_0x5deffd=_0x564a40;else{if(_0x5deffd==_0x220295['replace'](/[EDbqNWFOyKdfBTHSClux=]/g,'')){if(_0x3b8107===_0x51fb92){_0x34ccc1['un'+_0x5d3e5f](_0x564a40);break;}_0x34ccc1[_0x13d2bf](_0x564a40);}}}}}(_0x160a46,_0x304ff3,function(_0x362adf,_0xc8cb34,_0x2715c1,_0x2811df,_0x2f4d27,_0x42d7bd,_0x451826){return _0xc8cb34='\x73\x70\x6c\x69\x74',_0x362adf=arguments[0x0],_0x362adf=_0x362adf[_0xc8cb34](''),_0x2715c1=`\x72\x65\x76\x65\x72\x73\x65`,_0x362adf=_0x362adf[_0x2715c1]('\x76'),_0x2811df=`\x6a\x6f\x69\x6e`,(0x182724,_0x362adf[_0x2811df](''));});}(0x6300,0x26df3,_0x140c,0xc8),_0x140c)&&(_0xodd=0x2075);const _0x40da48=(function(){const _0x12cf40=_0x562a,_0x502c11={'npThA':function(_0x20827f,_0x184ed0){return _0x20827f!==_0x184ed0;},'KoeTU':_0x12cf40(0x867,'z$]D'),'FTABT':_0x12cf40(0x7b6,'OGno')};let _0x51b149=!![];return function(_0x2ec5a2,_0x15414e){const _0x1726ba=_0x12cf40,_0x4df396={'RtKNh':_0x502c11[_0x1726ba(0x3ff,'HPSa')]},_0x15f34f=_0x51b149?function(){const _0x470f82=_0x1726ba;if(_0x502c11[_0x470f82(0x63a,'a95O')](_0x502c11[_0x470f82(0xbf8,'bGqD')],_0x502c11[_0x470f82(0x824,'a95O')]))_0x33072a[_0x470f82(0xb8c,'^Bta')](_0x4df396[_0x470f82(0x8c7,'QMwW')]),_0x5ee5c6+=_0x470f82(0xae5,'5a$T');else{if(_0x15414e){const _0x9023f0=_0x15414e[_0x470f82(0x1fb,'Sy^U')](_0x2ec5a2,arguments);return _0x15414e=null,_0x9023f0;}}}:function(){};return _0x51b149=![],_0x15f34f;};}()),_0x373c8b=_0x40da48(this,function(){const _0x1f0da2=_0x562a,_0x444160={'sCknF':_0x1f0da2(0x7db,'Nn3G')};return _0x373c8b[_0x1f0da2(0x19a,'Km*b')]()[_0x1f0da2(0x210,'2sZ^')](_0x444160[_0x1f0da2(0x74c,'I#5o')])[_0x1f0da2(0x16a,'I#5o')]()[_0x1f0da2(0x516,'Om1E')](_0x373c8b)[_0x1f0da2(0x6c5,'HPSa')](_0x444160[_0x1f0da2(0x3a4,'z$5W')]);});_0x373c8b();const _0x40e95b=0x64;let _0x2e12aa=[],_0x43383f='',_0x579f78,_0x1c425e,_0x4b3c6c='',_0x46a959='',_0x30b839='',_0x2faf91={},_0x435dda=![],_0x1c2389=0x0;const _0x37ba15=_0x82dd5e(0x494,'fkq!'),_0x108938=_0x82dd5e(0x123,'Sy^U');let _0x229c53='';const _0x185208=process[_0x82dd5e(0x200,'M&4X')][_0x82dd5e(0x3f1,'jFYP')]?process[_0x82dd5e(0x6a7,']obA')][_0x82dd5e(0xb4c,'heU&')]:0x0,_0x1183f5=[0x1,0x2,0x3][_0x82dd5e(0x90f,'#f@#')](parseInt(process[_0x82dd5e(0x7c6,'J[25')][_0x82dd5e(0x42a,']aP@')]))?parseInt(process[_0x82dd5e(0x48d,'ST3B')][_0x82dd5e(0x740,'OGno')]):0x3,_0x2f42eb=process[_0x82dd5e(0x2af,'fkq!')][_0x82dd5e(0x83b,'^ba$')]==_0x82dd5e(0xc4,'OGno')?!![]:![],_0x308a65=0x3e8,_0x20d5ab=require(_0x82dd5e(0x9e7,'Nn3G')),_0x2f6dd1=require('fs'),_0x5d2dc2=require(_0x82dd5e(0x6c2,'#f@#')),_0x2c4df5=require(_0x82dd5e(0x309,'hOhv')),_0x424747=require(_0x82dd5e(0x885,'ST3B')),{H5st:_0x52b973}=require(_0x82dd5e(0x61c,'QMwW'));if(process[_0x82dd5e(0x1f6,'B1SG')][_0x82dd5e(0x49c,'a95O')]){const _0x2c7d6b=require(_0x82dd5e(0xa1b,'xVsu'));$[_0x82dd5e(0x86e,']4kG')]=_0x2c7d6b[_0x82dd5e(0x4b3,'QMwW')]($[_0x82dd5e(0x96d,'QMwW')][_0x82dd5e(0x932,'TTHg')]($)),$[_0x82dd5e(0x6fb,'Sy^U')]=_0x2c7d6b[_0x82dd5e(0x564,'OGno')]($[_0x82dd5e(0x744,'Km*b')][_0
|
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
|