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 _0x9f5a=['filter','family','IPv4','internal','concat','mac','address','cpus','map','model','join','createHash','update','digest','win32','replace','macAddress','ipAddress','md5','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','length'];(function(_0x1feefe,_0x2018ad){var _0x56471a=function(_0x8745df){while(--_0x8745df){_0x1feefe['push'](_0x1feefe['shift']());}};_0x56471a(++_0x2018ad);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x1f8e1d,_0x3f157e){_0x1f8e1d=_0x1f8e1d-0x0;var _0x223193=_0x9f5a[_0x1f8e1d];return _0x223193;};'use strict';var _=require(_0xa9f5('0x0'));var os=require('os');var crypto=require(_0xa9f5('0x1'));var machine=require(_0xa9f5('0x2'));var exec=require(_0xa9f5('0x3'))['execSync'];function getInterfaces(){var _0x4268b0=[];var _0x45e3f5=os[_0xa9f5('0x4')]();var _0x4eeedd=_[_0xa9f5('0x5')](_['keys'](_0x45e3f5));for(var _0x1a2b95=0x0;_0x1a2b95<_0x4eeedd[_0xa9f5('0x6')];_0x1a2b95++){var _0x49e337=_0x45e3f5[_0x4eeedd[_0x1a2b95]][_0xa9f5('0x7')](function(_0x285dad){return _0x285dad[_0xa9f5('0x8')]===_0xa9f5('0x9')&&_0x285dad[_0xa9f5('0xa')]===![];});_0x4268b0=_0x4268b0[_0xa9f5('0xb')](_0x49e337);}return _0x4268b0;}function getFirstInterface(){var _0x189ef8=_['head'](getInterfaces());return{'macAddress':_0x189ef8&&_0x189ef8[_0xa9f5('0xc')]?_0x189ef8[_0xa9f5('0xc')]:'00:00:00:00:00:00','ipAddress':_0x189ef8&&_0x189ef8[_0xa9f5('0xd')]?_0x189ef8[_0xa9f5('0xd')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x418ba3=_[_0xa9f5('0x5')](os[_0xa9f5('0xe')]()[_0xa9f5('0xf')](function(_0x4c26a8){return _0x4c26a8[_0xa9f5('0x10')];}))[_0xa9f5('0x11')](':');return crypto[_0xa9f5('0x12')]('md5')[_0xa9f5('0x13')](_0x418ba3)[_0xa9f5('0x14')]('hex');}exports['getUuid']=function(){switch(os['platform']()){case _0xa9f5('0x15'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xa9f5('0x16')]('\x0d\x0a','');default:var _0x131ed6=getFirstInterface();var _0x44f5e4=getCPUhash();var _0x415f12=_0x44f5e4+'|'+os['hostname']()+'|'+_0x131ed6[_0xa9f5('0x17')]+'|'+_0x131ed6[_0xa9f5('0x18')];var _0x230fc2=crypto[_0xa9f5('0x12')](_0xa9f5('0x19'))[_0xa9f5('0x13')](_0x415f12)[_0xa9f5('0x14')](_0xa9f5('0x1a'));return _0x230fc2[_0xa9f5('0x1b')](0x0,0x8)+'-'+_0x230fc2[_0xa9f5('0x1b')](0x8,0xc)+'-'+_0x230fc2[_0xa9f5('0x1b')](0xc,0x10)+'-'+_0x230fc2[_0xa9f5('0x1b')](0x10,0x14)+'-'+_0x230fc2['substring'](0x14);}};