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 _0x81d4=['127.0.0.1','getFirstInterface','cpus','map','join','update','digest','hex','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','crypto','bimedia-machine-uuid','execSync','orderBy','keys','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','address'];(function(_0x5a65c1,_0xea1e75){var _0x346660=function(_0xa352ae){while(--_0xa352ae){_0x5a65c1['push'](_0x5a65c1['shift']());}};_0x346660(++_0xea1e75);}(_0x81d4,0x197));var _0x481d=function(_0x26f77f,_0x28dbb9){_0x26f77f=_0x26f77f-0x0;var _0x348d51=_0x81d4[_0x26f77f];return _0x348d51;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x481d('0x0'));var machine=require(_0x481d('0x1'));var exec=require('child_process')[_0x481d('0x2')];function getInterfaces(){var _0x369cf6=[];var _0x266766=os['networkInterfaces']();var _0x5af777=_[_0x481d('0x3')](_[_0x481d('0x4')](_0x266766));for(var _0x2ecf40=0x0;_0x2ecf40<_0x5af777['length'];_0x2ecf40++){var _0x1ef8ca=_0x266766[_0x5af777[_0x2ecf40]][_0x481d('0x5')](function(_0x2f91fd){return _0x2f91fd[_0x481d('0x6')]===_0x481d('0x7')&&_0x2f91fd[_0x481d('0x8')]===![];});_0x369cf6=_0x369cf6['concat'](_0x1ef8ca);}return _0x369cf6;}function getFirstInterface(){var _0x3b7273=_[_0x481d('0x9')](getInterfaces());return{'macAddress':_0x3b7273&&_0x3b7273[_0x481d('0xa')]?_0x3b7273['mac']:_0x481d('0xb'),'ipAddress':_0x3b7273&&_0x3b7273[_0x481d('0xc')]?_0x3b7273['address']:_0x481d('0xd')};}exports[_0x481d('0xe')]=getFirstInterface;function getCPUhash(){var _0x22f802=_[_0x481d('0x3')](os[_0x481d('0xf')]()[_0x481d('0x10')](function(_0x9c7a08){return _0x9c7a08['model'];}))[_0x481d('0x11')](':');return crypto['createHash']('md5')[_0x481d('0x12')](_0x22f802)[_0x481d('0x13')](_0x481d('0x14'));}exports['getUuid']=function(){switch(os[_0x481d('0x15')]()){case'win32':return exec(_0x481d('0x16'),{'encoding':_0x481d('0x17')})[_0x481d('0x18')]('\x0d\x0a','');default:var _0x1bda12=getFirstInterface();var _0x879e29=getCPUhash();var _0x59c5d5=_0x879e29+'|'+os[_0x481d('0x19')]()+'|'+_0x1bda12[_0x481d('0x1a')]+'|'+_0x1bda12[_0x481d('0x1b')];var _0x4f399b=crypto[_0x481d('0x1c')]('md5')[_0x481d('0x12')](_0x59c5d5)['digest'](_0x481d('0x14'));return _0x4f399b['substring'](0x0,0x8)+'-'+_0x4f399b[_0x481d('0x1d')](0x8,0xc)+'-'+_0x4f399b['substring'](0xc,0x10)+'-'+_0x4f399b[_0x481d('0x1d')](0x10,0x14)+'-'+_0x4f399b['substring'](0x14);}};