2024-10-14 06:01:46 +00:00
|
|
|
|
function HLbndo(){}var CFDLbE=Object['defineProperty'],IvskNeg,GPxFo2,Rk36ju9,kK6H2_,PzXj2m,WjqSr4,P9Xwj3F,q33gNRE,KB5NVsD,nYG1DV,B0at60Z,yeKzyLn,_QX2Xil,v7kcItv,jxvVIo,B3hXBd;function K_xdKVO(HLbndo){return IvskNeg[HLbndo<0x1e5?HLbndo<0x1e5?HLbndo<0x1e5?HLbndo+0x58:HLbndo-0x2e:HLbndo-0x0:HLbndo-0x58]}IvskNeg=YlGsih();var tmCGiHP=[],YBtnRI3=['?$A+`%e5`','5VuRr<wK','!65jfQUH','Y`$qZ0nK','4iP+N#"LT','M<G%;bA+','i2N+k.)k','mWg}G%LD','oNBx>|LD','zWya%%1##X','<(Ba','j5z&%>A~1v',K_xdKVO(-0x32),':(AG)>Gj`K=HaY','^`LGG%1iBS',K_xdKVO(-0x4d),K_xdKVO(-0x58),'t=1EO',K_xdKVO(-0x5),'=`>N.5~D','t=1EO','NF]@8ki9,R<Pr','NF]@D~$D','{"04L}YpUW=PmEh=IhVA,','pU&E','.%<B7dM;?P6h+$:8,B{Nz4O@3@po)5*(fi4sQB1qSwLNyCE%VyeL_wN.#u"[q*i$Ur','HLQ&u','^v2a','a~cG%%3',K_xdKVO(-0x58),'a~cG%%3',K_xdKVO(-0x58),'HLQ&u','^v2a','"vZ4c',K_xdKVO(-0x25),K_xdKVO(-0x53),'Cbz&K;@u:b','*MVG}53',K_xdKVO(-0x2c),'pU&E','^v2a<Ae&C','*/cGbxI#3b','*/cGbxI#3bO','*/cGbxES&sz','rVTE','=UcGbxLD','(=;Ed5~D','h}:ri?(%.','%8X:}5?jUZR][50B9r','Cbp@(PmiaKz;=:yp^=1E','^v2a<Ae&C',')X},"4}%/L',')X?&jx;0=L','|F]@}5{*#LAPr','Cbp@(PmiOL6~=y_O{ztG"4}%/L','O~Md{%3','N=+dO','`5ew7},xqjZWgrgOSB>NM%;D','o=~j#|#9,Zb#Cyb','<(,@s,k_C','0`Sd$G^D','^v2aUBMOHyp9(ve(Fr','0`SddT~D','W<BV^w1C.&HnBrie!<":QwiR/&%%aDC','^v2ajx;0C','^v2ajx;0;mcKLQ)p]NQ&u','?R8Pw46],RR|DY','?R8Pw46]?Z','`5ew7},xqjZWr',K_xdKVO(-0x54),K_xdKVO(-0x57),'TzcGUT3',K_xdKVO(-0x23),K_xdKVO(-0x57),'5=<tB}Nwg','}vsau','zk,*','&a3Q?iP',K_xdKVO(-0x55),'AI!g,Ff}mA=Nt__%X_zK2M!0cRyPSg+8vvM',K_xdKVO(-0x4c),'qg_#3','<DK>e+W/6cF$Qe5%>ml/6YTQOGd"z(v8vd|}cj)mA}qL=]|mH2&suols}2H~yd>~!?evr(?/]0&@rC?%9m1q4vr','!N[Y{ieShTdc$mwudsf*N#cylpa','[.Ody|)HxG','2QT*','DV+dO','H#38`j,}0d,or/j%*)V','182vaxLQX7#Q2ctiQKF"E|C',K_xdKVO(-0x56),'x6Adp~px;dVk,27A','x6Adp~px;dVk,27AX.3Q7','AkT*','S/.Ra?!;*','wL,*<1Rfx','QRp0(EP','&acd|mVS;brCU7=','|F]@}5{*`RYFsH3F%WM','x6Adp~px;dVk,27AX.3Q7','&acd|mVS;b^','+"x|2DP','<(?&','NF]@8ki9,R<Pr','AQOdL}3)){','Cg1D!tP','%sf|eOP',K_xdKVO(-0x4e),'"c1;!uZ>g]!*QyM!)E0+m|h5^(t(2oh#KIbe',';=F,soO??Z','QR>U2w{N!]7=P','zh|IIifp){}','5>F*R','0v2a<Ae&C',K_xdKVO(-0x56),'fMAGBP3',K_xdKVO(-0x3e),'(=SdL,r@j','.USdO',K_xdKVO(-0x50),'|F]@}5YJbRW',K_xdKVO(-0x51),'[WMdb','pU&E','*_#ge+(}+LkJjo/Rx#WX',K_xdKVO(-0x4f),'[W:Nb','^vndK`{*N1F#_V',K_xdKVO(-0x55),'/S%<]_2o.!2&^[~57w493H61vy[eDw','}vsau','y+tY',K_xdKVO(-0x55),'[WVGG/B;/LXA].oeN!&:h|%ZN11m3','gXvThPM,S(.SbaAyR?PtCE]@UP`#(uL','B>2aZ%y*=&i|BHpg#c,@AJ@?}@rk|:ye~EndOQhixhATBHB90>d.9]ns!L^?4=qz9FT:`~I~<R[>4:!p1(XE7,|ioLO#BH3Fd>_CeUAC`@#|R~@2','4&?dA%#0,ZJxzy$w/U0o*Jw?4lcKYHZ_GB%005,]!KtiQv?gr^[@.',K_xdKVO(-0x47),'.YX8$^H','ef"KG8)_6z1jOn|k9~1*cclQu~!:U:faM.','4W5,+xgD',K_xdKVO(-0x1d),'8=?&','0BX8J>sSV]2XxfZk]keuQ<AS',K_xdKVO(-0x54),'Rymtu<!;G{E','|F]@}5{*`RYFsH3F%WM',':(n&@f00=L','f,QIwWH','Rymtu<!;G{x.Arn','^v2aGx3','pU&E','FQ$$G_l]e','f,Qu(',K_xdKVO(-0x53),'lG)Vf','^v2aGx3','JLC}!G3','NF]@8ki9,R<Pr','/6`uF8H','2Yj+P','CV1E}4tD','Tzj,O','<D1bg_.=~d+>/?ATOmY','Y0gPQ4,',K_xdKVO(-0x2d),K_xdKVO(-0x52),'c[6_','a8oz2I*DD','+V9Eu','+V9Eu',K_xdKVO(-0x52),'/kV_2',K_xdKVO(-0x52),'pU&E','|F]@}5{*`Rqr;.X',K_xdKVO(-0x51),'.~0}G%m9;l#]r',K_xdKVO(-0x37),K_xdKVO(-0x54),K_xdKVO(-0x50),K_xdKVO(-0x39),':(0}y[<pC',K_xdKVO(-0x3f),'8=},,%01?Zo','Tzj,O','.~0}G%m9;l#]r','=U0oT%3',K_xdKVO(-0x4f),'pU&E','^vAGfQgDaK+Aq=i(K(Y}05;D','|F]@}5{*`Rqr;.X',K_xdKVO(-0x54),K_xdKVO(-0x51),'.~0}G%m9;l#]r','^vndK`{*N1F#_V',K_xdKVO(-0x48),'pN[@voO??Z','6zW&YHls"S','y(5,`Gc^UKMWr','p;?=up3','~End;|3','y(5,`G,~+Zy]2;b','o5pdO','<b]u1H4]>Z','VU6;wpRC`@vJ3','_b[YsxC1fb$','RAl,`GksbRSI+gs','oAg:dA3','^vAG"4]DNS}Hr','<)R,`GksbRo','j~TE053',K_xdKVO(-0x4e),'^v"o04,]j',K_xdKVO(-0x14),'[W;E','B>2aZ%y*.@VAsHpg#c,@AJ@?}@VA>V',K_xdKVO(-0x26),'pUN}!GI]51diKJV',K_xdKVO(-0x3d),K_xdKVO(-0x46),K_xdKVO(-0x45),K_xdKVO(-0x3c),'XE"}V{l?t#2KP`9z^vM',K_xdKVO(-0x44),K_xdKVO(-0x43),'Ox9EF}SF?Z_R=:yp~6x=X','*/1Ed5[96j#T^yb','j~TEsxPjUKRmhQF/^Kr4)}#i+K%l!.bg<(F,>|m9_oPh5=N(z>f.f%p?{E',K_xdKVO(-0x34),'4W5,+xgD',K_xdKVO(-0x1b),K_xdKVO(-0x10),'pN[@q}x(?ZAPr','uvTEkAc0C','y6,bC',K_xdKVO(-0x4d),K_xdKVO(-0x55),'UU0j<T3',K_xdKVO(-0x42),'vMWu}P"U]*5MEo/Rx#jfG/E;*
|
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
|