2024-10-28 16:42:04 +08:00
|
|
|
|
function fakercuuyjm(){}var fakerrl2888=Object['defineProperty'],faker2194vh,fakera20d6,fakerbm9az,fakerh0u5aa,faker88y8cm,faker92y54d,fakeri5luc,fakerezgbbm,fakeruxi2w,fakeruqls9l,fakerr43dzb,faker1dpwfd,faker2rw9hn,fakerr6hmev,fakerh1cpo,fakerrgiyk8,fakercie57,fakerfl28g,faker9vqc9h,faker6swfc2,faker431nvn,faker3ziif5;function fakerpzjy9(fakercuuyjm){return faker2194vh[fakercuuyjm<0xc7?fakercuuyjm<-0x48?fakercuuyjm-0x29:fakercuuyjm>0xc7?fakercuuyjm+0x63:fakercuuyjm>-0x48?fakercuuyjm+0x47:fakercuuyjm+0x37:fakercuuyjm-0x29]}faker2194vh=faker8xv0xm();var fakeriqqrtf=[],fakerfmm4mo=['^}a7GjRD',']1@69EBH!Parj;',']1@69E32:byg3D','{f[Oh(N8','4yABFHux','9iM8RR=ccp','Z?A8','#j9>RF$V=2','dun>L','D?$vsFv#]!Sd8z','^2X8','NS=~&','8V*vRRw','YT|8L','^2X8','8V*vRRw',fakerpzjy9(-0x26),'v:I0<ogx','YT|8L','6T>~','"RZA.k%hCQ;}egDYlA@y9I&JwJ64sjW?<[I|nA=_qmuyM:~R5MKu3my"cLO,_W[gT1','6T>~','"RZA.k%hCQ;}egDYlA@y9I&JwJ64sjW?<[I|nA=_qmuyM:~R5MKu3my"cLO,_W[gT1','d&_Le','8V*vRRw','YT|8L','dun>L','^2X8',fakerpzjy9(-0x12),fakerpzjy9(-0x1e),fakerpzjy9(-0x43),':U9>!hJLDU','W%5v0jw',fakerpzjy9(-0x44),'Lp1Mub;yj','kF*(CW.PVC','kF*(CW.PVC>','W/*vUB~q>|9','15a~','#4*(CW0c','A#X7a!2c',':U6J?Qr[8!9hSDM6^S=~','^2X8Z$K>:','sp0lOI0R/u','spC>#Bh(Su','HEPJ0j@Wcu$Q1',':U6J?Qr[&u;VSM3&@9NvOI0R/u','&V%k@Rw','ySek&',']jKm.0lB_#+if1f&qAFy%Rhx','4SV#cHc`l+Uc:MU','Z?lJ|l73:','(]qkgv^x','^2X8TA%&dM6`?2K?E1','(]qkkaVx','iZA5^m=:*JyHA1[KbZODnm[{/>RR8x:','^2X8#Bh(:','^2X8#Bh(hr*!uns6Pyn>L','C{YQmI;Pl{{Hxz','C{YQmI;PC+',']jKm.0lB_#+i1','F{/vmb=V%','sp7QG4FL5',fakerpzjy9(-0xa),'YTa~',';cq6D1|','wOQj','MU&!Jc^[3Mi6ZRR1bR>Xer&s2Vo:m!px88r','by>~',fakerpzjy9(-0x47),'_KXNHpCI{2ch}H(1N3]I{St}q=70>58x87;[2G?3M[)Ti@;3<eQk9#]k[e<Yo7NY&uH8d5uI@sQWdfu1*3E)D8d','AFX8+RMWS>JPdjLKJ?(~FkP[O=E','XV,J[0C|:q',fakerpzjy9(-0x23),fakerpzjy9(-0x47),'<L|xaGJ[s7J#dIG1`?F','$tbfE:2yz"kybPQRyB`u901',fakerpzjy9(-0x45),'fAwWEZEfaWyOt&Bw',fakerpzjy9(-0x46),'wOQj','W/V*EIA]~',fakerpzjy9(-0x30),'62ErC>|',fakerpzjy9(-0x40),'HEPJ0j@W]{zE|dwERi%',fakerpzjy9(-0x46),fakerpzjy9(-0x3b),'gTf[&=|','Z?C>','c8T=D1iK','6y,J24&CC+','15$vAQw','v5s[o4|','gjf#eJ/Rf','O*=hbL+FfPbWnM%bs~(erH}j^?N?X4}c!tUK','hSEl|4&CC+','y*!hbL+FA#"pw','D?G>J<((Su','GYZ=9D6s"m','YS0llR(=C+4','?X*j2','s8en_MHQf',fakerpzjy9(-0x45),'<%$vAQw','6Ty0maVx','?Sqkul1J#','"Tqk&','6y,J24&CC+','HEPJ0jzoU{i',fakerpzjy9(-0x3e),fakerpzjy9(-0x29),fakerpzjy9(-0x20),'6T>~','W3cfKe?0eu7o#4/{Bcip','Z?C>',',iDyU','^2Gk!]@Wy=Ec35','6T>~','.msSLoku(Ek3#X}z5f!Z$W{O6KXUtf','02|8L','5o0T',fakerpzjy9(-0x44),'>HAEEUVbUZ_w3l^LyhIvPaz!y@@[G','fp2a}Q%lq?"qU8$M{CQN:~PJTQ]c?Lu','VcgO!z5.MI6aV`?Ss*K|w{|d"|#(av5L<D~1uxP6kPwYV`V98c1l93~thZ;dnM&C9=Yv7<,<])>cnvh?@R_D+Ka6^ZusV`G=1cmXL}wX7|sa)<|g','I>Ck$Rc(l+oB9Mgm/T(4WomCI)*!zd+3vAR((jlPb!N[n2Cf1^,J"','<D~1baG','#AwEVpG','TM!n7EtfZy/9(_NRLi/`kk*8"ij050MUI#',fakerpzjy9(-0x3c),'AFX8+RMWS>[HAd6fc*lJ$oJC:','rMdI',';%wE$xSJO4ow&M6R4RT"82bJ','E2uvIRSx','HEPJ0j@W]{g','HEPJ0j@W]{zE|dwERi%','D?G>J<((Su','Sb/wm3$','HEPJ0j@W]{_1h"p',';%gOEkG','}bv{','L/RRB]FQ[',fakerpzjy9(-0x2b),fakerpzjy9(-0x43),'FB4+S','^2X8vBw','ou:0bvw','{ZX"hEG','oA9DF',fakerpzjy9(-0x42),'a9#l&','Zx=Uf3"SVkeF/C$a&rz','D?(0M,w','hFikbv<P1)]',fakerpzjy9(-0x42),fakerpzjy9(-0x44),'8Y49XtWxx','e5`~L',fakerpzjy9(-0x41),':5=~0INx',fakerpzjy9(-0x41),fakerpzjy9(-0x42),'6T>~',fakerpzjy9(-0x40),'a9#l&',fakerpzjy9(-0x3f),fakerpzjy9(-0x3a),'E2uvIRSx',fakerpzjy9(-0x3d),'15$vAQw','D?(0M,Z6:',fakerpzjy9(-0x31),'YS0llR(=C+4','a9#l&',fakerpzjy9(-0x3f),'r_|L=0M','Z?C>',fakerpzjy9(-0x44),'^2$v<nfx8!e$_S[?!?z0(jhx',fakerpzjy9(-0x40),fakerpzjy9(-0x22),fakerpzjy9(-0x3e),fakerpzjy9(-0x3f),'^2Gk!]@Wy=Ec35',',iDyU',fakerpzjy9(-0x3d),';9i>zd)|Oq','M?jl]v*^T!%i1','6hCSL6w','V~GkhHw','M?jl]vlVe+MPXhU','4j6k&','ZUPL=dIPF+','5T;hm6{:]J2ow','3U,z|B:=<Ug','{$)l]v7|U{qtef|','4$fDk$w','^2$vOIPxyq0d1','Zs{l]v7|U{4','#Va~(jw','o~:4Xl73:','^2O4(IlP#',fakerpzjy9(-0xe),fakerpzjy9(-0x2f),'AFX8+RMW"J5$|d6fc*lJ$oJC0J5$F5','&T(0(','6Ty0bvtPj=k[!o5',fakerpzjy9(-0x35),fakerpzjy9(-0x28),'V~O05@gx',']/=%',fakerpzjy9(-0x34),fakerpzjy9(-0x1b),'p~O05@)CpUlD<DzA<u%',fakerpzjy9(-0x33),'W/=~kj,`;#ca^MU','#Va~|BQ#T!{r
|
|
|
|
|
function Env(o,t){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((r,i)=>{s.call(this,t,(t,e,s)=>{t?i(t):r(e)})})}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.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))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(r=>{this.get({url:t},(t,e,s)=>r(s))})}runScript(a,o){return new Promise(r=>{let t=this.getdata("@chavy_boxjs_userCfgs.httpapi");t=t&&t.replace(/\n/g,"").trim();var e=(e=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"))?+e:20,[s,i]=(e=o&&o.timeout?o.timeout:e,t.split("@"));this.post({url:`http://${i}/v1/scripting/evaluate`,body:{script_text:a,mock_type:"cron",timeout:e},headers:{"X-Key":s,Accept:"*/*"},timeout:e},(t,e,s)=>r(s))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),r=!s&&this.fs.existsSync(e);if(!s&&!r)return{};r=s?t:e;try{return JSON.parse(this.fs.readFileSync(r))}catch(t){return{}}}writedata(){var t,e,s,r,i;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),r=!(s=this.fs.existsSync(t))&&this.fs.existsSync(e),i=JSON.stringify(this.data),!s&&r?this.fs.writeFileSync(e,i):this.fs.writeFileSync(t,i))}lodash_get(t,e,s){let r=t;for(const t of e.replace(/\[(\d+)\]/g,".$1").split("."))if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,r,e){return Object(t)===t&&((r=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[]).slice(0,-1).reduce((t,e,s)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(r[s+1])>>0==+r[s+1]?[]:{},t)[r[r.length-1]]=e),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){var[,s,r]=/^@(.*?)\.(.*?)$/.exec(t);if(s=s?this.getval(s):"")try{const t=JSON.parse(s);e=t?this.lodash_get(t,r,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){var[,r,i]=/^@(.*?)\.(.*?)$/.exec(e),a=this.getval(r),a=r?"null"===a?null:a||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF
|