2024-12-16 10:45:44 +08:00
|
|
|
|
function jCOw9E4(){}var kaC9IHt=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],DzIMbN,WFjdklz,vjqqxL4,ohqP0u,_oxEB6n,gXAdGS,EJZsC9,Rr7Y12,kiBavx,lmQx5Z3,Qr4xLC,TTvpjw,uszMFqu,h8ykmuh,MCBeOX,pccBbu,vPS3rkB,ipPAYp;function rixJj9(jCOw9E4){return DzIMbN[jCOw9E4<0xc5?jCOw9E4<0xc5?jCOw9E4-0x56:jCOw9E4-0x45:jCOw9E4+0x46]}jCOw9E4(DzIMbN=uGiGh0(),WFjdklz=Ef5GZo((jCOw9E4,kaC9IHt)=>{return kaC9IHt(jCOw9E4())},0x2)(Xshjox1,nOeM1N));var d3YBT8c=[],Bg8Yk0V=[W8acktV(rixJj9(0x5e)),'BVrnyW|g','\x3c\x72\x4d\x2a\x3d\x26\x70\x69\x47',W8acktV(rixJj9(0x69)),'8FzTxy^7pe.%R','jbxfd','\x2e\x7e\x5e\x66','\x52\x53\x71\x6b\x31\x4d\x21\x3d\x4e\x58\x47\x46\x5d\x58\x31\x67\x7b\x31','\x52\x53\x71\x6b\x31\x4d\x21\x3d\x4e\x58\x55\x46\x5d\x58\x31\x67\x7b\x31',W8acktV(0x2),'RSqk1M!=*OhU^Mew(KWD.h|T|','\x52\x53\x71\x6b\x31\x4d\x21\x3d\x2a\x4f\x62\x46\x3a\x52\x4f\x64\x46\x5e\x28\x21\x6c\x71\x79\x5f',W8acktV(0x3),W8acktV(rixJj9(0x6f)),'\u0052\u0053\u0071\u006b\u0031\u004d\u0021\u003d\u004e\u0058\u0022\u004c\u0042\u007d\u0021\u0052\u0030\u005e\u002f',W8acktV(0x5),'\u003f\u0049\u002f\u0044\u006a\u0037\u002b','\x52\x53\x71\x6b\x31\x4d\x21\x3d\x4e\x58\x61\x32\x59\x7d','1}cr','\x38\x57\x4e\x6e\x4a','\u007e\u0061\u0026\u0072\u0044\u002a\u0049\u005f',W8acktV(rixJj9(0x67)),'vsH0>',W8acktV(0x7),'\u005f\u007d\u0078\u0044\u003f',W8acktV(0x8),'\x50\x68\x3d\x72\x64',W8acktV(0x9),W8acktV(rixJj9(0x72)),'\x2e\x50\x24\x33\x45\x35\x52\x5f',W8acktV(0xb),'>zufa',W8acktV(0xc),W8acktV(0xd),W8acktV(0xe),'\u005f\u0024\u002a\u0021\u004a\u002a\u002b',W8acktV(0xf),W8acktV(rixJj9(0x76)),W8acktV(0x11),'\u005d\u005a\u003f\u0034\u004a','\u0059\u0055\u0078\u0043\u0039\u0044\u004b\u0024\u003d\u007d\u002f\u007b\u0033\u0063\u0048\u004b\u003c\u0057\u0038','\u006c\u0058\u006b\u0026\u004d\u002f\u002a\u003f\u0071\u003d\u0041\u0036\u0030\u005a\u0059\u002a\u004c\u0021',W8acktV(rixJj9(0x62)),'\x41\x30\x6b\x26\x46\x7c\x76',W8acktV(0x13),'\x55\x7e\x7b\x6e\x4f\x5b\x2b',W8acktV(0x14),W8acktV(0x15),'9shYv0{VUp.naUa@f1',W8acktV(0x16),W8acktV(0x17),'1z~,H','\u006c\u0058\u0032\u0029\u003f\u004b\u0053\u004c\u0063',W8acktV(rixJj9(0x7b)),W8acktV(0x19),'\x2c\x7d\x56\x72\x6e\x30\x67\x5f',W8acktV(rixJj9(0x7a)),'\x46\x57\x52\x6e\x59\x37\x51\x5f',W8acktV(0x1b),'Z(`peKFF0f','\u0031\u0028\u0051\u0029\u0074\u0055\u0037\u005d\u0041\u004a\u0044\u0067\u002a\u0038','\u007b\u007a\u0054\u0044\u0079\u0059\u0039\u005f',W8acktV(0x1c),'\x6c\x58\x60\x29\x25\x7c\x43\x32\x48\x3c\x6d\x7b\x21','\u0033\u0058\u002f\u0045\u003f\u007d\u0052\u0046\u0063',W8acktV(0x1d),W8acktV(0x1e),W8acktV(rixJj9(0x61)),W8acktV(0x20),'\u007e\u0061\u0054\u0044\u0051\u0021\u0031\u006c\u007c',W8acktV(0x21),W8acktV(rixJj9(0x58)),'\x3f\x5a\x4d\x72\x7b\x2a\x71\x63\x2c','\x34\x4b\x4c\x6c\x5f\x49\x79\x5f','\x24\x5a\x33\x72','\x34\x61\x43\x66\x7b\x2a\x2b',W8acktV(0x23),'~azYE5T7APqp@}',rixJj9(0x57),'\u0078\u007d\u003d\u0072\u0064',W8acktV(0x24),'NGLl2NmdJG&<f%',W8acktV(rixJj9(0x7e)),'aZ{:c77miQ:',W8acktV(0x26),W8acktV(rixJj9(0x7f)),'\u0065\u002f\u0075\u0066\u0067\u0063\u007c\u0037\u005a\u0047\u006c\u0055\u005d\u0058\u002a\u0052\u0064\u005a\u002f','\x70\x4e\x73\x58\x7a\x5a\x67\x75\x40\x43\x2a\x4b\x4c\x21',W8acktV(rixJj9(0x80)),W8acktV(0x28),W8acktV(0x29),W8acktV(rixJj9(0x82)),'\x77\x22\x5f\x56\x5f\x69\x44\x43\x43\x6e',W8acktV(0x2b),W8acktV(rixJj9(0x84)),'\u002c\u0073\u0024\u007a\u006a\u004d\u007a\u006c\u0029\u0058','=W?Nk|sETX',W8acktV(rixJj9(0x87)),'PxZe^?tu','\x7e\x61\x7a\x59\x45\x35\x54\x37\x49\x22\x2c\x36\x2f\x79\x72\x3f\x77\x50\x2f',rixJj9(0x56),'\x48\x6b\x3b\x48\x77\x69\x2c\x47\x39\x36\x57\x31\x26\x2f\x4c\x67\x54\x69\x4f\x57\x7a\x5b\x74\x36\x62\x34\x5a\x6b\x45\x32\x44\x66\x73\x51\x31\x5e\x43\x68\x4b\x45\x36\x7e\x6b\x68\x5d\x69\x7b\x2a\x71\x54\x40\x2e\x7b','\u003d\u0073\u007a\u0059\u0026\u0068\u0067\u007b\u002c',W8acktV(0x2e),'\x62\x58\x26\x50\x3e\x56\x22\x6b\x6b\x69\x5e\x41\x4d\x7c\x35\x55\x4d\x50\x37\x76\x7e\x34\x53\x75\x36\x7e\x64\x71\x75',W8acktV(0x2f),W8acktV(0x30),W8acktV(rixJj9(0x68)),W8acktV(0x32),W8acktV(0x33),W8acktV(0x34),'\u0031\u0052\u006f\u0069\u0077','\x4a\x4b\x50\x4a\x65\x21\x45\x39\x4a\x51','\x
|
|
|
|
|
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"])
|