Built motion from commit (unavailable).|2.5.13
[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 _0xfc65=['substring','lodash','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress'];(function(_0x1b608d,_0x1919fc){var _0x472614=function(_0x8c681a){while(--_0x8c681a){_0x1b608d['push'](_0x1b608d['shift']());}};_0x472614(++_0x1919fc);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x15fa03,_0x5c93d5){_0x15fa03=_0x15fa03-0x0;var _0x23ff77=_0xfc65[_0x15fa03];return _0x23ff77;};'use strict';var _=require(_0x5fc6('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x5fc6('0x1'))[_0x5fc6('0x2')];function getInterfaces(){var _0x28dca3=[];var _0x4018d6=os[_0x5fc6('0x3')]();var _0x34b758=_[_0x5fc6('0x4')](_[_0x5fc6('0x5')](_0x4018d6));for(var _0x45609d=0x0;_0x45609d<_0x34b758[_0x5fc6('0x6')];_0x45609d++){var _0x3100b4=_0x4018d6[_0x34b758[_0x45609d]][_0x5fc6('0x7')](function(_0x1a9600){return _0x1a9600['family']===_0x5fc6('0x8')&&_0x1a9600[_0x5fc6('0x9')]===![];});_0x28dca3=_0x28dca3[_0x5fc6('0xa')](_0x3100b4);}return _0x28dca3;}function getFirstInterface(){var _0x3d9a11=_[_0x5fc6('0xb')](getInterfaces());return{'macAddress':_0x3d9a11&&_0x3d9a11[_0x5fc6('0xc')]?_0x3d9a11[_0x5fc6('0xc')]:_0x5fc6('0xd'),'ipAddress':_0x3d9a11&&_0x3d9a11[_0x5fc6('0xe')]?_0x3d9a11[_0x5fc6('0xe')]:'127.0.0.1'};}exports[_0x5fc6('0xf')]=getFirstInterface;function getCPUhash(){var _0x51ad7e=_[_0x5fc6('0x4')](os[_0x5fc6('0x10')]()[_0x5fc6('0x11')](function(_0x1dd2d6){return _0x1dd2d6['model'];}))[_0x5fc6('0x12')](':');return crypto[_0x5fc6('0x13')](_0x5fc6('0x14'))[_0x5fc6('0x15')](_0x51ad7e)[_0x5fc6('0x16')](_0x5fc6('0x17'));}exports[_0x5fc6('0x18')]=function(){switch(os[_0x5fc6('0x19')]()){case _0x5fc6('0x1a'):return exec(_0x5fc6('0x1b'),{'encoding':'utf8'})['replace']('\x0d\x0a','');default:var _0x3b35b2=getFirstInterface();var _0x45f10e=getCPUhash();var _0x5cb1c7=_0x45f10e+'|'+os[_0x5fc6('0x1c')]()+'|'+_0x3b35b2[_0x5fc6('0x1d')]+'|'+_0x3b35b2[_0x5fc6('0x1e')];var _0x2f2661=crypto[_0x5fc6('0x13')](_0x5fc6('0x14'))['update'](_0x5cb1c7)[_0x5fc6('0x16')](_0x5fc6('0x17'));return _0x2f2661[_0x5fc6('0x1f')](0x0,0x8)+'-'+_0x2f2661[_0x5fc6('0x1f')](0x8,0xc)+'-'+_0x2f2661['substring'](0xc,0x10)+'-'+_0x2f2661[_0x5fc6('0x1f')](0x10,0x14)+'-'+_0x2f2661[_0x5fc6('0x1f')](0x14);}};