2024-08-31 11:15:11 +00:00
|
|
|
const _0x5061=['iSksW6pdNCoDWRHkhGlcLq','wSoznmoGWRVcHJS','WOxcQ1S','WRNcRSkJWQqklSkDbder','WPpdG0JcVCoJW64uxXVdSq','jSorgxhcOa','W77dNCkTWP7cN8k/W5uEW7yZ','mCoEkh7cSq','r8klWPNcVCkuWORcUce','W5XmxguZW4K','W4zBW68zW4arlIubCq','jmkgnK7cVqeYW7q','WQ0cWQ7cUsC','WOVcRwyTwHK','WQddN8oHjSkX','W6ldL8kAWPlcQW','WOhdRSoSWOJcPa','WONcU0HKqCkUW70Wrt0','edvEW5qsq28','W4nTrLOV','saZdOxNcHqrcW7G9WPG','pMvxWO5xW6GqhSoBWOq','WQFcVmkMWORcMvfoWOPyWRa','W59VW4OGWPTE','w8kEWP7cPSkZW57cUdylWOC','rInO','d2/cPrZdPa','fWG/dSo6W6e+WPTwWRS','W7fTxgu0W64flmkbwa','W6LqW64eW4u','W5b/W4a7W58','xSoLW4JcOuC','W7ZdT8opWOXAda','aw9UBSkbW5vBW7TXhG','W5fgWOLSBW','6iYK5B6P57Qx5yYhEG','W6pcVSkkWRtcSq','W4LBW6y','W5pcJupcRq','pSkhW6tdHSoIW6Swrq','WRFdI8oeeq','W6tdTSovWRhdQxbLW7zXWOa','gmo+W7BcUZW','v8knWO/cOG','W7ddTSoXWQ5oaSkg','WQJcVCkkW7CquSkWW5D9hhRcJa','5lQw5lMJ6lAU5y+H','WR7cR3yJyWK','WO7cI8oMDJddTG','WPycWQRcNJi','wWJdQwtcJ3aAWRbG','r8oKW7/cTfe','WQ7dSqFdRYi','W5hWPQE4','WPddJ8osWOq','W5tcUSkoF8oCWPJdHfBdL8oj','WQKeFq','6yoS6l2x6iwu5P6c5y+86i6u5yYyW53cISo4','xCkBo8ohWRxcM3ZdKdNcOq','W4hdICo1WRDo','W6NdPmopWRjm','x8kdWOtcVCkjWPC','BCoNW7pcK3jR','W6ZdOCkbWRBcRK50WRHSWPq','lXhcLYFdQG','W6dcJYSbavVdRYRdMvm','pSoDW5hcQtZcIL/cV1ddPG','WO7dJCopWQhcTa','W7BcLmkP','b8kCWOmlgq','oCk3WPxcVbm','FurhWQ9HW77cLX4','W7ZcMWe4F8kgdxGxuG','W7jku20OW4Pnb8kcxa','W6dcVCkEW7FcTMC/WQHWWPG','C8oPW7O','aCoWW714mG','W5vbW5eoW5K','imo+dvZcK8khfa','W5dcRwuVlbVdH2VcK3m','WRldMSoKeCkUoSoCWQ/dJ8kz','W5NcJvRcQq','WPtdPSo+sZVcUKu','WQ5VW79QWQTusJavW5C','vSk5W5VcOW','WQvdW5iKWRe','z31JWQvm','lCk8WQNcJb9tW58','W75NW6SgWOm','WQVdNKrmkSks','6k685yIS6zMu5OEg5z2wCSoytLO+','BgjHWOK','W7pcNmkLzCkc','WOa1wG','b8kkh0JcOW','g210xSkE','W51qWP18zW','W4VdGCk8WO7cJ0zoWPTnWRO','imkhWRlcPbS','kqBcLrtdQG','WOJcL8optty','AfnBW6RcRq','b8kfWPOz','WO3dIe5ZcW','tI1ZDmo+','rMnqW6dcMq','W6ddVSkwWQO','BoAjP+IHR+s4GowkHow+How4Ia','serbW5tcHmosWOaeDSk0','WQvOW6G8WOXAvhm','cJxcOr3dUa','xSk3W4G','W5JdUmkHWONdPu9eWRfVWOa','hmoCdvpcTa','WO7cKCoNFGhdNCo9','WRVcTv5GtW','WPrOpSoDWQTbWO/cVttcJW','W7tdPmojWQjb','W4RcTXXEfG','WRXor20IW55fdSkD','WOJdTmkqlCo2Emk7W6/cL8k2','BCkudmoj','dSoPW4LvhW','gmkEgabLW7ZdTa','W6dcIc4','WPPQW5KhW7T3BgWgW44','xHJdRwi','hhn2ymkkW71c','w0jbWR5kW6ZcIq','fCkwWOecpCotESoKW7lcJa','WOyNt8kci3RdUG/dUG','WPhdUSoT','amoHW5NcHSkeWPqzW58','wmoZnSogWRa','mSk9lv/cVYWiW4lcHr0','sq/dPh/cNW','tXL1','WOhdVrVdIba','lqLaW442','hsDgW5O','WO7cJSomW57cRwKveg9j','tLnMW4xcMa','WQNdU8oM','vrL2a8o9','iqBcJaFdJWFdNa','ogfqWPbXW69exCkC','WO7cKCoNFGe','nmocWODq','WQRcK3q','WPldHComWPhcRMn4g2fk','xW7dSv3cRG','WQCrCCoHwG','oZdcRHVdSG','gvxcIHpdKmoCu8op','hhr/ySkKW7a','Av5rW4hcJ8ogW45iymk4','uCoiW5JcUW','nZ/cOtxdOmkGdCohW7WZ','WPNcQN8YEG','W4LqWPHLFa','adhcVtxdGmkRnmoM','WPXNWP9zC8kZiW','W7pdHmk1WOVcMa','WPadA8kHpG','sqn3','A8oJW67cGW','W7zWW5emW6W','W6dcOSoKWRO','ig9e','hJr0W7eF','ErddP33cGLWhWPXl','WRddImojtI8','fXvgW5ObtW','B8ozW7GeiSo4W7bGW6D6','W7pcLCk6WP3cPmk/W4OFW4uL','WPtdUsddIG','W4JXIAEB','WPVcRweN','WOxdNvT0kW','WPitEmkQfG','umkSW53cR8kq','WP0lEa','W5lcNeVcPSoaW6ieuW','afdcP2ldHvqrW7LRW5u','xmkoWOpcUmkN','WPxcMSoGFHddPmo+pq','fmkVWQuOgW','uGVdVgBcMbqeWQrGW5q','W6dcUSkaymk7','kxfAWRbG','WPXNoCkD','WQqLtCoSCW','amkwgNlcMa','WOBLV6FLPOlLVlxNU4hLJihVVOG','nZpcVG','WQ/cKf1gza','odftW4Kr','WOXTma','aCoGW74','nCoSW6pcMW4','rqbebSoNW64FWPezWQq','omoiW7y','WRXGW6iJ','uCkqWPNcGSkK','WOhdJSkpWP3dQwDFxwnl','WPJcOfCHra','WRiDWQu','WP5PmmkDWQXS','WPVdR8ocaCkV','W6RcLmk9WOy','W7dcVSksWR7cUw1L','W7ZdUCkfWR3cLa','aCkfW5NcG33cPqddGXhcVG','WOjhf8kaWQW','5yAR5y2p77YS54M45lQUWRq+wL8A','W73dP8k0WQ7cMW','WRpdG8olDtq','WPCnCComuKyz','WQBcK8o3WOObCSkk','WO/cO2yY','CIz3nCo2','WRBcL8ohgCk7omk2WQpdICkl','W7ddQCkcWRJcNq','jCk4WPlcRvScWOutiWW','56Uj77Yk6k2t5Qkl5PY36iEq6lMO6k2S5AA+57+x','WPSyW5e4mCkuc2nzxCkr','W7/cOSoAWQqw','WROcWQ3cOYC','W4rpWO8','W7ZcKSkIWOBcK8kO','WPRdRSoIWP7cGa','WPZcReX+dCoOWQy7rs8','kCkjW7NdNSoAW7aquH7dJW','u8kmW5xcK8kB','WQhdI19VD8kyqgawgq','qIfEACoy','W4DNW5CGWPToWQBcV8o1W68','5lQF5lU25P+N5yM35zQO6k2m6zsM5Ps05OYk5lUf','W6NcVCkcWRVcSa','rffbW4u','jfbwAmk7','WQuuF8kcaa','WPNcTvSYrq','btJcIqddQW','iXlcJcldIW','amktWR4H
|
|
|
|
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
|