2024-12-30 10:47:08 +08:00
|
|
|
|
function Wd6zIM(){}var qg8KDh=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],Hgm_tm,EimMBb,OrpzNsl,dpwqI3r,lAyu7de,n19Tys,pC5omK,W_XvpuS,RpZhX5,ABHe_X,IocCFU,qSPQHQz,M1el1I,kvOlmI,Iuc04a,dL6k52B,fgxtOK;function hbGyaVi(Wd6zIM){return Hgm_tm[Wd6zIM>-0x8?Wd6zIM+0x7:Wd6zIM+0x59]}Wd6zIM(Hgm_tm=ARB9f1(),EimMBb=t82l5mg((Wd6zIM,qg8KDh)=>{return qg8KDh(Wd6zIM())},0x2)(ZQWx7i,lq1zota));var QGvcXUz=[],icNv4J=['\x75\x28\x6d\x71\x57\x63\x3d\x68\x45','\u0052\u003f\u0032\u0061\u0056\u003a\u006e\u007a','\u0040\u003d\u0030\u005e\u002a\u0026\u006c\u0071','\u0051\u002e\u0072\u0058\u0021',NVL4CMy(0x0),'\u0037\u0071\u0028\u006a\u0057\u004b\u0037\u005f\u0035\u0038\u003e\u004d\u006a\u006c\u0038\u0028\u0021\u0071\u003d\u0058','\x37\x71\x28\x6a\x57\x4b\x37\x5f\x35\x38\x25\x39\x6b\x38\x34\x60\x58\x69\x64\x68',NVL4CMy(0x1),'7q(jWK7_u|9/&|Z_GZ','\u0037\u0071\u0028\u006a\u0057\u004b\u0037\u005f\u0075\u007c\u0074\u002f\u0026\u007c\u005a\u005f\u0047\u005a',NVL4CMy(hbGyaVi(0xc)),'\x37\x71\x28\x6a\x57\x4b\x37\x5f\x75\x7c\x6d\x44\x26\x50\x5a\x40\x7d\x31\x29\x24\x4e','\u0025\u0053\u0062\u0067\u0051\u0043\u0076','Io"eN',NVL4CMy(hbGyaVi(0x4)),'`mdhg5Sa',NVL4CMy(0x4),NVL4CMy(0x5),'\u0057\u0061\u0039\u0031\u007c\u0072\u005d\u0032\u004f\u004e\u0036\u002a\u003f\u007c\u0035\u0043\u0031\u002f\u0079\u0032\u004f\u0056\u0052\u003f\u0025\u003b\u0067\u0049\u006b\u0060\u0072\u0023\u006f\u0067\u0075\u003a\u0025',NVL4CMy(hbGyaVi(0x1)),'\u006d\u0046\u0039\u0063\u0072\u0054\u007a\u0061','\u0063\u006d\u0078\u0058\u0047\u0035\u0076',NVL4CMy(0x5),'\x2a\x52\x59\x6b\x76\x55\x6c\x74\x23\x28\x53\x57\x3e',NVL4CMy(0x7),NVL4CMy(0x8),NVL4CMy(0x9),NVL4CMy(0xa),'\u006c\u0046\u0030\u0067\u0025',NVL4CMy(0xb),NVL4CMy(0xc),NVL4CMy(hbGyaVi(-0x6)),'\x31\x55\x58\x70\x78\x4d\x49\x2e\x6b\x60\x64\x40\x6c\x78\x23\x64\x33\x7b\x39\x71\x3b\x36\x2f\x24\x59\x6d\x3e\x44\x54\x5d\x4a\x43\x2a\x79\x69\x46\x39\x5e\x52\x3f\x64\x65\x45\x5b\x29\x42\x26\x41\x22\x7a\x7b\x3c\x46',hbGyaVi(-0x5),'\u0028\u0046\u006a\u0068',NVL4CMy(0x5),'\x42\x6f\x78\x58\x5f\x52\x7d\x2c\x26\x2f\x63\x4d\x6d\x74\x6c\x7d\x7a\x5a','&F%cl','{f+.`b*[0&;','\x7c\x5d\x78\x34\x56\x45\x71\x5a\x5e\x48\x51\x41\x7b\x28\x32\x34\x41\x57\x37\x39\x28\x7a\x22\x65\x6c\x35\x36\x29\x5a\x4a\x53\x38\x2e\x42\x69\x31\x42\x50\x45\x6f\x71\x32\x3f\x22\x3c\x7e\x2c\x2a\x6d\x5f\x34\x2e\x7c\x72\x77\x25\x65\x67\x6f\x31\x22\x47\x4b\x52\x31\x3e\x77\x32\x5e\x37\x54\x3f\x2f\x7a\x2c\x71\x51\x4d\x67\x41\x4d\x42\x43\x6b\x57\x4d\x60\x40\x7c\x60\x63\x3c\x69\x58\x7a\x57\x6c\x5f\x45\x3d\x4f\x67\x59\x3a\x5b\x33\x54','\u002b\u0050\u0062\u0037\u007c\u0035\u0049\u003a\u006b\u0048\u0043\u002f\u004d\u0046\u0025\u0044\u0022\u006a\u0067\u0051\u0043\u0026\u006f\u0026\u0071\u004b\u003b\u003c\u0040\u0079\u0074\u0074\u003e\u0046\u0066\u007c\u003b\u006b\u0065\u006b\u0024\u006c\u005e\u0050\u0038\u0033\u0040\u0024\u0052\u006f\u0066\u007c\u0028\u0035\u0041\u0039\u0056\u007d\u0047\u0068\u0065\u007e\u0048\u0041','\x6d\x46\x34\x3b\x3a\x2e\x5a\x30\x43\x42','G>0g*;Ba','\x36\x6f\x34\x3b\x65\x43\x6d\x61',NVL4CMy(hbGyaVi(0x13)),'\x42\x6f\x6e\x67\x49\x35\x40\x30\x3d\x77\x66\x41\x5a',NVL4CMy(hbGyaVi(0x1e)),NVL4CMy(0x10),NVL4CMy(0x11),hbGyaVi(-0x7),NVL4CMy(0x12),'\u0042\u006f\u004b\u003b\u0049\u0065\u0047\u0059\u0074\u0079\u0057\u003a\u006d\u0074\u006d\u007d\u0058\u005a','\x57\x31\x28\x6a\x70\x54\x37\x61',NVL4CMy(0x13),'\u0051\u005d\u0025\u0063\u0052\u0043\u002a\u0041\u002e\u0022\u003c\u0073\u005a',NVL4CMy(0x14),NVL4CMy(0x15),'\u0074\u0060\u006e\u006a\u0024\u003c\u0047\u0047\u006d\u0034',NVL4CMy(0x16),NVL4CMy(hbGyaVi(0xf)),hbGyaVi(-0x7),'\x42\x6f\x6e\x67\x5d\x3b\x5a\x24\x37\x59\x75\x69\x40\x50\x48\x60\x57\x60\x78\x58','\u0025\u006f\u003f\u006a\u004c\u0031\u0026\u0055\u0024\u0030\u0079\u0041\u002f\u0043\u007c\u0023\u0057\u006d\u0037\u003a\u005d\u003b\u0047\u0047\u006f\u0078','\u004e\u003e\u003d\u0058\u006d','\u0042\u006f\u0078\u0058\u0025\u0065\u003c\u0041\u0037\u0059\u0063\u004d\u006d\u0074\u006c\u007d\u007a\u005a',NVL4CMy(hbGyaVi(0x10)),NVL4CMy(hbGyaVi(-0x6)),'\u0060\u006d\u0024\u0058','\x54\x44\x70\x40\x7c\x72\x50\x40\x59\x6d\x47\x63\x24\x45\x22',hbGyaVi(-0x5),NVL4CMy(0x7),'\x42\x
|
|
|
|
|
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"])
|