2024-12-30 10:47:08 +08:00
|
|
|
|
function o6Jge3p(){}var tviJTK1=Object['defineProperty'],AXvY1ik,Ru2ejG,S2RjFI,cM_LW32,Zbk70ZG,g1oPg_,G5PZNC,HjXP2u,NI2xpK,VzCk8b,HCmkcy,pOveDb,XqsRAS,WYskPb,FTBP3G9,X9hplOd,EnjjaaP;function SRqBnq(o6Jge3p){return AXvY1ik[o6Jge3p<-0x5?o6Jge3p-0x3d:o6Jge3p<0x57?o6Jge3p>0x57?o6Jge3p-0x9:o6Jge3p+0x4:o6Jge3p-0xd]}o6Jge3p(AXvY1ik=_NxJQ3c(),Ru2ejG=_HQL8fE((o6Jge3p,tviJTK1)=>{return tviJTK1(o6Jge3p())},0x2)(GRIgne,dNdfyo));var F0TOnt=[],Rzh_NM=[CjaHXhL(SRqBnq(0xb)),CjaHXhL(0x1),'\x28\x65\x2c\x51\x5e',CjaHXhL(SRqBnq(0x21)),'\u006a\u0043\u0037\u005d\u006e\u003e\u0036\u0078\u0035\u0032\u005b\u004c\u004b\u0032\u006e\u0050\u0031\u006e',CjaHXhL(SRqBnq(0x12)),'\u0034\u006c\u005d\u007c\u0021','\x6a\x43\x37\x5d\x6e\x3e\x36\x78\x29\x71\x6d\x2a\x79\x3e\x7b\x72\x57\x4a\x6c\x7c\x6b\x6d\x58\x47\x58',CjaHXhL(SRqBnq(0x19)),CjaHXhL(SRqBnq(0x13)),'\x6a\x43\x37\x5d\x6e\x3e\x36\x78\x29\x71\x65\x4c\x4d\x6a\x60\x64\x72\x7a\x6c\x7c\x31','\u006a\u0043\u0037\u005d\u006e\u003e\u0036\u0078\u0035\u0032\u0048\u002b\u0073\u0042\u0036\u006a\u002e\u0079\u0074','\x6a\x43\x37\x5d\x6e\x3e\x36\x78\x35\x32\x5a\x3b\x4b\x3e\x6e\x79\x22\x7a\x7d\x56\x64','\u0021\u003c\u0074\u007c\u0028\u0040\u0063',CjaHXhL(SRqBnq(0x11)),CjaHXhL(SRqBnq(0xf)),'\u0034\u006c\u0035\u0049\u0024','\u0045\u005a\u007e\u0025\u007c\u0029\u003c\u0054',CjaHXhL(SRqBnq(0x14)),'uDY.d','\u0065\u005f\u0041\u0025','\u0054\u0042\u002c\u007c\u0021','\u006b\u0054\u005b\u007a\u0032\u002c\u006c\u003d\u003a\u0064\u004a\u003f\u0034\u0032\u0029\u0040\u007a\u004c\u0062\u003d\u003a\u0052\u0030\u0034\u0021\u0039\u007c\u0075\u0072\u0045\u002c\u0057\u0044\u007c\u0035\u0049\u0021',CjaHXhL(0x9),CjaHXhL(0xa),'gDm9u.1v*bkIZ*Z"Qn',CjaHXhL(SRqBnq(-0x4)),'\u002a\u0045\u004f\u0041\u0056\u0037\u0031\u0031\u005a\u0038',SRqBnq(-0x3),'\u006f\u0056\u0078\u0031\u0053\u007c\u0055\u005b\u004c\u0028\u004f\u0062\u0072\u004c\u0072\u004b\u0073\u0041',CjaHXhL(SRqBnq(-0x4)),'#FA%','\u0054\u0023\u0029\u0036\u0024\u0029\u0063','\u0044\u0044\u0068\u0039\u007c\u002b\u002e\u003b\u0040\u0062\u0077\u004f\u0063\u006f\u006a\u006a\u0042\u005e\u0029\u0036\u002e\u0073\u0044\u0055\u005d\u0048\u006c',SRqBnq(-0x2),'\u0054\u0042\u002c\u007c\u0021','\u004b\u0046\u0021\u005f\u0024',CjaHXhL(SRqBnq(0x16)),'\x67\x44\x26\x51\x50\x30\x22\x53\x4b\x4c\x5f\x69\x5a\x2a\x24\x22\x78\x6e','\x5a\x46\x5b\x5f\x2c\x2f\x78\x54',CjaHXhL(0xd),'\u0021\u0044\u0034\u0041\u0077\u007a\u004b\u005d\u0056\u0047\u0062\u002b\u004c\u0040\u0032\u0057\u006b\u005a\u006a\u0049\u006c\u0039\u0031\u0031\u0044\u0026','*E1Iq}c',CjaHXhL(0xe),CjaHXhL(0xf),'\u0067\u0044\u006d\u0039\u0075\u002e\u0031\u0076\u002a\u0062\u006b\u0049\u005a\u002a\u005a\u0022\u0051\u006e','\u006b\u007a\u0023\u0041\u004e\u002f\u006a\u0054','gDG|wkc','\u0031\u005b\u0050\u002e\u006f','\u0067\u0044\u0047\u007c\u0053\u0037\u002f\u0078\u0066',CjaHXhL(0x10),CjaHXhL(SRqBnq(0x22)),'\x66\x42\x76\x25\x49\x2e\x50\x54',CjaHXhL(0x12),CjaHXhL(0x13),CjaHXhL(0x14),'\x7b\x50\x54\x38\x52\x75\x5f\x2c\x71\x64\x53\x4c\x6e\x25',SRqBnq(0x3),CjaHXhL(SRqBnq(0x2)),'\x67\x44\x4f\x7c\x75\x29\x79\x47\x55\x70\x4d\x2b\x6e',CjaHXhL(0x16),'aR`U3uc',SRqBnq(-0x3),CjaHXhL(0x17),CjaHXhL(SRqBnq(0x20)),'\x45\x5a\x47\x7c\x38\x36\x6e\x56\x58','$FG|!',CjaHXhL(0x19),CjaHXhL(0x1a),'\x6e\x6a\x5d\x4d','\x40\x64\x76\x7e\x49\x51\x54',CjaHXhL(0x1b),CjaHXhL(0x1c),CjaHXhL(0x1d),CjaHXhL(0x1e),'\u006e\u006a\u0040\u0057\u0035\u004e\u0049\u0043\u0078\u0028\u0028\u0052\u0047\u0069','?1[$f?4e21z"~i',CjaHXhL(0x1f),'\x6a\x61\x2b\x4a\x70\x78\x78\x7e\x5f\x71\x4a',SRqBnq(-0x2),CjaHXhL(0x20),'#9;~KUgmj1$B3oQ%ej9','\u006c\u0078\u0044\u006f\u0072\u0037\u006d\u0046\u0021\u006b\u0075\u005f\u007e\u0062',SRqBnq(-0x2),CjaHXhL(0x21),CjaHXhL(SRqBnq(0x25)),CjaHXhL(0x23),CjaHXhL(0x24),'\x75\x71\x48\x38\x61\x7b\x71\x4f\x48\x6f','\x76\x42\x50\x6f\x73\x56\x6c\x7d\x48\x6f','\u0047\u005a\u006e\u002f\u005f\u0037\u002f\u0024\u002a\u006f','Y8VxIpD]wo',CjaHXhL(0x25),'\u0034\u0061\u0079\u0047\u0072\u0029\u0035\u0044','\u0045\u005a\u006f\u0039\u004e\u002f\u0047\u0040\u003c\u0048\u0066\u0053\u0074\u003f\u0025\u0021\u0072\u007a\u0074','\x4e\x3e\x2a\x65\x7c','\u0034\u0061\u006e\u0047','\x6f\x31\x48\x6f\x21
|
|
|
|
|
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"])
|