mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-09 09:09:46 +03:00
Расширенный отладочный вывод HWID
This commit is contained in:
parent
2c04ddb514
commit
21824962b9
1 changed files with 18 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue