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 _0x291c=['family','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','join','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length'];(function(_0x26a1a9,_0xa88722){var _0x22b456=function(_0x344c88){while(--_0x344c88){_0x26a1a9['push'](_0x26a1a9['shift']());}};_0x22b456(++_0xa88722);}(_0x291c,0x137));var _0xc291=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x291c[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xc291('0x0'));var os=require('os');var crypto=require(_0xc291('0x1'));var machine=require(_0xc291('0x2'));var exec=require(_0xc291('0x3'))[_0xc291('0x4')];function getInterfaces(){var _0x253ebb=[];var _0xc32916=os[_0xc291('0x5')]();var _0xafdfee=_[_0xc291('0x6')](_[_0xc291('0x7')](_0xc32916));for(var _0x5e7cbd=0x0;_0x5e7cbd<_0xafdfee[_0xc291('0x8')];_0x5e7cbd++){var _0x5f2563=_0xc32916[_0xafdfee[_0x5e7cbd]]['filter'](function(_0x40dc89){return _0x40dc89[_0xc291('0x9')]===_0xc291('0xa')&&_0x40dc89[_0xc291('0xb')]===![];});_0x253ebb=_0x253ebb['concat'](_0x5f2563);}return _0x253ebb;}function getFirstInterface(){var _0x2f8764=_[_0xc291('0xc')](getInterfaces());return{'macAddress':_0x2f8764&&_0x2f8764[_0xc291('0xd')]?_0x2f8764[_0xc291('0xd')]:_0xc291('0xe'),'ipAddress':_0x2f8764&&_0x2f8764[_0xc291('0xf')]?_0x2f8764[_0xc291('0xf')]:_0xc291('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x49934e=_['orderBy'](os[_0xc291('0x11')]()[_0xc291('0x12')](function(_0x3c7a29){return _0x3c7a29['model'];}))[_0xc291('0x13')](':');return crypto['createHash'](_0xc291('0x14'))[_0xc291('0x15')](_0x49934e)[_0xc291('0x16')](_0xc291('0x17'));}exports[_0xc291('0x18')]=function(){switch(os[_0xc291('0x19')]()){case _0xc291('0x1a'):return exec(_0xc291('0x1b'),{'encoding':_0xc291('0x1c')})[_0xc291('0x1d')]('\x0d\x0a','');default:var _0x5495ff=getFirstInterface();var _0x305ecc=getCPUhash();var _0x23dbf0=_0x305ecc+'|'+os['hostname']()+'|'+_0x5495ff[_0xc291('0x1e')]+'|'+_0x5495ff['ipAddress'];var _0x4c8947=crypto['createHash'](_0xc291('0x14'))[_0xc291('0x15')](_0x23dbf0)[_0xc291('0x16')](_0xc291('0x17'));return _0x4c8947[_0xc291('0x1f')](0x0,0x8)+'-'+_0x4c8947[_0xc291('0x1f')](0x8,0xc)+'-'+_0x4c8947[_0xc291('0x1f')](0xc,0x10)+'-'+_0x4c8947[_0xc291('0x1f')](0x10,0x14)+'-'+_0x4c8947[_0xc291('0x1f')](0x14);}};