52f0b871e964ad667a08ed44713b39c0c167f1c4
[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 _0x0763=['ipAddress','hex','substring','lodash','bimedia-machine-uuid','child_process','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','orderBy','map','model','join','createHash','md5','update','digest','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress'];(function(_0x3031a3,_0x259efa){var _0x22b6d1=function(_0x1b3ffa){while(--_0x1b3ffa){_0x3031a3['push'](_0x3031a3['shift']());}};_0x22b6d1(++_0x259efa);}(_0x0763,0x87));var _0x3076=function(_0x18a16d,_0x199976){_0x18a16d=_0x18a16d-0x0;var _0x21cf0c=_0x0763[_0x18a16d];return _0x21cf0c;};'use strict';var _=require(_0x3076('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x3076('0x1'));var exec=require(_0x3076('0x2'))['execSync'];function getInterfaces(){var _0x37d1cf=[];var _0xa646e7=os[_0x3076('0x3')]();var _0xecc289=_['orderBy'](_[_0x3076('0x4')](_0xa646e7));for(var _0x140df8=0x0;_0x140df8<_0xecc289[_0x3076('0x5')];_0x140df8++){var _0x1b5f4e=_0xa646e7[_0xecc289[_0x140df8]][_0x3076('0x6')](function(_0x5efd65){return _0x5efd65[_0x3076('0x7')]===_0x3076('0x8')&&_0x5efd65[_0x3076('0x9')]===![];});_0x37d1cf=_0x37d1cf[_0x3076('0xa')](_0x1b5f4e);}return _0x37d1cf;}function getFirstInterface(){var _0x4f8224=_[_0x3076('0xb')](getInterfaces());return{'macAddress':_0x4f8224&&_0x4f8224[_0x3076('0xc')]?_0x4f8224[_0x3076('0xc')]:'00:00:00:00:00:00','ipAddress':_0x4f8224&&_0x4f8224['address']?_0x4f8224[_0x3076('0xd')]:_0x3076('0xe')};}exports[_0x3076('0xf')]=getFirstInterface;function getCPUhash(){var _0xefdbf1=_[_0x3076('0x10')](os['cpus']()[_0x3076('0x11')](function(_0x209fc0){return _0x209fc0[_0x3076('0x12')];}))[_0x3076('0x13')](':');return crypto[_0x3076('0x14')](_0x3076('0x15'))[_0x3076('0x16')](_0xefdbf1)[_0x3076('0x17')]('hex');}exports['getUuid']=function(){switch(os[_0x3076('0x18')]()){case _0x3076('0x19'):return exec(_0x3076('0x1a'),{'encoding':_0x3076('0x1b')})['replace']('\x0d\x0a','');default:var _0x5bf9ec=getFirstInterface();var _0x11bdf3=getCPUhash();var _0x1ca82d=_0x11bdf3+'|'+os[_0x3076('0x1c')]()+'|'+_0x5bf9ec[_0x3076('0x1d')]+'|'+_0x5bf9ec[_0x3076('0x1e')];var _0x3b21bc=crypto[_0x3076('0x14')](_0x3076('0x15'))[_0x3076('0x16')](_0x1ca82d)[_0x3076('0x17')](_0x3076('0x1f'));return _0x3b21bc[_0x3076('0x20')](0x0,0x8)+'-'+_0x3b21bc['substring'](0x8,0xc)+'-'+_0x3b21bc[_0x3076('0x20')](0xc,0x10)+'-'+_0x3b21bc[_0x3076('0x20')](0x10,0x14)+'-'+_0x3b21bc['substring'](0x14);}};