6283b14ea3a06302ea505ac95723b304dfd47c4c
[motion-next.git] / server / config / license / hardware.js
1 const a843_0xee46=['concat','replace','hex','digest','networkInterfaces','test','utf8','mac','createHash','IPv4','devLicense','md5','crypto','../config.service','map','model','head','internal','execSync','dmidecode\x20--string\x20system-uuid','macAddress','hostname','update','filter','00:00:00:00:00:00','substring','address','orderBy','exports','family','length','keys','ipAddress','win32'];(function(_0x3aa000,_0xee4671){const _0x14e6bf=function(_0x37f1d9){while(--_0x37f1d9){_0x3aa000['push'](_0x3aa000['shift']());}};_0x14e6bf(++_0xee4671);}(a843_0xee46,0x12a));const a843_0x14e6=function(_0x3aa000,_0xee4671){_0x3aa000=_0x3aa000-0x0;let _0x14e6bf=a843_0xee46[_0x3aa000];return _0x14e6bf;};const _0x5c5c5f=a843_0x14e6;'use strict';const _=require('lodash'),os=require('os'),crypto=require(_0x5c5c5f('0x14')),{getConfigService}=require(_0x5c5c5f('0x15')),exec=require('child_process')[_0x5c5c5f('0x1a')];function getInterfaces(){const _0xa3fceb=_0x5c5c5f;let _0x37f1d9=[];const _0x1f0e89=os[_0xa3fceb('0xc')](),_0x4b1cac=_['orderBy'](_[_0xa3fceb('0x5')](_0x1f0e89));for(let _0x4abdb=0x0;_0x4abdb<_0x4b1cac[_0xa3fceb('0x4')];_0x4abdb++){const _0x528437=_0x1f0e89[_0x4b1cac[_0x4abdb]][_0xa3fceb('0x1f')](function(_0x316be7){const _0x21159a=_0xa3fceb;return _0x316be7[_0x21159a('0x3')]===_0x21159a('0x11')&&_0x316be7[_0x21159a('0x19')]===![];});_0x37f1d9=_0x37f1d9[_0xa3fceb('0x8')](_0x528437);}return _0x37f1d9;}function getFirstInterface(){const _0x107c77=_0x5c5c5f,_0x50ee7e=_[_0x107c77('0x18')](getInterfaces());return{'macAddress':_0x50ee7e&&_0x50ee7e[_0x107c77('0xf')]?_0x50ee7e['mac']:_0x107c77('0x20'),'ipAddress':_0x50ee7e&&_0x50ee7e[_0x107c77('0x0')]?_0x50ee7e[_0x107c77('0x0')]:'127.0.0.1'};}function getCPUhash(){const _0x4494d6=_0x5c5c5f,_0x2d2b2c=_[_0x4494d6('0x1')](os['cpus']()[_0x4494d6('0x16')](function(_0x463d41){const _0x28378b=_0x4494d6;return _0x463d41[_0x28378b('0x17')];}))['join'](':');return crypto[_0x4494d6('0x10')](_0x4494d6('0x13'))[_0x4494d6('0x1e')](_0x2d2b2c)[_0x4494d6('0xb')](_0x4494d6('0xa'));}function getUuid(){const _0x46e46d=_0x5c5c5f,_0x3cd2de=getConfigService(),_0x26348b=os['platform'](),_0x25f47a=/[0-9a-f-]{36}/;if(!_0x3cd2de['isProduction']&&_0x25f47a[_0x46e46d('0xd')](_0x3cd2de[_0x46e46d('0x12')]))return _0x3cd2de[_0x46e46d('0x12')];else{if(_0x26348b===_0x46e46d('0x7'))return exec(_0x46e46d('0x1b'),{'encoding':_0x46e46d('0xe')})[_0x46e46d('0x9')]('\x0d\x0a','');else{const _0x559cc8=getFirstInterface(),_0x4175f2=getCPUhash(),_0x156756=_0x4175f2+'|'+os[_0x46e46d('0x1d')]()+'|'+_0x559cc8[_0x46e46d('0x1c')]+'|'+_0x559cc8[_0x46e46d('0x6')],_0x298612=crypto[_0x46e46d('0x10')]('md5')[_0x46e46d('0x1e')](_0x156756)[_0x46e46d('0xb')](_0x46e46d('0xa'));return _0x298612[_0x46e46d('0x21')](0x0,0x8)+'-'+_0x298612[_0x46e46d('0x21')](0x8,0xc)+'-'+_0x298612[_0x46e46d('0x21')](0xc,0x10)+'-'+_0x298612['substring'](0x10,0x14)+'-'+_0x298612['substring'](0x14);}}}module[_0x5c5c5f('0x2')]={'getUuid':getUuid,'getFirstInterface':getFirstInterface,'getCPUhash':getCPUhash};