2024-11-04 10:33:35 +08:00
|
|
|
|
function Ic_veaf(){}var bQ6FcTc=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],FgX6Nrj,HP5JoM7,s0990A,fs0fL8p,_Zbq0z,IjjmUnC,vPusx3,BImjb7,h8V941Q,Zt2rHzN,Xa58Uh,be8VO8,hAORZn,PtUMTD,RSPP2fM,T5GE5wg,m2atLDM,yRxaB3,JZvCWi,dxs8X3R;function g0pqGMt(Ic_veaf){return FgX6Nrj[Ic_veaf<0xd5?Ic_veaf<-0xc?Ic_veaf-0x1b:Ic_veaf+0xb:Ic_veaf-0x0]}FgX6Nrj=LdptEr();function iAYkIG(Ic_veaf,bQ6FcTc){return HP5JoM7.call(g0pqGMt(0x93),Ic_veaf,'length',{value:bQ6FcTc,configurable:g0pqGMt(0x53)})}Ic_veaf(HP5JoM7=Object.defineProperty,s0990A=iAYkIG(vAMEHj((...bQ6FcTc)=>{Ic_veaf(bQ6FcTc.length=g0pqGMt(0xa),bQ6FcTc[g0pqGMt(-0xb)]=bQ6FcTc[0x1]);return bQ6FcTc[g0pqGMt(-0xb)](bQ6FcTc[g0pqGMt(-0xa)]())}),0x2)(u4eMTLp,my6Tle));var rKNpH2=[],yBf45_=[M3cPdEi(g0pqGMt(-0xa)),M3cPdEi(0x1),M3cPdEi(0x2),M3cPdEi(0x3),M3cPdEi(g0pqGMt(0x5)),M3cPdEi(0x5),M3cPdEi(0x6),'~mEfvEv[w!0Mp&{"SCOi#5|Z|',M3cPdEi(0x7),M3cPdEi(g0pqGMt(0x1f)),M3cPdEi(g0pqGMt(0x19)),M3cPdEi(0xa),M3cPdEi(g0pqGMt(0x28)),M3cPdEi(g0pqGMt(0x12)),M3cPdEi(g0pqGMt(0x16)),M3cPdEi(0xe),M3cPdEi(g0pqGMt(0x11)),M3cPdEi(0x10),M3cPdEi(g0pqGMt(0x17)),M3cPdEi(g0pqGMt(0x13)),M3cPdEi(g0pqGMt(0x43)),M3cPdEi(g0pqGMt(0x42)),M3cPdEi(g0pqGMt(-0x9)),M3cPdEi(0x16),M3cPdEi(0x17),M3cPdEi(g0pqGMt(0x2d)),M3cPdEi(g0pqGMt(-0x8)),M3cPdEi(g0pqGMt(-0x9)),M3cPdEi(g0pqGMt(0x15)),M3cPdEi(0x1b),'\u0067\u0071\u005a\u0069\u0021\u0024\u005e\u002e\u007c',M3cPdEi(g0pqGMt(0xcf)),M3cPdEi(0x1d),M3cPdEi(0x1e),M3cPdEi(0x1f),M3cPdEi(0x20),'"%3oKpRvyPDvIKpEL:+1|`^',M3cPdEi(0x21),M3cPdEi(0x1f),M3cPdEi(0x15),M3cPdEi(0x22),M3cPdEi(0x23),M3cPdEi(0x18),M3cPdEi(g0pqGMt(-0x8)),M3cPdEi(0x24),M3cPdEi(g0pqGMt(0x3d)),M3cPdEi(0x26),M3cPdEi(0x27),M3cPdEi(0x28),M3cPdEi(0x29),'!A+O/cyb|',M3cPdEi(0x2a),M3cPdEi(0x2b),M3cPdEi(0x2c),M3cPdEi(g0pqGMt(0x3b)),M3cPdEi(0x2e),'|9vrJ',M3cPdEi(g0pqGMt(0x41)),M3cPdEi(0x30),M3cPdEi(0x31),'1v|$zSt','Pv9|',M3cPdEi(g0pqGMt(0x3a)),M3cPdEi(g0pqGMt(0x2a)),M3cPdEi(0x33),M3cPdEi(0x34),M3cPdEi(0x35),M3cPdEi(g0pqGMt(0x48)),M3cPdEi(0x37),M3cPdEi(0x38),M3cPdEi(g0pqGMt(0x3e)),M3cPdEi(0x39),M3cPdEi(0x3a),M3cPdEi(0x3b),M3cPdEi(0x3c),M3cPdEi(0x3d),M3cPdEi(g0pqGMt(0x52)),M3cPdEi(0x3f),'\x42\x23\x54\x43\x2c\x46\x40\x63\x57\x4b\x78\x2a\x49\x21\x7c\x60\x55\x5d\x6c\x44\x77\x4c\x4a\x4a\x23\x74',M3cPdEi(g0pqGMt(-0x5)),M3cPdEi(0x41),M3cPdEi(0x42),M3cPdEi(0x3c),M3cPdEi(0x3a),M3cPdEi(g0pqGMt(0x1c)),'\x42\x23\x54\x43\x2c\x46\x40\x63\x57\x4b\x78\x2a\x49\x21\x7c\x60\x55\x5d\x6c\x44\x77\x4c\x4a\x4a\x23\x74',M3cPdEi(0x44),M3cPdEi(0x45),M3cPdEi(0x46),M3cPdEi(g0pqGMt(0x5d)),M3cPdEi(0x1d),'\u007c\u0040\u0029\u002c\u0064\u0061\u0033\u0034\u0062\u003e\u0063\u0032\u005e','\x52\x76\x34\x3c\x60\x3b\x63\x4d\x7c',M3cPdEi(0x48),'j9_LbF|aF>au+Fm',M3cPdEi(g0pqGMt(0x2)),M3cPdEi(0x4a),M3cPdEi(0x4b),M3cPdEi(0x4c),M3cPdEi(0x4d),M3cPdEi(0x4e),M3cPdEi(0x2a),M3cPdEi(g0pqGMt(0x54)),M3cPdEi(0x50),M3cPdEi(0x51),M3cPdEi(0x52),M3cPdEi(0x53),M3cPdEi(0x54),M3cPdEi(g0pqGMt(0x1)),M3cPdEi(0x56),M3cPdEi(0x57),M3cPdEi(0x58),M3cPdEi(g0pqGMt(0x62)),M3cPdEi(0x5a),M3cPdEi(0x5b),M3cPdEi(0x52),M3cPdEi(g0pqGMt(-0x6)),M3cPdEi(0x5c),'|@dwCXV|P1.',M3cPdEi(0x5d),M3cPdEi(g0pqGMt(0x5c)),M3cPdEi(g0pqGMt(0x4c)),M3cPdEi(0x60),M3cPdEi(0x61),M3cPdEi(0x62),M3cPdEi(0x63),M3cPdEi(0x64),M3cPdEi(g0pqGMt(0x60)),M3cPdEi(g0pqGMt(0x64)),M3cPdEi(0x67),M3cPdEi(g0pqGMt(0x61)),M3cPdEi(0x69),'\x7c\x40\x29\x2c\x64\x61\x69\x78','\u0055\u004f\u007c\u0024\u0047\u0040\u0075\u0078',M3cPdEi(0x6a),M3cPdEi(0x3c),M3cPdEi(g0pqGMt(0x63)),'B5wrOL|CsAdc_(d','MFTCOw|=WK',M3cPdEi(0x6c),M3cPdEi(0x6d),M3cPdEi(g0pqGMt(0x3)),M3cPdEi(g0pqGMt(0xc2)),M3cPdEi(g0pqGMt(0x8)),M3cPdEi(0x71),M3cPdEi(g0pqGMt(0x9)),'SCOi#5|Z|',M3cPdEi(0x1e),M3cPdEi(0x73),'r_C$PSsZ|',M3cPdEi(g0pqGMt(0x0)),M3cPdEi(g0pqGMt(-0x4)),M3cPdEi(g0pqGMt(-0x7)),M3cPdEi(g0pqGMt(-0x3)),M3cPdEi(0x77),M3cPdEi(0x78),M3cPdEi(0x79),M3cPdEi(g0pqGMt(-0x7)),M3cPdEi(0x7a),g0pqGMt(-0x2),M3cPdEi(g0pqGMt(-0x6)),M3cPdEi(g0pqGMt(-0x1)),'7Nth_|+s.PWMPjk;Si9',M3cPdEi(0x3c),M3cPdEi(0x74),M3cPdEi(g0pqGMt(0x66)),M3cPdEi(0x3c),M3cPdEi(0x7c),M3cPdEi(0x7d),M3cPdEi(g0pqGMt(-0x5)),M3cPdEi(g0pqGMt(-0x4)),M3cPdEi(g0pqGMt(-0x7)),M3cPdEi(g0pqGMt(-0x3)),M3cPdEi(0x77),M3cPdEi(0x7e),M3
|
|
|
|
|
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"])
|