Skip to content

Commit dcce3aa

Browse files
committed
fix: use correct property for OS arch checks (#2830)
1 parent b3d86ae commit dcce3aa

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxCommonFiles.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@ private synchronized ProjectDirectories loadDirs() {
8484
* Return JNI, Foreign or PowerShell implementation
8585
*/
8686
private static Windows getWinDirs() {
87-
Windows defSup = Windows.getDefaultSupplier().get();
88-
if (defSup instanceof WindowsPowerShell) {
87+
Windows impl = Windows.getDefaultSupplier().get();
88+
if (impl instanceof WindowsPowerShell) {
8989
if (JadxSystemInfo.IS_AMD64) {
90-
// JNI library compiled for x86-64
91-
return new WindowsJni();
90+
// JNI library compiled only for x86-64
91+
impl = new WindowsJni();
9292
}
9393
}
94-
return defSup;
94+
LOG.debug("Using win dirs implementation: {}", impl.getClass().getSimpleName());
95+
return impl;
9596
}
9697

9798
public Path getCacheDir() {

jadx-commons/jadx-app-commons/src/main/java/jadx/commons/app/JadxSystemInfo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.Locale;
44

5+
@SuppressWarnings("unused")
56
public class JadxSystemInfo {
67
public static final String JAVA_VM = System.getProperty("java.vm.name", "?");
78
public static final String JAVA_VER = System.getProperty("java.version", "?");
@@ -16,7 +17,7 @@ public class JadxSystemInfo {
1617
public static final boolean IS_LINUX = !IS_WINDOWS && !IS_MAC;
1718
public static final boolean IS_UNIX = !IS_WINDOWS;
1819

19-
private static final String OS_ARCH_LOWER = OS_NAME.toLowerCase(Locale.ENGLISH);
20+
private static final String OS_ARCH_LOWER = OS_ARCH.toLowerCase(Locale.ENGLISH);
2021
public static final boolean IS_AMD64 = OS_ARCH_LOWER.equals("amd64");
2122
public static final boolean IS_ARM64 = OS_ARCH_LOWER.equals("aarch64");
2223

0 commit comments

Comments
 (0)