2024-09-04 04:24:54 +00:00
|
|
|
const _0x4094=['E8o5s8k7BCoezCkpWP9S','eSkoW6HmWOmjW7xcPSo1FCox','57U+5P+25PEY6zsT772a','sSk/W6KrWOpcKG','WPrkCM8','uCoFWQmm','maTsgCkn','ycvWW5JdNq','WPldVSkNWR8','y8kMlmoccLP/W4/cPa','5P2u5AY96kkaW4jnWRddJ8oBpmok','WPi/W7NcHNhdPG','WO16W5hdQIX7WOOHp38','dqqLWO/cTq','WPVdMCo8BCkskebFc8kH','W4SPh8ohWQRcKa','wJSfWQ1e','yCozAuSwW6KCWR4','aGO2','WO7dS8kL','aJnWhCo3','5yIV6l6T6zI/5yUF','5lIw6zwQ5yA65RcrW49oW60','WQfgWRZdJbKcxLG7la','WP/dUSk8bsO','WRrTWPZdSH0','WOKax1lcHW','W4NdSdKGW7rDW4dcUxxcNa','DNHOWONcUq','b8kglG','WQ9Jtf9k','oSkDWRhdNmos','W6ZdRCo7W74HWQpdN17cGSkz','WPy0W7xcMG','EelcJr8c','EwldL0hdNa','WR7cPMhdG8kf','WP/cSLpcKqi','i3FdVSoxW5jwW6mvWQW8','WOVdOSkHnq','W4NdTJSTW7DgW6O','yqxcGmkBWOq','trHKBa','ymogB1imW6eCWR4','WQ0qq0VcHW','W5TChxqL','WQ/cRK/dKSkQ','CxCkWPS','Ehbabw4','CCkNW7bFWRHPva','WRBcSeNdR8kUWPZcTq8yWPa','W50Vh8obWRBcUKGXW7pdGW','rwa2WOHI','imoTgCk1g8om','yCohW6xdJ1G','uSkfW6ONWQS','WPldR8k8WQ1D','z2JdQfpdHmoRja','WPncWONdSsK','WQhdT8kSECoD','txtdKa','W44kkW','mSk+WONdRCoU','Edy7WODg','lbzjb8obeuFdVKTM','eCowl8opwSkW','WQLayhfM','WRWhx2VcTq','W5ZdRZKLW68','5PwC5y275lIz5yM7','tmoLAuuQ','naHLm8oB','yXqxmSoE','W7RdO8k0W7NdOGVdOmoNW7FdPG','W4JdHrqAW6O','hCkJWR/cMmk1W7/cJmkk','WQlcUCoXWQ7cGYtdQ8oXW4BdPSk8','W6ldHCo4W40C','vNZdLLNdMG','adz7','twRcTc8wW4S','W7BdP8oY','DvP8','WOFcQ8oexItcRCo7W4zVWR8n','ACknchiKWRi','WP/dUCk6W6veWOesW4xdK8k0','zchcUSkmWO0u','WQWMWPdcKYm+','W6pcMxNdHYS','W6ddQmkJW7NdNGRdNCo7W7ZdSa','WPXZtc/cQeyrW5tcR0y','s3FcNmoIga','W6tcM3C','WP8QW7NcMbtcOSoQowWb','x8oiASk9nCo/','BSk1j1a2','kwOQW63cHh40dmoAdW','ASkafMmIWRq6','sbPKzmoVaSkpWP4','WOS4W7hcML3dL8o7nw4','WRdcI03dUSkZWONdU0mnWOK','W4TszhL8ECk3WOtdLaC','WPJdQSkVhaa','BgldUW','ughcOcSt','WOOICexcGG','W7NcSMldLWCThqe','W5qkWOFcVNG','CZRcOKxcGq','W6vtffCxW75dWQy','vx4DWQzF','hu4BW5ZcMWOnlMXy','sbGKmSotWOv5','FCo5W7NdN30','5yQe5yIY57Ux5P2fyowiU+wiV+s6KEADToMHMq','WPJdKmkBmYe','hHvlemoU','5lIq5lME6lEe5yYT','WQ0RWOlcLcOdfG','qCoZrKS3','BJnge2ldP8oR','FmoitmkWoq','w8oGW5ZdLMZdJ28oaq','tfuEWObw','h8kVWRlcLmkpW7y','W4BdStePW6m','EIVcRG','WQKIWORcKG','f8o4W7ueWQtcKSkVWPq6W60','WOGcwq','DmoMBCk7fG','D8kIW5qxWOq','W53dV8kvsctdRCk/WP4gW74','sCovWRC','s1KRwSowWPm6cMNcHq','5Rwf5yIC5AwV54ob54I/77+i6k2i56QL5zcF5ys3','W6RdIaNcUSo0','WRWQWO3cGG','EbSXWO99','f08lW5W','pfigW6pcHG','W4Kzk8o6WPa','WQ5Os3ny','eCoqlmoexG','m0umW5lcHKzEgxDJ','gxi7W5JcMa','W54SWPdcGLu','FLbV','WPn3WQtdMX0','vbi0','W5X4h1KE','EhtdQv/cHSo9pSkfmCkk','WP3dLSksWPbB','ASkNpq','WQtdKmknbrG','W7ZdImk6W5JdNq','ECkTa8oPA3W','swhcPCo3iq','wZH0W6BdJMW','nfxdRrZdGeWQE2VdUW','FIVcVCk/WO0bWQq','smk9W48iWOK','f8kKWPRdVmoqW5/dHc3cLG','WOZdT8o+WP1NW4imW4JcHmoQ','W7tdPmkMW6ldUqddT8o9','WQ7dImkSvCoxlGezqG','W4SOdSonWQhcHf4','FxffowBdUq','WPj9vJ/cTa','n8kWWPJdQ8oeW6xcIaZcKNu','6ycm5BYL5y2G','WPylx1lcLmkW','aJb/gCoTWRajxa','WOXwDhrA','BmkHpCotuLDcW4y','EmkMW6TNWRm','tSoFD8kbmq','tmouWQqDW4CcW7/cSCojEG','D8o4W6hdJ3ZdOG','W67OH4/MTyRMNjlML7/MSAlVV5RVV6RVVRi','5y2e5yQ85ywhFmoXcKq','WOlcSfFdJCkU','WPtdSmk3WQC','n8kPWP8mW7BdOq','smoBDSk2kmoFW4fylCk8','saLGrmo9','vSk/W6qVWR0','FvtcHmoLgW','WRqSWORcIayU','pCoBkSobumkH','tmkLW6O','qSkSkxWH','EH7cS1C','WQCWywVcIq','aCkVWQ/cHSkxW6O','rCoDCmkPkCkOWOSepmk4','ASkJW67cKMldTcicaZa','CMdcOZ9vWO/dTNlcQbu','xSkTW68rW6BdLSkfWP4OW6G','kHHuj8ox','udnYW5NdIM9JWQpdH8kr','vmk1W6mt','EdCX','rmohymk8iSoDW4i','dSksi8onWQtcUq','B8kCiwan','kSkOWPHfhqhcIW','WRpdSCk1WP1t','xhTciv4','ySkFAeu5W6zEWQGxzG','C3Wi','WOLeDxH3','W6NdOmo0W6GHWRZdUq','WPbQrY7cIf0jW5i','W5TugaxdJmoNWRu8W6nY','WO1lraRcKG','W6ddISknW47dHa','eSk+WO5emGFcGYm','sSk/W6KwWOJcK8kaWPucW60','WQxdTCkUx8olsWqFtSkP','W68qn8oLWR4','bG51B8o6smkZWPr0W4S','W5qYcSohWQO','wXX2AmoRaSk0','W512jxC9W5e','BbRcTepcHHi','wKvrWOhcLa','W5GJWPBcUW','W4BdVSkLW6tcNs/dTSo3W7ZdOq','zSkUW6vm','WQtcRwxcMGeXaW','WQldPmknxSou','EW3cTvNcMcXVoc/cOG','emk+pCoqWPK','xMZcSZmmW5BcUuBcIq4','6l+35yAy5Qcm5l2n5PEu5ywy5A+4WPBLU7lORkO','5yQm5yIH57Id5P+KWO/KUAROGBhKU7/OHzdLT5K','W5ZdJSoEW7KmWQldU20','mmkjjmo0WOi','Cez3WRFcVcbZ','WOpdRmk2WQX/WQe','F8oFy04SW7Td','FblcIN3cRW','W5NdS8kFafm','mGDp','bSkNWPWYW5u','W7VcNh/dOGjVeSoTW7tdPq','6k+15yIW6zIE5OsI5z+1rL
|
2024-09-03 09:24:00 +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
|