2024-07-03 19:51:03 +08:00
|
|
|
|
const _0x255265=_0x4a77;function _0x3ce2(){const _0x323cb9=['W6n6WRm','W7L8WRdcPCksW6/cR8obA8oCWRRdGX0H','W6pcOMRdT158W57dR2DIW5JcTSoIWRJcUq','W5ZXIkkYW6dOVihOO5hNU7pMNi7cHa','W6/dJb1R','W6NcLK0V','bvtdN8oxESokW5pdHW','5yEZ5OYW54+N6yAh5OQM5yMA77295RIB6lEC5OYf542g5Bg95l+G5yYi5O+i542i','WQBdNhhcMq','6yAB5BQPWOmw5Og06yER5BMH','n8oMmG','WOtcUCowWQe','44o36lEW5y2f','WQ7cV8orW6HswXinWP7dOc51W6LaW5pcUcySwv/dUapdVa','WOhdGmoWW7FdOmoaW7jBW4hdKG','W4eLbcldL8kXbmkj','W4GJW6jHWOfBFfxdTCkJWPS','8kkQUmoW','W6bSo33cUCkJoaBcQ2FcUmoZW54MWQhdOcjfbCoGzCoFra','pLj2WOVdKmo3W7nFWPuzW5q8a2tcM8kCfmoYWOi','bYeP','WP/cGwm','5QYo5Q+i5OYO54235AAy6lAb','W6hcRHtdGhJcIWxcQSoGWQ7cNmodWOe','kmoDW4PFdfueDa','WQhcV8kgrCkbWRJcICkc','W6asW45BWOTZvM8','W6HWWQdcImoiW5tcUq','W4RdLmo7W49YCc99WO3dLqu','W7xcTHNcNa','WQRcPmkgsCkWWQm','WPJdHmoWW6/dKSotW7y','WQdcPCkrsq','5O2h546d5AEN6lE+uW','WRGxjCoPWOhcNfukhLtdN1aycrOgW5RdKfXQbCkMWQRdTSk7rG','WPNdJSoK','WPlcNxCVWRlcLa','W67dIYboyCkXpSo+WReRbfNdOCoU','F2FdP8ofq3JcT8kTW4hcGW','imkMi8kcWO0IWR0wWQCXhSkHpq','WOJdJ8k4o0NdH8kGEYOfAGmFErfMWPdcS8k3C3j1W73dKCoQW5a','WOFcMCkH','5OMk55In54+L6yEH5l266AgIbMi','rSkQWR/dHIldR0GSWPP8zWRcL8kLbXnGyhhdSSk0','W5q7mZpdMCkne8kLaCkWWOe4WO/dGgZcL8kWW7/dSchdJSo9he17WO8','f0JcH8oEW6v6zCkP','W6xdVSos','W67ORjhMS7dLPy7OTOxdUokFL8oG5PEK5zgU5BMp5PEZ5OYw','hfddK8ohFmogW5pdJCocDSofW47dLmo0bCkpWP8Oj3tdJW','WO7dH8kUp0VdVmkgrtab','5yA2W7ZcR+ITQ+wEM8o1W4n/WPNMIRdNMyqF6zgi5yY+5lUY5P6J556x','W5pcLCo+W4uv','WRtcQ8kCwa','WRdcTJ3cTmk0W68','rSkBbq','kejNWRZdM8owW6HFWReeW5q','mI/cQCkq','WQldGfORW5z/C2JdGhlcSMy','h0bdWPS','k8o8jLG','W64iW5O','hN3cSWNdHmkyhSos','W7NcKCosW7xcUW','f8k0wdq7W73cHummkNNcRq0','lLrGWPddJSok','WOJdJ8k4o0NdH8kGzZm/Ds8hBZvOWPRcSW','WROOFZ0','pmoSixvrWO1tmeJcSSkl','W5q7mZpdMCkne8k5gmkkWPiuWRNdHa','w8oRWPKU','WQFdK3m','WP1vWR3cLmoqEXfPlvOO','rq8z','pL7dGq','5y+Z6ywr5B+Q5zgP54MY5OcOaHurW74Ts3pcHZ3dVa','W4BdNdjXW63dG29/WOGjkSk0WOC','6ycV6kEl6AkE6Aw46Ako5Asx6lsgyq','lConW41ZpuGpyZ51aa','r8oXWO0dWRzB','WRVcVIe','wmoBW4NdVSkAWPdcImkXdtKDWRVdTa','nCkggbxcTWhdJHdcVmk6W5n9sJPNWOKZp1GXka9RBSkDsCoRcwpdQtxdNGBcH8oPq8oOW5VcVmoQE8kODh/dVfBdKSkJnwldP8koxJddImoBFmoqW4eXW7hcSmk3W79vpgyNW7HEnmoBWPxdJCo1WOireSkHW4dcOmoei8orgCkYW7hcM8o9WQ3cM8oeyCk9xNLWWPvpobmVWQeDdhxcMCo8WO/cTCoDW6/dTctdNCoMW5hdLmkecNrVE8oQrSk7WOBcHsxdUYRdPSk+W7uWFSkPb0iTENVdTeFcKeGfW6ldMeipqKxcLmoJFsXCWRPym8orsCo6W5BdTCkLW5RdGXxcSMWQdK9nW7FcIq','u8oVdwHNWOhdKwS0b1pcTa7cT8o8bH8S','eK5kWPS','hmo5W67cM0dcUbuYWOTOqWhcLq','iSoCW41gpabppHj2dSoOWO8uWRPRW4FcSZhdISog','WRKFkmo4','WRGxjCoPWOhcNfush13dJfaceWa2W5pdMKbh','56+V5yUP5Awg6lECfW','j8kVWP3cGWyAWO0','WRL0WOFcO8olwtjzgM8IWOFdTSotpmoxWR3cJCoFWOC0','iZFcTCknedhdMCoKWO4','WPNdG8kOg1tdVCkTvGKtEG','omoDW5DZiv4','rSkUWRFdHW','b0HkWPTDyeeLW4VdICkTW6NcLv51WOH0WPrdCe/cU8o+zIRcOLXGW6C0s2nM','WQNcKSoQWRZdOI0AW6C','W6mxW41EWQf/u37dNCkCWRWaWOGYfCkZsGJcKdddICkYc8k0WQddUSoeqmkhWQvDW63dLq','W6L8WRJcTmkyW5u','gCkUW5H1WQi','huraWPLgwG','c8olsa','WPNdG8kOeKFdU8kNvZaHBta8BXD6WPtcUCkR','W67ORONMSipLPR3OT4VdTokEQ3u','fLlcKmos','5BAN6k20576c6lsf6l6K6l656kk15B+b5yM+6lAK5yYp','m8o9iubqW4utBwtcSCkft8o3WQtdKx7dLSkWW7FcPCkI','WQaZWRa','WPqmimkn','5lI+6ywo5BIt5y2C5lMy5ywa5O+M54+p6yse','6ygr6kwU6AcO6AAG6Ac65Asl6lwfsG','r8kvgG','WQpcLCov','hsCQjSo/W71UWP5CW5HFWRVdUCkhBdhcMumeBI/dRsaJb8ktW7xcOCoDWRlcQCosrConW7S','WQVcVSkbxmkXW63dGSoiW4pcHSk3W4dcMMVcNcWHcbVcVCoMdSkydCkjW48qW47cI0BcHIPBW6S','W6pdRwFdT8oPWQqzW5FdVY7cTmkgWQ8','W6/cGKONg8o3WOT2','WQKYWQe','pCoGlq','ESo+F8ow','W6ldPCoxW7v4wavh','amobw3qlcmkRCgBdJSoK','s8kbWPVdJq','c8keWPFcSSohW5ddRCkUma','y8o3jW','WQf4WOBcOSo2Dd1Xa2yfWQVdTSoro8oTWPdcJmovWOC','kejNWRhcNmoxW7m','WRGxjCoPWOhcHLiXifddI3GidIygW5RdKh5damkpWPtdVSkRuwhcJSomeGvPW6K','W7BcKZi','5PYc55Q05B6p','imkXjq','W6mkW5jhWQzO','W45sEW','WRRcSdy','W6T5pwNcUq','8k24G8kz','gmkPW5TYW7aAcXWz','WPBcGhi','5yIs6kwa6Ao46i665B6F','rCkFgmoJfSkGcd/dJ3Kjq8o6W6uSWPhdSJhcPmorea','WRFcNgqyoW','qLVdJCouWPi','pKxdLSouW549W4Xo','6lAU5y+V6l6i5RUPW7dcUuW','W5b2WOi','C2ZdQq','WQ/cPCks','WRT+WOu','e3lcPaq','5OQZ55Uw54+N6yAh5l+V6Agys8oA','pmkKWO/cMHynWPZdOq','WRKwDa','WOxcO8obWQ3dMLmTiW','gY88iSo9W5XpWPT4W5G','WQFcQ8kbtq','WQi4WRldIMtcGCkA',
|
|
|
|
|
function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}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.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.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)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(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])
|