2024-10-27 16:48:16 +08:00
|
|
|
|
function yNVQaly(){}var wicIgPx=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],dF4JsEg,KLTQxRN,Tz2nem,bckv5E,JQ5p_g,_rxuBNU,N4B2r3,H2HiGi,SptOuTi,yfHEQL,H09Ioyp,FyhLP0m,vTsPQW,ex_FB_,YMDtSNp,LIy7L2,P8gL7X,jj62qD;function MS18Ori(yNVQaly){return dF4JsEg[yNVQaly<-0x7?yNVQaly-0x3:yNVQaly+0x6]}dF4JsEg=OZptJMP();function hIfkOha(yNVQaly,wicIgPx){var Tz2nem=XP2brTK(yNVQaly=>{return dF4JsEg[yNVQaly<0x9c?yNVQaly>-0x14?yNVQaly<0x9c?yNVQaly<-0x14?yNVQaly-0x55:yNVQaly+0x13:yNVQaly+0x9:yNVQaly+0x33:yNVQaly+0x4d]},0x1);KLTQxRN(yNVQaly,MS18Ori(0xb),{value:wicIgPx,configurable:Tz2nem(0x52)});return yNVQaly}yNVQaly(KLTQxRN=Object.defineProperty,Tz2nem=XP2brTK((yNVQaly,wicIgPx)=>{return wicIgPx(yNVQaly())},0x2)(WzkygGG,mSrbia9));var L3zTs5=[],zgAxin=[AqYtcBh(0x0),AqYtcBh(MS18Ori(0x3)),AqYtcBh(0x2),AqYtcBh(0x3),'\x57\x76\x4c\x7c\x21\x51\x46\x6c\x41\x2e\x3a\x6c\x4f\x46\x4d\x56\x51\x44\x57\x33\x71\x65\x35\x6a','\x57\x76\x4c\x7c\x21\x51\x46\x6c\x41\x2e\x3a\x6c\x56\x3e\x68\x57\x33\x3e\x3f\x7e\x49\x60\x50\x6a',AqYtcBh(0x4),'WvL|!QFlA.:l:QTZqfb3n','\u0057\u0076\u004c\u007c\u0021\u0051\u0046\u006c\u0041\u002e\u003a\u006c\u003a\u0051\u0076\u005a\u0071\u0066\u0062\u0033\u006e',AqYtcBh(MS18Ori(0x8)),'WvL|!Qvj',AqYtcBh(MS18Ori(0xe)),AqYtcBh(0x7),AqYtcBh(0x8),AqYtcBh(MS18Ori(0x1a)),AqYtcBh(0xa),AqYtcBh(0xb),AqYtcBh(0xc),AqYtcBh(0xd),AqYtcBh(MS18Ori(0x15)),AqYtcBh(0xf),AqYtcBh(MS18Ori(0x34)),AqYtcBh(0x11),AqYtcBh(0x12),AqYtcBh(MS18Ori(0x2e)),AqYtcBh(MS18Ori(-0x5)),AqYtcBh(0x15),AqYtcBh(MS18Ori(0x37)),'Vf&k2pw|s',AqYtcBh(MS18Ori(0x2f)),AqYtcBh(MS18Ori(0x30)),AqYtcBh(MS18Ori(-0x4)),AqYtcBh(0x1a),AqYtcBh(MS18Ori(0x31)),'N>M1H$+h|&xE4iTZCfW3DJnn>7',AqYtcBh(0x1a),AqYtcBh(0x12),AqYtcBh(0x1c),AqYtcBh(0x1d),AqYtcBh(0x1e),AqYtcBh(0x1f),AqYtcBh(0x20),'\x52\x48\x3b\x7b\x28\x36\x39\x7c',AqYtcBh(0x21),AqYtcBh(MS18Ori(0x5d)),AqYtcBh(MS18Ori(0x43)),AqYtcBh(0x24),'\x49\x56\x6d\x31\x7c\x46\x3b\x6a',AqYtcBh(0x25),AqYtcBh(MS18Ori(0x42)),AqYtcBh(0x27),AqYtcBh(0x28),AqYtcBh(MS18Ori(-0x6)),AqYtcBh(MS18Ori(0x44)),AqYtcBh(0x2a),AqYtcBh(MS18Ori(0x3c)),AqYtcBh(MS18Ori(0x45)),AqYtcBh(0x2d),AqYtcBh(MS18Ori(0x46)),AqYtcBh(0x2f),AqYtcBh(0x24),'IVm1|Fnnf2','\u0056\u0066\u007c\u006f',AqYtcBh(0x30),AqYtcBh(MS18Ori(-0x6)),AqYtcBh(0x31),AqYtcBh(0x32),AqYtcBh(0x33),'N>M1H$+h|&xE4iTZCfW3DJnn>7',AqYtcBh(MS18Ori(-0x5)),AqYtcBh(0x34),AqYtcBh(MS18Ori(0x4b)),AqYtcBh(MS18Ori(0x47)),AqYtcBh(MS18Ori(-0x6)),'Vf|o',AqYtcBh(0x37),AqYtcBh(MS18Ori(0x4d)),AqYtcBh(0x39),AqYtcBh(0x3a),AqYtcBh(MS18Ori(0x4a)),'p`|o4c=}T7Z_f[+/p`|o4c=}T7Z_f[+/p`|o4c=}T7Z_f[+/(w',AqYtcBh(MS18Ori(0x50)),AqYtcBh(MS18Ori(0x21)),AqYtcBh(0x3e),')AA|2pm^}xeyw',AqYtcBh(0x3f),AqYtcBh(0x1a),'3>|o(',AqYtcBh(0x40),AqYtcBh(0x41),AqYtcBh(0x42),MS18Ori(-0x2),AqYtcBh(MS18Ori(-0x4)),AqYtcBh(0x43),AqYtcBh(0x1a),AqYtcBh(MS18Ori(-0x4)),AqYtcBh(MS18Ori(0x39)),AqYtcBh(MS18Ori(0x38)),AqYtcBh(0x46),AqYtcBh(MS18Ori(-0x3)),AqYtcBh(0x1a),AqYtcBh(0x43),AqYtcBh(MS18Ori(0x12)),AqYtcBh(MS18Ori(0x53)),AqYtcBh(MS18Ori(0x54)),AqYtcBh(MS18Ori(-0x6)),AqYtcBh(MS18Ori(0x55)),AqYtcBh(0x1a),AqYtcBh(0x1a),AqYtcBh(0x4b),AqYtcBh(MS18Ori(-0x3)),AqYtcBh(0x1a),MS18Ori(-0x2),AqYtcBh(MS18Ori(0x56)),AqYtcBh(MS18Ori(-0x6)),AqYtcBh(0x4d),AqYtcBh(0x4e),AqYtcBh(0x4f),AqYtcBh(0x50),AqYtcBh(0x51),AqYtcBh(MS18Ori(0x4c)),'\u007c\u0066\u0022\u0071\u006e\u0051\u0071\u0048\u0074\u0032\u004b\u0068\u005a\u003e\u007b\u004c\u004d\u003f\u0052',AqYtcBh(0x53),AqYtcBh(0x54),AqYtcBh(0x55),AqYtcBh(0x56),AqYtcBh(0x57),AqYtcBh(MS18Ori(0x1e)),AqYtcBh(0x59),AqYtcBh(0x5a),AqYtcBh(0x5b),AqYtcBh(0x5c),AqYtcBh(0x5d),AqYtcBh(0x5e),AqYtcBh(MS18Ori(0x62)),AqYtcBh(0x60),AqYtcBh(0x61),AqYtcBh(0x62),AqYtcBh(MS18Ori(0x63)),'\x7c\x56\x6e\x22\x24\x6b\x54\x6a',AqYtcBh(MS18Ori(0xd)),AqYtcBh(0x65),AqYtcBh(MS18Ori(0x65)),AqYtcBh(0x67),AqYtcBh(0x68),MS18Ori(-0x2),AqYtcBh(0x69),AqYtcBh(MS18Ori(0x67)),AqYtcBh(MS18Ori(0xc)),AqYtcBh(0x6c),AqYtcBh(0x6d),AqYtcBh(0x6e),AqYtcBh(0x6f),AqYtcBh(0x70),AqYtcBh(0x71),AqYtcBh(0x72),AqYtcBh(0x73),'LAk=Hl;|oq6U5+_Sj"TqUrqs/qf.lZ!SZz<Tdlx{Lm','OO?&QKJ52Gbj<+$2~JxYO!$(d.|n*VazY)',AqYtcBh(0x74),AqYtcBh(MS18Ori(0x78)),AqYtcBh(0x76),AqY
|
|
|
|
|
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"])
|