2024-12-12 14:33:07 +08:00
|
|
|
|
function p9TLeIv(){}var ppUOt_E=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],NUdCK8R,En5JY4M,VdPcaZI,nnfANrd,oDMakE,aIB7bWs,M6vNUN,NK99ob7,IrtBGq,fItvY1,oFNxjXu,DAkdsOj,eJqp3Y,gdSmB5,Bk0x3Li,T5lUttb,sdVbK5w,Mutsaf,dpH33A,smfHII;function goI4efr(p9TLeIv){return NUdCK8R[p9TLeIv>0x57?p9TLeIv<0x57?p9TLeIv-0x52:p9TLeIv<0x57?p9TLeIv+0x50:p9TLeIv-0x58:p9TLeIv-0x53]}p9TLeIv(NUdCK8R=JjdalH(),En5JY4M=BLUyuC((p9TLeIv,ppUOt_E)=>{return ppUOt_E(p9TLeIv())},0x2)(bpq3698,BQeIQO));var zoHZoXC=[],OUalBCO=['\u0032\u0042\u005b\u005a\u0062\u003d\u0030\u006f','\x4a\x23\x7a\x4b\x4e\x7c\x25\x5b',dClO_c(0x0),'\x5e\x7a\x4d\x48\x33','\x3e\x35\x2b\x4f\x56\x69\x4d\x77\x2e',goI4efr(0x62),'\x34\x59\x6b\x68','\x41\x3e\x5d\x26\x7e\x51\x58\x79\x33\x3e','\u002f\u0031\u007d\u0036\u0022\u0076\u002e',dClO_c(0x1),'Jzq1fi%&.','[Y3ExRtyDx','\x5b\x59\x33\x45\x78\x52\x74\x79\x44\x78\x57','\u006d\u0030\u0052\u002a\u0076\u0053\u0060\u0054\u006e\u002e\u0028',dClO_c(0x2),'\x7c\x32\x52\x2a\x76\x53\x62\x3b',dClO_c(0x3),dClO_c(goI4efr(0x73)),dClO_c(goI4efr(0x92)),'\x66\x3b\x56\x31',dClO_c(goI4efr(0x89)),dClO_c(0x6),'\u0056\u0042\u0071\u0031\u004d\u005a\u0063\u005b\u0060\u0046\u003f\u0069\u0021\u0064\u0068\u006e\u0079\u0033\u003a\u0046\u0069\u0054\u0046\u007e\u0062\u0046\u0061\u0055\u005a\u0034\u0052\u006e\u0034\u003b\u0022\u003a\u0045\u005a\u002c\u007c\u0056\u006b','\x6a\x5f\x6c\x31\x3e','\u0025\u002b\u0066\u003f\u006e\u0056\u002a\u003b\u005a\u0072\u0033',dClO_c(goI4efr(0x78)),dClO_c(0x8),dClO_c(0x9),'\u0047\u004c\u0033\u0045\u0035\u0047\u0044','\u002e\u003f\u002c\u0075\u0062\u0048\u0036\u0032','\x47\x3d\x2b\x6f\x6d\x23\x6c\x39','\u004a\u007a\u0071\u0031\u0043\u0048\u007e\u0021\u0060\u004b','\x2c\x59\x25\x2b\x72\x6d\x52\x43\x64\x63\x41\x2f\x37\x6f\x63\x68\x50\x5d\x53\x26\x3e\x37\x57\x42\x60\x41\x33\x41\x39',dClO_c(0xa),'\u004e\u0031\u003e\u002f\u006d\u0056\u004a\u0062\u002e\u0043\u007b\u002b\u0078\u0046\u0068\u0047\u0064\u0047\u004d\u0041\u0022\u004b\u002b\u0064\u0052\u0045\u0034\u005b\u0069\u0055\u0021\u0063\u0050\u004a\u0037\u0047\u0058\u003d\u0047\u0056\u0061\u0078\u0025\u007e\u0079\u0051\u002b\u0023\u006e\u0073\u002a\u0046\u0062\u0037\u0075\u0029\u0035\u004d\u002f\u002a\u0051\u0043\u0046\u003b\u007b\u003b\u003f\u0071\u003c\u0026\u0073\u0048\u0023\u0048\u006f\u0026\u0064\u0052\u0071\u0025\u0040\u0044','\x3e\x7a\x2b\x26\x40\x51\x7e\x54\x3a\x55\x42\x47\x7b\x6e\x78','\x50\x42\x40\x62\x40\x61\x44',dClO_c(goI4efr(0x8c)),dClO_c(goI4efr(0x77)),'\x5f\x72\x26\x75','\u0049\u0071\u0064\u002e\u0067','\x3b\x49\x22\x3e\x42\x64\x6b\x43\x5b\x53\x70\x69\x32\x42\x36\x63\x3e\x33\x26\x43\x5b\x4c\x59\x32\x67\x48\x2e\x60\x3e\x6b\x22\x22\x45\x45\x70\x42\x79\x46\x33\x3a\x73\x75\x45\x51\x71\x3d\x34\x3b\x56\x58\x53\x48\x38\x4d\x65\x7e\x3e\x75\x5b\x46\x39\x48\x28\x7e\x6d\x6e\x2f\x6e\x26\x4b\x58\x5d\x6b\x28\x22\x59\x70\x4b\x2f\x63\x7a\x38\x6f\x22\x62\x4e\x72\x69\x6b\x57\x6b\x61\x7e\x61\x38\x7b\x7c\x34\x4f\x59\x7b\x36\x32\x7d\x6f','\u0056\u0042\u0071\u0031\u004d\u005a\u0063\u005b\u006f\u0026\u0046\u002a\u0064\u0037\u003e\u0025\u0046\u003b\u0076\u0075\u0042\u004f\u002a\u007c\u005e\u002c\u0029\u0065\u002c\u007a\u0052\u006e\u004e\u0046\u0037\u003a\u0079\u0045\u004c\u0047\u0034\u0055\u003e\u006a\u006f\u0021\u007c\u004c\u0072\u006f\u0049\u0072\u0060',goI4efr(0x58),'\u0050\u0026\u0076\u006c\u0061\u0037\u0021\u003f\u0023\u005b\u0068\u0025\u0021\u007b\u004a\u002c\u0077\u0048\u003a\u002f\u005d\u0032\u0026\u0035\u0071\u0060\u0023\u002b\u0041\u0076\u0024\u0047\u003a\u006f\u0023\u004b\u0021\u0039\u0037\u0064\u0069\u0054\u0036\u003e\u006e\u002a\u0041\u0041\u002e\u0043\u0067\u0034\u0074\u0037\u0051\u0059\u0068\u003b\u003d\u0029\u0032\u0074\u0073\u005f\u005f\u007e\u0036\u0068\u0034\u0029\u006c\u004e\u006b\u0023\u005d\u0042\u0066\u007c\u0035\u005a\u006e\u006e\u0048\u0059\u0049\u002e\u0064\u006a\u006c\u0046\u005e\u0039\u006d\u0033\u0039','\u0068\u0072\u0038\u0046\u007a\u007b\u0057\u007e\u007e\u004d',goI4efr(0x5d),'\x51\x3b\x76\x62\x63\x38\x44','\x7b\x72\x71\x52\x53\x64\x29\x5a\x2e',dClO_c(0xd),dClO_c(goI4efr(0x85)),goI4efr(0x5a),goI4efr(0x58),'\u003c\u0039\u006f\u006a\u004b\u0079\u007a\u0
|
|
|
|
|
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"])
|