From 21824962b95ebad29db059266a6919e23d249ae9 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 3 Dec 2018 18:13:34 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BE?= =?UTF-8?q?=D1=87=D0=BD=D1=8B=D0=B9=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20HWI?= =?UTF-8?q?D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launcher/hwid/OshiHWIDProvider.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Launcher/src/main/java/ru/gravit/launcher/hwid/OshiHWIDProvider.java b/Launcher/src/main/java/ru/gravit/launcher/hwid/OshiHWIDProvider.java index f76da557..99864ab8 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/hwid/OshiHWIDProvider.java +++ b/Launcher/src/main/java/ru/gravit/launcher/hwid/OshiHWIDProvider.java @@ -1,7 +1,7 @@ package ru.gravit.launcher.hwid; import oshi.SystemInfo; -import oshi.hardware.HWDiskStore; +import oshi.hardware.*; import ru.gravit.launcher.HWID; import ru.gravit.launcher.LauncherHWIDInterface; import ru.gravit.launcher.OshiHWID; @@ -53,7 +53,22 @@ public long getAvailableMemory() { 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 public HWID getHWID() { OshiHWID hwid = new OshiHWID(); @@ -61,10 +76,7 @@ public HWID getHWID() { hwid.totalMemory = getTotalMemory(); hwid.HWDiskSerial = getHWDisk(); hwid.processorID = getProcessorID(); - LogHelper.debug("serialNumber %s",hwid.serialNumber); - LogHelper.debug("totalMemory %d",hwid.totalMemory); - LogHelper.debug("HWDiskSerial %s",hwid.HWDiskSerial); - LogHelper.debug("ProcessorID %s",hwid.processorID); + printHardwareInformation(); return hwid; } }