Built motion from commit ec3ecc5.|1.0.2
[motion.git] / server / config / license / index.js
1 var _0x8e71=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x75\x74\x69\x6C","\x75\x72\x6C","\x63\x72\x79\x70\x74\x6F","\x6D\x6F\x6D\x65\x6E\x74","\x43\x72\x6F\x6E\x4A\x6F\x62","\x63\x72\x6F\x6E","\x2E\x2F\x6C\x69\x63\x65\x6E\x73\x65\x2E\x73\x65\x72\x76\x69\x63\x65","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x4C\x69\x63\x65\x6E\x73\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x65\x73\x73\x69\x6F\x6E","\x2A\x20\x2A\x20\x2A\x20\x2A\x20\x2A","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x64\x61\x74\x61\x32","\x61\x65\x73\x2D\x32\x35\x36\x2D\x63\x74\x72","\x73\x65\x63\x72\x65\x74","\x63\x72\x65\x61\x74\x65\x44\x65\x63\x69\x70\x68\x65\x72","\x62\x61\x73\x65\x36\x34","\x75\x74\x66\x38","\x75\x70\x64\x61\x74\x65","\x66\x69\x6E\x61\x6C","\x64\x61\x79\x73","\x64\x69\x66\x66","\x64\x61\x74\x61\x31","\x67\x65\x74\x55\x75\x69\x64","\x63\x72\x65\x61\x74\x65\x43\x69\x70\x68\x65\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D","\x66\x6F\x72\x6D\x61\x74","\x61\x63\x74\x69\x76\x65","\x6C\x69\x63\x65\x6E\x73\x65","\x75\x75\x69\x64","\x74\x68\x65\x6E","\x70\x72\x6F\x76\x69\x73\x69\x6F\x6E\x69\x6E\x67","\x2F\x73\x65\x72\x76\x65\x72\x73\x2F","\x2F\x63\x68\x65\x63\x6B","\x73\x70\x72\x65\x61\x64","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x73\x74\x61\x72\x74","\x65\x78\x70\x6F\x72\x74\x73"];_0x8e71[0];var rp=require(_0x8e71[1]);var util=require(_0x8e71[2]);var url=require(_0x8e71[3]);var crypto=require(_0x8e71[4]);var moment=require(_0x8e71[5]);var CronJob=require(_0x8e71[7])[_0x8e71[6]];var licenseService=require(_0x8e71[8]);var config=require(_0x8e71[9]);var License=require(_0x8e71[11])[_0x8e71[10]];var session=require(_0x8e71[9])[_0x8e71[12]];const expirationTh=7;function licenseManager(){var _0x6fe7xd= new CronJob({cronTime:_0x8e71[13],onTick:function(){return License[_0x8e71[39]]({where:{id:1}})[_0x8e71[38]](function(_0x6fe7xf){var _0x6fe7x10={};if(_0x6fe7xf[_0x8e71[16]]){var _0x6fe7x11=crypto[_0x8e71[19]](_0x8e71[17],session[_0x8e71[18]]);var _0x6fe7x12=_0x6fe7x11[_0x8e71[22]](_0x6fe7xf[_0x8e71[16]],_0x8e71[20],_0x8e71[21]);_0x6fe7x12+= _0x6fe7x11[_0x8e71[23]](_0x8e71[21]);if(moment()[_0x8e71[25]](_0x6fe7x12,_0x8e71[24])> expirationTh){_0x6fe7x10[_0x8e71[26]]= licenseService[_0x8e71[27]]();_0x6fe7x10[_0x8e71[16]]= null}};if(!_0x6fe7xf[_0x8e71[26]]){_0x6fe7x10[_0x8e71[26]]= licenseService[_0x8e71[27]]()}else {if((_0x6fe7x10[_0x8e71[26]]!== licenseService[_0x8e71[27]]())&& !_0x6fe7xf[_0x8e71[16]]){var _0x6fe7x13=crypto[_0x8e71[28]](_0x8e71[17],session[_0x8e71[18]]);_0x6fe7x10[_0x8e71[16]]= _0x6fe7x13[_0x8e71[22]](moment()[_0x8e71[30]](_0x8e71[29]),_0x8e71[21],_0x8e71[20]);_0x6fe7x10[_0x8e71[16]]+= _0x6fe7x13[_0x8e71[23]](_0x8e71[20])}};return _0x6fe7xf[_0x8e71[22]](_0x6fe7x10)[_0x8e71[34]](function(_0x6fe7x10){return rp({uri:config[_0x8e71[35]]+ _0x8e71[36]+ licenseService[_0x8e71[27]]()+ _0x8e71[37],json:true})})[_0x8e71[34]](function(_0x6fe7x10){if(_0x6fe7x10[_0x8e71[31]]){return _0x6fe7xf[_0x8e71[22]]({license:_0x6fe7x10[_0x8e71[32]],data1:_0x6fe7x10[_0x8e71[33]],data2:null})}else {if(!_0x6fe7xf[_0x8e71[16]]){var _0x6fe7x13=crypto[_0x8e71[28]](_0x8e71[17],session[_0x8e71[18]]);var _0x6fe7x14=_0x6fe7x13[_0x8e71[22]](moment()[_0x8e71[30]](_0x8e71[29]),_0x8e71[21],_0x8e71[20]);_0x6fe7x14+= _0x6fe7x13[_0x8e71[23]](_0x8e71[20]);return _0x6fe7xf[_0x8e71[22]]({data2:_0x6fe7x14})}}})})[_0x8e71[15]](function(_0x6fe7xe){console[_0x8e71[14]](_0x6fe7xe)})},start:true});_0x6fe7xd[_0x8e71[40]]();return {}}module[_0x8e71[41]]= licenseManager