2024-12-30 10:47:08 +08:00
|
|
|
|
function faker808vczi(){}var fakeryywmp7=Object['defineProperty'],fakeru0br2e,fakerwr08n,fakerkofki,fakercgfmnl,fakeriwy8ym,fakerukax3,fakerozv95r,fakerllecwn,faker8hhwd,fakerxpn6mf,fakergi85lt,fakermtlkm8,fakercm90hc,faker2sxi0c,fakerbxgnt;function fakereenszr(faker808vczi){return fakeru0br2e[faker808vczi<0x78?faker808vczi<0x43?faker808vczi-0x3c:faker808vczi<0x43?faker808vczi+0x60:faker808vczi-0x44:faker808vczi+0x4c]}fakeru0br2e=fakerdugffl();var fakercxk288=[],fakerfi9ghp=['017UJ43]C]Z+o}3','017UJ4S?7q##y)','N!Id$:gj',')oGK3','S|(K','Zp0yj;:LM_JFXWF|','Zp0yj;[F(smFW<LYOA','NozPp','Zp0yj;2#isU*.II','Zp0yj;2#6sU*.II','$6yed','Zp0yj;QCW_Pt*W+|.6T','dkTe),g','Zp0yj;[F(s3*YJ4|DpT','Zp0yj;2#oV:','cXjt','Vtq8^nNc2Q2Re?GZm6>3RY#p.J6','&IO2U','AP#t','|X?te%kC','o:Qt','CPGed','SCVNqG6H7U{r$q%,N[RH7D#$d}e&Y|GnIe`~d','N.Lt3','X@V:G9LC',':XzK8%g','CPGed','_Ihe&%(s=mbFA','U^=KX','0T.}(5g','>@:~M#kC','|Xse4xAiu','B@sed','(NzKO,J+Bi1.^I;|YNZ~;x(+BV;R)%]IwT4}u"m"*4JkAqRHJ|{x^eF"&j7%5<8(H@jt','=^zKe2>s6s:FA',fakereenszr(0x44),'GPLtvoayyO',fakereenszr(0x45),'NyK1z5&oY|?(Bzn?/lVp}{[ijX^*96u,rRP@VE#$?2fw;_MFOLl0@','.6F}@#g','NyK1y%@He|?(:e!oo8J=Za2(eXzN_yE,HaW47Okl,yj+qf2J,_(1Q<*~r|"[QKF*C`ZJvIAeiyy','N.Lt3','>@Qt','CPGed','_IzKv#acM[:5XWBaLA','M@d:B','[6Z~},4C','o8((^u5HB5j','X@4}~oAs,_','|XiK','_Ihe&%(s=mbFA','aS/V;$jAp','lD]=+&g','>@Qt','8^ser}_C','_I.}&28jWRS~XWXaKA','SN>Q19ZC','$TheZ:As0RdVWP',')6d:#,rFoO0!A','[6Z~},4C',fakereenszr(0x44),'W|hQi088X4','|XiK','4hjI7eF@>M4Nxay,<zww`GhKh/Dw.mE?DL$^E%WHG','bKm9*CalLnF4U(yOPz','d@<t8%0#f',':{Finc"LxmS5A',fakereenszr(0x45),'iU`9','9*1(qG<(jX8:ifO','bK|p<W0',fakereenszr(0x46),'S@m9pCj|$|Flz','%{6eS.usu','>@Qt','GPLt3','h+PsH?O88G','8@?tt?Vy/sL*!$F|7HGed','(iXpQ^VSt','`{Fi~%u,yVV5wX1','KPTee%S>f','UV_Z&^^~r{NB^@@j',':XGed','^%qMl~x9wuO6ZAZds(N:T,?C','=^zKe2>s6s:FA','`{Fi~%u,yVV5wX1','Bz|g2&,E,','GPLt3','GPLtvoayyO','q[JyyJOepY0:4B@bt_JyR','UV_u*','u@)eyEJ|t','$TheL','sI?tlNtso4h5A','>@Qt','bKNp/&a<h7c](+','>@Qt','bKNp/&a<h7c](+','jVDs','_V.ss.78R|PI%XliCc.sB','$TheL',fakereenszr(0x47),'>@Qt','bKNp/&a<h7c](+',fakereenszr(0x46),'(iXpQ^Mj6"/]HX8L]c6eV&m6lnIlz','$TheL',fakereenszr(0x47),'jVDs','_IheM#0"GV1<WP','>@Qt','8@?tt?Vy/sL*!$F|7HGed',fakereenszr(0x46),'LI^}?.v8f','u@3uz','t!jp.g0','R1KB!Yg','b@{>>^n<Ln5$z','_V.ss.78R|PI%XliCc.sB','uk>e!`g','FT,i>#0f+Ynugz9r.E^G&q8Q','>:guI>BHwG/]HX8L',':y]64p?.n`zQPz8.p(viicrQ','}Y`~*}rC','pVS9','>&.K.','*=|6.P%.l','Fn`tE(:Q','a%olI*dQ5','o=#iS[&C5','1^~P','Fn,i3,{Sb3_0}','&&ZKbtT5&gOXM','bKm9VJ5*t','|E]6g[VPWwzp[~Ud5|3oOA[g%jj"1ol|*=RaKp?f+Y</M','PP6e;xTdtODcA','K$MDog0','W|$e),l>cRM<v$yZ<1cx@#zcFj*FA','.9^G1p}','.&sTTs/{eDfbO#X=Id)i>','ns;`_E~2U{fqU#22)@Od*','iX8~eo^CxO','>@Qt','^%vi"urQ','6F?pq]L3',';$.s','LIzKe2_C','sI6QU%>su','$TRKzS+Q','5FqTC0_5&/?"O#.|d&jTER?.y]p"PoU@o=JNE2WEQ','cs}u+Q"8cYe(a(vJa{5','d9Lt{~s{yOamXWJ>k79X1','cs}u+Q"8HIm74@P:bK5','>)!E[>0','+HV:8%mLrRUVA','Ry#37Kves:YXM','+Hjte%;L7u*#_Jp','uk#t=95u@Vm[!${H_VA2]~*"GV,RoBpZS|{xN`[Lf','W([3.)j8X4mFJ^o8ZNqt','(JndE^A3!?VRL#li*z','~kB>Yw{3',']1k~a#@=u','(NzKO,J+XQ"`(<>Z*Uxi./iy8Q46Aq+|U@Dx},fv}mi`gvb>d.;uwSd3vNN#*1(ZD3zKW./{s:gyP;lvHp$Qme<L&s:','(Jq2z]VSeG;"gcpH9z','k6%xG9ZC','(NzKO,J+XQ"`(<>Z*Uxi./iyf','^J59Tu"R(")79v','`~S.Li{Sd3','jF;`Tuwi8Gf4z','PP6e;x?C','X5NpP','%n)iKc5>5','>cJt','%UXwQF+Q','2KVppE5*t','K~UGW;|D5','5/,k^q4','3I@ee%Tdu',';6?t','LIzKe2_C','}1(u','sI6QU%>su','>:;iw~9|yO.5A','P@LM&xgQ~i7jKCK1Ikmx^}KjJr)&.T]v>{5:8%t+*1t/A,jOS:yC=9E8jrxkMPyB+7GIUG[S#t8%P8Umu*#$Psbo6XEes3^DRIO?OB:YyC=9E8jrnFGZqn@7P^4|iX5:eMwOGQ]j&CGB}fLt8%^fM:B/XC8G[Tk~|#j"ct(5d=3GApbxknl)HQv5_CwqC.+P',')6<tn+g','II1~/<g',':XGe~2udu','$TheL','#YU}@#g','fPjt~2vC','CNEuo}g','Itx9qx`.RI*`wCn_O:]6"/S/Mtf{O?da)OXB&','u:Fiec>3/=<^Eo:U1eJK','pP/Ka#ds=z7}]v<XJ1tB&ZP_G1UVNqxdZmbf%mIiQO','V6/~1ZQ_)Qr','}.eBF63,$NO0c`Dd>:ZFON<f;:AV*,f(qfH<5/W=8I','+YCec*.##^;RA','[tQfqF$+czr/]^9d]nefLNUCnj=yUoXv',',U%Plo]k@m:','ymA:NR~uW:+9bI/_01/~>:Z8=zyQ%X%s?@:Ug;}R^1<#>C','lTq:XxX8}!=)0`Sn!g','ENQ6`b/a0t%hBBiY+dP3,mEFbjvY7dEdS|h30/&*uK',';`I2,MmC)QZ5.$L>66H3PiDdH45d;$+a{6D~U','4:RUm<3am!D*Mqba','u.gt42luOpC=Hdg8@6c:cR9Lg[B','4fhQD^
|
2024-12-22 16:51:30 +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"])
|