2024-12-01 17:30:41 +08:00
|
|
|
|
function fO0Si4z(){}var JaAyQ71=Object['defineProperty'],Y97Qpu,R7FYkvl,E2h4w77,uJT5Ey,Zye60K,pHx5EHe,rMWwWh7,QwIjuo,p8wP4oW,gkx5vl,eFmmPF,xjJbNj,Qzzp09,ZkcY1mV,R5cItm,m6NbrAT,EGD9bk,xkNAtQ0,CzWlsyu;function CIhtXg(fO0Si4z){return Y97Qpu[fO0Si4z<0x10d?fO0Si4z>0x10d?fO0Si4z+0x47:fO0Si4z<0x10d?fO0Si4z+0x4f:fO0Si4z-0x53:fO0Si4z-0x18]}Y97Qpu=lE3MKu();function h2MMikJ(fO0Si4z,JaAyQ71){var E2h4w77=t28YuVZ(fO0Si4z=>{return Y97Qpu[fO0Si4z>0x1?fO0Si4z<0x1?fO0Si4z-0xf:fO0Si4z<0x15e?fO0Si4z>0x15e?fO0Si4z+0x64:fO0Si4z-0x2:fO0Si4z+0x60:fO0Si4z-0x48]},0x1);return R7FYkvl.call(null,fO0Si4z,E2h4w77(0x33),{value:JaAyQ71,configurable:E2h4w77(0xf2)})}fO0Si4z(R7FYkvl=Object.defineProperty,E2h4w77=h2MMikJ(t28YuVZ((...JaAyQ71)=>{var R7FYkvl=t28YuVZ(JaAyQ71=>{return Y97Qpu[JaAyQ71>0x27?JaAyQ71-0x28:JaAyQ71-0x43]},0x1);fO0Si4z(JaAyQ71.length=0x2,JaAyQ71[0x60]=-0x2f);if(JaAyQ71[R7FYkvl(0x28)]>R7FYkvl(0x9b)){var E2h4w77=t28YuVZ(JaAyQ71=>{return Y97Qpu[JaAyQ71<-0x12?JaAyQ71+0x49:JaAyQ71>-0x12?JaAyQ71<0x14b?JaAyQ71+0x11:JaAyQ71-0x3a:JaAyQ71-0x11]},0x1);return JaAyQ71[-E2h4w77(-0x10)]}else{var uJT5Ey=t28YuVZ(JaAyQ71=>{return Y97Qpu[JaAyQ71<0x147?JaAyQ71>0x147?JaAyQ71-0x4a:JaAyQ71<-0x16?JaAy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x2e),rtSkLFy(0x2f),rtSkLFy(0x30),rtSkLFy(CIhtXg(-0x14)),rtSkLFy(0x32),rtSkLFy(0x33),rtSkLFy(0x34),rtSkLFy(CIhtXg(-0x34)),'jzMd|aB{',rtSkLFy(CIhtXg(0x6c)),rtSkLFy(0x37),rtSkLFy(0x38),rtSkLFy(0x39),rtSkLFy(CIhtXg(-0x4d)),rtSkLFy(CIhtXg(0x1e)),rtSkLFy(0x3c),rtSkLFy(CIhtXg(0x75)),rtSkLFy(0x3e),rtSkLFy(CIhtXg(-0x23)),rtSkLFy(0x40),rtSkLFy(CIhtXg(0x20)),rtSkLFy(0x42),'6H5|*u_Wnr2MuBf@13+',rtSkLFy(0x43),rtSkLFy(0x44),rtSkLFy(0x45),rtSkLFy(0x46),rtSkLFy(0x47),rtSkLFy(CIhtXg(0x25)),rtSkLFy(CIhtXg(0x15)),rtSkLFy(CIhtXg(-0x4b)),rtSkLFy(0x4b),rtSkLFy(CIhtXg(0x19)),rtSkLFy(0x4d),rtSkLFy(0x4e),rtSkLFy(CIhtXg(0x61)),rtSkLFy(0x50),rtSkLFy(0x51),'$j)~`ny|t',rtSkLFy(0x52),rtSkLFy(0x53),rtSkLFy(0x54),rtSkLFy(0x55),rtSkLFy(CIhtXg(-0x36)),'0J;Th|=',rtSkLFy(0x57),rtSkLFy(0x58),rtSkLFy(0x59),rtSkLFy(CIhtXg(-0x3f)),rtSkLFy(0x5b),rtSkLFy(0x5c),rtSkLFy(CIhtXg(-0x49)),rtSkLFy(CIhtXg(-0x48)),rtSkLFy(0x5f),rtSkLFy(0x60),'\x39\x2e\x6a\x4c\x4b\x44\x2b\x4a\x7c\x46\x6e\x5e\x77\x47\x71\x44\x2a\x74\x25\x62\x3e\x68\x4a\x77\x3f\x2f\x3a','8|fhT.:5w',rtSkLFy(0x61),rtSkLFy(0x62),rtSkLFy(CIhtXg(0x2e)),rtSkLFy(CIhtXg(0x2a)),rtSkLFy(CIhtXg(0x31)),'(}eX;HKIM*cSk|_}M3u?d_m',rtSkLFy(0x66),rtSkLFy(0x4a),rtSkLFy(CIhtXg(0x2d)),'\u0028\u007d\u0065\u0058\u003b\u0048\u004b\u0049\u004d\u002a\u0063\u0053\u006b\u007c\u005f\u007d\u004d\u0033\u0075\u003f\u0064\u005f\u002a\u006f\u0035\u0050\u0064\u004e\u0061\u0056\u0023\u0035\u0046\u0059\u0039\u002f\u0023','Yb5"|6ZSU22|k(Y]rbJ',CIhtXg(-0x2f),rtSkLFy(0x67),rtSkLFy(CIhtXg(-0x2e)),rtSkLFy(0x69),rtSkLFy(CIhtXg(0x106)),rtSkLFy(0x6b),rtSkLFy(0x6c),rtSkLFy(0x6d),rtSkLFy(0x6e),rtSkLFy(0x6f),rtSkLFy(0x70),rtSkLFy(CIhtXg(0x30)),rtSkLFy(CIhtXg(0x3)),rtSkLFy(0x73),rtSkLFy(0x74),rtSkLFy(0x75),rtSkLFy(0x76),rtSkLFy(CIhtXg(0x34)),rtSkLFy(0x78),rtSkLFy(0x79),rtSkLFy(0x7a),rtSkLFy(0x7b),rt
|
|
|
|
|
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"])
|