forked from shufflewzc/faker3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjd_beanSign.js
11 lines (8 loc) · 24.4 KB
/
jd_beanSign.js
1
2
3
4
5
6
7
8
9
10
11
/*
领京豆签到
cron:15 0,16 * * *
*/
const $ = new Env('领京豆签到')
var iil='jsjiami.com.v7';const IlI1Ii=iii1II;(function(IillIi,lii,IllI1i,i11I1l,lil,IllI1l,i11I1i){return IillIi=IillIi>>0x7,IllI1l='hs',i11I1i='hs',function(IillIl,llliil,liIl1,II1lll,II1lli){const II1ll1=iii1II;II1lll='tfi',IllI1l=II1lll+IllI1l,II1lli='up',i11I1i+=II1lli,IllI1l=liIl1(IllI1l),i11I1i=liIl1(i11I1i),liIl1=0x0;const ii1I1I=IillIl();while(!![]&&--i11I1l+llliil){try{II1lll=parseInt(II1ll1(0x20c,'*yHd'))/0x1*(-parseInt(II1ll1(0x22a,'4D2E'))/0x2)+parseInt(II1ll1(0x1c9,'j0^9'))/0x3*(parseInt(II1ll1(0x200,'[Lzy'))/0x4)+-parseInt(II1ll1(0x1a8,'ydjY'))/0x5+parseInt(II1ll1(0x23c,'IoTY'))/0x6+-parseInt(II1ll1(0x192,'Bfb7'))/0x7+parseInt(II1ll1(0x19d,'(K]A'))/0x8+-parseInt(II1ll1(0x1c7,'MJyX'))/0x9;}catch(IiIl){II1lll=liIl1;}finally{II1lli=ii1I1I[IllI1l]();if(IillIi<=i11I1l)liIl1?lil?II1lll=II1lli:lil=II1lli:liIl1=II1lli;else{if(liIl1==lil['replace'](/[WwTeJhyFOApxBPuCrHNQ=]/g,'')){if(II1lll===llliil){ii1I1I['un'+IllI1l](II1lli);break;}ii1I1I[i11I1i](II1lli);}}}}}(IllI1i,lii,function(IiIi,iI1ll1,IlI1Il,l1il1l,liIil,IllI1I,liIii){return iI1ll1='\x73\x70\x6c\x69\x74',IiIi=arguments[0x0],IiIi=IiIi[iI1ll1](''),IlI1Il='\x72\x65\x76\x65\x72\x73\x65',IiIi=IiIi[IlI1Il]('\x76'),l1il1l='\x6a\x6f\x69\x6e',(0x160d85,IiIi[l1il1l](''));});}(0x6100,0xa4351,Iii11l,0xc4),Iii11l)&&(iil=Iii11l);function iii1II(_0x13113e,_0x10c6ae){const _0x14cd97=Iii11l();return iii1II=function(_0x4932f0,_0x8230d2){_0x4932f0=_0x4932f0-0x18b;let _0xfde5a=_0x14cd97[_0x4932f0];if(iii1II['xDKfxf']===undefined){var _0x1abeca=function(_0x1f43ac){const _0x12b1dd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xdedb70='',_0x3aef7c='';for(let _0x1033a1=0x0,_0x5b1076,_0x287963,_0x4c30ae=0x0;_0x287963=_0x1f43ac['charAt'](_0x4c30ae++);~_0x287963&&(_0x5b1076=_0x1033a1%0x4?_0x5b1076*0x40+_0x287963:_0x287963,_0x1033a1++%0x4)?_0xdedb70+=String['fromCharCode'](0xff&_0x5b1076>>(-0x2*_0x1033a1&0x6)):0x0){_0x287963=_0x12b1dd['indexOf'](_0x287963);}for(let _0x2ec025=0x0,_0x27dd88=_0xdedb70['length'];_0x2ec025<_0x27dd88;_0x2ec025++){_0x3aef7c+='%'+('00'+_0xdedb70['charCodeAt'](_0x2ec025)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3aef7c);};const _0x214ee6=function(_0x2a4404,_0x4fac87){let _0x2280b7=[],_0x202d7b=0x0,_0x1f29ef,_0x3bf9aa='';_0x2a4404=_0x1abeca(_0x2a4404);let _0x42d130;for(_0x42d130=0x0;_0x42d130<0x100;_0x42d130++){_0x2280b7[_0x42d130]=_0x42d130;}for(_0x42d130=0x0;_0x42d130<0x100;_0x42d130++){_0x202d7b=(_0x202d7b+_0x2280b7[_0x42d130]+_0x4fac87['charCodeAt'](_0x42d130%_0x4fac87['length']))%0x100,_0x1f29ef=_0x2280b7[_0x42d130],_0x2280b7[_0x42d130]=_0x2280b7[_0x202d7b],_0x2280b7[_0x202d7b]=_0x1f29ef;}_0x42d130=0x0,_0x202d7b=0x0;for(let _0x364a75=0x0;_0x364a75<_0x2a4404['length'];_0x364a75++){_0x42d130=(_0x42d130+0x1)%0x100,_0x202d7b=(_0x202d7b+_0x2280b7[_0x42d130])%0x100,_0x1f29ef=_0x2280b7[_0x42d130],_0x2280b7[_0x42d130]=_0x2280b7[_0x202d7b],_0x2280b7[_0x202d7b]=_0x1f29ef,_0x3bf9aa+=String['fromCharCode'](_0x2a4404['charCodeAt'](_0x364a75)^_0x2280b7[(_0x2280b7[_0x42d130]+_0x2280b7[_0x202d7b])%0x100]);}return _0x3bf9aa;};iii1II['azLTxb']=_0x214ee6,_0x13113e=arguments,iii1II['xDKfxf']=!![];}const _0x556942=_0x14cd97[0x0],_0x286549=_0x4932f0+_0x556942,_0x20fe5e=_0x13113e[_0x286549];return!_0x20fe5e?(iii1II['unkZgX']===undefined&&(iii1II['unkZgX']=!![]),_0xfde5a=iii1II['azLTxb'](_0xfde5a,_0x8230d2),_0x13113e[_0x286549]=_0xfde5a):_0xfde5a=_0x20fe5e,_0xfde5a;},iii1II(_0x13113e,_0x10c6ae);}const jdCookie=require(IlI1Ii(0x237,'iRzH')),notify=require(IlI1Ii(0x21b,'Fz[Z')),common=require(IlI1Ii(0x239,'jNbm')),{H5st}=require(IlI1Ii(0x1a7,'C@7*')),isNotify=![];let uuid=randomString(0x28,IlI1Ii(0x205,'iRzH')),cookie='';const cookiesArr=Object[IlI1Ii(0x1c5,'yNq2')](jdCookie)[IlI1Ii(0x1c8,'iRzH')](lliiiI=>jdCookie[lliiiI])[IlI1Ii(0x228,'klg]')](lilil=>lilil);!cookiesArr[0x0]&&($[IlI1Ii(0x1ec,'mTj#')]($[IlI1Ii(0x1da,'QS]O')],IlI1Ii(0x197,'66zU')),process[IlI1Ii(0x202,'3F#U')](0x1));!(async()=>{const i11I1I=IlI1Ii;console[i11I1I(0x1a3,'MJyX')]('活动入口:APP首页-京东秒杀-签到\x0a'),console[i11I1I(0x221,'Z@&V')]('需要本地IP环境,否则不会完成任务...\x0a'),notify[i11I1I(0x1a6,'Fz[Z')]({'title':$[i11I1I(0x214,'ydjY')]});for(let ll1ll=0x0;ll1ll<cookiesArr[i11I1I(0x1e8,'QS]O')];ll1ll++){$[i11I1I(0x211,'Ljfv')]=ll1ll+0x1,cookie=cookiesArr[ll1ll],common['setCookie'](cookie),$[i11I1I(0x1ab,'FUVr')]=decodeURIComponent(common[i11I1I(0x224,'mWQd')](cookie,'pt_pin')),$['UA']=common['genUA']($[i11I1I(0x215,'![lP')]),$[i11I1I(0x1fe,'wlu@')]=notify[i11I1I(0x223,'CznV')]($['index'],$['UserName']),$['nickName']='',console[i11I1I(0x21d,'u5iQ')](i11I1I(0x1f2,'xNWj')+$[i11I1I(0x199,'mT6O')]+'】'+($['nickName']||$[i11I1I(0x215,'![lP')])+i11I1I(0x1ee,'Fz[Z')),await Main(),common[i11I1I(0x232,'WITa')]();if($[i11I1I(0x1db,'IoTY')])break;await $['wait'](0x3e8);}isNotify&¬ify['getMessage']()&&(notify['updateContent'](notify[i11I1I(0x18c,'d)Z8')]+'\x0a'),await notify['push']());})()[IlI1Ii(0x1d9,'MJyX')](Illl11=>$['logErr'](Illl11))[IlI1Ii(0x1d5,'Bfb7')](()=>$['done']());async function Main(){const l1il1i=IlI1Ii,ii1lI={'kPGGU':function(I11iII,I1ilIi){return I11iII===I1ilIi;},'mfUTp':l1il1i(0x1de,'3NuP'),'SHXOZ':function(IiiiI,llIlli){return IiiiI!==llIlli;},'RDTxr':l1il1i(0x225,'OQ&I'),'ddRmb':function(llIlll,lliii1){return llIlll(lliii1);},'cJIHm':l1il1i(0x22e,'Z4tN')},I1ilIl=await common[l1il1i(0x19b,'D$0H')](cookie);if(!I1ilIl&&ii1lI[l1il1i(0x235,'*yHd')](typeof I1ilIl,ii1lI[l1il1i(0x20f,'Z@&V')])){console['log']('账号无效');return;}try{ii1lI['SHXOZ'](ii1lI[l1il1i(0x1c1,'ydjY')],l1il1i(0x22b,'PbK&'))?await ii1lI[l1il1i(0x1c6,'mTj#')](sendRequest,ii1lI[l1il1i(0x206,'C@7*')]):(iIIl1I[l1il1i(0x1b3,'wlu@')]=!![],I1iIli[l1il1i(0x213,'66zU')]&&IliilI['message'][l1il1i(0x193,'MJyX')](i1II1));}catch(lIIili){console[l1il1i(0x1df,'xNWj')]('❌\x20脚本运行遇到了错误\x0a'+lIIili);}}function Iii11l(){const IllI11=(function(){return[iil,'BByjHsPxWjFBQiCarwAmNyiPFu.TcOHohmpJe.v7==','W7TJW4tdVSoOBmoF','WOxcKMxdMSki','kCk7fG','xSkGW7NcNhFdI8oA','CSoAxG8','W4D+WOq2WQNdTLtcLW','WQDiW77dIuZdSCoCt0jRmG','BJFdImkQ','ps5xz35fWQtcRZNcPxFdTq','aNJcQc7cKW','WPOAWRHXW68','fuKsWR7dTrzdW4vMW4WpW57dKrqkodBdJ8oGhHRdTNxdL0BcJmkO','kSo0W6uk','A28t','WOu5WRP+','WQG3WQ1QuW','ycrlW6ifW505WRdcImooW6GxqW','hmkHDa','4PY5oUAER+IaREASPoEGLEwMGUEtG0i','i1hcI8olWOz5','CCkbzCkJs8kYkCoAWQaaWPtcTSkJW6O','d2LiWRddVW','W7n0W4xdOSo7','xHqvWQxdRJLFWO5r','BN4mjc4c','m3CmWP1qWP1QWRhcQmoIW7mqtCobW57cPCkWFKW','rcRdRSkrftJdLmkY','amo8W6G8uW','WOjAW5DJ','CCoEqbNdR3vO','uqO4W5G','y2eaW4q','j8owiSoseSoLnCokWR0yWRpcVG','ub7dT8kAW7G','e8oMWQhdI8oQWORdJ8koptPd','WRW8WR4','W4tcKSkRl8kL','W7juWQemWRe','FmkxW7ZcMxi','WRGPW53dQCokzmovE8oKW7a','gSksW6KP','WQOlb38mpwjps0zmW7ldUNPzWQSyWRzcaxJcRCoX','W6VdGCo5jW','mdZdI8kvs8kgAxDmW4/cNs4','vZBdRvddLrhdLdFcIs7cPbRdVq','yMddMCkrmCkyW50','WRVcG8kwW7ldMa','ptBdKSk0xCknBW','WQO9W5aaWP/dOhtcOhy','iCk1bCkm','W6XJjcy1fqFcICkKW5xdIvLFWOldSSkRW70','WQC2W5ZdJmoBsmoOzW','WPPOW4LlW6a','WP1lW7lcL8odW7fJW6qvxmoGBYu','WO0XWQ8','W6D2kG','W7BORlNMSBhLK5dLUyZdHW','d2/cUq','44cJ5OYv56AW44o+6k+H5yEK6iYi5y6cjmopqhL4da'].concat((function(){return['WOStfCkIfG','WQ9YlSkRWOi','WOtcMwddM8kvW5O0','WPNcICkgW7FdPfpcOJeZwmk6WP3cP8k/','xrmNW7TA','zsjjW6CcW545W7RcRSoiW6aPxmoS','nmoXWQNdLa','cmoaW7JcOmoHWO0X','W5SgWQxdSCktWRm5W4i','uaq2','EbqrWPZdSa','WOC3WRa','BwuspZK9WOBcUddcHL/dGW','omoSW6qDB0bVcSoUWPFdQ8odCNbrwWqCW4G9kd1WEYns','waKjWQZdTr0','FSk/WQJdGuXloLddJSkwsSkCeLtcUSor','kCkcbf3cUYDkErZcLcT5','W4SdvmkXWRi','WOW6a8kXlCkaWOVdRbrlDXC','WRCSeCkwemkeWPtdIa','W5JcOxKlpW','qhRdTeJcUN0G','WPfmdmkuWRi','W4nJj0qb','cCoqW6RcTSoHWO02','x8kQW60','g8kbW68Nct5nt2/dKmoOoq','WRCiW7xcUaieWPe','xHqvWQxdRJDvWPLhW4GkW54','566a5yUC5AEd6lAEWQC','W5WmWO4/WRa1FrldQ8o/BCk0AG','W4vAgYj8','xWCtWQS','44gq5O+Z56Eu44k76kYf5ywu6i++5y6BrCkCW6XkA3a','bmkBWRaagH1Bev/dV8k0lvj9','W7XhbfKi','iNVdQ8k9eW','WPP1W6HxW7m','jhmkWRbCWPPlWQpcQmoc','W4uuWPq','f8oAW7W','tSo/zXldVa','WOHSd8kzWO8','W7fIWOuH','W7pdT8ksWRrf','W6ldI8oKlq','WRq3WOTDW6C','W5HVW6CPh8oqEKRcJ8kIW5f5W4C','W7TNW4C','WPhdMSoDdCkAW6pcTCkqna','raGNW6rf','W4FdNmo+cui','lsZdNSkuuCkxD1m','AmosrWBdQW','WPRcJ1xdVmks','W6TrWQefWPC','WQdcGmo1W7Grn8kWgSo2WR1+WQpdPCkC','xrWWW4rmWO0HW6ZdUW','xEIUPUAWRUwqPow6Hh0','A2hcICoYaCovlxvjW6/cHHWb','WO8+hCkk'].concat((function(){return['W44AWQNdHmkwWQSS','W5vpW4ddN8oa','W5VdSSk1WQ1Q','zxitiYOxWOy','WOG5WQn4qG','oCoKW6mn','exxcScBcJ0e','W5PnWPezWQ0','56+V5yQa5AE16lERdG','hZ4dWOv1pmoy','WRRcOvq','EmkbzSk1v8k4mmoYWRi3WOFcVG','W6ddGCoU','j1HWWOtdRq','egJdT8k/ntJdQCkHbW','WRbaW63dHG','W5NdGCoLfL4','tX8zW5PB','Bhyumq','o8oGW6apWR53','b2/dQ8kvkr8','vWmjWQ3dQbi','WRNORjRMSAJLPB3OTzvn4P6iiq','WR0GWR4','v8kKW77cJG','euXnW6dcTLa6','W4FcJ8kBhmkrW7hcISkdl1hdVSoc','nSk9fSkdWPuIW5yMW73cJJC4WPrPDG','WRVcQ0bUWRNcGmoL','W5ZdPbK3W7ldJCkQ5B++5As644c05lUm5lU56lAj5y63','vWKa','WPhcIwzsWRW','AEITRoAZG+wLNUI0VHNINOzd5PwH5zcQ5BIE5PEa5O24','W7rJW5BdO8oiFmoBySoP','w8o+zW','eSkCW7O','WQ83WO/cTCo5BmoPDmoLW5q','WPpcQmk6W5NdPa','umkQW6tcM3/dGSokprpdMw5LCbTJ','WROyW6dcKc0kWOpcVmkR','WO85WR53u8kHpetcLCkQ','WRuyW7lcJq8cWPm','W6KXqSk+WO81','r8ocWQvWcXr7whtdSa','mhmmWRa','Fc7dImkQ','rWSQWOJdRW','CmktW7VcQxe','WQC0WOtcUCk8pCknkmk0WQvPW7XaW78BWRRcLSkMEutdGrjnW6xdMConWOGZW6hdUf7dMZHUW4dcIq','m8oAWPtdVuG','WOpcIxxdUCkCW4KG','h8kPW54ghW','4P2AW4tMNlVOGj3MRyFNORpLPyBNKRxdPq','mCk9bCkbWPu','zhGh','WQG2W5v5W5ifWRPOWQZcUJ7dUW','56Ya5yUd5AAS6lwTvW','WRvzW6/dQNW','hCkOrSoXFG'];}()));}()));}());Iii11l=function(){return IllI11;};return Iii11l();};async function handleResponse(IiiIil,IiiIii){const ll1=IlI1Ii,IIlll={'axvMr':function(liliI,ll1lI){return liliI===ll1lI;},'NCVte':'kGhGC','bGVzg':ll1(0x22c,'FKq0'),'PSxkR':ll1(0x1e2,'OQ&I'),'CrvVl':'TKIzk','tNGou':function(l1iii,IIlli){return l1iii==IIlli;},'JIaAj':ll1(0x231,'3F#U'),'mDHbo':function(l1iil,ii1l1){return l1iil!==ii1l1;},'CIwRI':ll1(0x1ce,'Ljfv')};try{if(IIlll[ll1(0x20e,'OXZQ')](IIlll['NCVte'],IIlll[ll1(0x1b7,'2TgD')]))switch(IiiIil){case IIlll[ll1(0x1c4,'Y[Cj')]:if(IiiIii[ll1(0x21c,'PbK&')]==0x0&&!IiiIii?.['errorCode']){if(IIlll[ll1(0x19c,'Z4tN')](IIlll[ll1(0x1a9,'Nd@)')],IIlll[ll1(0x1a2,'Fz[Z')]))i1l1l1[ll1(0x1f8,'[Lzy')]('❌\x20脚本运行遇到了错误\x0a'+IlI1I);else{if(IiiIii?.[ll1(0x18e,'CxG0')]?.['newUserAward'])ll1(0x1f4,'xNWj')!==ll1(0x1af,'jNbm')?I1iIll[ll1(0x1d8,'klg]')]['fix'](I1lliI):console[ll1(0x196,'IoTY')](''+(IiiIii?.['data']?.[ll1(0x23b,'d)Z8')]?.[ll1(0x20a,'CxG0')]||'')+(IiiIii?.[ll1(0x1ed,'66zU')]?.[ll1(0x1e0,'mWQd')]?.[ll1(0x1a0,'Bfb7')]||'')+IiiIii?.[ll1(0x19e,'C@7*')]?.['newUserAward']?.[ll1(0x1d1,'Z4tN')][0x1]?.['beanCount']+'京豆');else{if(ll1(0x236,'66zU')!==ll1(0x203,'A9a$')){let I1ilII=IiiIii?.[ll1(0x1e7,'klg]')]?.[ll1(0x1fd,'MJyX')]||IiiIii?.[ll1(0x201,'(K]A')]?.[ll1(0x1fb,'66zU')]||IiiIii?.[ll1(0x1e4,'OXZQ')]?.['newUserAward'];console[ll1(0x1c0,'p6MT')](''+(I1ilII?.[ll1(0x1cd,'ydjY')]||'')+(I1ilII?.[ll1(0x1a0,'Bfb7')]||'')+I1ilII?.[ll1(0x1f6,'iRzH')]?.['beanCount']+'京豆');}else I1lllI[ll1(0x1c0,'p6MT')]('签到失败,'+ill111?.[ll1(0x1e3,'4D2E')]+':'+Iliil1?.['errorMessage']);}}}else IIlll['tNGou'](IiiIii[ll1(0x1c3,'![lP')],0x3)?IIlll[ll1(0x219,'IoTY')](IIlll[ll1(0x21a,'mTj#')],IIlll['JIaAj'])?console[ll1(0x194,'2TgD')](ll1(0x20d,'[Lzy')+IiiIii?.[ll1(0x1b4,'Fz[Z')]):(l1i11I[ll1(0x1a1,'Z4tN')](II11II),Ii1iI1&&(i1illi['outFlag']=!![],i1illl[ll1(0x1ad,'fwVJ')]&&lilIll[ll1(0x1f1,'xNWj')]['fix'](l1i111))):console['log'](ll1(0x1dd,'Y[Cj')+IiiIii?.[ll1(0x227,'Fz[Z')]+':'+IiiIii?.[ll1(0x1a4,'klg]')]);break;}else iii1Ii[ll1(0x233,'mTj#')](''+(iii1Il?.[ll1(0x18e,'CxG0')]?.[ll1(0x1ef,'j0^9')]?.['title']||'')+(lI1IiI?.[ll1(0x22f,'u5iQ')]?.['newUserAward']?.[ll1(0x1cc,'d)Z8')]||'')+i1lI?.[ll1(0x238,'[Lzy')]?.[ll1(0x1aa,'FUVr')]?.['awardList'][0x1]?.[ll1(0x1fc,'wlu@')]+'京豆');}catch(l1iIi){IIlll[ll1(0x1fa,'D$0H')](IIlll[ll1(0x1dc,'*yHd')],IIlll[ll1(0x1d6,'iRzH')])?(lilIl1['msg'](i1l1ii[ll1(0x21e,'MJyX')],ll1(0x1b9,'CznV')),i1l1['exit'](0x1)):console[ll1(0x1b1,'66zU')](ll1(0x209,'mWQd')+IiiIil+ll1(0x195,'xNWj')+(l1iIi['message']||l1iIi));}}async function sendRequest(l1iIl){const iI1llI=IlI1Ii,illIll={'ndRtj':iI1llI(0x1d4,'FUVr'),'mxGfG':'9d49c','rUGNs':iI1llI(0x216,'OXZQ'),'JBqcH':iI1llI(0x1f0,'CxG0'),'stHls':iI1llI(0x1e1,'yNq2'),'aZCNd':'https://api.m.jd.com/client.action','WPFZH':'api.m.jd.com','GXvYm':iI1llI(0x1bf,'FKq0'),'WanmT':iI1llI(0x18f,'2TgD'),'RHVIj':'https://h5.m.jd.com/rn/42yjy8na6pFsq1cx9MJQ5aTgu3kX/index.html?tttparams=OTxiiOeyJnTGF0IjoiMzAuOTM3OTc2IiwidW5fYXJlYSI6IjRfMTMzXzU4NTMwXzAiLCJkTGF0IjoiIiwicHJzdGF0ZSI6IjAiLCJhZGRyZXNzSWQiOiIxMzg3NjMyODgiLCJsYXQiOiIyOS41MDI3NTgiLCJwb3NMYXQiOiIzMC45Mzc5NzYiLCJwb3NMbmciOiIxMDguNjg2NTM2IiwiZ3BzX2FyZWEiOiI0XzUwOTUyXzYwNDI2XzAiLCJsbmciOiIxMDYuNDc2NTk5IiwidWVtcHMiOiIwLTAtMiIsImdMbmciOiIxMDguNjg2NTM2IiwibW9kZWwiOiJpUGhvbmU5LDIiLCJkTG5nIjoiIn60%3D&has_native=0&jumpFrom=1&source=AppHome&sid=94c8fde9792f48dbdb86b75f99f42eaw&un_area=4_133_58530_0','Cozqy':function(lilIi,l1l11I){return lilIi===l1l11I;},'PoxHP':iI1llI(0x1f7,'ydjY'),'iLaFH':'Content-Type','QVdXO':function(lilIl,IilIlI){return lilIl<IilIlI;},'EodIS':function(iIli11,Iiiil){return iIli11!==Iiiil;},'mXXZX':iI1llI(0x1bb,'jNbm'),'NpEWu':function(Iiiii,l11i1I){return Iiiii>l11i1I;},'KzmZt':function(IiII,llIIli,lIII1I){return IiII(llIIli,lIII1I);},'ALSGO':function(illIlI,liIiI){return illIlI>=liIiI;}};if($[iI1llI(0x1e9,'4D2E')])return;let iIli1I='',Iiil1=null,iiilli=null,l1iIIl='POST',iiilll={},lI11Il={};switch(l1iIl){case illIll['ndRtj']:lI11Il={'appId':illIll[iI1llI(0x234,'j0^9')],'functionId':illIll[iI1llI(0x1cf,'*yHd')],'appid':illIll[iI1llI(0x1d7,'Y[Cj')],'clientVersion':common[iI1llI(0x229,'(K]A')](),'client':illIll[iI1llI(0x1e6,'Z4tN')],'body':{},'version':'4.4','ua':$['UA'],'t':!![]},iiilll=await H5st['getH5st'](lI11Il),iIli1I=illIll[iI1llI(0x208,'[Lzy')],Iiil1=iiilll[iI1llI(0x1be,'(K]A')];break;default:console[iI1llI(0x20b,'klg]')]('❌\x20未知请求\x20'+l1iIl);return;}const lIII1i={'url':iIli1I,'method':l1iIIl,'headers':{'Host':illIll[iI1llI(0x1ae,'mT6O')],'Accept':illIll['GXvYm'],'Cookie':cookie,'User-Agent':$['UA'],'Accept-Language':iI1llI(0x1ba,'[Lzy'),'Accept-Encoding':illIll[iI1llI(0x1bc,'4D2E')],'Referer':illIll['RHVIj']},'params':iiilli,'data':Iiil1,'timeout':0x7530};illIll[iI1llI(0x21f,'MJyX')](l1iIIl,illIll[iI1llI(0x1e5,'yNq2')])&&(delete lIII1i[iI1llI(0x23a,'yNq2')],delete lIII1i[iI1llI(0x19a,'Ljfv')][illIll[iI1llI(0x198,'FUVr')]]);const l11i11=0x1;let IilIl1=0x0,lIII1l=null,l1iIIi=![];while(illIll['QVdXO'](IilIl1,l11i11)){if(illIll[iI1llI(0x18b,'D$0H')](illIll['mXXZX'],iI1llI(0x1ca,'Z4tN')))iliIIi['log'](iI1llI(0x222,'4D2E')+ill11I+iI1llI(0x1d2,'3NuP')+(Iliiil[iI1llI(0x22d,'ydjY')]||li1Il));else{illIll[iI1llI(0x1c2,'mT6O')](IilIl1,0x0)&&await $[iI1llI(0x217,'3F#U')](0x3e8);const Iiili=await common[iI1llI(0x1b0,'p6MT')](lIII1i);if(!Iiili[iI1llI(0x19f,'p6MT')]){lIII1l='🚫\x20'+l1iIl+iI1llI(0x1eb,'eFD[')+Iiili[iI1llI(0x226,'iRzH')],IilIl1++;continue;}if(!Iiili?.[iI1llI(0x1b8,'Fz[Z')]){lIII1l='🚫\x20'+l1iIl+iI1llI(0x1f5,'PbK&'),IilIl1++;continue;}illIll['KzmZt'](handleResponse,l1iIl,Iiili['data']),l1iIIi=![];break;}}illIll[iI1llI(0x1ac,'eFD[')](IilIl1,l11i11)&&(console[iI1llI(0x212,'CxG0')](lIII1l),l1iIIi&&($[iI1llI(0x207,'Ljfv')]=!![],$[iI1llI(0x23d,'EZP7')]&&$[iI1llI(0x210,'iRzH')]['fix'](lIII1l)));}function randomString(IilIli,li1=IlI1Ii(0x1a5,'PbK&')){const llliii=IlI1Ii,illIl1={'uNVZv':function(IilIll,lI11Ii){return IilIll<lI11Ii;},'NrcWL':function(Iiill,l11i1i){return Iiill!==l11i1i;},'CVqFg':llliii(0x191,'FKq0'),'jbZOK':function(lI11I1,l1il11){return lI11I1*l1il11;}};let l1llII='';for(let IiI1=0x0;illIl1[llliii(0x1bd,'FKq0')](IiI1,IilIli);IiI1++){illIl1[llliii(0x1cb,'yNq2')](illIl1[llliii(0x204,'66zU')],'KxOqO')?l1llII+=li1[Math['floor'](illIl1['jbZOK'](Math[llliii(0x1ff,'Nd@)')](),li1[llliii(0x1ea,'Fz[Z')]))]:i1ill1[llliii(0x1f3,'Fz[Z')](llliii(0x1b5,'D$0H')+iIIl1l?.[llliii(0x1b2,'[Lzy')]);}return l1llII;}var version_ = 'jsjiami.com.v7';
// prettier-ignore
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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }