Built motion from commit (unavailable).|2.5.9
[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 _0x2f2e=['win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','ipAddress','hex','substring','crypto','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','filter','family','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','getUuid','platform'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x2f2e,0x146));var _0xe2f2=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x2f2e[_0x45e98e];return _0x374dba;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xe2f2('0x0'));var machine=require(_0xe2f2('0x1'));var exec=require('child_process')[_0xe2f2('0x2')];function getInterfaces(){var _0x5c1823=[];var _0x1d89ba=os[_0xe2f2('0x3')]();var _0x2da048=_[_0xe2f2('0x4')](_['keys'](_0x1d89ba));for(var _0x5c0570=0x0;_0x5c0570<_0x2da048['length'];_0x5c0570++){var _0x3dca30=_0x1d89ba[_0x2da048[_0x5c0570]][_0xe2f2('0x5')](function(_0x2bdfe5){return _0x2bdfe5[_0xe2f2('0x6')]==='IPv4'&&_0x2bdfe5['internal']===![];});_0x5c1823=_0x5c1823['concat'](_0x3dca30);}return _0x5c1823;}function getFirstInterface(){var _0x40574d=_['head'](getInterfaces());return{'macAddress':_0x40574d&&_0x40574d[_0xe2f2('0x7')]?_0x40574d[_0xe2f2('0x7')]:_0xe2f2('0x8'),'ipAddress':_0x40574d&&_0x40574d[_0xe2f2('0x9')]?_0x40574d['address']:_0xe2f2('0xa')};}exports[_0xe2f2('0xb')]=getFirstInterface;function getCPUhash(){var _0x4b98f3=_[_0xe2f2('0x4')](os[_0xe2f2('0xc')]()[_0xe2f2('0xd')](function(_0xec8ce1){return _0xec8ce1[_0xe2f2('0xe')];}))[_0xe2f2('0xf')](':');return crypto[_0xe2f2('0x10')](_0xe2f2('0x11'))[_0xe2f2('0x12')](_0x4b98f3)[_0xe2f2('0x13')]('hex');}exports[_0xe2f2('0x14')]=function(){switch(os[_0xe2f2('0x15')]()){case _0xe2f2('0x16'):return exec(_0xe2f2('0x17'),{'encoding':_0xe2f2('0x18')})['replace']('\x0d\x0a','');default:var _0x5b7f1a=getFirstInterface();var _0x10cc99=getCPUhash();var _0xb11b33=_0x10cc99+'|'+os[_0xe2f2('0x19')]()+'|'+_0x5b7f1a['macAddress']+'|'+_0x5b7f1a[_0xe2f2('0x1a')];var _0x653f02=crypto[_0xe2f2('0x10')]('md5')[_0xe2f2('0x12')](_0xb11b33)[_0xe2f2('0x13')](_0xe2f2('0x1b'));return _0x653f02[_0xe2f2('0x1c')](0x0,0x8)+'-'+_0x653f02[_0xe2f2('0x1c')](0x8,0xc)+'-'+_0x653f02[_0xe2f2('0x1c')](0xc,0x10)+'-'+_0x653f02['substring'](0x10,0x14)+'-'+_0x653f02[_0xe2f2('0x1c')](0x14);}};