Built motion from commit (unavailable).|2.4.18
[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 _0x975f=['address','127.0.0.1','getFirstInterface','map','join','createHash','md5','update','digest','hex','getUuid','win32','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00'];(function(_0x3eecf2,_0x444f6a){var _0x8c26ba=function(_0x45a25d){while(--_0x45a25d){_0x3eecf2['push'](_0x3eecf2['shift']());}};_0x8c26ba(++_0x444f6a);}(_0x975f,0x109));var _0xf975=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x975f[_0x61b3ab];return _0x57097f;};'use strict';var _=require(_0xf975('0x0'));var os=require('os');var crypto=require(_0xf975('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xf975('0x2')];function getInterfaces(){var _0x274f21=[];var _0x556f63=os[_0xf975('0x3')]();var _0x2d047c=_[_0xf975('0x4')](_[_0xf975('0x5')](_0x556f63));for(var _0x4a3199=0x0;_0x4a3199<_0x2d047c[_0xf975('0x6')];_0x4a3199++){var _0x5a9aca=_0x556f63[_0x2d047c[_0x4a3199]][_0xf975('0x7')](function(_0x2018ea){return _0x2018ea['family']===_0xf975('0x8')&&_0x2018ea[_0xf975('0x9')]===![];});_0x274f21=_0x274f21[_0xf975('0xa')](_0x5a9aca);}return _0x274f21;}function getFirstInterface(){var _0x53dc00=_[_0xf975('0xb')](getInterfaces());return{'macAddress':_0x53dc00&&_0x53dc00[_0xf975('0xc')]?_0x53dc00['mac']:_0xf975('0xd'),'ipAddress':_0x53dc00&&_0x53dc00[_0xf975('0xe')]?_0x53dc00[_0xf975('0xe')]:_0xf975('0xf')};}exports[_0xf975('0x10')]=getFirstInterface;function getCPUhash(){var _0x22f122=_[_0xf975('0x4')](os['cpus']()[_0xf975('0x11')](function(_0x34111a){return _0x34111a['model'];}))[_0xf975('0x12')](':');return crypto[_0xf975('0x13')](_0xf975('0x14'))[_0xf975('0x15')](_0x22f122)[_0xf975('0x16')](_0xf975('0x17'));}exports[_0xf975('0x18')]=function(){switch(os['platform']()){case _0xf975('0x19'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xf975('0x1a')]('\x0d\x0a','');default:var _0x168a76=getFirstInterface();var _0x24b7dc=getCPUhash();var _0x3bcc62=_0x24b7dc+'|'+os[_0xf975('0x1b')]()+'|'+_0x168a76[_0xf975('0x1c')]+'|'+_0x168a76[_0xf975('0x1d')];var _0x4f6568=crypto['createHash'](_0xf975('0x14'))[_0xf975('0x15')](_0x3bcc62)[_0xf975('0x16')](_0xf975('0x17'));return _0x4f6568[_0xf975('0x1e')](0x0,0x8)+'-'+_0x4f6568[_0xf975('0x1e')](0x8,0xc)+'-'+_0x4f6568['substring'](0xc,0x10)+'-'+_0x4f6568[_0xf975('0x1e')](0x10,0x14)+'-'+_0x4f6568[_0xf975('0x1e')](0x14);}};