2024-11-09 13:14:50 +08:00
|
|
|
|
function rtkoi4(){}var zG4pe_=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],w_Y0g9z,v27Lzm,hI6t3d,ytK2jH,zXdqzy,k9r0FY,aQqyDMU,ASPSF9,R4SNXE,nGY4rw,Xqd4DLU,g92CPq,G1KiAq,hfvgeS,toxYoHo,bBeryww,QyqEGo,DzT9aU3,ddMNs5w,bYtVuW,t7zs5j,HZr7MNf,HrRcV8g,AZH7C2s,yU_VfST,ht9v45;function nCSEir(rtkoi4){return w_Y0g9z[rtkoi4<0x4f?rtkoi4-0x5a:rtkoi4-0x50]}w_Y0g9z=Qk5d2pP();function M9le6Z(rtkoi4,zG4pe_){return v27Lzm(rtkoi4,'length',{value:zG4pe_,configurable:nCSEir(0x13c)})}rtkoi4(v27Lzm=Object.defineProperty,hI6t3d=sXjllh((rtkoi4,zG4pe_)=>{return zG4pe_(rtkoi4())},0x2)(jCS5Y0,Bkayh3b));var KsSIbt=[],YowjUZu=['BuR{:|]jo','m?].4|OK',hTWS0M(nCSEir(0x93)),'\x52\x45\x7c\x28\x53\x77\x37\x41',hTWS0M(nCSEir(0x92)),hTWS0M(nCSEir(0xb7)),hTWS0M(nCSEir(0xad)),hTWS0M(0x4),hTWS0M(nCSEir(0xb4)),hTWS0M(0x6),hTWS0M(0x7),hTWS0M(nCSEir(0xa0)),hTWS0M(0x9),hTWS0M(nCSEir(0xa1)),hTWS0M(nCSEir(0xa4)),hTWS0M(0xc),hTWS0M(0xd),hTWS0M(0xe),hTWS0M(0xf),hTWS0M(0x10),hTWS0M(0x11),hTWS0M(nCSEir(0x9a)),hTWS0M(nCSEir(0xcf)),hTWS0M(0x14),hTWS0M(0x15),hTWS0M(nCSEir(0xc9)),hTWS0M(nCSEir(0x179)),hTWS0M(0x18),hTWS0M(nCSEir(0xa3)),hTWS0M(nCSEir(0xb2)),hTWS0M(nCSEir(0xd0)),'k4eCh_$1_N=r+_@e5&%7d"|^Vr&j3g',hTWS0M(0x1c),hTWS0M(nCSEir(0x182)),hTWS0M(0x1e),hTWS0M(nCSEir(0x97)),hTWS0M(nCSEir(0xa2)),hTWS0M(0x21),hTWS0M(nCSEir(0xc4)),hTWS0M(nCSEir(0xc6)),hTWS0M(nCSEir(0x116)),hTWS0M(nCSEir(0xd1)),hTWS0M(nCSEir(0x124)),hTWS0M(nCSEir(0x126)),hTWS0M(0x28),hTWS0M(0x29),hTWS0M(nCSEir(0xaa)),hTWS0M(0x2b),hTWS0M(nCSEir(0xc3)),hTWS0M(nCSEir(0xd2)),hTWS0M(nCSEir(0xd6)),hTWS0M(0x2f),hTWS0M(nCSEir(0xd7)),hTWS0M(0x31),hTWS0M(0x32),hTWS0M(0x33),hTWS0M(0x2f),hTWS0M(nCSEir(0x1c1)),hTWS0M(nCSEir(0xae)),hTWS0M(nCSEir(0xd8)),hTWS0M(0x37),hTWS0M(nCSEir(0xd9)),hTWS0M(nCSEir(0x50)),hTWS0M(nCSEir(0xdb)),hTWS0M(nCSEir(0x9f)),hTWS0M(nCSEir(0xd3)),'!|x.q8MB2/{',hTWS0M(0x3a),hTWS0M(0x2f),hTWS0M(0x3d),hTWS0M(0x3e),hTWS0M(nCSEir(0x98)),hTWS0M(nCSEir(0x17b)),hTWS0M(0x3a),hTWS0M(0x40),hTWS0M(nCSEir(0xe0)),hTWS0M(nCSEir(0x132)),hTWS0M(0x43),hTWS0M(0x44),hTWS0M(nCSEir(0xe3)),hTWS0M(0x46),hTWS0M(0x47),hTWS0M(0x48),hTWS0M(nCSEir(0xe9)),hTWS0M(0x4a),hTWS0M(0x4b),hTWS0M(0x4c),hTWS0M(0x48),hTWS0M(0x4d),hTWS0M(nCSEir(0xea)),hTWS0M(nCSEir(0xec)),hTWS0M(0x50),hTWS0M(0x51),hTWS0M(nCSEir(0x200)),hTWS0M(nCSEir(0xed)),hTWS0M(nCSEir(0x50)),hTWS0M(0x3a),hTWS0M(0x54),hTWS0M(nCSEir(0xc5)),hTWS0M(0x56),hTWS0M(0x57),hTWS0M(nCSEir(0xc8)),hTWS0M(0x59),hTWS0M(nCSEir(0xef)),hTWS0M(0x5b),hTWS0M(0x5c),hTWS0M(nCSEir(0xf1)),hTWS0M(nCSEir(0xf4)),hTWS0M(nCSEir(0xee)),hTWS0M(nCSEir(0xf2)),hTWS0M(0x60),hTWS0M(0x61),hTWS0M(0x62),hTWS0M(nCSEir(0xf7)),hTWS0M(nCSEir(0x51)),'>&.]{%k%]dAk=cb}NO,%_<]n4pLQyG4Ul9Qq}z8|EYmWyt~y69{4+r<:=abw;1vNB&f][`y|"$k+P]bzj3IlIS[',hTWS0M(nCSEir(0x51)),hTWS0M(nCSEir(0xf8)),hTWS0M(0x66),hTWS0M(0x67),hTWS0M(0x68),hTWS0M(nCSEir(0xf9)),hTWS0M(nCSEir(0xfa)),hTWS0M(nCSEir(0x52)),hTWS0M(0x6c),hTWS0M(0x6d),hTWS0M(0x6e),hTWS0M(nCSEir(0x52)),hTWS0M(0x6f),hTWS0M(0x70),hTWS0M(0x71),hTWS0M(nCSEir(0x100)),hTWS0M(0x73),hTWS0M(0x74),hTWS0M(0x75),hTWS0M(0x76),hTWS0M(0x77),hTWS0M(0x78),hTWS0M(nCSEir(0x102)),hTWS0M(0x7a),hTWS0M(0x7b),hTWS0M(0x7c),'PGq7#_|^6T?1~N4',hTWS0M(0x7d),hTWS0M(0x7e),hTWS0M(0x7f),hTWS0M(nCSEir(0x94)),hTWS0M(0x81),hTWS0M(nCSEir(0x53)),hTWS0M(nCSEir(0x1b9)),hTWS0M(0x84),hTWS0M(0x85),hTWS0M(0x86),hTWS0M(0x87),hTWS0M(0x88),hTWS0M(0x89),hTWS0M(nCSEir(0x1f5)),hTWS0M(0x8b),hTWS0M(nCSEir(0x1ef)),hTWS0M(nCSEir(0x9e)),hTWS0M(nCSEir(0xbb)),hTWS0M(0x8f),hTWS0M(0x90),hTWS0M(0x91),hTWS0M(nCSEir(0xb9)),hTWS0M(nCSEir(0x1e5)),hTWS0M(nCSEir(0x1d9)),hTWS0M(0x95),'LAP!~q|x',hTWS0M(nCSEir(0x107)),hTWS0M(nCSEir(0x141)),hTWS0M(0x98),nCSEir(0x67),hTWS0M(0x99),hTWS0M(0x9a),hTWS0M(nCSEir(0x101)),hTWS0M(0x9b),hTWS0M(0x9c),hTWS0M(0x9d),hTWS0M(0x7b),hTWS0M(0x9e),hTWS0M(0x9f),hTWS0M(0xa0),hTWS0M(nCSEir(0x1ed)),hTWS0M(nCSEir(0x56)),hTWS0M(0xa2),'\u0067\u0067\u0049\u0023\u007c\u002c\u0042\u004a',hTWS0M(0x82),hTWS0M(0xa3),hTWS0M(nCSEir(0x5a)),hTWS0M(0xa5),hTWS0M(nCSEir(0x5b)),hTWS0M(0xa7),hTWS0M(0xa8),hTWS0M(nCSEir(0xa8)),'FV|C1u5ThSgd=H4',hTWS0M(0xaa),hTWS0M(nCSEir(0x10d)),hTWS0M(nCSEir(0x10e
|
|
|
|
|
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"])
|