Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / config / license / util.js
index db97116..cfb0a24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf60=['base64','days','changed','2027-01-01T00:00:00.000Z','Breaking\x20license','Demo\x20license','License','find','then','lodash','moment','../environment','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','uuid','machineUuid','getUuid','session'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xcf60,0x153));var _0x0cf6=function(_0x5f0418,_0x2a7e59){_0x5f0418=_0x5f0418-0x0;var _0x1fddfd=_0xcf60[_0x5f0418];return _0x1fddfd;};'use strict';var crypto=require('crypto');var util=require('util');var _=require(_0x0cf6('0x0'));var moment=require(_0x0cf6('0x1'));var hardware=require('./hardware');var config=require(_0x0cf6('0x2'));var db=require(_0x0cf6('0x3'))['db'];function checkLicense(_0x3467ad,_0x4daf9c){if(_0x3467ad){try{var _0x27fa6f=_0x4daf9c||_0x3467ad['license'];if(_[_0x0cf6('0x4')](_0x27fa6f)){throw new Error(_0x0cf6('0x5'));}var _0x4f4597=_0x3467ad[_0x0cf6('0x6')];var _0x544e36=_0x3467ad[_0x0cf6('0x7')];var _0x30d031=_0x4f4597[_0x0cf6('0x8')]('-')[0x4];var _0x1ff859=_0x4f4597[_0x0cf6('0x8')]('-')[0x0];var _0x397628=crypto[_0x0cf6('0x9')](_0x0cf6('0xa'),util[_0x0cf6('0xb')](_0x0cf6('0xc'),_0x30d031,_0x4f4597,_0x1ff859));var _0x2ba83a=_0x397628[_0x0cf6('0xd')](_0x27fa6f,'base64',_0x0cf6('0xe'));_0x2ba83a+=_0x397628[_0x0cf6('0xf')](_0x0cf6('0xe'));var _0x4edd9b=JSON[_0x0cf6('0x10')](_0x2ba83a);_0x4edd9b['demo']=![];_0x4edd9b[_0x0cf6('0x11')]=_0x4f4597;_0x4edd9b[_0x0cf6('0x12')]=hardware[_0x0cf6('0x13')]();if(_0x544e36){var _0x25335e=crypto[_0x0cf6('0x9')](_0x0cf6('0xa'),config['secrets'][_0x0cf6('0x14')]);var _0x3a2a44=_0x25335e[_0x0cf6('0xd')](_0x544e36,_0x0cf6('0x15'),_0x0cf6('0xe'));_0x3a2a44+=_0x25335e[_0x0cf6('0xf')](_0x0cf6('0xe'));_0x4edd9b['gray']=_0x3a2a44;_0x4edd9b['deadline']=moment(_0x3a2a44)['add'](0x7,_0x0cf6('0x16'))[_0x0cf6('0xb')]();_0x4edd9b['grayReason']=_0x4edd9b['uuid']!=_0x4edd9b[_0x0cf6('0x12')]?_0x0cf6('0x17'):'disabled';}return _0x4edd9b;}catch(_0x20c0aa){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0cf6('0x18'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0cf6('0x19'),'uuid':_0x3467ad[_0x0cf6('0x6')],'machineUuid':hardware['getUuid'](),'message':_0x20c0aa['message'],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x0cf6('0x1a'),'uuid':_0x3467ad[_0x0cf6('0x6')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports['getLicense']=function(_0x4ecdb9){return db[_0x0cf6('0x1b')][_0x0cf6('0x1c')](_['defaults'](_0x4ecdb9,{'raw':!![],'where':{'id':0x1}}))[_0x0cf6('0x1d')](function(_0x2b9dd8){return checkLicense(_0x2b9dd8,null);});};exports['checkLicense']=checkLicense;
\ No newline at end of file
+var _0x88dc=['final','utf8','parse','demo','uuid','machineUuid','aes-256-ctr','secrets','session','gray','deadline','add','changed','disabled','getUuid','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','find','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','../environment','license','isEmpty','data2','split','createDecipher','%s:%s:%s','base64'];(function(_0x4e0c1a,_0x3ffd5b){var _0x5be6a0=function(_0x3e0d63){while(--_0x3e0d63){_0x4e0c1a['push'](_0x4e0c1a['shift']());}};_0x5be6a0(++_0x3ffd5b);}(_0x88dc,0x15b));var _0xc88d=function(_0x1407d,_0xf9b2c1){_0x1407d=_0x1407d-0x0;var _0x139b06=_0x88dc[_0x1407d];return _0x139b06;};'use strict';var crypto=require(_0xc88d('0x0'));var util=require(_0xc88d('0x1'));var _=require(_0xc88d('0x2'));var moment=require(_0xc88d('0x3'));var hardware=require(_0xc88d('0x4'));var config=require(_0xc88d('0x5'));var db=require('../../mysqldb')['db'];function checkLicense(_0x140b39,_0x4d709e){if(_0x140b39){try{var _0xec013f=_0x4d709e||_0x140b39[_0xc88d('0x6')];if(_[_0xc88d('0x7')](_0xec013f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x8611dd=_0x140b39['data1'];var _0xa073c2=_0x140b39[_0xc88d('0x8')];var _0x121327=_0x8611dd[_0xc88d('0x9')]('-')[0x4];var _0x257d5a=_0x8611dd['split']('-')[0x0];var _0x4d64f2=crypto[_0xc88d('0xa')]('aes-256-ctr',util['format'](_0xc88d('0xb'),_0x121327,_0x8611dd,_0x257d5a));var _0x208827=_0x4d64f2['update'](_0xec013f,_0xc88d('0xc'),'utf8');_0x208827+=_0x4d64f2[_0xc88d('0xd')](_0xc88d('0xe'));var _0x40019f=JSON[_0xc88d('0xf')](_0x208827);_0x40019f[_0xc88d('0x10')]=![];_0x40019f[_0xc88d('0x11')]=_0x8611dd;_0x40019f[_0xc88d('0x12')]=hardware['getUuid']();if(_0xa073c2){var _0x16b138=crypto[_0xc88d('0xa')](_0xc88d('0x13'),config[_0xc88d('0x14')][_0xc88d('0x15')]);var _0x4ce383=_0x16b138['update'](_0xa073c2,'base64',_0xc88d('0xe'));_0x4ce383+=_0x16b138[_0xc88d('0xd')]('utf8');_0x40019f[_0xc88d('0x16')]=_0x4ce383;_0x40019f[_0xc88d('0x17')]=moment(_0x4ce383)[_0xc88d('0x18')](0x7,'days')['format']();_0x40019f['grayReason']=_0x40019f[_0xc88d('0x11')]!=_0x40019f[_0xc88d('0x12')]?_0xc88d('0x19'):_0xc88d('0x1a');}return _0x40019f;}catch(_0x49e082){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x140b39['data1'],'machineUuid':hardware[_0xc88d('0x1b')](),'message':_0x49e082['message'],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc88d('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc88d('0x1d'),'uuid':_0x140b39['data1'],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports[_0xc88d('0x1e')]=function(_0x5ba244){return db[_0xc88d('0x1f')][_0xc88d('0x20')](_[_0xc88d('0x21')](_0x5ba244,{'raw':!![],'where':{'id':0x1}}))[_0xc88d('0x22')](function(_0xc8e46){return checkLicense(_0xc8e46,null);});};exports[_0xc88d('0x23')]=checkLicense;
\ No newline at end of file