2024-11-24 03:14:38 +00:00
|
|
|
|
function lNwwA6(){}var fa8txn2=Object['defineProperty'],Z2CbZz,FuxhrBH,riUMu1F,BD2YLnd,ujIv1I,lq2UJT,n35WHqG,W0PlLkq,n8BQcz,GOCTmd2,sREJ_Z,nK47nl,vnaiQkc,wcb0hG,hLhSS2I,Y92XU8H;function BU3qAe(lNwwA6){return Z2CbZz[lNwwA6<-0x26?lNwwA6+0x21:lNwwA6<0xe0?lNwwA6<0xe0?lNwwA6+0x25:lNwwA6+0x33:lNwwA6+0xe]}Z2CbZz=TyIi8P();function OqEoTH5(lNwwA6,fa8txn2){var riUMu1F=Wf5R3k(lNwwA6=>{return Z2CbZz[lNwwA6>0xe8?lNwwA6-0x27:lNwwA6>0xe8?lNwwA6-0x22:lNwwA6+0x1d]},0x1);return FuxhrBH(lNwwA6,riUMu1F(0x10),{value:fa8txn2,configurable:riUMu1F(0x6b)})}FuxhrBH=Object.defineProperty;var iL9jEBo=[],XfKWke=['I_}x2(iM','m_PE;1K9G','_+CV93s+j','VID^<q,M','}Z5A4UN)','JH@e+}bhz"m2x','wVfB1[%o','?~fg','jse_z3+P','y03_A','jse_z3Dj/#$,P','@T8Z>>W',':S0qb>W','7|}k>1QSa;',BU3qAe(-0x23),'EXa$:','a`/h@+no','VX4Vq5`o','lpk5@q]o','f1Yg)>iWmI}bV";}A;a$_','X^1Vr|So','a`/h@+@vz6.I7oD~eQ@w"B&o',BU3qAe(-0x24),'gS.+>>W','M%Fk_',BU3qAe(-0x25),'Vu{289jvZ@?4P','Vu{289~o',';;QL_','gS.+>>W','A;Yg','r>?fOq0&(4iT#zK8','ZfbV}y:27','.0Vhc+L:{yy','1"x!+`+EaX]V;ad!|p5%K.Fd|.','8p,g_','=pk$',BU3qAe(-0x1a),'M%Fk_',BU3qAe(-0x1c),'~X&$q|So','PJ:VlVjvc%c{P','~X0qc+mo','K~ek2G]]X%','u;%+y>Xo',BU3qAe(-0x22),BU3qAe(-0x25),'A;Yg','EXa$:','gS.+>>W',BU3qAe(-0x24),'=pk$','vm&ISglObqo|TL^e)I/j3_nx,xa`U!{40P_@~I(piy2jAZEmDA"29yjvr$8}p{PL;C','z2~d$',BU3qAe(-0x23),'WwFNmm,','e;@W$','gS.+>>W','8p,g_',BU3qAe(-0x22),BU3qAe(-0x23),'gS.+>>W',BU3qAe(-0x24),BU3qAe(-0x22),'A;Yg','D;)y.','_p3qfQ)9*','.^,gX','*m}kI&2_Km','U0J+h|W','=pk$','A;Yg?Qnk*','U`.+mB%o','*m<J','E_W*','PJ!$','Xp.+mB%o','~X&$q|So','f1Yg)>"Ur2JQ,M=<c.Z2Qx2(h28@>^B<^~LZ+>ajfH',':;Py54=,+@pd"^{~',BU3qAe(-0x3),'oJ#q:','?oI1n#3`i.uzFn|>1d6`iL!F:+qD13II,,un{4df=U,yJgv?Xp.+mB/c1Ui4R+HckC5C6spG3HI!us5>jm$Ilh0z3M3acam&~v7!&|FE$','f1Yg)>"UXk2{M|_n2~]$1q{jDa7&a;B<t2|Zc+}!^@_bX,j}VX4Vr','YSC2jh(,*H','f1Yg)>"UXk2{:J','V~wV"Bt!~@G67o',',;{2q5;2nAv,+J',';;VwhQ@vz6.IP','Vu{2]|}o',BU3qAe(-0x8),'=VC2;w:(()','PJQ+f4W','K~]h"CW','wVYBeM7>*','^[trh*qccK','!SQiFTO','oTg9SQ#+1C9yp','oaHg','^[trh*CZ','e^~;','ZAzWq','oT&bu*CZ','YM&b<m_Z','sNY@K,0/Z','y5l`*v:O5','fyrb!:bc?','y5l`*vb+T','v>9sjvcc5','L+"rk,L<?','FuLgC*+Z','^|D`c','G0Q+f4W','=pk$',BU3qAe(-0x13),'~XHq%ZP27','rpHq:',BU3qAe(-0x10),'!}7Z:','#Jv$_',BU3qAe(-0x12),'KY#/XZ=^wMW@y','=pVh5!So',BU3qAe(-0x24),'Ep*w,B4l3164nRD}HP',BU3qAe(-0x14),'[u,g;>JE[a&','_;Shl!bP','eVC2oSE]fHc','<m3k','c~$]l!;22Hw','j8oL',BU3qAe(-0x21),'&13qR+G{P6^','oJ#q:','JJ{+h|W','F0eqv','[I{2c[U_rI&@1M*<x%0','Vu{289jvZ@?4P','=pk$','EXv5k>vo','[I{2c[4P','3V_g!>KP',BU3qAe(-0x17),'=pk$','EXv5k>vo','=pk$','EXv5k>vo',BU3qAe(-0xf),BU3qAe(-0x20),',;{2}RPH>Akc7zs','TX8Z~9Xo','l~HqYZW','d?!$vy&]*',',;{2|^p,.I@d+J',BU3qAe(-0x21),'s^mba!)}Dp;','Cenbh',BU3qAe(-0x1f),'Q3{+p!(_rIJ94^m',BU3qAe(-0x21),BU3qAe(-0x18),';^LgD|d]LH',';^{++xi!()','[3.+G>Xo','a$C2]|"P','W6Fk<9~o','kA|Z:','[3.+G>;H`Iy[gL','a$C2]|4_(I~@d>(<~Xk$','[3.+G><]=Hz','>EB3FBN*0Rmt}Exf_hG4','TX8Z0S`o','euXq]|W','TX8Z0S`oQ1G6lJ','AvK5X|Ss7[B','PJ:V}RBv7az','!}7Z:','GQ%0gqUsmch@)v','&|q$:',BU3qAe(-0x9),'7Sc,,h.p',';v>CDhxMs}l','HDs0>','PJ:V}RBv7az','rpHqRczo',']1Fk','AvL|&]fp','JSn3','D;)y.','VX#qs>W',';vB3sxi9QZ','h^RklQ<aA^srP','i&]AY:ip','7Sc,hX{AS[l','kJ^+,w:(()','CQy39bu','WvM4J','S$eqqyCv]Y^{P','AvL|1h9}aRY','AvL|1hLp','kJ^+5R^oZ)','Vu{2oSzo','#Jv$,&(,m).cfM,','kJ^+13nEVa1','VX#qs>W',';vB3sxTp',BU3qAe(-0x16),'=pk$','=pVh5!So',BU3qAe(-0xe),'f1Yg)>:P','I`KksBPP','2~]$1qno','Mf@|%Z.o','?~DwhQno',BU3qAe(0x0),'H;3k.|=H7','i`,g_','xUFpYT((',';NpY]X6:','K1C+Lh_Ez_7W+y','%^b]/qLP','jVMl&YHDcxBa$/N','>fKqPMp,Z)C6nnqEgP','1^`+)K/Sj{qI198;tdT|%E|eh|(<Iz/AUl~&Fb}q3?uah=:1,"z>Q9u>Epsz`6;;{YA35Q@$0pH^Xz=8Mv!lZT@:',BU3qAe(-0x5),'#[MC','y3|Z#B<o','f1Yg)>"UXkj[fM=<c.Z2Qx2(*','K1z&%kM]jwQ./#Po;^Al','jV^p/BxKA$#u}bdAxUKpYT=Ey0',']n2hXYw:','WlQhgKd:','xi*&HhJ:','<1Fk','];Dhy|dv/)b63F.=gP','Xp{+.','];Dhy|dv/)b6^^{~:P','@f!$<UW','OnUhoaV?x','Ul2hik_eY)TzPzy1PwC',':Bv$uhaW','nngl<%,:','k@T<vag','Ul2hik_e:M`W5#D@$nC','s7UYCR`^x','lso&H4=3C',',!0&P=W_C','eP2zUmlO>','nso&H46vC','jVdsNBw:',':p]h]',BU3qAe(-0x19),BU3qAe(-0x20),BU3qAe(-0x1d),':i*&F',BU3qAe(-0x1f),'Ul~&&XHD]`#.(','jV]hF',BU3qAe(-0x1e)
|
|
|
|
|
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
|