Built motion from commit (unavailable).|2.5.5
[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 _0x7118=['IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','filter','family'];(function(_0x1c05c0,_0x38e872){var _0x4b8d87=function(_0x4eb807){while(--_0x4eb807){_0x1c05c0['push'](_0x1c05c0['shift']());}};_0x4b8d87(++_0x38e872);}(_0x7118,0x159));var _0x8711=function(_0x351dd8,_0xe9d053){_0x351dd8=_0x351dd8-0x0;var _0x177ebe=_0x7118[_0x351dd8];return _0x177ebe;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x8711('0x0'));var exec=require(_0x8711('0x1'))['execSync'];function getInterfaces(){var _0x1758c5=[];var _0x3ea36f=os[_0x8711('0x2')]();var _0x259c36=_[_0x8711('0x3')](_[_0x8711('0x4')](_0x3ea36f));for(var _0x206b82=0x0;_0x206b82<_0x259c36['length'];_0x206b82++){var _0x385033=_0x3ea36f[_0x259c36[_0x206b82]][_0x8711('0x5')](function(_0x1f23a9){return _0x1f23a9[_0x8711('0x6')]===_0x8711('0x7')&&_0x1f23a9[_0x8711('0x8')]===![];});_0x1758c5=_0x1758c5[_0x8711('0x9')](_0x385033);}return _0x1758c5;}function getFirstInterface(){var _0x2f01ca=_[_0x8711('0xa')](getInterfaces());return{'macAddress':_0x2f01ca&&_0x2f01ca[_0x8711('0xb')]?_0x2f01ca[_0x8711('0xb')]:'00:00:00:00:00:00','ipAddress':_0x2f01ca&&_0x2f01ca['address']?_0x2f01ca[_0x8711('0xc')]:_0x8711('0xd')};}exports[_0x8711('0xe')]=getFirstInterface;function getCPUhash(){var _0x4b1fbe=_['orderBy'](os[_0x8711('0xf')]()[_0x8711('0x10')](function(_0x5d2c38){return _0x5d2c38['model'];}))[_0x8711('0x11')](':');return crypto[_0x8711('0x12')](_0x8711('0x13'))[_0x8711('0x14')](_0x4b1fbe)[_0x8711('0x15')](_0x8711('0x16'));}exports[_0x8711('0x17')]=function(){switch(os['platform']()){case _0x8711('0x18'):return exec(_0x8711('0x19'),{'encoding':_0x8711('0x1a')})[_0x8711('0x1b')]('\x0d\x0a','');default:var _0x3ab905=getFirstInterface();var _0x4628e9=getCPUhash();var _0x57fedb=_0x4628e9+'|'+os[_0x8711('0x1c')]()+'|'+_0x3ab905[_0x8711('0x1d')]+'|'+_0x3ab905[_0x8711('0x1e')];var _0xe1e9b3=crypto[_0x8711('0x12')]('md5')['update'](_0x57fedb)['digest'](_0x8711('0x16'));return _0xe1e9b3[_0x8711('0x1f')](0x0,0x8)+'-'+_0xe1e9b3[_0x8711('0x1f')](0x8,0xc)+'-'+_0xe1e9b3['substring'](0xc,0x10)+'-'+_0xe1e9b3['substring'](0x10,0x14)+'-'+_0xe1e9b3[_0x8711('0x1f')](0x14);}};