[FEATURE] Новые параметры в HWID

This commit is contained in:
Gravit 2019-03-09 22:41:12 +07:00
parent 5786699474
commit 07761dd88b
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -62,6 +62,29 @@ public String getHWDisk() {
} }
} }
public String getSoundCardInfo()
{
for(SoundCard soundcard : hardware.getSoundCards())
{
return soundcard.getName();
}
return "";
}
public String getMacAddr()
{
for(NetworkIF networkIF : hardware.getNetworkIFs())
{
for(String ipv4 : networkIF.getIPv4addr())
{
if(ipv4.startsWith("127.")) continue;
if(ipv4.startsWith("10.")) continue;
return networkIF.getMacaddr();
}
}
return "";
}
public long getTotalMemory() { public long getTotalMemory() {
if (noHWID) return -1; if (noHWID) return -1;
if (hardware == null) hardware = systemInfo.getHardware(); if (hardware == null) hardware = systemInfo.getHardware();
@ -85,6 +108,20 @@ public void printHardwareInformation() {
for (UsbDevice s : hardware.getUsbDevices(true)) { for (UsbDevice s : hardware.getUsbDevices(true)) {
LogHelper.debug("USBDevice Serial: %s Name: %s", s.getSerialNumber(), s.getName()); LogHelper.debug("USBDevice Serial: %s Name: %s", s.getSerialNumber(), s.getName());
} }
for(NetworkIF networkIF : hardware.getNetworkIFs())
{
LogHelper.debug("Network Interface: %s mac: %s", networkIF.getName(), networkIF.getMacaddr());
for(String ipv4 : networkIF.getIPv4addr())
{
if(ipv4.startsWith("127.")) continue;
if(ipv4.startsWith("10.")) continue;
LogHelper.subDebug("IPv4: %s", ipv4);
}
}
for(SoundCard soundcard : hardware.getSoundCards())
{
LogHelper.debug("SoundCard %s", soundcard.getName());
}
CentralProcessor processor = hardware.getProcessor(); CentralProcessor processor = hardware.getProcessor();
LogHelper.debug("Processor Model: %s ID: %s", processor.getModel(), processor.getProcessorID()); LogHelper.debug("Processor Model: %s ID: %s", processor.getModel(), processor.getProcessorID());
} catch (Throwable e) { } catch (Throwable e) {