From dcce3aaa392e9ca2508e45c4c216354d384d9080 Mon Sep 17 00:00:00 2001 From: Skylot <118523+skylot@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:17:35 +0000 Subject: [PATCH] fix: use correct property for OS arch checks (#2830) --- .../main/java/jadx/commons/app/JadxCommonFiles.java | 11 ++++++----- .../main/java/jadx/commons/app/JadxSystemInfo.java | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxCommonFiles.java b/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxCommonFiles.java index a98794fe5..d600b2c3c 100644 --- a/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxCommonFiles.java +++ b/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxCommonFiles.java @@ -84,14 +84,15 @@ public class JadxCommonFiles { * Return JNI, Foreign or PowerShell implementation */ private static Windows getWinDirs() { - Windows defSup = Windows.getDefaultSupplier().get(); - if (defSup instanceof WindowsPowerShell) { + Windows impl = Windows.getDefaultSupplier().get(); + if (impl instanceof WindowsPowerShell) { if (JadxSystemInfo.IS_AMD64) { - // JNI library compiled for x86-64 - return new WindowsJni(); + // JNI library compiled only for x86-64 + impl = new WindowsJni(); } } - return defSup; + LOG.debug("Using win dirs implementation: {}", impl.getClass().getSimpleName()); + return impl; } public Path getCacheDir() { diff --git a/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxSystemInfo.java b/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxSystemInfo.java index 43e881336..9a0d73640 100644 --- a/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxSystemInfo.java +++ b/jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxSystemInfo.java @@ -2,6 +2,7 @@ package jadx.commons.app; import java.util.Locale; +@SuppressWarnings("unused") public class JadxSystemInfo { public static final String JAVA_VM = System.getProperty("java.vm.name", "?"); public static final String JAVA_VER = System.getProperty("java.version", "?"); @@ -16,7 +17,7 @@ public class JadxSystemInfo { public static final boolean IS_LINUX = !IS_WINDOWS && !IS_MAC; public static final boolean IS_UNIX = !IS_WINDOWS; - private static final String OS_ARCH_LOWER = OS_NAME.toLowerCase(Locale.ENGLISH); + private static final String OS_ARCH_LOWER = OS_ARCH.toLowerCase(Locale.ENGLISH); public static final boolean IS_AMD64 = OS_ARCH_LOWER.equals("amd64"); public static final boolean IS_ARM64 = OS_ARCH_LOWER.equals("aarch64");