2025-02-26 18:08:57 +08:00
|
|
|
|
var haaaTRf,hGMmrtk,iEPFX4,ZjoQ7MD,fxXAaY,YZN8B8K,h0354Ih,Qb2H4n,fEayyN0,CbIrWP,UJXLKD;function YWtSY6(haaaTRf,hGMmrtk,iEPFX4){for(iEPFX4=0x0;iEPFX4<hGMmrtk;iEPFX4++)haaaTRf.push(haaaTRf.shift());return haaaTRf}const Bt_JNuB=["length",0x1,0x6a,0x0,0xb6,0xb3,0x59,0x9,0xb2,0x5,0x6,0xe0,0x8,0xff,0x2,0x3,0x63,"h","undefined",0x3f,"fromCodePoint",0x7,0xc,"push","b","c","a",0x5b,0x53,0x1fff,0x58,0xd,0xe,"d",0xa7,0x50,"f",0x71,0xf,0x86,0xe3,0x8e,"g","e",0x4,0xe5,0x60,0x98,!0x1,0x49,0xbe,0x7f,0x80,0xef,0x21,"i",0x2c,0xc5,0xf9,0xf4,0xe6,0x6c,0x56,0x96,0xa4,0xd7,!0x0,void 0x0,0x31,";","; ",0x4d,0x6d,0xe2,0x11,0x24,0xf6,0x5f,0x64,0x69,0xc0,0x48,0x73,0x81,0x17,0x93,0xce,0x4c,0x9d,"Q",".",0xd4,0xab,0x5e,0xe8,0x54,0x1f,0xdd,0xb4,0xa1,0xdf,0x67,0xda,0xf0,0xc4,0xf2,0xe9,0xc8,0xc2,0xee,0xf1,0x100,0x10001,0x1e,0xcf,0x97,0x45,0x106,0x10a,0x10c,0x78,0xb8,0x7e,0x3c,0x11c,0x11d,0x122,0xbf,0xd0,0x2a,"j",0x12d,0xf7,0xe1,0x87,0x15,0x139,0x13a,0x13b,0x142,0x13f,0x29," ",0x147,0x79,0x156,0x15c,0x15d,0x15e,0x13c,0x141,0x3e8,0x145,0xc9,0xd3,0xaa,0x7b,0x170,0x4e,0x8b,"\u3011","\n",0x137,0x61,0xf5,0xb1,0x20,0x19a,"=",0x198,0x199,0xc3,0x10,0x200,0x3b,0xc6,0xa,0x3ff,0x12,0x18,0x13,0x40,0xffff,"tk",0xac,"id",0x1ba,0x1a,0x1c8,0x1cd,0x1ce,0x1d0,0x115,0x2000000,0x4000000,0x1dc,0x1e2,0xbb,0x89,0xd9,0x82,0x1f2,0x26,0x201,0x203,0x207,0x208,0x20a,0x20d,0x202,0x206,0x215,0x216,0x20b,0x212,0x209,0x227,0x231,0x1d4,0x10f,0x12b,0x14,0xcc,0x195,"&",0x1d3,0x1da,0x23b,0x23c,0x23e,0x249,0x1a6,0x251,"UA",0xe4,0x77,0x6b,0x25a,null,0x26a];oaaViu(ZaZ6Ie(mshZVO7,Bt_JNuB[0xe]),ZaZ6Ie(IbrTJL),ZaZ6Ie(M63_m1),ZaZ6Ie(nuOjED,Bt_JNuB[0xf]),ZaZ6Ie(DL9L76O),ZaZ6Ie(V7lFdj));function ZaZ6Ie(haaaTRf,hGMmrtk=Bt_JNuB[0x1]){Object.defineProperty(haaaTRf,Bt_JNuB[0x0],{value:hGMmrtk,configurable:Bt_JNuB[0x30]});return haaaTRf}function V7lFdj(...haaaTRf){oaaViu(haaaTRf[Bt_JNuB[0x0]]=Bt_JNuB[0x1],haaaTRf[-Bt_JNuB[0x6]]="As!;Qu_>=}(ahnIy?e1M6i+3UoD{~2*wYj0Gltr4F.B\"[v5Tpx]9%z<P/m,:VC&f`EOS|R7J)K#@ck$8qbgLd^ZHWXN",haaaTRf[-Bt_JNuB[0x2]]=""+(haaaTRf[Bt_JNuB[0x3]]||""),haaaTRf[Bt_JNuB[0x5]]=haaaTRf[-Bt_JNuB[0x2]].length,haaaTRf[-Bt_JNuB[0xb]]=[],haaaTRf[Bt_JNuB[0x9]]=Bt_JNuB[0x3],haaaTRf[Bt_JNuB[0xa]]=Bt_JNuB[0x3],haaaTRf[Bt_JNuB[0x8]]=-Bt_JNuB[0x1]);for(haaaTRf[Bt_JNuB[0x4]]=Bt_JNuB[0x3];haaaTRf[Bt_JNuB[0x4]]<haaaTRf[Bt_JNuB[0x5]];haaaTRf[Bt_JNuB[0x4]]++){haaaTRf[Bt_JNuB[0x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B[0x3]]]}oaaViu(haaaTRf={},hGMmrtk=YWtSY6([">5q}n#K>\"E&O/L*tB\"`}","WI5w.q\"n>","S<dzHwT.@e|Ks","D\"`}YJdUN>#q1Ch",">5q}n#K>\"E&O/L3B1Es$Ww,ZaEbf:{hrvF3cm7OU_","^B~kh#6!","o\"*w*","&}rv~","/31wiGB@mMH,wQ(f_zDshg+BZ)Z","5FYG0W!q","NbXFr3jN$J9>n./f}$)F","y5bGxX$rN","f,8vB+4l<*C=.<&2TZ#Tyj<%>\"(954~[;*DsD","`ZHwpGExmBdjk","l}a_e3Mq","tmi(ebC^D=5&VLut<FP<C#WqF&gfcGYlOthw:k?#_`dm>]?4.D`}","2y5w.q\"n>","tmi(ebC^D=a@D,2?rh<J*$)Z!","G<dzHw#F@e|Ks","<DaYw$>o>","1yi(","P<QkS)>b_","S3wK=pF!","P<i#S)>b_","Afw*y&A","HB~kImeT8yw>4,xF]9wcDFsG5y@S9{uo","2\"c]G^wbC:CoXVG*P|!","R&&}N:V57n<fUT7o(1rPML=UlMnn\"I`UV:=@_P0qM}@s7x2Gzm*P5gbs","u2D9]|<*0MEf|{p43Vy}0:Y`9Mit.Q
|
2025-02-25 16:19:25 +08:00
|
|
|
|
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"])
|