Built motion from commit (unavailable).|2.3.94
[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 _0x070f=['join','update','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','createHash','md5','substring','lodash','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x070f,0x8d));var _0xf070=function(_0x24041e,_0x28cf9c){_0x24041e=_0x24041e-0x0;var _0x3fe988=_0x070f[_0x24041e];return _0x3fe988;};'use strict';var _=require(_0xf070('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xf070('0x1'));var exec=require('child_process')[_0xf070('0x2')];function getInterfaces(){var _0x253b0b=[];var _0x1684e5=os[_0xf070('0x3')]();var _0x2fc86a=_[_0xf070('0x4')](_[_0xf070('0x5')](_0x1684e5));for(var _0x10324e=0x0;_0x10324e<_0x2fc86a[_0xf070('0x6')];_0x10324e++){var _0x510754=_0x1684e5[_0x2fc86a[_0x10324e]][_0xf070('0x7')](function(_0x69fe86){return _0x69fe86['family']===_0xf070('0x8')&&_0x69fe86[_0xf070('0x9')]===![];});_0x253b0b=_0x253b0b[_0xf070('0xa')](_0x510754);}return _0x253b0b;}function getFirstInterface(){var _0x19c77c=_[_0xf070('0xb')](getInterfaces());return{'macAddress':_0x19c77c&&_0x19c77c[_0xf070('0xc')]?_0x19c77c[_0xf070('0xc')]:_0xf070('0xd'),'ipAddress':_0x19c77c&&_0x19c77c[_0xf070('0xe')]?_0x19c77c[_0xf070('0xe')]:_0xf070('0xf')};}exports[_0xf070('0x10')]=getFirstInterface;function getCPUhash(){var _0x4ee8fe=_[_0xf070('0x4')](os['cpus']()[_0xf070('0x11')](function(_0xbbc029){return _0xbbc029[_0xf070('0x12')];}))[_0xf070('0x13')](':');return crypto['createHash']('md5')[_0xf070('0x14')](_0x4ee8fe)['digest'](_0xf070('0x15'));}exports[_0xf070('0x16')]=function(){switch(os[_0xf070('0x17')]()){case _0xf070('0x18'):return exec(_0xf070('0x19'),{'encoding':'utf8'})['replace']('\x0d\x0a','');default:var _0x26dcac=getFirstInterface();var _0x49c5f3=getCPUhash();var _0xd8b28c=_0x49c5f3+'|'+os[_0xf070('0x1a')]()+'|'+_0x26dcac[_0xf070('0x1b')]+'|'+_0x26dcac[_0xf070('0x1c')];var _0x86ac50=crypto[_0xf070('0x1d')](_0xf070('0x1e'))[_0xf070('0x14')](_0xd8b28c)['digest']('hex');return _0x86ac50[_0xf070('0x1f')](0x0,0x8)+'-'+_0x86ac50[_0xf070('0x1f')](0x8,0xc)+'-'+_0x86ac50[_0xf070('0x1f')](0xc,0x10)+'-'+_0x86ac50[_0xf070('0x1f')](0x10,0x14)+'-'+_0x86ac50['substring'](0x14);}};