2024-10-16 14:12:03 +00:00
|
|
|
|
function r1A3tV(){}var fvRhqB=Object['defineProperty'],FyZCnms,khdIGE,NM_zyd,nkNeeM6,JpleWuL,COmWHNw,y279JR5,cYOU5B,ah4xjC,oGcETrL,_0niCvI,CDKXFlC,hv7zNp,j5dVOtH,gPx22Z,h7wB3yP,lLbnaVA,JH4aiAq,Gc4bqn;function iAvr_KR(r1A3tV){return FyZCnms[r1A3tV<0x1b2?r1A3tV>0x1b2?r1A3tV+0x52:r1A3tV-0x44:r1A3tV-0x55]}FyZCnms=L5inMI();var swzGlKp=[],HGMBEEC=[',#p#Vq#R^','tA+oE.:4^','](jPNqaw',';ykJ%qn)','apo3${lP','HLNjQq+3','bZTu$*Bq','YWAooyH','BO"#a9tMJ"o)q0J','vv;j5Q+3iaFlcCDeK)','B[Y@T:+3','"L$iqqoEEg','*eYi','~."dqTl;ov','I+OdM','%elQZTQ~paCIi1','9vwi','6Co(J',iAvr_KR(0x44),'n`|iM','Z%x*','NdoRT&6csUgC3]W0?RtFXnO{|{ZVif<YL[nI/RPJl>2F9~*d+9#2!>FN(=M_J<[]%z','72/x=','9vwi','w^})dd|','0%Iw=',iAvr_KR(0x44),'n`|iM','I+OdM','9vwi','Sv}{<','M`LXYl},>','<p|iC','>W"daG0M%W','UusQj._','=`d(','9vwi*lPd>','Uh<QW@fE_W','Uh<QW@fE_WJ','Uh<QW@(xd|"','8nUN',iAvr_KR(0x87),'%wrNP.&A','>W=0e2HDia"GC%$=9Co(','9vwi*lPd>','Zgj4S{jqh+','Zgmd~@GKC+',':Vz0j.bUE+l2)','>W=0e2HDJ+t;C$?Jb"6QS{jqh+','J;uXbq_','[CFXJ','p.P!7j4@c~}LN)NJxYT[uqG3','BC;~E:Er4}WE>$W','*e40|4,?>','KpxX#Q93','9vwi`YuJI$=revPeV)','KpxXXk;3','L*Ys9!o>&dIyY)DP5*S%O!D]hdqqi3>','9vwi~@GK>','9vwi~@GKGH<a+OZ=z[OdM','m]n2!{tz4]]:31','m]n2!{tzm}','p.P!7j4@c~}L)',iAvr_KR(0x4b),'"Lg~DUvJ>','k"<Q`k_',iAvr_KR(0x4a),'"Lg~DUvJ>','Zg,2yBTMs',iAvr_KR(0x49),'n`k(',':VJ[{q_',iAvr_KR(0x47),'lf5N4VRjHlC[6??qg?"awu5K<]$2xNFnvvu','5[d(',iAvr_KR(0x45),'*3aTPFLht<V#OP.qTH/ht1kOJQXS"evnvX:j<~ZHljc+Cz:HIwd|MB/|jwI;$XT;5mPv)emhzKd0)>mqrHoc{v)','YTwi}q$UCd0zI.MP0eK(TXzDSoV','w;A0Djm|>x',iAvr_KR(0x50),iAvr_KR(0x45),iAvr_KR(0x5a),'lf5NV>v[1&X[5z2q[@r+"j)',iAvr_KR(0x46),'>W=0o6o>p0b`k5&=','>W=0o6o>p0b`k5&=1;J[&','en<#','z(L|)g>,#','h36#ZH|%}',';|k.ObG','~)RlK@8z,vdAjfU','~)RlK@8z,vP)x1G)CO.','>W=0o6o>p0b`k5&=1;J[&',':Vz0j.bUp]#','+Q}KsaG',iAvr_KR(0x48),'e;_l3ty==`',')slQY2_','%eKj$A_','^(>Bw4,?>','5|kjsh`ocRszV0.sM#%$J~I@:4E4utI&"Y7i','jm)rxty==`',';|"jsh`o>wfUG','/4]<l^%%mQ','wLEahg;%>X','FmKrrC%k=`t','M"D#|',iAvr_KR(0x46),'Kvwi*lPd>','RulQY2_','=`[j!k;3','eCxX+4)0~','&`xXJ','=[A0vBJmm}',':Vz0j.1^W]L','k"~4J',iAvr_KR(0x66),iAvr_KR(0x47),'U?ENPFejF+,^~Bh]@ELg',iAvr_KR(0x48),'AL%[W',iAvr_KR(0x4f),'=`d(','U?ENPF@J,Q@z)>`q$~}+Ru^iD4>h|~',iAvr_KR(0x49),'$F61',iAvr_KR(0x47),'ALsQQhYGh+glz&BP[5d%8:q}[ooH_','Ngvk82u4xe&xWil$]m26>(z0`2pEeM+','YTwi}q$UCdD:YI=NE<40l^0mj0),:%$P;(yXJO8D@8lkYIYrKTX&rzy|5+9m{Cc"rVk%p;f;*]AT{%5=oeg(74:DB+JEYI_VXT?>P`l>p0E:];0w','{dmXlqEK4}^@"$#!h`KBU^!m{/<a1I}?QYqKK.4z5a6DOvmN)9A0&',';(yXG:_',iAvr_KR(0x83),'8p>MFT&jHLJC^tS0nrJ|??xm_rbI(Ipa]Q','Mcs$3?@W','fh}~>#(5p]qwf|K@)x$,ve,Rl','nCmd',iAvr_KR(0x4e),'Vv+Q{qC3','w71,_sb5F<E','w71,_sb5F<87&|u7#cU','%eyd0RKKC+','pDmX[#u','w71,_sb5F<:Q2ot','9vwiQ@_','KD]B','OmffFjx`8','pDm_Z','nrEu4','Uj!H8Y18',iAvr_KR(0x69),iAvr_KR(0x51),'eHl_OTu','L71,W6EW','eHl_OTu','3/CB.',iAvr_KR(0x4a),iAvr_KR(0x59),'*3oWN?&C;XFThmlkJH1',iAvr_KR(0x4c),'GTLX5QRz)/p',iAvr_KR(0x4a),'=`d(','inB"wfU33','Fsr(M','Fsr(M','>so(j{63','Fsr(M',iAvr_KR(0x4a),'=`d(',iAvr_KR(0x5c),'k"~4J','&;KjQqHrG/Ez)',iAvr_KR(0x4d),iAvr_KR(0x4b),'=[A0vBJmm}',')slQY2_',iAvr_KR(0x8a),iAvr_KR(0x4c),'nCj44qKom}B','k"~4J','&;KjQqHrG/Ez)',iAvr_KR(0x4d),'*emd','u<#S',iAvr_KR(0x4e),':Vz0j.bUp]c)G&g','Vv+Q{qC3','k"~4J','&;KjQqHrG/Ez)',iAvr_KR(0x4f),iAvr_KR(0x67),'=[A0vBJmm}','t"Ld1I/|Sx','$e.4pQ<9`auL)','=GmCM=_',';(yXG:_','$e.4pQ4;F}$zwGW','B.=XJ','*WzMoI{zT}','s`tG!=]>p0v^_','?WA1|@>oRW#',']l/4pQ,|W]xfFN|',';(wiKU[K>','BlN%Xl_','9vlQS{z3[xjI)','*Z]4pQ,|W]B','~;k(K._','^(>Bw4,?>','9vSBK{4z~','+pFiM',iAvr_KR(0x5e),'YTwi}q$U&0sl|I=NE<40l^0mj0slTs','J`KjK','=`[j5Qfz.oXDa^s',iAvr_KR(0x5f),iAvr_KR(0x54),';(Sjsb#3',iAvr_KR(0x71),'g(Sjsb/m6Ewa2pr"9vu',iAvr_KR(0x55),'g(Sjsb/mgW4%R%1YR+u',iAvr_KR(0x60),'Uho(X.Art~Ek9$W','~;k(|@2~`a]H8OVh9a){ZjEDFaq/5&WN*eV4T:Hr?B28.C[e"TR&Rq=mb(','Uh<QW@+3',iAvr_KR(0x61),'Zg;j?k`|~',iAvr_KR(0x62),iAvr_KR(0x68),'$t4W>','i;<Qqq_','[Vz03;#3','=`d(','``K~*k_',iAvr_KR(0x45),iAvr_KR(0x56),iAvr_KR(0x57),'Q>{jR^#3',iAvr_KR(0x50),'=`d(','%eKj$A*=>','3:c"d=$ht<>0#x.kz~s','^+>j5Q_',iAvr_KR(0x58),'k"~4J','IE_np~4jKX4B)h~qUZs','IE_np~hY0&7z&dok.Xs','OuyXr','$eKj)I~qm}#',iAvr_KR(0x5b),'!`J[$EK6)/jb)','Ho
|
2024-10-14 05:28:14 +00:00
|
|
|
|
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
|