Built motion from commit (unavailable).|2.5.1
[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 _0x3435=['length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','join','createHash','update','hex','getUuid','platform','win32','utf8','replace','hostname','macAddress','ipAddress','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces'];(function(_0x1fc899,_0x3c4319){var _0x5a0048=function(_0x2de24b){while(--_0x2de24b){_0x1fc899['push'](_0x1fc899['shift']());}};_0x5a0048(++_0x3c4319);}(_0x3435,0xfa));var _0x5343=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x3435[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x5343('0x0'));var os=require('os');var crypto=require(_0x5343('0x1'));var machine=require(_0x5343('0x2'));var exec=require(_0x5343('0x3'))[_0x5343('0x4')];function getInterfaces(){var _0x2a91fe=[];var _0x597aa9=os[_0x5343('0x5')]();var _0x3ae07e=_['orderBy'](_['keys'](_0x597aa9));for(var _0x1f0046=0x0;_0x1f0046<_0x3ae07e[_0x5343('0x6')];_0x1f0046++){var _0x4d26b5=_0x597aa9[_0x3ae07e[_0x1f0046]]['filter'](function(_0x13641f){return _0x13641f[_0x5343('0x7')]===_0x5343('0x8')&&_0x13641f[_0x5343('0x9')]===![];});_0x2a91fe=_0x2a91fe[_0x5343('0xa')](_0x4d26b5);}return _0x2a91fe;}function getFirstInterface(){var _0x5e1147=_[_0x5343('0xb')](getInterfaces());return{'macAddress':_0x5e1147&&_0x5e1147['mac']?_0x5e1147[_0x5343('0xc')]:_0x5343('0xd'),'ipAddress':_0x5e1147&&_0x5e1147[_0x5343('0xe')]?_0x5e1147[_0x5343('0xe')]:_0x5343('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x42a94a=_[_0x5343('0x10')](os[_0x5343('0x11')]()['map'](function(_0x2ddeb7){return _0x2ddeb7['model'];}))[_0x5343('0x12')](':');return crypto[_0x5343('0x13')]('md5')[_0x5343('0x14')](_0x42a94a)['digest'](_0x5343('0x15'));}exports[_0x5343('0x16')]=function(){switch(os[_0x5343('0x17')]()){case _0x5343('0x18'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x5343('0x19')})[_0x5343('0x1a')]('\x0d\x0a','');default:var _0x1df724=getFirstInterface();var _0x3f27fb=getCPUhash();var _0x45cade=_0x3f27fb+'|'+os[_0x5343('0x1b')]()+'|'+_0x1df724[_0x5343('0x1c')]+'|'+_0x1df724[_0x5343('0x1d')];var _0x4cf3c2=crypto[_0x5343('0x13')](_0x5343('0x1e'))[_0x5343('0x14')](_0x45cade)['digest'](_0x5343('0x15'));return _0x4cf3c2[_0x5343('0x1f')](0x0,0x8)+'-'+_0x4cf3c2[_0x5343('0x1f')](0x8,0xc)+'-'+_0x4cf3c2[_0x5343('0x1f')](0xc,0x10)+'-'+_0x4cf3c2[_0x5343('0x1f')](0x10,0x14)+'-'+_0x4cf3c2[_0x5343('0x1f')](0x14);}};