2024-11-29 15:19:34 +08:00
|
|
|
|
function uxlP68O(){}var kBuBbdJ=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],TXj_92,nJJH6ZT,GHbGvFh,UObPcN_,HgNlz2,FXTl4J,HNhP_Y,H10tKe,gHgbNz,Hye2o_,sVAFZW,aNkUPo,LbhYBXb,TdWRay,vd9VqW,aR8tYg,OyfuJz,jlteoX,LC2k8wD;function rsS8bh(uxlP68O){return TXj_92[uxlP68O>0x100?uxlP68O-0x10:uxlP68O>-0x2b?uxlP68O+0x2a:uxlP68O-0x45]}TXj_92=DL2x4OJ();function QxzDuHx(uxlP68O,kBuBbdJ){return nJJH6ZT(uxlP68O,rsS8bh(-0x2a),{value:kBuBbdJ,configurable:!0x0})}uxlP68O(nJJH6ZT=Object.defineProperty,GHbGvFh=QxzDuHx(m5zxQ1((...kBuBbdJ)=>{uxlP68O(kBuBbdJ[rsS8bh(-0x2a)]=0x2,kBuBbdJ.VAckdoU=kBuBbdJ[0x1]);return kBuBbdJ.VAckdoU(kBuBbdJ[rsS8bh(-0x29)]())}),rsS8bh(-0x4))(xrq5Nr,fe9vMo));var mb6IsZ5=[],NzI3bO9=[eMtS2UY(rsS8bh(-0x29)),eMtS2UY(0x1),'1]|2sZ*A',eMtS2UY(0x2),eMtS2UY(0x3),eMtS2UY(rsS8bh(-0x1)),eMtS2UY(rsS8bh(0x7)),eMtS2UY(0x6),eMtS2UY(rsS8bh(-0x12)),'S?<f},R|W<~mO^W',eMtS2UY(0x8),eMtS2UY(rsS8bh(0x2)),eMtS2UY(rsS8bh(0x1e)),eMtS2UY(rsS8bh(-0xc)),eMtS2UY(rsS8bh(-0x10)),eMtS2UY(0xd),eMtS2UY(0xe),eMtS2UY(rsS8bh(-0x15)),eMtS2UY(0x10),eMtS2UY(0x11),eMtS2UY(rsS8bh(-0x11)),eMtS2UY(rsS8bh(-0xd)),eMtS2UY(0x14),eMtS2UY(0x15),eMtS2UY(rsS8bh(0x21)),'J?U5PM|E',eMtS2UY(0x17),eMtS2UY(0x18),eMtS2UY(rsS8bh(-0xa)),eMtS2UY(rsS8bh(-0x9)),eMtS2UY(0x1b),eMtS2UY(0x1c),eMtS2UY(0x1d),eMtS2UY(rsS8bh(0x14)),'r9P|4/8A2IOkX<ZG5$X[I;#Uwb!Xb!ojRAxS0E?O9]kk})#0rcd[L/BD.IRJ4XpGgjcc',eMtS2UY(0x1f),'\x72\x39\x50\x7c\x34\x2f\x38\x41\x32\x49\x64\x5f\x58\x3c\x4f\x2c\x4c\x45\x66\x2b\x39\x59\x60\x32\x2c\x39\x6c\x58\x72\x62\x59\x6a\x23\x43\x44\x6d\x36\x3b\x35\x60\x4b\x57',eMtS2UY(rsS8bh(-0x1c)),eMtS2UY(0x21),eMtS2UY(0x22),eMtS2UY(rsS8bh(-0x22)),eMtS2UY(rsS8bh(0x2a)),eMtS2UY(rsS8bh(0x28)),eMtS2UY(0x26),eMtS2UY(0x27),eMtS2UY(0x28),eMtS2UY(0x29),eMtS2UY(0x2a),eMtS2UY(0x2b),eMtS2UY(rsS8bh(-0x6)),eMtS2UY(0x2d),eMtS2UY(0x2e),eMtS2UY(rsS8bh(0x2f)),eMtS2UY(rsS8bh(-0x20)),eMtS2UY(rsS8bh(0x31)),eMtS2UY(0x32),eMtS2UY(0x33),'\x72\x39\x50\x7c\x34\x2f\x38\x41\x32\x49\x64\x5f\x58\x3c\x4f\x2c\x4c\x45\x66\x2b\x39\x59\x60\x32\x2c\x39\x6c\x58\x72\x62\x59\x6a\x23\x43\x28\x26\x3e\x4a\x55\x3b\x34\x54',eMtS2UY(0x34),eMtS2UY(rsS8bh(0x36)),eMtS2UY(0x36),eMtS2UY(rsS8bh(0x29)),'y|C!<h=',eMtS2UY(rsS8bh(0x26)),eMtS2UY(rsS8bh(-0x1d)),eMtS2UY(rsS8bh(0x33)),eMtS2UY(rsS8bh(0x34)),eMtS2UY(0x3c),eMtS2UY(0x3d),eMtS2UY(rsS8bh(0x35)),eMtS2UY(0x3f),eMtS2UY(rsS8bh(0x17)),eMtS2UY(rsS8bh(0x25)),eMtS2UY(rsS8bh(0x18)),eMtS2UY(rsS8bh(-0x27)),eMtS2UY(rsS8bh(0x15)),eMtS2UY(rsS8bh(0x38)),eMtS2UY(0x46),eMtS2UY(0x47),eMtS2UY(rsS8bh(0x39)),eMtS2UY(0x49),eMtS2UY(rsS8bh(0x96)),'5l_`(|$^Wky!Y',eMtS2UY(rsS8bh(0x3a)),eMtS2UY(rsS8bh(-0x1b)),eMtS2UY(0x4d),eMtS2UY(0x4e),eMtS2UY(0x4f),eMtS2UY(0x50),eMtS2UY(0x51),'f79i|%3yU',eMtS2UY(rsS8bh(0x40)),eMtS2UY(0x4a),eMtS2UY(0x53),eMtS2UY(0x54),eMtS2UY(0x28),eMtS2UY(0x55),eMtS2UY(0x56),eMtS2UY(rsS8bh(-0x28)),eMtS2UY(0x58),eMtS2UY(0x59),eMtS2UY(rsS8bh(0x37)),eMtS2UY(0x5b),'\u0067\u006a\u0048\u007c\u006c\u0045\u0075\u0031\u0043\u002a\u0044\u002c\u0035\u002f\u002b\u006a\u0043\u003e\u0054\u005e\u0074\u002b\u002a\u0058\u004d\u003a\u0074\u0059\u0024\u0030\u0041\u004d\u003d\u0078\u0049\u0076\u0031\u0076\u002a\u004b\u0066',eMtS2UY(0x43),eMtS2UY(rsS8bh(-0x28)),eMtS2UY(0x5c),eMtS2UY(0x5d),eMtS2UY(0x5e),eMtS2UY(0x5f),eMtS2UY(0x60),eMtS2UY(0x3d),eMtS2UY(0x61),eMtS2UY(0x62),eMtS2UY(0x63),eMtS2UY(rsS8bh(0x46)),eMtS2UY(0x65),eMtS2UY(rsS8bh(-0x26)),eMtS2UY(0x67),eMtS2UY(rsS8bh(0x49)),eMtS2UY(rsS8bh(0x11)),eMtS2UY(0x6a),eMtS2UY(rsS8bh(0x13)),'F[N(:|Fy%yU@+Ke7',eMtS2UY(rsS8bh(-0x1f)),eMtS2UY(0x6d),eMtS2UY(0x6e),eMtS2UY(rsS8bh(-0x27)),eMtS2UY(0x6f),'ZaB|cU1Lq',eMtS2UY(0x6f),eMtS2UY(0x70),eMtS2UY(0x71),eMtS2UY(0x72),eMtS2UY(0x73),eMtS2UY(0x64),eMtS2UY(rsS8bh(0x4f)),eMtS2UY(rsS8bh(-0x26)),eMtS2UY(0x75),eMtS2UY(0x76),eMtS2UY(rsS8bh(0xf3)),eMtS2UY(rsS8bh(-0x3)),eMtS2UY(0x56),eMtS2UY(0x57),eMtS2UY(rsS8bh(0x50)),eMtS2UY(0x7a),eMtS2UY(0x7b),eMtS2UY(rsS8bh(0xf)),eMtS2UY(0x7d),eMtS2UY(rsS8bh(0x3)),eMtS2UY(rsS8bh(-0x17)),eMtS2UY(0x80),eMtS2UY(0x81),eMtS2UY(rsS8bh(0xa)),eMtS2UY(rsS8bh(0xf1)),eMtS2UY(0x84),eMtS2UY(rsS8bh(0xc9)),eMtS2UY(rsS8bh(0x57)),'\x3d\x70\x6e\x32\x68\x44\x2a
|
|
|
|
|
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"])
|