From e5ec7ede72f1c37930a24dc30a6a17da06f18145 Mon Sep 17 00:00:00 2001 From: Intelli Date: Thu, 28 Nov 2024 19:41:52 -0700 Subject: [PATCH] Disable processor information when running on Android --- src/main/java/net/coreprotect/utility/Util.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/coreprotect/utility/Util.java b/src/main/java/net/coreprotect/utility/Util.java index 80005a2d..c6fdda66 100755 --- a/src/main/java/net/coreprotect/utility/Util.java +++ b/src/main/java/net/coreprotect/utility/Util.java @@ -127,6 +127,9 @@ public static CentralProcessor getProcessorInfo() { if (System.getProperty("os.name").startsWith("Windows") && !System.getProperty("sun.arch.data.model").equals("64")) { Class.forName("com.sun.jna.platform.win32.Win32Exception"); } + else if (System.getProperty("os.name").toLowerCase().contains("android") || System.getProperty("java.runtime.name").toLowerCase().contains("android")) { + return null; + } Configurator.setLevel("oshi.hardware.common.AbstractCentralProcessor", Level.OFF); SystemInfo systemInfo = new SystemInfo(); result = systemInfo.getHardware().getProcessor();