Built motion from commit 87cd5f02.|2.5.48
[motion2.git] / server / config / license / hardware.js
index 276684a..65c2303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f80=['../environment','networkInterfaces','orderBy','keys','filter','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','digest','hex','getUuid','test','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','update','substring','lodash','bimedia-machine-uuid','child_process'];(function(_0xa9cd31,_0xff422b){var _0x30e2c5=function(_0x40fea1){while(--_0x40fea1){_0xa9cd31['push'](_0xa9cd31['shift']());}};_0x30e2c5(++_0xff422b);}(_0x8f80,0x1ed));var _0x08f8=function(_0x30ed55,_0x55a112){_0x30ed55=_0x30ed55-0x0;var _0x149e64=_0x8f80[_0x30ed55];return _0x149e64;};'use strict';var _=require(_0x08f8('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x08f8('0x1'));var exec=require(_0x08f8('0x2'))['execSync'];var config=require(_0x08f8('0x3'));function getInterfaces(){var _0x835aea=[];var _0x41d410=os[_0x08f8('0x4')]();var _0x357d0a=_[_0x08f8('0x5')](_[_0x08f8('0x6')](_0x41d410));for(var _0x4cdada=0x0;_0x4cdada<_0x357d0a['length'];_0x4cdada++){var _0x496dc1=_0x41d410[_0x357d0a[_0x4cdada]][_0x08f8('0x7')](function(_0x26d08c){return _0x26d08c['family']===_0x08f8('0x8')&&_0x26d08c['internal']===![];});_0x835aea=_0x835aea['concat'](_0x496dc1);}return _0x835aea;}function getFirstInterface(){var _0x30f0fd=_[_0x08f8('0x9')](getInterfaces());return{'macAddress':_0x30f0fd&&_0x30f0fd[_0x08f8('0xa')]?_0x30f0fd[_0x08f8('0xa')]:_0x08f8('0xb'),'ipAddress':_0x30f0fd&&_0x30f0fd[_0x08f8('0xc')]?_0x30f0fd['address']:_0x08f8('0xd')};}exports[_0x08f8('0xe')]=getFirstInterface;function getCPUhash(){var _0x1fa180=_[_0x08f8('0x5')](os[_0x08f8('0xf')]()['map'](function(_0x371609){return _0x371609[_0x08f8('0x10')];}))[_0x08f8('0x11')](':');return crypto[_0x08f8('0x12')](_0x08f8('0x13'))['update'](_0x1fa180)[_0x08f8('0x14')](_0x08f8('0x15'));}exports[_0x08f8('0x16')]=function(){var _0x381693=os['platform']();var _0x2aee96=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2aee96[_0x08f8('0x17')](config[_0x08f8('0x18')])){return config[_0x08f8('0x18')];}else if(_0x381693==='win32'){return exec(_0x08f8('0x19'),{'encoding':_0x08f8('0x1a')})['replace']('\x0d\x0a','');}else{var _0x2bad38=getFirstInterface();var _0x45ac07=getCPUhash();var _0x2bf9ac=_0x45ac07+'|'+os[_0x08f8('0x1b')]()+'|'+_0x2bad38[_0x08f8('0x1c')]+'|'+_0x2bad38['ipAddress'];var _0x28b181=crypto[_0x08f8('0x12')]('md5')[_0x08f8('0x1d')](_0x2bf9ac)[_0x08f8('0x14')]('hex');return _0x28b181[_0x08f8('0x1e')](0x0,0x8)+'-'+_0x28b181[_0x08f8('0x1e')](0x8,0xc)+'-'+_0x28b181[_0x08f8('0x1e')](0xc,0x10)+'-'+_0x28b181[_0x08f8('0x1e')](0x10,0x14)+'-'+_0x28b181['substring'](0x14);}};
\ No newline at end of file
+var _0x91b5=['internal','concat','head','mac','address','getFirstInterface','orderBy','cpus','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','utf8','substring','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','filter','family','IPv4'];(function(_0x5d911c,_0x34a1dc){var _0x2220d3=function(_0x4ff48b){while(--_0x4ff48b){_0x5d911c['push'](_0x5d911c['shift']());}};_0x2220d3(++_0x34a1dc);}(_0x91b5,0x92));var _0x591b=function(_0x12d39a,_0x4b41bb){_0x12d39a=_0x12d39a-0x0;var _0x34e1a2=_0x91b5[_0x12d39a];return _0x34e1a2;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x591b('0x0'));var exec=require(_0x591b('0x1'))[_0x591b('0x2')];var config=require(_0x591b('0x3'));function getInterfaces(){var _0x2a4721=[];var _0x69b7c3=os[_0x591b('0x4')]();var _0x3b65b2=_['orderBy'](_[_0x591b('0x5')](_0x69b7c3));for(var _0x48aabc=0x0;_0x48aabc<_0x3b65b2['length'];_0x48aabc++){var _0x4587a8=_0x69b7c3[_0x3b65b2[_0x48aabc]][_0x591b('0x6')](function(_0x40e41a){return _0x40e41a[_0x591b('0x7')]===_0x591b('0x8')&&_0x40e41a[_0x591b('0x9')]===![];});_0x2a4721=_0x2a4721[_0x591b('0xa')](_0x4587a8);}return _0x2a4721;}function getFirstInterface(){var _0x494001=_[_0x591b('0xb')](getInterfaces());return{'macAddress':_0x494001&&_0x494001[_0x591b('0xc')]?_0x494001[_0x591b('0xc')]:'00:00:00:00:00:00','ipAddress':_0x494001&&_0x494001[_0x591b('0xd')]?_0x494001[_0x591b('0xd')]:'127.0.0.1'};}exports[_0x591b('0xe')]=getFirstInterface;function getCPUhash(){var _0x8fdb64=_[_0x591b('0xf')](os[_0x591b('0x10')]()['map'](function(_0x3d64db){return _0x3d64db[_0x591b('0x11')];}))[_0x591b('0x12')](':');return crypto[_0x591b('0x13')](_0x591b('0x14'))[_0x591b('0x15')](_0x8fdb64)[_0x591b('0x16')](_0x591b('0x17'));}exports[_0x591b('0x18')]=function(){var _0x562d10=os[_0x591b('0x19')]();var _0x4a9f9b=/[0-9a-f-]{36}/;if(config[_0x591b('0x1a')]&&_0x4a9f9b[_0x591b('0x1b')](config['licenseToken'])){return config[_0x591b('0x1a')];}else if(_0x562d10===_0x591b('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x591b('0x1d')})['replace']('\x0d\x0a','');}else{var _0x29a7ab=getFirstInterface();var _0x191e50=getCPUhash();var _0x10b210=_0x191e50+'|'+os['hostname']()+'|'+_0x29a7ab['macAddress']+'|'+_0x29a7ab['ipAddress'];var _0x51a987=crypto[_0x591b('0x13')](_0x591b('0x14'))['update'](_0x10b210)[_0x591b('0x16')](_0x591b('0x17'));return _0x51a987[_0x591b('0x1e')](0x0,0x8)+'-'+_0x51a987[_0x591b('0x1e')](0x8,0xc)+'-'+_0x51a987[_0x591b('0x1e')](0xc,0x10)+'-'+_0x51a987['substring'](0x10,0x14)+'-'+_0x51a987[_0x591b('0x1e')](0x14);}};
\ No newline at end of file