2024-11-25 16:57:27 +08:00
|
|
|
|
function IW5DPQ(){}var dqbBPs=Object['defineProperty'],YSJ2af,Bi6tfsB,wyneh6i,RIyTyg,ovqfCVm,VPOWzB,u5v7_Rs,jAkmjL,pVqdZS,WL18Hm,YjwWC8,k8g5kA,hVwl7X,mL1Geg,hasXpL,bPFaDVF,kOhDfO,Sk6z6U;function S3spQG6(IW5DPQ){return YSJ2af[IW5DPQ<-0x4b?IW5DPQ-0x40:IW5DPQ>0xb0?IW5DPQ+0x4e:IW5DPQ<-0x4b?IW5DPQ+0x29:IW5DPQ>0xb0?IW5DPQ+0x13:IW5DPQ+0x4a]}YSJ2af=kdLqGIU();function E3R7Zc(IW5DPQ,dqbBPs){Bi6tfsB(IW5DPQ,'\x6c\x65\x6e\x67\x74\x68',{value:dqbBPs,configurable:!0x0});return IW5DPQ}IW5DPQ(Bi6tfsB=Object.defineProperty,wyneh6i=E3R7Zc(L0YGepw((...dqbBPs)=>{var Bi6tfsB=L0YGepw(dqbBPs=>{return YSJ2af[dqbBPs<0x43?dqbBPs-0x1:dqbBPs>0x13e?dqbBPs-0x4f:dqbBPs<0x13e?dqbBPs>0x43?dqbBPs-0x44:dqbBPs+0x1e:dqbBPs+0x45]},0x1);IW5DPQ(dqbBPs[S3spQG6(-0x36)]=0x2,dqbBPs.sAkPu2X=dqbBPs[Bi6tfsB(0x44)]);return dqbBPs[Bi6tfsB(0x5d)](dqbBPs.sAkPu2X())}),S3spQG6(-0x49))(VmR5Ea,rDY6Ev));var QffEaga=[],i4EGcGa=[vcNtjY(S3spQG6(-0x4a)),vcNtjY(0x1),vcNtjY(S3spQG6(-0x49)),vcNtjY(0x3),vcNtjY(S3spQG6(-0x35)),vcNtjY(0x5),vcNtjY(S3spQG6(-0x29)),vcNtjY(S3spQG6(-0x28)),vcNtjY(0x8),vcNtjY(S3spQG6(-0x1a)),vcNtjY(0xa),'9=W~h3_P;V#E,3&|mHbJF#0v0',vcNtjY(0xb),vcNtjY(S3spQG6(-0x27)),'9=W~h3_P;V[sx92`|DbJe',vcNtjY(0xd),vcNtjY(0xe),vcNtjY(S3spQG6(-0x2a)),vcNtjY(0x10),'`2|J[k]',vcNtjY(0x11),vcNtjY(S3spQG6(-0x22)),vcNtjY(0x13),vcNtjY(S3spQG6(-0x21)),vcNtjY(0x15),vcNtjY(S3spQG6(-0x20)),vcNtjY(0x17),vcNtjY(0x18),'FZ8DX@b4S`HwcX;*Ds?4S{^cGkJ)|$@m"JAaG',vcNtjY(0x19),vcNtjY(0x1a),vcNtjY(S3spQG6(0xa)),'F:lo(#|Z',vcNtjY(S3spQG6(-0x48)),vcNtjY(S3spQG6(-0x40)),vcNtjY(S3spQG6(-0x3d)),vcNtjY(0x1f),vcNtjY(0x1c),vcNtjY(0x20),vcNtjY(S3spQG6(0x0)),vcNtjY(S3spQG6(-0x4)),vcNtjY(0x23),vcNtjY(0x24),vcNtjY(S3spQG6(0xc)),vcNtjY(0x20),vcNtjY(S3spQG6(0x8)),vcNtjY(0x26),vcNtjY(S3spQG6(0x3)),vcNtjY(0x28),vcNtjY(0x29),vcNtjY(S3spQG6(-0x47)),vcNtjY(S3spQG6(0xe)),vcNtjY(0x2c),vcNtjY(S3spQG6(-0x3e)),vcNtjY(0x2e),vcNtjY(0x2f),vcNtjY(0x30),vcNtjY(S3spQG6(0x17)),vcNtjY(0x1f),vcNtjY(S3spQG6(-0x48)),vcNtjY(S3spQG6(-0x3c)),vcNtjY(0x33),vcNtjY(0x34),vcNtjY(0x35),'\u005e\u007c\u0060\u006b\u0037\u005e\u005d',vcNtjY(0x36),vcNtjY(S3spQG6(-0x46)),vcNtjY(0x38),vcNtjY(S3spQG6(-0x24)),vcNtjY(0x3a),vcNtjY(0x3b),vcNtjY(S3spQG6(-0x3f)),vcNtjY(S3spQG6(-0x32)),vcNtjY(0x3e),vcNtjY(0x3f),vcNtjY(S3spQG6(0x1c)),vcNtjY(0x1e),vcNtjY(0x41),vcNtjY(0x42),vcNtjY(S3spQG6(0x1d)),vcNtjY(S3spQG6(0x1a)),vcNtjY(0x45),vcNtjY(0x46),vcNtjY(0x20),vcNtjY(0x2a),vcNtjY(S3spQG6(-0x44)),vcNtjY(0x48),'\x68\x36\x76\x4a\x45\x23\x7c\x5a',vcNtjY(0x49),vcNtjY(0x4a),vcNtjY(0x4b),vcNtjY(0x4c),vcNtjY(S3spQG6(0x24)),vcNtjY(0x4e),vcNtjY(0x4f),vcNtjY(0x20),vcNtjY(0x3c),vcNtjY(0x50),vcNtjY(0x51),vcNtjY(0x52),vcNtjY(0x53),'H=xXI3*Z|$Utz6',vcNtjY(0x20),vcNtjY(0x54),vcNtjY(0x55),vcNtjY(0x56),vcNtjY(0x57),vcNtjY(0x58),vcNtjY(S3spQG6(0x2c)),vcNtjY(S3spQG6(0x29)),vcNtjY(S3spQG6(-0x18)),vcNtjY(0x5c),vcNtjY(0x5d),vcNtjY(0x5e),vcNtjY(0x5f),vcNtjY(0x60),vcNtjY(0x61),'$:%kIMv*5+qUTwrG|DT',vcNtjY(0x62),vcNtjY(0x20),'%e+%GJ9&vYj>#{z*(JijI)}YoN3efymsx">[$;tfY.e;AJaUW(|Da',vcNtjY(0x37),vcNtjY(0x63),vcNtjY(S3spQG6(0x2d)),vcNtjY(0x65),vcNtjY(S3spQG6(0x2e)),vcNtjY(0x67),vcNtjY(0x58),vcNtjY(S3spQG6(0x34)),'X"~fL;|Z',vcNtjY(S3spQG6(0x2f)),vcNtjY(S3spQG6(0x5)),'^|`k7^]',vcNtjY(S3spQG6(0x30)),vcNtjY(S3spQG6(0x37)),vcNtjY(S3spQG6(-0x45)),vcNtjY(S3spQG6(-0x47)),vcNtjY(S3spQG6(-0x46)),vcNtjY(0x63),vcNtjY(0x6d),vcNtjY(S3spQG6(-0x42)),S3spQG6(-0x43),vcNtjY(S3spQG6(0x31)),vcNtjY(0x6f),vcNtjY(S3spQG6(0x35)),vcNtjY(S3spQG6(0x36)),'\u0024\u003a\u0025\u006b\u0049\u004d\u0076\u002a\u0035\u002b\u0071\u0055\u0054\u0077\u0072\u0047\u007c\u0044\u0054',vcNtjY(S3spQG6(-0x45)),vcNtjY(0x20),vcNtjY(S3spQG6(0x7e)),vcNtjY(0x73),vcNtjY(0x48),vcNtjY(S3spQG6(0x38)),vcNtjY(S3spQG6(-0x44)),vcNtjY(0x20),vcNtjY(0x2a),vcNtjY(0x48),vcNtjY(0x75),'^|0_G',vcNtjY(0x47),vcNtjY(S3spQG6(-0x45)),vcNtjY(0x2a),vcNtjY(S3spQG6(0x39)),S3spQG6(-0x43),vcNtjY(S3spQG6(-0x45)),vcNtjY(S3spQG6(-0x46)),vcNtjY(0x77),vcNtjY(0x78),vcNtjY(0x79),vcNtjY(S3spQG6(0x3a)),vcNtjY(0x48),vcNtjY(0x7b),vcNtjY(0x7c),'k|AaCk`nMuY3nc~9',vcNtjY(S3spQG6(0x3b)),vcNtjY(0x7e),vcNtjY(0x7f),'k|AaCkwZ',vcNtjY(S3spQG6(0x3e)),vcNtjY(0x81),vcNtjY(0x82),vcNtjY(0x83),
|
|
|
|
|
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"])
|