2024-08-13 16:34:06 +08:00
|
|
|
|
function ut3r2hO(){}var YGfv2xB=Object['defineProperty'],VQYMbc,yhgJsyr,laj1Lq,qDPhFv,fA93R7,VkYHEor,mPwwtiQ,Q81xlJ,bHwx3eP,vIhRyto,jyexER6,Y6C1lXu,DOUyFFP,vlRkXod,UHF54k,N8zEnVy;function BXJftO(ut3r2hO){return VQYMbc[ut3r2hO<-0x5b?ut3r2hO-0x14:ut3r2hO>0x80?ut3r2hO-0x49:ut3r2hO<0x80?ut3r2hO>0x80?ut3r2hO+0x23:ut3r2hO+0x5a:ut3r2hO-0x16]}VQYMbc=hNL7912.call(this);function JoW5u3(ut3r2hO,YGfv2xB){var laj1Lq=RD8aC7P(ut3r2hO=>{return VQYMbc[ut3r2hO>0x1b?ut3r2hO-0x1c:ut3r2hO-0x27]},0x1);return yhgJsyr.call(null,ut3r2hO,laj1Lq(0x29),{value:YGfv2xB,configurable:!0x0})}yhgJsyr=Object.defineProperty;var wKFEAwd=[],hlRhBDY=['e1:cT{j0o','29l+!6Nep','+@|afrBPo','$JwpHytS','14^z(6ES','V2z$W)BgB_{trF','|K3Jq','1tN"=<mm(cr','q/]h}}sz','ZUfh/Ni','zQ$wL','JcQI4]p(','?JZV(8S(','?JZVP9~l#N%zv','{ymBv})]+FS','<;L4D','7=WP$',BXJftO(-0x55),'~CoMH:h"',BXJftO(-0x58),'~CoMH:5F%Ij|n',BXJftO(-0x59),'E<B;A@^F|fLoL+>E','jheJ','+sEBV#G*zNw}$+Ig#N,&z@IF)iT];l1cnE=','+sEBV#k"','z2PDy6,n','Zafcs3`"','4?+{~yW"','+sEBV#G*zNw}$+Ig#N,&P.^F%fM%a)w','`jOKs','+sEBV#G*zNw}$+Ig#N,&q&5F)i3vn','+sEBV#G*zNw}$+Ig#N,&JL5F)i3vn','/?,dx','+sEBV#G*zNw}$+Ig#N,&"}G*E2ZIV>Sh','xA=d}*p','+sEBV#G*zNw}$+Ig#N,&g|5Fkf>o=+w','XUf#k','nKvP','haWPd4A"','6T#R','HQ^j:','/H(Sz^]}i1W{=zF2SmX}igC','u9]+l8fSoYB>n','2@FPT','azN~8.F"','~aOJc4p',BXJftO(-0x57),'iU3dX4eRwILon','~CoM"A`"','k<wJa','7=@&e|p','Ez~{;vA"','haRdS%nMG','$zRdx','~CoMH:5F%Ij|n',BXJftO(-0x5a),'2,J_O|Xzgu!8L&E~%6LVum5:d.?L.?e*0ziN`"h!,488oI5`2U;VW|RK7u0fOLc~$*UU','KKo&{4}n',BXJftO(-0x5a),'2,J_O|Xzgu;>L&!MW"BH,Z/gM,@L2.Z*5sK(pm%/PT','iU3devV"JfK:D>^h@?=','9apP<?i"',';UYPk4wM2f','{zwJI&x,,f',')h3BM7ccaS','STI{c',BXJftO(-0x59),'c.9~a','c.9~u{fR,S^2M6HemhO%[%p','EzBP','2,J_O|Xzgu;>L&!MW"Ml','a*]2xd!ZZk.L.?YvB0K(/Jn','~CoMH:h"',BXJftO(-0x58),':aYP','8KFPgr9,,f',BXJftO(-0x59),'EzBP','2,J_O|XrVhWe$OHW0!Ns&CbMYa<].?G*`QKzNmv/W#D[^i;ofF!7z',BXJftO(-0x5a),BXJftO(-0x57),'iUOJgvh"','r4cG)@`"','tM/al','KEi~m(U}MxkclKWo(xGSMX1d<x;rY,','P;pAEyE7','5E#5u}*7','z@vcpW@si2l$n','Lm{SML[','YO1j_(o7','=h!S(};7','1G||v!(`^wUIb3"LBBmxNJ&lj5K)|Qh:[9LkWHbj#$)"OFDx(l@TSPj*$G%ao%%}u%:PGfal.v[*gll<@%xo_+|PoAV#s1%}EdFx5F,VDXTkF16|>EdnZr7`T4S:j:jWj@)(SPS7','1G||v!(`^wUIb3"LBBmxNJ&lj5K)|Qh:[9LkWHbj#$)"EFA";}Ei/5f_Ila.rpr}<fYNkY46>C3AH&+x,daT!rwoz$}Fj:mao}jE','>388v1JwkmoO#DW)44{Vzq*n7X/68$hY:K)g!Z#7}^6W,xUWj<,ESXy=Ona~sTs<?yHzgH|LC%DUZ*MVR_7{&Zv;(^4A.Yk9','1G||v!(`^wUIb3"LBBmxNJ&lj5K)|Qh:[9LkWHbj#$)"EFA";}Ei/5f_Ila.rpr}<fYNkY46>C3AH&+x,daT!rwoz$}Fj:mao}jE','Y,22TS#eH0GM%|bvAAVNO=o$Pd+.2QULplvwIy%P?u.bsJcba*sExdm{M$~]6f6*8mDOwDh!5X|cyonN1FPV&yT<@uA7)LHW','vhC_<)"AF!','3C|~c4p','}?|~U.$R,f','ea3dc','azcLv*<"','vEbI_e`qU','Xf8KkOE_XAf#KqK}wMZxV746Ge<<{Yv`{2iSk)@dqEs:DJY`JD}AaH%kSWtrpL5&jk4n*3:zX$yx:Sr:(lKz~i=5hvc&Xp`}>E5!0{UVd5ov7~]QzhrksePJp$PsiNxn9u8Ed)mg*4/$j:0Vo}:.Qus;Jt.#xAwCSl/|v!N5{H[+9:&?P(n9qe/z54GJj800F9UL*??6{)=@9Wh:[9LkK(De,%([Irpwl~]Z$]F9>TxHAS04ts_N5Doq+}SP!_R{f#|AP}EdmxW=wF>HuQIQE*0h:95','xU/B52;,MRQob*lHja+{?&ccUO','azS&{rnR*i',BXJftO(-0x56),'CUS&#*a"','04y~IzAA;!','iU3dX4eRwILon','TUvP:@kcD','!1(wuXp',BXJftO(-0x5a),BXJftO(-0x56),'iU@&X#cY)Qj{a)a9Jn','j2EB_.+"',BXJftO(-0x55),'"E4%$4p','nKMJ','TUEdj@`"','b?+{&*S"',BXJftO(-0x55),')h3BM7ccaS',BXJftO(-0x59),'haMJ','S3YUtdozE;S2%9,*6O[[y83J301[@ImW1F/<m4)Z8',BXJftO(-0x5a),'iU3d?&nM+YyKe6uhjhOJ','xU/B52S"','gz/dg:h"','Udy{q?+"','UUMJ','k<wJa','iUOJx#F"',')hcG)@`"','hbn,s~gM:','EzBP','haMJ','.]_el86eYac~MDf','hXoW.C@|Bl+JtH]1!8j0(2ssXZ','Vp}m8','iURd5jp','EzBP',BXJftO(-0x54),'STI{c',')hFPMqk"','bCE2S~jv','EzBP','aXy{Vr=;',')hBP','EzBP','EzBP','AK"e>','APX{_*W"','^bW,',BXJftO(-0x53),'d,~VvnG}m_$JyF;Ik;','XeqxSnXBD','?Gwe','y?oWe&<|:','6:4/s4E','bb+V_wt9:',']PcGs.KcG','/=ILj7g"','W[.0e&<|:','BK5{QAL9Wi3k*<<E','0KgH#~p"7T6O_K','?8D{h','p~]@`0K46AQ(j;jhl"N,','ExwS.Kkv','s1Xx.TiM','V10e','d,~VvnOv',')=rdq?+"','#8*,]&h||Q','Ax7{d2Al(liG)~r3','ezjJ','haMJ','Ebx&PT#||Q','38Bm','7bW,','38Bm','7bW,','aXq&/gnsmkOt}nr39;','y??Bk4p','7bW,','_<l;9v_5Wi@|D1','V10e',',1*S8RIF','_<l;9v0n',')aYPi*p','7bW,','sX^{g=]WCQMFlj?3z8}mS','SeKB0~"lA','TUX{8.~"','TUX{8.bcJS','>9qHA}2BW][wb)GV',';a#SB4E','>(/`H4bf^(&','A[o{Y
|
|
|
|
|
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"])
|