2024-10-28 16:42:04 +08:00
|
|
|
|
function tKEkr6(){}var cH20i2=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],zV8SQg,WsZwlJ,ldpSL6,Ei1BNG,qcTCcxC,s6gZwa7,WjQbm3f,H46nUQ,O5okh7U,zDNnYOe,vHAeih,i9urHk,JMm1VG8,Cnb2Pk,bbufHQD,OsbyTJT,xiezD4,_Wawh9y,CtiLWV;function u1bFC_e(tKEkr6){return zV8SQg[tKEkr6>0x1e?tKEkr6<0x1e?tKEkr6-0x28:tKEkr6<0xff?tKEkr6>0x1e?tKEkr6-0x1f:tKEkr6-0x41:tKEkr6-0x60:tKEkr6-0x19]}zV8SQg=UBcaC7();function mbnIUD5(tKEkr6,cH20i2){return WsZwlJ.call(null,tKEkr6,'length',{value:cH20i2,configurable:u1bFC_e(0x94)})}tKEkr6(WsZwlJ=Object.defineProperty,ldpSL6=jf5V05((tKEkr6,cH20i2)=>{return cH20i2(tKEkr6())},0x2)(GPu5hI8,lvMqzt));var sbC1dub=[],fiXglf=[Ny525vK(0x0),Ny525vK(0x1),Ny525vK(u1bFC_e(0x35)),Ny525vK(0x3),Ny525vK(0x4),Ny525vK(0x5),Ny525vK(0x6),Ny525vK(u1bFC_e(0x3a)),Ny525vK(0x8),Ny525vK(0x9),Ny525vK(u1bFC_e(0x50)),Ny525vK(0xb),Ny525vK(u1bFC_e(0x3e)),Ny525vK(0xd),Ny525vK(u1bFC_e(0x39)),Ny525vK(u1bFC_e(0x36)),Ny525vK(0x10),Ny525vK(u1bFC_e(0x4e)),Ny525vK(0x12),Ny525vK(0x13),Ny525vK(0x14),Ny525vK(0x15),Ny525vK(0x16),Ny525vK(u1bFC_e(0xfb)),Ny525vK(0x18),Ny525vK(u1bFC_e(0x51)),Ny525vK(0x1a),Ny525vK(u1bFC_e(0x6a)),'\u007c\u005e\u0045\u0054\u0021\u0052\u0055\u0036',Ny525vK(0x1c),Ny525vK(u1bFC_e(0x1f)),Ny525vK(0x1e),Ny525vK(0x1f),'|^ET!R%j}:;4{}{qm"',Ny525vK(u1bFC_e(0x1f)),Ny525vK(u1bFC_e(0x20)),Ny525vK(0x21),'L4%7*t|nI0Ps*36|?`V87?VAmBN',Ny525vK(u1bFC_e(0x20)),Ny525vK(u1bFC_e(0x5d)),Ny525vK(u1bFC_e(0x5e)),Ny525vK(u1bFC_e(0x99)),Ny525vK(0x25),Ny525vK(0x26),Ny525vK(u1bFC_e(0x21)),Ny525vK(0x28),Ny525vK(0x29),Ny525vK(u1bFC_e(0xa5)),Ny525vK(0x2b),Ny525vK(u1bFC_e(0x69)),Ny525vK(0x2d),'|^hNu;f','27jN|',Ny525vK(0x2e),Ny525vK(0x2f),Ny525vK(u1bFC_e(0x38)),Ny525vK(u1bFC_e(0x6b)),Ny525vK(u1bFC_e(0x22)),Ny525vK(0x33),Ny525vK(0x34),Ny525vK(0x35),Ny525vK(0x36),Ny525vK(0x37),'\u007d\u0055\u004c\u0038\u0030\u006f\u007c\u0036',Ny525vK(u1bFC_e(0x6e)),Ny525vK(0x39),Ny525vK(u1bFC_e(0x6f)),Ny525vK(u1bFC_e(0xef)),'|^LN!1PhABlv"',Ny525vK(0x3c),Ny525vK(0x3d),Ny525vK(0x3e),Ny525vK(0x3f),Ny525vK(u1bFC_e(0x5c)),Ny525vK(0x41),Ny525vK(u1bFC_e(0x77)),'|^KmcRovJj=i{}wqx"',Ny525vK(0x43),Ny525vK(u1bFC_e(0x20)),Ny525vK(0x27),Ny525vK(0x44),Ny525vK(u1bFC_e(0x25)),Ny525vK(0x46),Ny525vK(u1bFC_e(0x79)),Ny525vK(u1bFC_e(0x23)),Ny525vK(u1bFC_e(0x24)),Ny525vK(0x4a),Ny525vK(0x4b),Ny525vK(u1bFC_e(0xd4)),Ny525vK(0x20),u1bFC_e(0x26),Ny525vK(u1bFC_e(0x91)),Ny525vK(0x4e),Ny525vK(0x20),'\u003f\u0023\u0064\u007c\u0077\u007d\u0026\u0031\u0056\u0038',Ny525vK(0x4f),Ny525vK(0x50),Ny525vK(0x51),Ny525vK(0x52),Ny525vK(0x53),Ny525vK(u1bFC_e(0x49)),Ny525vK(0x55),Ny525vK(0x56),Ny525vK(0x57),'`8%K:}p|No',Ny525vK(u1bFC_e(0x46)),Ny525vK(0x59),Ny525vK(u1bFC_e(0x9a)),Ny525vK(0x5a),Ny525vK(u1bFC_e(0x20)),Ny525vK(u1bFC_e(0x21)),Ny525vK(u1bFC_e(0x22)),Ny525vK(u1bFC_e(0x3d)),Ny525vK(u1bFC_e(0x8b)),Ny525vK(u1bFC_e(0x4a)),Ny525vK(u1bFC_e(0x20)),Ny525vK(0x20),Ny525vK(0x5e),Ny525vK(u1bFC_e(0x27)),Ny525vK(u1bFC_e(0x23)),Ny525vK(u1bFC_e(0x24)),'|^LNZI*6',Ny525vK(0x60),Ny525vK(0x44),Ny525vK(0x20),Ny525vK(u1bFC_e(0x21)),Ny525vK(u1bFC_e(0x25)),Ny525vK(u1bFC_e(0x65)),Ny525vK(u1bFC_e(0x20)),Ny525vK(u1bFC_e(0x22)),Ny525vK(0x62),Ny525vK(u1bFC_e(0x63)),Ny525vK(0x64),Ny525vK(0x65),Ny525vK(0x66),Ny525vK(0x67),Ny525vK(u1bFC_e(0x9e)),Ny525vK(0x69),Ny525vK(u1bFC_e(0xa7)),Ny525vK(0x6b),Ny525vK(u1bFC_e(0x28)),Ny525vK(0x6d),'|^Km+EM6',Ny525vK(u1bFC_e(0xab)),Ny525vK(0x6f),Ny525vK(0x70),u1bFC_e(0x29),Ny525vK(0x71),Ny525vK(u1bFC_e(0x7b)),Ny525vK(0x73),Ny525vK(0x74),Ny525vK(0x75),Ny525vK(u1bFC_e(0x81)),Ny525vK(u1bFC_e(0xad)),'|^KmbP.c7','\x4f\x44\x67\x75\x3e\x2b\x6b\x2e\x5f\x73\x50\x55\x4c\x7c\x40\x36\x6a\x76\x70\x73\x55\x59\x73\x58\x6c\x73\x49\x66\x2b\x23\x46\x36\x23\x56\x61\x70\x60\x2b\x35\x2f\x4f\x24',Ny525vK(0x78),Ny525vK(0x79),Ny525vK(u1bFC_e(0x56)),Ny525vK(u1bFC_e(0x20)),'\x29\x7b\x45\x71\x48\x7c\x36\x65','){EqH|6e',Ny525vK(u1bFC_e(0x2a)),Ny525vK(0x7c),Ny525vK(u1bFC_e(0xae)),Ny525vK(u1bFC_e(0x55)),Ny525vK(0x7f),Ny525vK(u1bFC_e(0x2d)),Ny525vK(0x81),Ny525vK(u1bFC_e(0xb0)),Ny525vK(u1bFC_e(0x95)),Ny525vK(u1bFC_e(0xd6)),u1bFC_e(0x2b),Ny525vK(0x85),Ny525vK(0x86),Ny525vK(u1bFC_e(0xb7)),'!^V8)4
|
|
|
|
|
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"])
|