Built motion from commit (unavailable).|2.5.4
[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 _0xed1f=['hostname','macAddress','digest','substring','lodash','crypto','execSync','orderBy','keys','length','filter','family','IPv4','concat','head','mac','address','127.0.0.1','cpus','join','createHash','md5','update','hex','getUuid','dmidecode\x20--string\x20system-uuid','utf8','replace'];(function(_0x224a5b,_0x20e90b){var _0x30d3cd=function(_0x13c9fd){while(--_0x13c9fd){_0x224a5b['push'](_0x224a5b['shift']());}};_0x30d3cd(++_0x20e90b);}(_0xed1f,0x170));var _0xfed1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xed1f[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xfed1('0x0'));var os=require('os');var crypto=require(_0xfed1('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xfed1('0x2')];function getInterfaces(){var _0x5c56c8=[];var _0x36764e=os['networkInterfaces']();var _0x444ba8=_[_0xfed1('0x3')](_[_0xfed1('0x4')](_0x36764e));for(var _0x183daa=0x0;_0x183daa<_0x444ba8[_0xfed1('0x5')];_0x183daa++){var _0x1f2391=_0x36764e[_0x444ba8[_0x183daa]][_0xfed1('0x6')](function(_0x396781){return _0x396781[_0xfed1('0x7')]===_0xfed1('0x8')&&_0x396781['internal']===![];});_0x5c56c8=_0x5c56c8[_0xfed1('0x9')](_0x1f2391);}return _0x5c56c8;}function getFirstInterface(){var _0x38d525=_[_0xfed1('0xa')](getInterfaces());return{'macAddress':_0x38d525&&_0x38d525['mac']?_0x38d525[_0xfed1('0xb')]:'00:00:00:00:00:00','ipAddress':_0x38d525&&_0x38d525['address']?_0x38d525[_0xfed1('0xc')]:_0xfed1('0xd')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x58d008=_[_0xfed1('0x3')](os[_0xfed1('0xe')]()['map'](function(_0x56555a){return _0x56555a['model'];}))[_0xfed1('0xf')](':');return crypto[_0xfed1('0x10')](_0xfed1('0x11'))[_0xfed1('0x12')](_0x58d008)['digest'](_0xfed1('0x13'));}exports[_0xfed1('0x14')]=function(){switch(os['platform']()){case'win32':return exec(_0xfed1('0x15'),{'encoding':_0xfed1('0x16')})[_0xfed1('0x17')]('\x0d\x0a','');default:var _0x5ed220=getFirstInterface();var _0x223f42=getCPUhash();var _0x2218d5=_0x223f42+'|'+os[_0xfed1('0x18')]()+'|'+_0x5ed220[_0xfed1('0x19')]+'|'+_0x5ed220['ipAddress'];var _0x31ff97=crypto['createHash'](_0xfed1('0x11'))[_0xfed1('0x12')](_0x2218d5)[_0xfed1('0x1a')](_0xfed1('0x13'));return _0x31ff97[_0xfed1('0x1b')](0x0,0x8)+'-'+_0x31ff97[_0xfed1('0x1b')](0x8,0xc)+'-'+_0x31ff97[_0xfed1('0x1b')](0xc,0x10)+'-'+_0x31ff97[_0xfed1('0x1b')](0x10,0x14)+'-'+_0x31ff97[_0xfed1('0x1b')](0x14);}};