Skip to content

Commit

Permalink
Disable processor information when running on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelli committed Nov 29, 2024
1 parent 6570550 commit e5ec7ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/net/coreprotect/utility/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e5ec7ed

Please sign in to comment.