fix: use correct property for OS arch checks (#2830)

This commit is contained in:
Skylot
2026-03-24 20:17:35 +00:00
parent b3d86ae908
commit dcce3aaa39
2 changed files with 8 additions and 6 deletions
@@ -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() {
@@ -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");