Skip to content

Commit ed49212

Browse files
authored

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

flutter-idea/src/io/flutter/utils/JxBrowserUtils.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
package io.flutter.utils;
77

88
import com.intellij.openapi.util.SystemInfo;
9+
import com.intellij.util.system.CpuArch;
910
import io.flutter.settings.FlutterSettings;
1011
import org.jetbrains.annotations.NotNull;
11-
// import com.intellij.util.system.CpuArch;
1212

1313
import java.io.FileNotFoundException;
1414
import java.io.IOException;
15+
import java.util.Objects;
1516
import java.util.Properties;
1617

1718
public class JxBrowserUtils {
@@ -22,19 +23,20 @@ public class JxBrowserUtils {
2223

2324
public String getPlatformFileName() throws FileNotFoundException {
2425
String name = "";
26+
final boolean is64Bit = Objects.requireNonNull(CpuArch.CURRENT).width == 64;
2527
if (SystemInfo.isMac) {
26-
if (SystemInfo.OS_ARCH.equals("aarch64")) {
28+
if (SystemInfo.isAarch64){
2729
name = "mac-arm";
2830
} else {
2931
name = "mac";
3032
}
3133
} else if (SystemInfo.isWindows) {
32-
if (SystemInfo.is32Bit) {
34+
if (CpuArch.is32Bit()) {
3335
name = "win32";
34-
} else if (SystemInfo.is64Bit) {
36+
} else if (is64Bit) {
3537
name = "win64";
3638
}
37-
} else if (SystemInfo.isLinux && SystemInfo.is64Bit) {
39+
} else if (SystemInfo.isLinux && is64Bit) {
3840
name = "linux64";
3941
}
4042

0 commit comments

Comments
 (0)