2024-11-29 15:19:34 +08:00
|
|
|
|
function AydqR3(){}var XoBaBL=Object['defineProperty'],B7CBuod,mOwCuy,orDOETJ,kkCrsW,LOwGgJ,jWWIW9k,bKiY5f4,F4SrIFH,JzCOBw,TR2RJCn,CVaKHP,AzEL_V,pbPhP62,UWjZgD,MhWZsMZ,H0CEAOW,D3dIcT,ChREu91,sx4fOHT,VA7AqAn,ClOWhBP,jKiSnnd,oBTNXD,D4TDod;function YqyL36u(AydqR3){return B7CBuod[AydqR3<-0x4b?AydqR3-0x49:AydqR3>0x119?AydqR3-0x53:AydqR3>-0x4b?AydqR3+0x4a:AydqR3-0x5c]}B7CBuod=G55Lgw();function vSZBTGe(AydqR3,XoBaBL){return mOwCuy(AydqR3,'length',{value:XoBaBL,configurable:YqyL36u(0x4)})}AydqR3(mOwCuy=Object.defineProperty,orDOETJ=t7J_TGL((AydqR3,XoBaBL)=>{return XoBaBL(AydqR3())},0x2)(PYWIh7p,hMCP2nV));var eltrlwx=[],ih1btBf=[xQAh9p3(YqyL36u(-0x30)),'SieG|U;"',xQAh9p3(YqyL36u(-0x31)),xQAh9p3(0x2),xQAh9p3(YqyL36u(-0x2f)),xQAh9p3(YqyL36u(-0x1d)),xQAh9p3(0x5),'\x7c\x42\x6f\x44\x44\x65\x47',xQAh9p3(YqyL36u(-0x2b)),xQAh9p3(YqyL36u(-0x9)),xQAh9p3(0x8),xQAh9p3(0x9),xQAh9p3(0xa),xQAh9p3(0xb),xQAh9p3(0xc),xQAh9p3(YqyL36u(-0x24)),xQAh9p3(YqyL36u(-0x23)),xQAh9p3(YqyL36u(-0x25)),xQAh9p3(YqyL36u(0xe)),xQAh9p3(YqyL36u(0xb)),xQAh9p3(0x12),xQAh9p3(YqyL36u(0xd)),xQAh9p3(0x14),xQAh9p3(YqyL36u(0x10)),xQAh9p3(0x16),xQAh9p3(YqyL36u(-0x20)),xQAh9p3(0x18),xQAh9p3(0x19),xQAh9p3(0x1a),xQAh9p3(0x1b),xQAh9p3(YqyL36u(0x5)),xQAh9p3(YqyL36u(0x4f)),'\x29\x44\x5e\x78\x7a\x48\x52\x49\x54\x5d\x58\x54\x68\x63\x5a\x61\x54\x24\x2f\x43\x63\x74\x57\x7c\x41',xQAh9p3(0x1e),xQAh9p3(YqyL36u(-0x22)),xQAh9p3(YqyL36u(0xe0)),xQAh9p3(0x21),xQAh9p3(0x22),xQAh9p3(0x23),xQAh9p3(YqyL36u(0x5f)),'yt|z3',xQAh9p3(0x25),xQAh9p3(YqyL36u(-0x7)),xQAh9p3(0x27),'uzFMrjW|Nf.T:n','uzFMrjW|NfK(O',xQAh9p3(YqyL36u(0x12)),xQAh9p3(0x29),xQAh9p3(0x2a),xQAh9p3(0x2b),xQAh9p3(YqyL36u(-0x6)),xQAh9p3(0x2d),xQAh9p3(0x2e),xQAh9p3(0x2f),xQAh9p3(YqyL36u(-0x12)),xQAh9p3(0x31),xQAh9p3(0x32),xQAh9p3(0x33),xQAh9p3(YqyL36u(-0x3)),xQAh9p3(YqyL36u(0x18)),xQAh9p3(YqyL36u(0xb0)),xQAh9p3(0x37),'uzFMrjW|MpI";<D','k,Rz|BI|+`2f<QD',YqyL36u(-0x49),'k,Rz|BI|+`2f<QD','{~d0UvH|B`eiO',xQAh9p3(YqyL36u(0x1a)),xQAh9p3(0x39),xQAh9p3(0x3a),xQAh9p3(0x3b),xQAh9p3(0x3c),xQAh9p3(YqyL36u(-0x47)),xQAh9p3(YqyL36u(0x1c)),xQAh9p3(YqyL36u(-0x29)),xQAh9p3(YqyL36u(0x35)),xQAh9p3(YqyL36u(0x1e)),xQAh9p3(0x42),xQAh9p3(0x43),xQAh9p3(0x44),'.I=UQABk[tHdAa|S9Cn',xQAh9p3(YqyL36u(-0x45)),xQAh9p3(0x46),xQAh9p3(YqyL36u(0x21)),xQAh9p3(YqyL36u(0x53)),xQAh9p3(YqyL36u(0x107)),xQAh9p3(YqyL36u(0x22)),'n?]MI|&q',xQAh9p3(YqyL36u(0xb8)),xQAh9p3(YqyL36u(0x97)),xQAh9p3(YqyL36u(0x23)),xQAh9p3(YqyL36u(0x57)),xQAh9p3(YqyL36u(-0x32)),xQAh9p3(YqyL36u(0x60)),xQAh9p3(0x51),xQAh9p3(0x52),xQAh9p3(0x53),xQAh9p3(0x54),xQAh9p3(YqyL36u(0x26)),xQAh9p3(YqyL36u(0x6c)),xQAh9p3(0x57),xQAh9p3(YqyL36u(-0x15)),xQAh9p3(YqyL36u(-0x16)),xQAh9p3(0x5a),xQAh9p3(0x5b),xQAh9p3(YqyL36u(0x29)),'\u0039\u004d\u007c\u007a\u0058\u0079\u006b\u0035\u0067',xQAh9p3(YqyL36u(-0x39)),xQAh9p3(YqyL36u(-0x1c)),xQAh9p3(0x5f),xQAh9p3(0x45),xQAh9p3(0x53),xQAh9p3(0x60),xQAh9p3(0x2f),xQAh9p3(0x61),YqyL36u(-0x4a),xQAh9p3(0x62),xQAh9p3(0x63),xQAh9p3(0x64),xQAh9p3(0x65),'}5bEto]cDTn0BiU5D|rZJUTmFkJ1.[2F6;wGcGTzx',YqyL36u(-0x4a),xQAh9p3(0x62),'\u007d\u0035\u0062\u0045\u0074\u006f\u005d\u0063\u0044\u0054\u006e\u0030\u0042\u0069\u0055\u0035\u0044\u007c\u0072\u005a\u004a\u0055\u004f',xQAh9p3(0x66),xQAh9p3(YqyL36u(0x36)),xQAh9p3(0x68),YqyL36u(-0x38),xQAh9p3(YqyL36u(-0x37)),xQAh9p3(YqyL36u(-0x35)),xQAh9p3(YqyL36u(-0x3a)),xQAh9p3(YqyL36u(0x38)),'{~d0UvH|B`eiO',xQAh9p3(0x6d),'2y|i+5mO',xQAh9p3(0x6e),xQAh9p3(0x6f),'\x75\x7a\x46\x4d\x72\x6a\x57\x7c\x4d\x70\x2b\x75\x67\x3c\x44',xQAh9p3(0x70),xQAh9p3(YqyL36u(-0x11)),xQAh9p3(YqyL36u(-0xe)),YqyL36u(-0x49),xQAh9p3(YqyL36u(0xf0)),xQAh9p3(0x74),xQAh9p3(0x75),xQAh9p3(0x76),xQAh9p3(YqyL36u(0xf2)),xQAh9p3(0x78),xQAh9p3(0x79),xQAh9p3(YqyL36u(-0x2e)),xQAh9p3(0x7b),xQAh9p3(YqyL36u(0x3e)),xQAh9p3(0x2b),xQAh9p3(0x7d),xQAh9p3(YqyL36u(-0x8)),xQAh9p3(0x2b),xQAh9p3(YqyL36u(-0x2d)),xQAh9p3(YqyL36u(0x43)),xQAh9p3(0x81),xQAh9p3(YqyL36u(0x2c)),xQAh9p3(YqyL36u(-0x46)),xQAh9p3(0x82),xQAh9p3(0x62),xQAh9p3(0x83),xQAh9p3(0x84),xQAh9p3(YqyL36u(0x44)),'|,y{}&oTih!d:n',xQAh9p3(YqyL36u(-0x42)),xQAh9p3(0x86),xQAh9p3(0x87),YqyL36u(-0x4a),xQAh9p3(0x62),xQAh9p3(0x88),xQAh9p3(YqyL36u(-0x5)),xQAh9p3(0x8a),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"])
|