Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / config / license / hardware.js
index fea426f..5f0b51e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14f5=['address','orderBy','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','substring','crypto','child_process','execSync','networkInterfaces','keys','length','filter','family','internal','head','mac','00:00:00:00:00:00'];(function(_0x5ed32c,_0x956025){var _0x271ea3=function(_0x206a21){while(--_0x206a21){_0x5ed32c['push'](_0x5ed32c['shift']());}};_0x271ea3(++_0x956025);}(_0x14f5,0xae));var _0x514f=function(_0x5416c0,_0x3d5244){_0x5416c0=_0x5416c0-0x0;var _0xdc8a3a=_0x14f5[_0x5416c0];return _0xdc8a3a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x514f('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x514f('0x1'))[_0x514f('0x2')];function getInterfaces(){var _0x12d5e2=[];var _0x5281a3=os[_0x514f('0x3')]();var _0x2443e8=_['orderBy'](_[_0x514f('0x4')](_0x5281a3));for(var _0x1e90d4=0x0;_0x1e90d4<_0x2443e8[_0x514f('0x5')];_0x1e90d4++){var _0x434452=_0x5281a3[_0x2443e8[_0x1e90d4]][_0x514f('0x6')](function(_0x43ec42){return _0x43ec42[_0x514f('0x7')]==='IPv4'&&_0x43ec42[_0x514f('0x8')]===![];});_0x12d5e2=_0x12d5e2['concat'](_0x434452);}return _0x12d5e2;}function getFirstInterface(){var _0x302bcf=_[_0x514f('0x9')](getInterfaces());return{'macAddress':_0x302bcf&&_0x302bcf[_0x514f('0xa')]?_0x302bcf[_0x514f('0xa')]:_0x514f('0xb'),'ipAddress':_0x302bcf&&_0x302bcf[_0x514f('0xc')]?_0x302bcf[_0x514f('0xc')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x486bec=_[_0x514f('0xd')](os[_0x514f('0xe')]()[_0x514f('0xf')](function(_0x321914){return _0x321914[_0x514f('0x10')];}))[_0x514f('0x11')](':');return crypto[_0x514f('0x12')](_0x514f('0x13'))[_0x514f('0x14')](_0x486bec)[_0x514f('0x15')](_0x514f('0x16'));}exports[_0x514f('0x17')]=function(){switch(os[_0x514f('0x18')]()){case _0x514f('0x19'):return exec(_0x514f('0x1a'),{'encoding':'utf8'})[_0x514f('0x1b')]('\x0d\x0a','');default:var _0x1f0cbe=getFirstInterface();var _0x519b63=getCPUhash();var _0x255996=_0x519b63+'|'+os['hostname']()+'|'+_0x1f0cbe[_0x514f('0x1c')]+'|'+_0x1f0cbe[_0x514f('0x1d')];var _0x466ca8=crypto['createHash'](_0x514f('0x13'))[_0x514f('0x14')](_0x255996)[_0x514f('0x15')](_0x514f('0x16'));return _0x466ca8['substring'](0x0,0x8)+'-'+_0x466ca8['substring'](0x8,0xc)+'-'+_0x466ca8[_0x514f('0x1e')](0xc,0x10)+'-'+_0x466ca8[_0x514f('0x1e')](0x10,0x14)+'-'+_0x466ca8[_0x514f('0x1e')](0x14);}};
\ No newline at end of file
+var _0xcf62=['model','join','createHash','update','hex','getUuid','platform','test','licenseToken','utf8','ipAddress','md5','digest','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','keys','length','filter','family','IPv4','internal','head','mac','address','getFirstInterface','orderBy','map'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0xcf62,0x1df));var _0x2cf6=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xcf62[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x2cf6('0x0'));var os=require('os');var crypto=require(_0x2cf6('0x1'));var machine=require(_0x2cf6('0x2'));var exec=require('child_process')[_0x2cf6('0x3')];var config=require(_0x2cf6('0x4'));function getInterfaces(){var _0x2c6061=[];var _0xacdc7a=os['networkInterfaces']();var _0x13fda0=_['orderBy'](_[_0x2cf6('0x5')](_0xacdc7a));for(var _0x1f5879=0x0;_0x1f5879<_0x13fda0[_0x2cf6('0x6')];_0x1f5879++){var _0x47952a=_0xacdc7a[_0x13fda0[_0x1f5879]][_0x2cf6('0x7')](function(_0x43ff18){return _0x43ff18[_0x2cf6('0x8')]===_0x2cf6('0x9')&&_0x43ff18[_0x2cf6('0xa')]===![];});_0x2c6061=_0x2c6061['concat'](_0x47952a);}return _0x2c6061;}function getFirstInterface(){var _0x1c19cc=_[_0x2cf6('0xb')](getInterfaces());return{'macAddress':_0x1c19cc&&_0x1c19cc[_0x2cf6('0xc')]?_0x1c19cc[_0x2cf6('0xc')]:'00:00:00:00:00:00','ipAddress':_0x1c19cc&&_0x1c19cc[_0x2cf6('0xd')]?_0x1c19cc[_0x2cf6('0xd')]:'127.0.0.1'};}exports[_0x2cf6('0xe')]=getFirstInterface;function getCPUhash(){var _0x2ff3db=_[_0x2cf6('0xf')](os['cpus']()[_0x2cf6('0x10')](function(_0x5e2bbc){return _0x5e2bbc[_0x2cf6('0x11')];}))[_0x2cf6('0x12')](':');return crypto[_0x2cf6('0x13')]('md5')[_0x2cf6('0x14')](_0x2ff3db)['digest'](_0x2cf6('0x15'));}exports[_0x2cf6('0x16')]=function(){var _0x14eadf=os[_0x2cf6('0x17')]();var _0x2d00f6=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2d00f6[_0x2cf6('0x18')](config[_0x2cf6('0x19')])){return config[_0x2cf6('0x19')];}else if(_0x14eadf==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x2cf6('0x1a')})['replace']('\x0d\x0a','');}else{var _0x521224=getFirstInterface();var _0x1f33ff=getCPUhash();var _0x21aeba=_0x1f33ff+'|'+os['hostname']()+'|'+_0x521224['macAddress']+'|'+_0x521224[_0x2cf6('0x1b')];var _0x18c221=crypto['createHash'](_0x2cf6('0x1c'))['update'](_0x21aeba)[_0x2cf6('0x1d')](_0x2cf6('0x15'));return _0x18c221[_0x2cf6('0x1e')](0x0,0x8)+'-'+_0x18c221['substring'](0x8,0xc)+'-'+_0x18c221[_0x2cf6('0x1e')](0xc,0x10)+'-'+_0x18c221[_0x2cf6('0x1e')](0x10,0x14)+'-'+_0x18c221[_0x2cf6('0x1e')](0x14);}};
\ No newline at end of file