mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
16 lines
23 KiB
JavaScript
16 lines
23 KiB
JavaScript
/*
|
||
活动名称:车管家签到
|
||
环境变量:jd_car_sign_interval // 自定义运行间隔时长(整数,单位毫秒),默认1500
|
||
jd_car_sign_notify // 是否推送通知(true/false),默认不推送
|
||
jd_car_sign_pinFilter // 账号pin过滤,多个用@进行分割
|
||
|
||
定时随机
|
||
|
||
*/
|
||
|
||
const $ = new Env('车管家签到')
|
||
const _0x44c41f=_0x1b37;(function(_0x40262b,_0x42b7f2){const _0x4854d8=_0x1b37,_0x3ac2e5=_0x40262b();while(!![]){try{const _0x38a604=-parseInt(_0x4854d8(0x10c,'eBaQ'))/0x1+-parseInt(_0x4854d8(0x147,'roJ('))/0x2+parseInt(_0x4854d8(0x145,'XCJN'))/0x3+-parseInt(_0x4854d8(0x11b,'[TlU'))/0x4+parseInt(_0x4854d8(0x123,'eL0%'))/0x5+-parseInt(_0x4854d8(0x116,'a1%Z'))/0x6*(-parseInt(_0x4854d8(0x18e,'[TlU'))/0x7)+parseInt(_0x4854d8(0x11c,'p%2v'))/0x8*(parseInt(_0x4854d8(0x141,'n]FN'))/0x9);if(_0x38a604===_0x42b7f2)break;else _0x3ac2e5['push'](_0x3ac2e5['shift']());}catch(_0x5bca4c){_0x3ac2e5['push'](_0x3ac2e5['shift']());}}}(_0x1c12,0xe75d0));const jdCookie=require(_0x44c41f(0x134,'WeW(')),notify=require(_0x44c41f(0x14c,'!0rJ')),common=require('./utils/Rebels_jdCommon'),{H5st}=require(_0x44c41f(0x14d,'A2ho'));let taskThreads=process[_0x44c41f(0x166,'Sv@F')][_0x44c41f(0x143,'eBaQ')]||'1';const runInterval=process[_0x44c41f(0x139,'q2oR')][_0x44c41f(0x11a,'1]EE')]||_0x44c41f(0x150,'fl7a'),isNotify=(process[_0x44c41f(0x18f,'Qzce')][_0x44c41f(0x13c,'jEnN')]||process[_0x44c41f(0x104,'*Of@')][_0x44c41f(0x132,'LU2z')])===_0x44c41f(0x167,'XCJN'),pinFilter=(process[_0x44c41f(0x176,'WW)m')][_0x44c41f(0x106,'eBaQ')]||'')[_0x44c41f(0x15c,']ZDg')]('@'),maxThreads=0x1;let cookiesArr=Object[_0x44c41f(0x10e,'LU2z')](jdCookie)[_0x44c41f(0x177,'XSKZ')](_0x4dab5b=>jdCookie[_0x4dab5b])[_0x44c41f(0x18b,'tot1')](_0x3fa9f5=>_0x3fa9f5);!cookiesArr[0x0]&&($[_0x44c41f(0x15f,'Y@oQ')]($[_0x44c41f(0x105,'O^UR')],_0x44c41f(0x14a,'1)6z')),process[_0x44c41f(0x17d,'fl7a')](0x1));!(async()=>{const _0x3db26d=_0x44c41f;notify[_0x3db26d(0x102,'A2ho')]({'title':$[_0x3db26d(0x18d,'a1%Z')]}),await Main(),isNotify&¬ify[_0x3db26d(0x10b,'1)6z')]()&&await notify[_0x3db26d(0x12b,'eBaQ')]();})()[_0x44c41f(0x109,'jEnN')](_0x4c347f=>$[_0x44c41f(0x138,')dIN')](_0x4c347f))['finally'](()=>$[_0x44c41f(0x130,'q2oR')]());async function Main(){const _0x4d489a=_0x44c41f;try{try{const _0x31f784=parseInt(taskThreads);_0x31f784>0x0&&_0x31f784!==0x1&&(taskThreads=_0x31f784);}catch{taskThreads=0x1;}taskThreads=Math[_0x4d489a(0x117,'GKmX')](taskThreads,maxThreads),$[_0x4d489a(0x107,'GKmX')]=null;if(runInterval)try{const _0x35029b=parseInt(runInterval);_0x35029b>=0x0&&($[_0x4d489a(0x174,'O^UR')]=_0x35029b);}catch{console['log'](_0x4d489a(0x168,'RKpD'));}$[_0x4d489a(0x136,'Xe(8')]=[],console[_0x4d489a(0x10a,'[gbd')](_0x4d489a(0x10d,'A2ho')+$['name']+'变量开启状态=========='),console['log']('间隔时长:\x20['+$[_0x4d489a(0x182,'XSKZ')]/0x3e8+_0x4d489a(0x11e,'J[Gp')),console[_0x4d489a(0x186,'!0rJ')](_0x4d489a(0x12c,'qRUd')+common[_0x4d489a(0x124,'Aa%M')]()+']'),console[_0x4d489a(0x113,'eL0%')]('通知推送:\x20['+(isNotify?'开启':'关闭')+']'),console[_0x4d489a(0x114,'RKpD')](_0x4d489a(0x135,'4Ri*')+pinFilter[_0x4d489a(0x14e,'n]FN')](',\x20')+']'),console['log'](_0x4d489a(0x112,'Qzce')+$[_0x4d489a(0x111,'JJ2B')]+'变量状态结束=========='),console[_0x4d489a(0x101,'1)6z')](''),await common[_0x4d489a(0x133,'roJ(')](taskThreads,cookiesArr,taskFnc),$[_0x4d489a(0x13e,'1)6z')]=![];$[_0x4d489a(0x16f,'JJ2B')]['length']>0x0&&(cookiesArr=cookiesArr[_0x4d489a(0x170,')dIN')]((_0x338eff,_0x32b388)=>!$[_0x4d489a(0x16f,'JJ2B')][_0x4d489a(0x181,'eBaQ')](_0x32b388+0x1)),$['needRemoveCookieIndex']=[]);const _0x1b5a2a=notify['getMessage']();_0x1b5a2a&&console[_0x4d489a(0x188,'XCJN')](_0x4d489a(0x12a,'Aa%M')+_0x1b5a2a[_0x4d489a(0x192,'Aa%M')](/:/g,_0x4d489a(0x194,'l[K0')));}catch(_0x3d3be6){console['log'](_0x4d489a(0x163,'XSKZ')+_0x3d3be6);}}function _0x1c12(){const _0x47076b=['nmoUWQldLq','WOVcLSkaWR/cVZldPmkUomke','WP5evW','WQ/dGuq','BrVcLmkr','W4VdN8oTW6ZcQSkjD8oGW5/cVG','d8kfWQi','ywtcQYfcW7qdqSkwFtRdNSoDvX/cHHqdoa','WP8GWRJdNCouuq','jG9BW7aVsq0IBSolESoFWQ0HgCkVbSk+Cmoc','W57cOrDWBSk/WR4jW43cIrJcLmoD','WRlcN1Psj0XTWRe+WRzNpmo9','w8kmWQi','56ADWP/OVkxOOPVPLi/PMP3ML5ZPLly','uLnxaSoaWRa','xCoZW7RdSmkjWQtcKmoMlr7dSSkfWPVcGxpdHbVdUCkFDCogWPlcKeZdVmkjkSkfu1VcOcHSWOfDzYJdRfnC','j8k2WOhcP8kimWvMpmkUgCouWPfLa2G7W5/cL3SEo8kFp8kcd0xdVmoExLzKW4K8WPNcUmklW6FcVCkmW5xcL8ofwCk4xN/dLxBcRgGxWPZcJmkyWRJdNmkraN4RW7OfiCoLotz9c8ovmcq','WR8yWO47p8kE','W4yFcCkPW6aMW7lcPIVcL8kVWO1K','uH9PWP4mW5BdPCo8W4FdTSk6WPLmWRO','nSoQWQhdLYBdRa','xbr+WQilW53dUmo2','EmkOWOlcGq','WR/dPdBcUa','p8k3WOBcVW','p/cHS77dRUI+RUIJTEE5JUACMCkE','vCo+W7hdOa','5lUM55cE5B6X5yAiW6H/WRm','WQLcv8k3','g3f1','C8kqvKqwxSotpmk9ASkBzSoXaSobnatcQeqKi8oKWOddUtekomkI','WOG6WRtdTq','WP5oxSo/WQf+','fSo1WPWVks3cSmkFvsruWOiJw1fLW6VdHG','WQVdQJhcR8omWRbKWPa','W7XEW6NcOmo8WOj2Btu6','6lwW5y2S6l645RMMcCkJWOG','ttHSW5zUoblcVb/dLuVcJ8k0d05Dl08/W61P','W4fHW4eyWQdcHG','lmoDW4xcUdtdHq','WOK7WQW','mCkJumkwmMpdI8kdWPJcGq','4PYmW4RMNjNNN5NOR5tMSyJdHq','W595oXW/qcDlW4bGFSoQhSkEWOGKW4Gx','g8o0WRCpjZdcHmkfwrvBWReyuq','WQqOA8kieCkc','bgTWWQz3WONdPa','WPu0W5C','BZldO8kXW6RdT8oN','vSoyW7xcK0hdJ8kmW6a8uvSobq','t8oVW53dQ8kqWQ7cT8oTpahdPmkIWRZcJwpdJGBdOmkdFG','WP85WRpdS8oc','xxyGWQbPBslcQ8oICConW7G','WP3dPu8dn8oJ','W7RcS2ZdUSkUW6eJWOKHW5qcawC','kmkEr0XqmmokCSkuEmkJgSoFEmonf1/cVrOJFSoYWQ3dIaywaSkxWPTZWOpcHLFdOwRdHWpcP8oMrmoe','dcjJW7u','44og5O6n56s/44oC6k6i5yAU6iYM5y+sWP7dJ8oXkSkjWOi','CxdcUHjvW6GD','WQpcGH1Kd8oKoCoMi2bnC8kYumktWOpdTmoMCmotW4uKW7PxW5FcL8ko','W4GQWRJdUYOgWR5vWPHVWPhdPKFdT8oPdq','pa3dRCkf','W4GOma','CSoZf8oh','WOCtl8oP','eMXGWOPQ','WPZdPumfnSoJW6m','kCkeufbwBSkalG','oSo+eCoLr8oR','W4BdNSooW6O','W5RdHmoA','FSoRWOG','CSkSWPpcHgVcPCk/ie97bK5VW7eRvNpdGMj5W60','lmkpxvTxyG','W4hdSe7cNCkWASkro8odou57WQWz','xSkqoKVcRq','i8otW5dcRttdMd7dHCohfg/cUxJdTrpdQmkHEtC','W5agWQ7dRmoeWRi','W65hta','W5VcVHy','a+IUQUAXI+wMG+I0Mx3IN6pdS+AwIEwrVEw6NoAwKoAoTq','tmk5zSopW6BcL0O','4P6ss+IhP+ADVUI+IoIIVoMdP+wjHUs4I+MwSoIVGCkJ','tSkbjhlcQ8kzzSoYxmoVmwq7AmoSzchcMwu','WR12vMXvW6OsWQ4fWR0+W68','eNbK','hdfIW7e','4PMJWO7OH4NLRRNKUkBOVi7OOj7PLOpPM4NMLkBPLARORyZNVOJPLyNORi8','fmk6WRtcVSogW6tdKmoZoHldR8kjWO0','6lEu5y+C5PEq5PEq','dSkdWQS','vdXGW4y','Ah3dGSkiWRm4WO0','tCkPDmoPW6JcHW','nmoQWQRdLaddOtddKIKHW78KxCoQWO8FvCklW4hcHCoi','jSoBW47cIspdHq','ewS6WOqkBuVcOrNdUvhcPSkq','WQ7dJ1S','iCkPsmkBjwBdQW','WRXgx8kTWP8UWQNcIW','ygRdG8k4WR07WO0','tZhdSG','WRmkWO0','sCkbiKm','W4FdPKNcUmk4yW','WOjKWRNdRG','DCoWf8ocDZ7dQ8kVWPhcJ8oeWRa','W6b2pMLcW6LVW7K','jSk+tSkd','BSk8WPJcPvFcPa','WR/dPdBcUmomWRH6WP4','WP/cJ8kK','tmoLW6hdPmkeWRJcJCoT','WQKkWPqMdmkzW40t','DM3dK8k2WQe4','5BsE6k+R57606lwJ6l2G6l+M6kcr5BYG5yIy6lA+5yYO','zrxcHW','W6hdGG8','W4ijW57dMSooua','bcXW','8lABRhC','W4iUlW','W64QdsWjWQS','6lEa5y+Y5PsT5PEh','WPFcH8kXWRK','W53cOXzXA8o/W58IW6VcHsC','W5pdHCol','mqFdQSk+W5xdMCoI','WOfGWRNdH3yzWRK','rX9TWQiFW5RdUa','WQFdJ1Dc','WOBINiKA','W6WIftK','W7/dIb9XfmoSbmkOhga','W4ZcIIaLqq','W4ldTe7cSa','WPTdW4mJWP7cPmkx','44kY6ls15y2t','WROYyG','WOvQWQpdQsOn','4P2ojEAFS+IcJoATK+EJTEwLQUEqQ8oc','Ahri','WQvgw8k8','t8oVW53dQ8kqWQ7cT8oTpahdPmkIWPpcKgxdUGRdRCktAmom','fCknWQxdLIdcLSorW6y','W69Bta','W5z8ebW2','WPOCWRW','WRe4CCkagSkvW6jLWRRdHq','e8k9WRlcVCogW6xcHSotmq3dOmkZ','W5S4W7dcSN5xW7bhW7C3','f8o0WRO/','w8kTCmoT','W5jNW7SjWR3cJq'];_0x1c12=function(){return _0x47076b;};return _0x1c12();}function _0x1b37(_0xc74ab,_0x1825df){const _0x1c1263=_0x1c12();return _0x1b37=function(_0x1b3704,_0x2b6a1f){_0x1b3704=_0x1b3704-0x100;let _0xb880eb=_0x1c1263[_0x1b3704];if(_0x1b37['JLoUxL']===undefined){var _0x5b8e6a=function(_0x3fa9f5){const _0x4c347f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1b5a2a='',_0x31f784='';for(let _0x35029b=0x0,_0x338eff,_0x32b388,_0x3d3be6=0x0;_0x32b388=_0x3fa9f5['charAt'](_0x3d3be6++);~_0x32b388&&(_0x338eff=_0x35029b%0x4?_0x338eff*0x40+_0x32b388:_0x32b388,_0x35029b++%0x4)?_0x1b5a2a+=String['fromCharCode'](0xff&_0x338eff>>(-0x2*_0x35029b&0x6)):0x0){_0x32b388=_0x4c347f['indexOf'](_0x32b388);}for(let _0x48810a=0x0,_0x446ff4=_0x1b5a2a['length'];_0x48810a<_0x446ff4;_0x48810a++){_0x31f784+='%'+('00'+_0x1b5a2a['charCodeAt'](_0x48810a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x31f784);};const _0x4dab5b=function(_0x4aa953,_0x489d32){let _0x396c76=[],_0x1f8e2f=0x0,_0x237355,_0x474a35='';_0x4aa953=_0x5b8e6a(_0x4aa953);let _0x382595;for(_0x382595=0x0;_0x382595<0x100;_0x382595++){_0x396c76[_0x382595]=_0x382595;}for(_0x382595=0x0;_0x382595<0x100;_0x382595++){_0x1f8e2f=(_0x1f8e2f+_0x396c76[_0x382595]+_0x489d32['charCodeAt'](_0x382595%_0x489d32['length']))%0x100,_0x237355=_0x396c76[_0x382595],_0x396c76[_0x382595]=_0x396c76[_0x1f8e2f],_0x396c76[_0x1f8e2f]=_0x237355;}_0x382595=0x0,_0x1f8e2f=0x0;for(let _0x540a04=0x0;_0x540a04<_0x4aa953['length'];_0x540a04++){_0x382595=(_0x382595+0x1)%0x100,_0x1f8e2f=(_0x1f8e2f+_0x396c76[_0x382595])%0x100,_0x237355=_0x396c76[_0x382595],_0x396c76[_0x382595]=_0x396c76[_0x1f8e2f],_0x396c76[_0x1f8e2f]=_0x237355,_0x474a35+=String['fromCharCode'](_0x4aa953['charCodeAt'](_0x540a04)^_0x396c76[(_0x396c76[_0x382595]+_0x396c76[_0x1f8e2f])%0x100]);}return _0x474a35;};_0x1b37['ytpwvs']=_0x4dab5b,_0xc74ab=arguments,_0x1b37['JLoUxL']=!![];}const _0x58aed1=_0x1c1263[0x0],_0x3ebc5c=_0x1b3704+_0x58aed1,_0x3b564b=_0xc74ab[_0x3ebc5c];return!_0x3b564b?(_0x1b37['asRPkC']===undefined&&(_0x1b37['asRPkC']=!![]),_0xb880eb=_0x1b37['ytpwvs'](_0xb880eb,_0x2b6a1f),_0xc74ab[_0x3ebc5c]=_0xb880eb):_0xb880eb=_0x3b564b,_0xb880eb;},_0x1b37(_0xc74ab,_0x1825df);}async function taskFnc(_0x48810a,_0x446ff4){const _0x2b4e58=_0x44c41f;if($[_0x2b4e58(0x187,']lMx')])return{'runEnd':!![]};const _0x4aa953=decodeURIComponent(common[_0x2b4e58(0x13d,'LU2z')](_0x48810a,_0x2b4e58(0x110,'19Ij')));function _0x489d32(_0x895bdc,_0x20571e){const _0x1ec6d3=_0x2b4e58;if(_0x895bdc[_0x1ec6d3(0x131,'eL0%')]<=0x4)return _0x895bdc;else{const _0x2cae6b=_0x895bdc['slice'](0x0,0x2),_0x2e823c=_0x895bdc[_0x1ec6d3(0x144,'q2oR')](-0x2),_0x46eaa1=Math[_0x1ec6d3(0x172,'RKpD')](_0x20571e-_0x2cae6b[_0x1ec6d3(0x125,'JJ2B')]-_0x2e823c[_0x1ec6d3(0x15a,'Alcz')],0x0),_0x581ba9='*'[_0x1ec6d3(0x16e,'idht')](_0x46eaa1);return _0x2cae6b+_0x581ba9+_0x2e823c;}}const _0x396c76=decodeURIComponent(_0x4aa953),_0x1f8e2f=_0x489d32(_0x396c76,0x6),_0x237355=_0x2b4e58(0x100,'19Ij')+_0x446ff4+'】'+_0x1f8e2f+':',_0x474a35=notify[_0x2b4e58(0x137,'19Ij')](_0x446ff4,_0x4aa953);if(pinFilter[_0x2b4e58(0x155,'4Ri*')]>0x0&&(pinFilter[_0x2b4e58(0x126,'Aa%M')](_0x4aa953)||pinFilter[_0x2b4e58(0x154,'Alcz')](encodeURIComponent(_0x4aa953)))){_0x474a35[_0x2b4e58(0x18a,'aRSm')](_0x2b4e58(0x184,'q2oR')),console[_0x2b4e58(0x108,'Y@oQ')](_0x474a35['getInlineContent']()),$[_0x2b4e58(0x159,'FWi5')][_0x2b4e58(0x156,'Qzce')](_0x446ff4);return;}const _0x382595=await common[_0x2b4e58(0x15b,'l[K0')](_0x48810a);if(!_0x382595&&typeof _0x382595===_0x2b4e58(0x173,'fl7a')){console[_0x2b4e58(0x14f,'aRSm')](_0x237355+_0x2b4e58(0x16a,'eL0%')),_0x474a35[_0x2b4e58(0x180,'a1%Z')](_0x2b4e58(0x18c,'A2ho')),$['needRemoveCookieIndex'][_0x2b4e58(0x129,'J[Gp')](_0x446ff4);return;}const _0x540a04=common['genUA'](_0x4aa953),_0x46f096=common[_0x2b4e58(0x190,'n]FN')](_0x2b4e58(0x120,'eBaQ'));await _0x3997d1(_0x2b4e58(0x15d,')dIN'));if($[_0x2b4e58(0x17e,'FWi5')])return{'runEnd':!![]};await $[_0x2b4e58(0x128,'roJ(')](parseInt($[_0x2b4e58(0x17f,'roJ(')]*0x1+0x1f4,0xa));async function _0x171b7b(_0x1c653d,_0x42b9ce){const _0x2e09a8=_0x2b4e58;try{switch(_0x1c653d){case _0x2e09a8(0x15d,')dIN'):if(_0x42b9ce?.[_0x2e09a8(0x175,'qRUd')]==0xc8){if(_0x42b9ce?.[_0x2e09a8(0x195,'tot1')]?.[_0x2e09a8(0x162,'idht')]==0x0)console[_0x2e09a8(0x158,'y#^x')](''+_0x237355+(_0x42b9ce?.[_0x2e09a8(0x178,']ZDg')]?.[_0x2e09a8(0x183,'qRUd')]||'')+'-'+(_0x42b9ce?.[_0x2e09a8(0x193,'RKpD')]?.[_0x2e09a8(0x151,'7vv*')]?.[_0x2e09a8(0x196,'!0rJ')]||'')),_0x474a35['insert']((_0x42b9ce?.[_0x2e09a8(0x149,'XCJN')]?.['subMsg']||'')+'-'+(_0x42b9ce?.[_0x2e09a8(0x198,'l[K0')]?.[_0x2e09a8(0x12d,'O^UR')]?.[_0x2e09a8(0x13a,'fl7a')]||''));else _0x42b9ce?.[_0x2e09a8(0x17a,'A2ho')]?.[_0x2e09a8(0x13f,'Sv@F')]==0x67?console[_0x2e09a8(0x157,'Qzce')](''+_0x237355+(_0x42b9ce?.[_0x2e09a8(0x115,'M#f2')]?.[_0x2e09a8(0x11f,'U8ha')]||'')+'-'+(_0x42b9ce?.['data']?.[_0x2e09a8(0x153,'[TlU')]||'')):console[_0x2e09a8(0x14f,'aRSm')](''+_0x237355+(_0x42b9ce?.[_0x2e09a8(0x127,'FWi5')]?.[_0x2e09a8(0x119,'q2oR')]||'')+'-'+(_0x42b9ce?.['data']?.['subCode']||''));}else console[_0x2e09a8(0x185,'M#f2')](''+_0x237355+(_0x42b9ce?.['errCode']||''));break;}}catch(_0x1c4e08){console[_0x2e09a8(0x12e,'Sv@F')](_0x2e09a8(0x103,'lvZ$')+_0x1c653d+'\x20请求响应\x20'+(_0x1c4e08[_0x2e09a8(0x16d,'qRUd')]||_0x1c4e08));}}async function _0x3997d1(_0x3e1977){const _0x429f21=_0x2b4e58;if($[_0x429f21(0x146,'[TlU')])return;let _0x1ea3d0='',_0x4d206c=null,_0x15b28a=null,_0x3b62c8=_0x429f21(0x140,'WeW('),_0x1f495e={},_0x252fa3={};switch(_0x3e1977){case _0x429f21(0x118,'lvZ$'):_0x252fa3={'appId':'d2328','functionId':_0x429f21(0x164,']ZDg'),'appid':_0x429f21(0x197,'p%2v'),'body':{'obtainOrUseScore':0x1,'encryptAssignmentId':_0x429f21(0x12f,'Alcz'),'itemId':'1'},'version':_0x429f21(0x160,'[TlU'),'ua':_0x540a04},_0x1f495e=await H5st[_0x429f21(0x191,'A2ho')](_0x252fa3),_0x1ea3d0=_0x429f21(0x148,'Alcz')+_0x1f495e['params']+'&_t='+Date['now']()+_0x429f21(0x15e,'[gbd')+_0x46f096;break;default:console[_0x429f21(0x16b,'GKmX')](_0x429f21(0x13b,'Alcz')+_0x3e1977);return;}const _0x1bd937={};_0x4d206c&&Object[_0x429f21(0x122,'XSKZ')](_0x4d206c,_0x1bd937);_0x15b28a&&Object[_0x429f21(0x179,'l[K0')](_0x15b28a,_0x1bd937);const _0x469a55={'url':_0x1ea3d0,'method':_0x3b62c8,'headers':{'origin':'https://m-car.jd.com','Referer':_0x429f21(0x121,'J[Gp'),'User-Agent':_0x540a04,'Cookie':_0x48810a,'x-rp-client':_0x429f21(0x17c,'tot1'),'accept':'application/json,\x20text/plain,\x20*/*'},'params':_0x15b28a,'data':_0x4d206c,'timeout':0x7530,'httpsTlsOptions':common['useAppTls']()};_0x3b62c8===_0x429f21(0x11d,'FWi5')&&(delete _0x469a55['data'],delete _0x469a55['headers']['Content-Type']);const _0x3d451c=0x1;let _0x5c653a=0x0,_0x5d1532=null;while(_0x5c653a<_0x3d451c){_0x5c653a>0x0&&await $[_0x429f21(0x16c,'Xe(8')](0x3e8);const _0x5b3ea8=await common['request'](_0x469a55);if(!_0x5b3ea8[_0x429f21(0x14b,'lvZ$')]){_0x5d1532='🚫\x20'+_0x3e1977+'\x20请求失败\x20➜\x20'+_0x5b3ea8[_0x429f21(0x152,'Sv@F')],_0x5c653a++;continue;}if(!_0x5b3ea8[_0x429f21(0x10f,'idht')]){_0x5d1532=_0x429f21(0x189,'aRSm')+_0x3e1977+_0x429f21(0x161,'Xe(8'),_0x5c653a++;continue;}await _0x171b7b(_0x3e1977,_0x5b3ea8['data']);break;}_0x5c653a>=_0x3d451c&&console['log'](_0x5d1532);}}
|
||
|
||
// 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) }
|