Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / config / license / util.js
index e7405bb..6dc06d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee3f=['grayReason','machineUuid','changed','disabled','Breaking\x20license','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','find','defaults','checkLicense','lodash','moment','./hardware','../environment','../../mysqldb','license','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','demo','uuid','getUuid','secrets','session','base64','final','gray','deadline','days'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xee3f,0x1df));var _0xfee3=function(_0x2c6ba2,_0xd32e17){_0x2c6ba2=_0x2c6ba2-0x0;var _0x75620e=_0xee3f[_0x2c6ba2];return _0x75620e;};'use strict';var crypto=require('crypto');var util=require('util');var _=require(_0xfee3('0x0'));var moment=require(_0xfee3('0x1'));var hardware=require(_0xfee3('0x2'));var config=require(_0xfee3('0x3'));var db=require(_0xfee3('0x4'))['db'];function checkLicense(_0x497e9e,_0x463c00){if(_0x497e9e){try{var _0x39e179=_0x463c00||_0x497e9e[_0xfee3('0x5')];if(_['isEmpty'](_0x39e179)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x244f88=_0x497e9e[_0xfee3('0x6')];var _0x26ce9d=_0x497e9e[_0xfee3('0x7')];var _0x16d29f=_0x244f88[_0xfee3('0x8')]('-')[0x4];var _0x5efea0=_0x244f88[_0xfee3('0x8')]('-')[0x0];var _0x53daf1=crypto[_0xfee3('0x9')](_0xfee3('0xa'),util[_0xfee3('0xb')](_0xfee3('0xc'),_0x16d29f,_0x244f88,_0x5efea0));var _0x3737b3=_0x53daf1[_0xfee3('0xd')](_0x39e179,'base64',_0xfee3('0xe'));_0x3737b3+=_0x53daf1['final'](_0xfee3('0xe'));var _0x377ebb=JSON['parse'](_0x3737b3);_0x377ebb[_0xfee3('0xf')]=![];_0x377ebb[_0xfee3('0x10')]=_0x244f88;_0x377ebb['machineUuid']=hardware[_0xfee3('0x11')]();if(_0x26ce9d){var _0x20c88d=crypto[_0xfee3('0x9')](_0xfee3('0xa'),config[_0xfee3('0x12')][_0xfee3('0x13')]);var _0x37f124=_0x20c88d[_0xfee3('0xd')](_0x26ce9d,_0xfee3('0x14'),_0xfee3('0xe'));_0x37f124+=_0x20c88d[_0xfee3('0x15')](_0xfee3('0xe'));_0x377ebb[_0xfee3('0x16')]=_0x37f124;_0x377ebb[_0xfee3('0x17')]=moment(_0x37f124)['add'](0x7,_0xfee3('0x18'))[_0xfee3('0xb')]();_0x377ebb[_0xfee3('0x19')]=_0x377ebb[_0xfee3('0x10')]!=_0x377ebb[_0xfee3('0x1a')]?_0xfee3('0x1b'):_0xfee3('0x1c');}return _0x377ebb;}catch(_0x3e3439){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':_0xfee3('0x1d'),'uuid':_0x497e9e['data1'],'machineUuid':hardware[_0xfee3('0x11')](),'message':_0x3e3439['message'],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfee3('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfee3('0x1f'),'uuid':_0x497e9e[_0xfee3('0x6')],'machineUuid':hardware[_0xfee3('0x11')](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports[_0xfee3('0x20')]=function(_0x190556){return db['License'][_0xfee3('0x21')](_[_0xfee3('0x22')](_0x190556,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x51530c){return checkLicense(_0x51530c,null);});};exports[_0xfee3('0x23')]=checkLicense;
\ No newline at end of file
+var _0x3ed3=['utf8','parse','uuid','machineUuid','getUuid','createDecipher','secrets','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','Demo\x20license','find','defaults','then','checkLicense','util','lodash','../environment','../../mysqldb','license','License\x20key\x20value\x20not\x20found','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','final'];(function(_0x270609,_0x2a7c70){var _0x54f250=function(_0x79802e){while(--_0x79802e){_0x270609['push'](_0x270609['shift']());}};_0x54f250(++_0x2a7c70);}(_0x3ed3,0x7a));var _0x33ed=function(_0x16091b,_0x46345f){_0x16091b=_0x16091b-0x0;var _0x5e9f7a=_0x3ed3[_0x16091b];return _0x5e9f7a;};'use strict';var crypto=require('crypto');var util=require(_0x33ed('0x0'));var _=require(_0x33ed('0x1'));var moment=require('moment');var hardware=require('./hardware');var config=require(_0x33ed('0x2'));var db=require(_0x33ed('0x3'))['db'];function checkLicense(_0x3e209d,_0x3ab8a4){if(_0x3e209d){try{var _0x3e06b4=_0x3ab8a4||_0x3e209d[_0x33ed('0x4')];if(_['isEmpty'](_0x3e06b4)){throw new Error(_0x33ed('0x5'));}var _0x118d79=_0x3e209d[_0x33ed('0x6')];var _0x411250=_0x3e209d['data2'];var _0x3a029c=_0x118d79[_0x33ed('0x7')]('-')[0x4];var _0x2b19b0=_0x118d79[_0x33ed('0x7')]('-')[0x0];var _0x56d651=crypto['createDecipher'](_0x33ed('0x8'),util[_0x33ed('0x9')](_0x33ed('0xa'),_0x3a029c,_0x118d79,_0x2b19b0));var _0x1b3d64=_0x56d651[_0x33ed('0xb')](_0x3e06b4,_0x33ed('0xc'),'utf8');_0x1b3d64+=_0x56d651[_0x33ed('0xd')](_0x33ed('0xe'));var _0x4a9545=JSON[_0x33ed('0xf')](_0x1b3d64);_0x4a9545['demo']=![];_0x4a9545[_0x33ed('0x10')]=_0x118d79;_0x4a9545[_0x33ed('0x11')]=hardware[_0x33ed('0x12')]();if(_0x411250){var _0x5c2f30=crypto[_0x33ed('0x13')](_0x33ed('0x8'),config[_0x33ed('0x14')]['session']);var _0xaf31ef=_0x5c2f30[_0x33ed('0xb')](_0x411250,'base64',_0x33ed('0xe'));_0xaf31ef+=_0x5c2f30[_0x33ed('0xd')](_0x33ed('0xe'));_0x4a9545['gray']=_0xaf31ef;_0x4a9545[_0x33ed('0x15')]=moment(_0xaf31ef)[_0x33ed('0x16')](0x7,_0x33ed('0x17'))[_0x33ed('0x9')]();_0x4a9545[_0x33ed('0x18')]=_0x4a9545[_0x33ed('0x10')]!=_0x4a9545[_0x33ed('0x11')]?_0x33ed('0x19'):_0x33ed('0x1a');}return _0x4a9545;}catch(_0x25604e){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x33ed('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x33ed('0x1c'),'uuid':_0x3e209d[_0x33ed('0x6')],'machineUuid':hardware['getUuid'](),'message':_0x25604e['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':_0x33ed('0x1d'),'uuid':_0x3e209d[_0x33ed('0x6')],'machineUuid':hardware[_0x33ed('0x12')](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports['getLicense']=function(_0x48ae05){return db['License'][_0x33ed('0x1e')](_[_0x33ed('0x1f')](_0x48ae05,{'raw':!![],'where':{'id':0x1}}))[_0x33ed('0x20')](function(_0x2616af){return checkLicense(_0x2616af,null);});};exports[_0x33ed('0x21')]=checkLicense;
\ No newline at end of file