Built motion from commit (unavailable).|2.5.21
[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 _0x28e3=['bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','family','IPv4','internal','concat','mac','00:00:00:00:00:00','getFirstInterface','cpus','map','model','join','createHash','md5','update','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto'];(function(_0x2a8e11,_0x4c70b0){var _0x1277cf=function(_0x295de1){while(--_0x295de1){_0x2a8e11['push'](_0x2a8e11['shift']());}};_0x1277cf(++_0x4c70b0);}(_0x28e3,0x106));var _0x328e=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x28e3[_0xf48cce];return _0x2a5c38;};'use strict';var _=require(_0x328e('0x0'));var os=require('os');var crypto=require(_0x328e('0x1'));var machine=require(_0x328e('0x2'));var exec=require(_0x328e('0x3'))['execSync'];function getInterfaces(){var _0x5f1520=[];var _0x392b85=os[_0x328e('0x4')]();var _0x168893=_[_0x328e('0x5')](_[_0x328e('0x6')](_0x392b85));for(var _0xe03ffa=0x0;_0xe03ffa<_0x168893[_0x328e('0x7')];_0xe03ffa++){var _0x5e5bcf=_0x392b85[_0x168893[_0xe03ffa]]['filter'](function(_0x58885f){return _0x58885f[_0x328e('0x8')]===_0x328e('0x9')&&_0x58885f[_0x328e('0xa')]===![];});_0x5f1520=_0x5f1520[_0x328e('0xb')](_0x5e5bcf);}return _0x5f1520;}function getFirstInterface(){var _0x1bc607=_['head'](getInterfaces());return{'macAddress':_0x1bc607&&_0x1bc607[_0x328e('0xc')]?_0x1bc607[_0x328e('0xc')]:_0x328e('0xd'),'ipAddress':_0x1bc607&&_0x1bc607['address']?_0x1bc607['address']:'127.0.0.1'};}exports[_0x328e('0xe')]=getFirstInterface;function getCPUhash(){var _0x30d2f4=_[_0x328e('0x5')](os[_0x328e('0xf')]()[_0x328e('0x10')](function(_0x45cda0){return _0x45cda0[_0x328e('0x11')];}))[_0x328e('0x12')](':');return crypto[_0x328e('0x13')](_0x328e('0x14'))[_0x328e('0x15')](_0x30d2f4)['digest'](_0x328e('0x16'));}exports[_0x328e('0x17')]=function(){switch(os[_0x328e('0x18')]()){case _0x328e('0x19'):return exec(_0x328e('0x1a'),{'encoding':_0x328e('0x1b')})[_0x328e('0x1c')]('\x0d\x0a','');default:var _0x3c5b37=getFirstInterface();var _0x20901e=getCPUhash();var _0x50f970=_0x20901e+'|'+os[_0x328e('0x1d')]()+'|'+_0x3c5b37[_0x328e('0x1e')]+'|'+_0x3c5b37[_0x328e('0x1f')];var _0x1adadc=crypto[_0x328e('0x13')](_0x328e('0x14'))[_0x328e('0x15')](_0x50f970)['digest'](_0x328e('0x16'));return _0x1adadc[_0x328e('0x20')](0x0,0x8)+'-'+_0x1adadc[_0x328e('0x20')](0x8,0xc)+'-'+_0x1adadc[_0x328e('0x20')](0xc,0x10)+'-'+_0x1adadc[_0x328e('0x20')](0x10,0x14)+'-'+_0x1adadc['substring'](0x14);}};