Расширенный отладочный вывод HWID

This commit is contained in:
Gravit 2018-12-03 18:13:34 +07:00
parent 2c04ddb514
commit 21824962b9
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -1,7 +1,7 @@
package ru.gravit.launcher.hwid; package ru.gravit.launcher.hwid;
import oshi.SystemInfo; import oshi.SystemInfo;
import oshi.hardware.HWDiskStore; import oshi.hardware.*;
import ru.gravit.launcher.HWID; import ru.gravit.launcher.HWID;
import ru.gravit.launcher.LauncherHWIDInterface; import ru.gravit.launcher.LauncherHWIDInterface;
import ru.gravit.launcher.OshiHWID; import ru.gravit.launcher.OshiHWID;
@ -53,7 +53,22 @@ public long getAvailableMemory()
{ {
return systemInfo.getHardware().getMemory().getAvailable(); return systemInfo.getHardware().getMemory().getAvailable();
} }
public void printHardwareInformation()
{
HardwareAbstractionLayer hardware = systemInfo.getHardware();
ComputerSystem computerSystem = hardware.getComputerSystem();
LogHelper.debug("ComputerSystem Model: %s Serial: %s",computerSystem.getModel(),computerSystem.getSerialNumber());
for (HWDiskStore s : systemInfo.getHardware().getDiskStores())
{
LogHelper.debug("HWDiskStore Serial: %s Model: %s Size: %d",s.getSerial(),s.getModel(),s.getSize());
}
for (UsbDevice s : systemInfo.getHardware().getUsbDevices(true))
{
LogHelper.debug("USBDevice Serial: %s Name: %s",s.getSerialNumber(),s.getName());
}
CentralProcessor processor = hardware.getProcessor();
LogHelper.debug("Processor Model: %s ID: %s",processor.getModel(),processor.getProcessorID());
}
@Override @Override
public HWID getHWID() { public HWID getHWID() {
OshiHWID hwid = new OshiHWID(); OshiHWID hwid = new OshiHWID();
@ -61,10 +76,7 @@ public HWID getHWID() {
hwid.totalMemory = getTotalMemory(); hwid.totalMemory = getTotalMemory();
hwid.HWDiskSerial = getHWDisk(); hwid.HWDiskSerial = getHWDisk();
hwid.processorID = getProcessorID(); hwid.processorID = getProcessorID();
LogHelper.debug("serialNumber %s",hwid.serialNumber); printHardwareInformation();
LogHelper.debug("totalMemory %d",hwid.totalMemory);
LogHelper.debug("HWDiskSerial %s",hwid.HWDiskSerial);
LogHelper.debug("ProcessorID %s",hwid.processorID);
return hwid; return hwid;
} }
} }