Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / config / license / hardware.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x6d19=['lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','filter','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','md5','update','digest','hex','getUuid','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','substring'];(function(_0x225074,_0x1abb16){var _0x3fb50c=function(_0xf22c61){while(--_0xf22c61){_0x225074['push'](_0x225074['shift']());}};_0x3fb50c(++_0x1abb16);}(_0x6d19,0x160));var _0x96d1=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x6d19[_0x44946b];return _0x249bc4;};'use strict';var _=require(_0x96d1('0x0'));var os=require('os');var crypto=require(_0x96d1('0x1'));var machine=require(_0x96d1('0x2'));var exec=require(_0x96d1('0x3'))[_0x96d1('0x4')];function getInterfaces(){var _0x31518c=[];var _0x36405d=os['networkInterfaces']();var _0x186315=_[_0x96d1('0x5')](_[_0x96d1('0x6')](_0x36405d));for(var _0x4704b3=0x0;_0x4704b3<_0x186315['length'];_0x4704b3++){var _0x32b7d9=_0x36405d[_0x186315[_0x4704b3]][_0x96d1('0x7')](function(_0x61e0f5){return _0x61e0f5['family']===_0x96d1('0x8')&&_0x61e0f5[_0x96d1('0x9')]===![];});_0x31518c=_0x31518c[_0x96d1('0xa')](_0x32b7d9);}return _0x31518c;}function getFirstInterface(){var _0x4e1e7a=_[_0x96d1('0xb')](getInterfaces());return{'macAddress':_0x4e1e7a&&_0x4e1e7a[_0x96d1('0xc')]?_0x4e1e7a['mac']:'00:00:00:00:00:00','ipAddress':_0x4e1e7a&&_0x4e1e7a[_0x96d1('0xd')]?_0x4e1e7a[_0x96d1('0xd')]:'127.0.0.1'};}exports[_0x96d1('0xe')]=getFirstInterface;function getCPUhash(){var _0x51b089=_[_0x96d1('0x5')](os[_0x96d1('0xf')]()[_0x96d1('0x10')](function(_0xb019fb){return _0xb019fb[_0x96d1('0x11')];}))[_0x96d1('0x12')](':');return crypto['createHash'](_0x96d1('0x13'))[_0x96d1('0x14')](_0x51b089)[_0x96d1('0x15')](_0x96d1('0x16'));}exports[_0x96d1('0x17')]=function(){switch(os['platform']()){case'win32':return exec(_0x96d1('0x18'),{'encoding':_0x96d1('0x19')})[_0x96d1('0x1a')]('\x0d\x0a','');default:var _0x9eb2c4=getFirstInterface();var _0x2d521d=getCPUhash();var _0x3e9a0=_0x2d521d+'|'+os[_0x96d1('0x1b')]()+'|'+_0x9eb2c4[_0x96d1('0x1c')]+'|'+_0x9eb2c4[_0x96d1('0x1d')];var _0x5853f0=crypto[_0x96d1('0x1e')](_0x96d1('0x13'))[_0x96d1('0x14')](_0x3e9a0)[_0x96d1('0x15')](_0x96d1('0x16'));return _0x5853f0['substring'](0x0,0x8)+'-'+_0x5853f0[_0x96d1('0x1f')](0x8,0xc)+'-'+_0x5853f0[_0x96d1('0x1f')](0xc,0x10)+'-'+_0x5853f0[_0x96d1('0x1f')](0x10,0x14)+'-'+_0x5853f0[_0x96d1('0x1f')](0x14);}};