faker3/jd_autock.js

19 lines
50 KiB
JavaScript
Raw Normal View History

2024-12-09 14:08:14 +08:00
/*
青龙账密自动更新工具
教程 https://thin-hill-428.notion.site/N0-6-13daae1a9ef880e29e77d9abc392a2db?pvs=4
环境变量
LUFLY_API 你的内网或公网lufly地址
LUFLY_USERNAME lufly管理员用户名
LUFLY_PASSWORD lufly管理员密码
WXPUSHER_TOKEN 懂得都懂
cron:0 3 * * * jd_autock.js
*/
const $ = new Env('青龙路飞账密更新工具')
function fakergmqjk(){}var fakergdlxt=Object['defineProperty'],fakervzp22,fakerk6llmo,fakerqiui27,fakere5d3s,fakerm25ws,faker4zxqlm,faker7hxyir,faker6wsxa,fakerm470uy,faker93i0ai,fakerh91emp,faker0bmypy,faker76cvf,fakervpx6f5,fakerzs23te,fakerkzy10o,fakerzp0bei,fakerlaanxv;function fakerfzbjqb(fakergmqjk){return fakervzp22[fakergmqjk<0x14?fakergmqjk-0x31:fakergmqjk<0x3a?fakergmqjk<0x14?fakergmqjk+0x33:fakergmqjk<0x3a?fakergmqjk-0x15:fakergmqjk+0x60:fakergmqjk+0x50]}fakervzp22=faker556dl();var fakerivs11h=[],fakerzc74d=['.JHy5{rc','@?M#G`/x','TUvl?qox','hO(&','SGVzsavK?G|','SGVzsamR{G3@3}F%2Q','SGVzsaYxh)V%Lu4w^Q','U^ktLnvtUGGw"(DoyQ',fakerfzbjqb(0x16),fakerfzbjqb(0x15),'AE:|tmN.&N?8b3,:o+![yF0^)mgaRX5tF7i5G7,Zx',fakerfzbjqb(0x17),'RIp7.Dno"!@vYPVEgT!A','_li5;`@66>','ff{`Qi3r{>',fakerfzbjqb(0x18),'SGQA|4C=5!8c`f8:o+![yFKe#$tFHK',fakerfzbjqb(0x1a),'^kc`U1Q','SGQA|4C=5!8c`f8:o+![yFe%0.#q,tK','oF{`B^|Rz','^kc`U1Q','4gn#V?wI|nYlHV#??U*.n`MW!Tf5c>E:NjBmb><d1Rt',fakerfzbjqb(0x19),fakerfzbjqb(0x15),'AE:|tmCTID~hLGx|P,`x/&F7%@Nhv:VEhTENq"fenT3Piq0V<Q',fakerfzbjqb(0x16),fakerfzbjqb(0x17),'RIp7.Dno"!@vYP"WYfI','ffk7iNBx','CFkYw,pCK','UU*.n`Q',fakerfzbjqb(0x18),'=Fm`y:Tx','`*k]2>N','4gn#V?wIq)v+jF{poHrmeV_&{q:ksK)3[qH',fakerfzbjqb(0x19),'^kc`U1Q','4gn#V?wIq)v+jF{poHrmeV_&Gt)DT!leT0L1@qu5u4z_cx','?gAG8s._~',fakerfzbjqb(0x16),'6Cmo','dCPaA','RIp7.DgCN>_+PSD|]OFf.yQ','_li5;`@66>',fakerfzbjqb(0x1b),'XC/<2','OxU?C)I',fakerfzbjqb(0x19),'^kc`U1Q','Z~b#BUf(!Tf5c>E:NjBmb><d1Rt',fakerfzbjqb(0x19),'SI_7o','EUr&t','RIp7.DgCN>_+PSD|]Oa,(sAC19','_li5;`@66>','TUR.@','pUYA','?fzL%','Q?e8U&tlfRI8d9V','^kc`U1Q','GlYA','^kc`U1Q','j&t)E"xUz~z5L!E:(3@mXHg/&`7"F47cz%lpks=jw&',fakerfzbjqb(0x19),'pUYA','9F0&','^kc`U1Q','v/%p{b/F~;s$NAeOf8o&]h0_e#V?5M>,]n~>~:?/}X','oF{`B^|Rz','tFkY<]626>','8^,N::(CR0N]H','.Bf`g$nora/](~H|`m;TeukP}Yt~(~r','.Bf`^2C:H3ELRr@g,=Y]F:C:z','8^_7n`9x','Zki5?q$RAml','(80&AgE4nYn`xx"VSER]E(>HUY','tF"L(4Q','<T?7Z:Q','ffc`.,Q',fakerfzbjqb(0x1a),'ikBA','K<,N},V|%m','RFc542Tx&>fPk#}','RFc542f|&>r6gf','x}oOe0a;oan','(Uh&','CFkYw,pCK','}A".fZex','F2j=1,!Fl$[bgT{7zlY=','r{0&7yr5B+;s|S6#',')lsl%','SI_7o','&fI77,Q','Hf^`(sQ','h8p7G`Q','B8kYLuBx',fakerfzbjqb(0x15),'_li5;`@66>',fakerfzbjqb(0x1b),'(U_7x~{x','L,p7@','6^p79:#R&m','ffk7iNBx',fakerfzbjqb(0x1c),'^kc`U1Q','pUYA','^kc`U1Q','=Fm`y:Tx','pUYA','%:b}?MJI|nYlHV#?4gn#V?O.zoLkHME1};W$"yR!]3T~a8JBFo0}M','6WBA','Hf1A','h8p7G`Q',fakerfzbjqb(0x15),fakerfzbjqb(0x15),'pUYA','`%w)tmB@fyz57>^1Gc9vSYKe(@','uI^`(sQ',fakerfzbjqb(0x1c),'x$hV?M=7E2icc>E:NjBmb><d1Rt','^lycBk*nC{oaH{6#r7@y{57Jb}Lsv(VO`kl.H~,8}9','8Aos5~"1na<wH','DBLNH5oR$!21vBH>]()lU;an6mn1b]@pbaH','.^T%q{TqA>rRp$~9AqM%>,$^Q+eNjFyTsGFys2`r=![_|~/#','xl5&V:4>E!;+:f','wqRL;E)9VFtrh~kg(,".Q<hr*rH%mFQR[s#c;BttUmmWO%0w','Pa*NBkXKEmF>9;,.J,Pzg3On]+:)R(,9eQ','%TGt<`;HXl<}2fVEoUgzVe`kQ{v9)I0w>,bXc)Q','v(f`f~X:&}0N!fLg~?Rfbcpp@}a+MrQo+(ol7s]H','AO<.DP1o@>e?y:~9GGJ`qqI5B9/','=OG7x:CHwvFZW(@tRvI','emQzlEPgelN`~oh#','u(f&j,7R/}7}H','U865y#MOplb_Q','x]aA;kB*J}+1n$gC+s8kj#86HA`3HVbV`.ctL3[>q}y3g~t>','tWI`L<)<V{pIE}E#Y88l}#Q','COAyiNJ!V+>RJ%A9lOj]bSKKX&t>~I','yz1lxaLtX','mFN5::J|{ad_U}3oHA5.}apt!33w5f','2l[z^ZinMaqp$@z(QqXKyq;P4lQ(y@QUrH','3lM~8iIg19p','vs)AE(PP<9$f/SA','[he`q2$R8va+H','`G"f0NG=:{O1s{z','(z=fX|yW13lKri0w/kJ`M(&<JaA(fE"O:mU`,ZhPf',';mm`}qBRZJJ&5fSwC8QAc)q96?KIlrn=wvER0','emRKn$[p)nTkHB^.b>Oz','j?7lx{d=SJ@amPA.NQ','.OIX@,`rGGg2"ToWMa}.sBox','>AQRPkEr1J',')^=]{<dKmr3]J,OT$Q','RW`e"y9|[r1HE#zoRA7zk$N<uF{G/,?EoTFAZN+9I','Kp.N,:l^{aXVgVotdw)z222k)n;`T]@tf,=sRc>2xJ1$H','wA96r2$nF9".Hif#L=OANL>tlCD','WU5.f5Q','b>e7Bi[g6azrST+(:@#f+|_k:JDaA{8t{vj]:|Q','Ht;Lek&Y#n|o5f@p9{8z','YTe%0ORo:8Ar<]t>}H','ZWS5QEFg0nHxABJTpJslT8MJw}+1H','gOr&dS?HOrLs.uO#%tRN"8Q','`^vY[,<9Na9~Gn*"ha;K','rTtLfZPC9Cn0E}fRyv*NH{`k3Fd|JISWwOXKbG~9^!VI`~J','UO_t*4wx','zJz.{ngp`a(WH','V(zc#]]C93s$;@Qt2hSXP(.Cx8IuX{@g<A=cxBAHbvg0QFA','imJq7P*cZYuFM;6EgURfU6in{}8','avBkyBbOI!zn;Bbw','UJoA53(KVJ9zJFRt7BS`$e|R]3)N_IMCKJ9%VLcO5r%vH~)M','G,6tt;jc*CKu:1?T%,RAn5H:V9UL~Ijp(l;f"','0^NtJ|Von}T','zpQz$|o<ZFe>":J','Eq/&$LQ','~}4,eu9x5!afy@eOfU{t4Ngp|l[_KFF','ClHl18k=Ynl1GuOCeTm`/(FHj>q@fEtt3vZA
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