Built motion from commit (unavailable).|2.5.15
[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 _0x8ece=['child_process','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','macAddress','ipAddress','md5','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x26fc7c,_0x1784f9){var _0x303753=function(_0x5db0e4){while(--_0x5db0e4){_0x26fc7c['push'](_0x26fc7c['shift']());}};_0x303753(++_0x1784f9);}(_0x8ece,0x195));var _0xe8ec=function(_0x24d15e,_0x242fa4){_0x24d15e=_0x24d15e-0x0;var _0x9dcd72=_0x8ece[_0x24d15e];return _0x9dcd72;};'use strict';var _=require(_0xe8ec('0x0'));var os=require('os');var crypto=require(_0xe8ec('0x1'));var machine=require(_0xe8ec('0x2'));var exec=require(_0xe8ec('0x3'))['execSync'];function getInterfaces(){var _0x47b1c1=[];var _0xe18b82=os[_0xe8ec('0x4')]();var _0x5047e7=_[_0xe8ec('0x5')](_[_0xe8ec('0x6')](_0xe18b82));for(var _0x4f2e7f=0x0;_0x4f2e7f<_0x5047e7[_0xe8ec('0x7')];_0x4f2e7f++){var _0x23fa35=_0xe18b82[_0x5047e7[_0x4f2e7f]][_0xe8ec('0x8')](function(_0x234b67){return _0x234b67[_0xe8ec('0x9')]===_0xe8ec('0xa')&&_0x234b67[_0xe8ec('0xb')]===![];});_0x47b1c1=_0x47b1c1['concat'](_0x23fa35);}return _0x47b1c1;}function getFirstInterface(){var _0x44d128=_['head'](getInterfaces());return{'macAddress':_0x44d128&&_0x44d128[_0xe8ec('0xc')]?_0x44d128['mac']:_0xe8ec('0xd'),'ipAddress':_0x44d128&&_0x44d128[_0xe8ec('0xe')]?_0x44d128[_0xe8ec('0xe')]:_0xe8ec('0xf')};}exports[_0xe8ec('0x10')]=getFirstInterface;function getCPUhash(){var _0x959f4=_[_0xe8ec('0x5')](os[_0xe8ec('0x11')]()[_0xe8ec('0x12')](function(_0x69a424){return _0x69a424[_0xe8ec('0x13')];}))[_0xe8ec('0x14')](':');return crypto[_0xe8ec('0x15')]('md5')[_0xe8ec('0x16')](_0x959f4)[_0xe8ec('0x17')](_0xe8ec('0x18'));}exports[_0xe8ec('0x19')]=function(){switch(os[_0xe8ec('0x1a')]()){case _0xe8ec('0x1b'):return exec(_0xe8ec('0x1c'),{'encoding':_0xe8ec('0x1d')})['replace']('\x0d\x0a','');default:var _0x2e7c82=getFirstInterface();var _0xf34100=getCPUhash();var _0x389c13=_0xf34100+'|'+os['hostname']()+'|'+_0x2e7c82[_0xe8ec('0x1e')]+'|'+_0x2e7c82[_0xe8ec('0x1f')];var _0x2a3b73=crypto[_0xe8ec('0x15')](_0xe8ec('0x20'))[_0xe8ec('0x16')](_0x389c13)[_0xe8ec('0x17')](_0xe8ec('0x18'));return _0x2a3b73['substring'](0x0,0x8)+'-'+_0x2a3b73[_0xe8ec('0x21')](0x8,0xc)+'-'+_0x2a3b73[_0xe8ec('0x21')](0xc,0x10)+'-'+_0x2a3b73[_0xe8ec('0x21')](0x10,0x14)+'-'+_0x2a3b73[_0xe8ec('0x21')](0x14);}};