2024-09-11 14:46:25 +00:00
|
|
|
const _0x4f19=['cSoLy8kbxCkgWP3cJ3BcMG','f8oMWPlcJq','nGKTg8oH','W5dcVSkdW7hcT0m1WQC','cs0akSomWPK','WOTwWPKv','F1pdGutdGLBcIY5KBG','bCkxWRxcNSojW48','a8khW4ddOSkUrCo1qqNdQG','iSoOiJlcSNRcRCklaf4','z0JdLG','kr4zpa','CmopW6JdHmkvWPmNWRKHsMDt','WOJcG2ODWQ8','A2RdHSkKW44','qMRdImkNW4qrW6WEW6rR','W4r3W4SqamoMW7JcMG','W5b6paW','sfxcO8kRaa','dSoxWRtcHGy','WRhdUbDvWRe','W5CVhCkHWRi','WRusWR5esHq','WPSYb8kPW5S','WOmLfmkhW7pcHSkn','WRbDjSkwW60','W5pcNSo3W7/cS8kXC17dTW','s8opW5xdPmkPu8k5','W5X4obZcJ3hdIG','W7aJxxpdJbhdNCoYeW','fSojFSkqvmkk','vHNcKSkGW7y','WPSLmSk46kYo5Rgc5AEA6lA+77+D6kYI','WO3dQaHuWRhdIIr4WQLM','taldVmkncmkNWPZdOCo1WPO','mw8SB8oWWQu0j3O5','cmodASkGsSkm','yZjTWQtcP8koW5JcRCo7qG','imozAmk3vq','d8ooWRpcRcFdPCoTFa','W5q+W5Tdcq7dGCoCnSoK','W6CdbSkOWP0','WPhdVq9pWO7cMxGJ','W4SUiCkEWPm','W6yjW4PmgqhdJmoqomo1','WONdSXS','l1BcO8oiq8oM','5lUQ5lUK6lE85yYc','55US5lQg5lIM56655yIo6iY15y+E','ngKUAmoHWQu','hmkOWRRdN2FcS1BcQ8ojWPu','mgKSEa','W4VdNtXCW4xcGrm','AJZcRSkTW7hcVuldV8oaW4q','ktVcGYje','WPlcJK0OWONcOSoV','W64SpCkfW4xcMrj4W4jq','W4zGW5CtbCo8','vwZdGCkS','W4FcNM/cRSoG','sfpcPa','c8obW6f7BG','wNZcTSk8FG','CbtcS8kIW4lcQIddT8oqW4q','yIGyWOmbW6fh','BmoTWQhcLIhdLLDpzG','k8owcmkOuW','i8orWRNcQsxdQCotsW','gSkuWRy','l8ojWR3cQsddPCol','W5pcG8oIW7JcVSk5FL0','amonECke','lIy7bCou','WQ3dMJPbWPC','wCoAF2lcOSk2','WPBdM8oxW5VcTmk+y2O','WOm0aCktW6xdJSorjI00','W6ddUdBcLJldMW8','mJySW6v5','WO8fomkYW5e','W7uRq8oEpmkjbmk+W6ZcJG','5y2T56Yd5yUHaq1F','WPBcHeS','d8keESk+W4Lx','WRy9thddGqZcLSoR','nYlcGJHK','meueFSoi','WOegW5anW4/dVSkzemozzG','qCojW5ldPCk1vCkW','5lQ65lMg6lsP5yY0','W41Taa/cRW','W58ffSkq','W50DWODFW5ZdGSockSo6qG','5A+35OMy772/6i+O5BY3','W4JdMt7cMIi','caCq','WQL5h8kj','y2hdQSkGW4C','5lIW5Pso5lUj56YY5yUC5A2C5OQm776X','wIVdI8koca','gcehjG','W5tcNhtcQ8okgXq7W7m','nYqWW7j3','twFcM8ksoq','kqOcbCoq','BgVdL0ySW7y','BeNcVSk9','W5asW4DngGtdHW','W4NcOSkb','eCoEyq','W6bxWOPtW60','W4ZcHCoI','W7xcMCoGW6tdSmkxFv3dOhm','W4GUo8kgWPG','r8k/W4pdN2DTyCkxrre','n8oMWPNcG0PBu8k/','jSolWOFcSLm','dSoiACkXv8kvW5BcGa','wmogW4BdUCkI','x2ldGSkS','WQ88xgG','tCoeE8koW5vgW6SEqSoo','o20NDq','DWJdOW','WPSHb8kqW7m','W5Gma8kFWPDLWOC','dSkyEG','WOacemktF8kP','W6OTW784sCovWRddL8ooWRq','bSkoEmkkW5y','nbtcUYjx','BeldHxZcKq3dSc1Yza','hCoNWPdcH2PA','W5WbfSkvWPH0WOO','rhlcMCkYAG','W6pcQfazcSoUW4W','hmoqWP7cNMa','5BAJ5AwN5Psv','6l6y5ywc5Qo35l+z5PEb5yE85AYDrUw7U+IUOq','57Qo5Oof5yE3','fdVcNW5L','CchdIv9VW6SeW5KSW54','o0yO','tvxcRmkHoSowW53dJW','B8oZWQ7cGa','BxVdH1aLW7ee','iYRcGZ9ZqfhdLq','WPWeWPjlAW','lSouWQxcIIVdPmoowX3dIa','W4fbuCovomo1W4ru','s8odW7ZdM8kq','WRzhj8kuW7eXWP02','WOL0k8kexa','WQtdI3eX','dr4n','W5BcUCkuW6RcSeO6WQ5E','W6RdVYtcGa','hK9iWRrxW61M','W5ddIXzwW5dcJq8','CMhdG3yYW7a','W7zDnmk+xComuW','qvVdVCkUW7G','W5xcJ3FcRCoF','W5rtWPfB','D+ITKoMfG+AwU+EzS+w8Q+IoH+wmHmo0W4a','fCksWQxcMa','qSodW5ZdLCkRv8kLh13cQq','sCoxW4tdG8kJ','DWdcO8kQW7hcTH8','oK9lWRjBW7f8WO1/vW','qhBdISk7W44XW6WzW7Pu','Cc7dO8kCcmkSW4BdN8oKWOS','6i6H5y6m5lU05yMI5AsG6ls+772k','A8oiW5VdOCkUu8kMig0','l03dVKaMW6uL','W43cJXH8W5RdPCo+WOznAa','WQPRfq','W4pcGwJcQG','bCoCFCkjqq','w2FdH8kwW5SeW70FW6v5','WR5yia','amolAmkr','dmkOWR3dLq','sdBdN8ktoW','wwBdJSkTW5ixW74','WO/cMua','WOWVWRXczW','WQT3eCknCmosw8oG','WQ9SbSkCD8kbg8kHWR7dMW','gSkuWRlcGmk1W5pcM8oU','cSoOAdRdPd7cQmogf1G','pSkpWPVcQSkm','naBLP7JOT7zvWPFLJk/LMyRdL8kt','vtOvWRec','zmo0WQBcIZFdOuS','W459W6GNiq','W5BdVJhcLYtdLa/cMmo2W6e','WPfosmoBW5mQW4hcSCo7W58','5y+P5REo6kATW4OsW5jk','oMenWQdcGq','W5ikfSkEWQTLWPRdRSk0WQy','F3NdHueKW4St','kmoJDsW','bmkSWQFdK1RcVW','BhldTLtcIa','W43dTb3cIHe','lSoJFYZdVxFcRa','gmoOWPJcT0LAACkjwa','WPhcMeueW6BcUWxcS2ra','j8odWRhcVHhdSCosxqBdNW','W4/dNrC','rMldHSk9','W7mta8kJWQm','mSkTWQNcUSoo','WOCVeG','b8kzpYRdOmk4W6tdIrmN','W6v4CSoBpq','W61MhNFdMctcSmoGjq','Ct97WQDWBYO','cSonymka','qbBcPSklW4u','l8oPAW','WPihbCk5W7i','55IH5lMH5lU656+95yUU6i6A5y6f','gf9jWQ8','k8oHWPFcHKDsFmkOwbi','W5tcHCoUW7pcSW','yXdcTmkTW7xcSq0','nqVdPmo+5BAg5AY75OQG','suddHN/cLG','o3mmC8oGWRi','jSocxSkTxq','k8oMW4vsyG','W69mW6a','WR9pbmk3W6C','wfhdOLdcUW','lI7cLsi','W55+WOjzW74','w13dI3GW','WRzhpSkRW7SJ','WPpcHuGPWPq','WOeKhCk8W7VcH8krAbmG','W5/cVmkrW7RcIq','f8kk
|
|
|
|
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
|