将 OS X 重命名为 macOS (#3878)
This commit is contained in:
@@ -23,7 +23,6 @@ import org.jackhuang.hmcl.task.GetTask;
|
||||
import org.jackhuang.hmcl.task.Task;
|
||||
import org.jackhuang.hmcl.util.gson.JsonUtils;
|
||||
import org.jackhuang.hmcl.util.io.NetworkUtils;
|
||||
import org.jackhuang.hmcl.util.platform.Architecture;
|
||||
import org.jackhuang.hmcl.util.platform.OperatingSystem;
|
||||
import org.jackhuang.hmcl.util.platform.Platform;
|
||||
import org.jackhuang.hmcl.util.versioning.VersionNumber;
|
||||
@@ -37,14 +36,6 @@ public final class DiscoFetchJavaListTask extends Task<EnumMap<JavaPackageType,
|
||||
|
||||
public static final String API_ROOT = System.getProperty("hmcl.discoapi.override", "https://api.foojay.io/disco/v3.0");
|
||||
|
||||
private static String getOperatingSystemName(OperatingSystem os) {
|
||||
return os == OperatingSystem.OSX ? "macos" : os.getCheckedName();
|
||||
}
|
||||
|
||||
private static String getArchitectureName(Architecture arch) {
|
||||
return arch.getCheckedName();
|
||||
}
|
||||
|
||||
private final DiscoJavaDistribution distribution;
|
||||
private final String archiveType;
|
||||
private final Task<String> fetchPackagesTask;
|
||||
@@ -55,8 +46,8 @@ public final class DiscoFetchJavaListTask extends Task<EnumMap<JavaPackageType,
|
||||
|
||||
HashMap<String, String> params = new HashMap<>();
|
||||
params.put("distribution", distribution.getApiParameter());
|
||||
params.put("operating_system", getOperatingSystemName(platform.getOperatingSystem()));
|
||||
params.put("architecture", getArchitectureName(platform.getArchitecture()));
|
||||
params.put("operating_system", platform.getOperatingSystem().getCheckedName());
|
||||
params.put("architecture", platform.getArchitecture().getCheckedName());
|
||||
params.put("archive_type", archiveType);
|
||||
params.put("directly_downloadable", "true");
|
||||
if (platform.getOperatingSystem() == OperatingSystem.LINUX)
|
||||
|
||||
@@ -40,12 +40,12 @@ public enum DiscoJavaDistribution implements JavaDistribution<DiscoJavaRemoteVer
|
||||
EnumSet.of(JDK, JRE),
|
||||
pair(WINDOWS, EnumSet.of(X86_64, X86, ARM64)),
|
||||
pair(LINUX, EnumSet.of(X86_64, X86, ARM64, ARM32, RISCV64, PPC64, PPC64LE, S390X, SPARCV9)),
|
||||
pair(OSX, EnumSet.of(X86_64, ARM64))),
|
||||
pair(MACOS, EnumSet.of(X86_64, ARM64))),
|
||||
LIBERICA("BellSoft Liberica", "liberica", "BellSoft",
|
||||
EnumSet.of(JDK, JRE, JDKFX, JREFX),
|
||||
pair(WINDOWS, EnumSet.of(X86_64, X86, ARM64)),
|
||||
pair(LINUX, EnumSet.of(X86_64, X86, ARM64, ARM32, RISCV64, PPC64LE)),
|
||||
pair(OSX, EnumSet.of(X86_64, ARM64))) {
|
||||
pair(MACOS, EnumSet.of(X86_64, ARM64))) {
|
||||
@Override
|
||||
public boolean testVersion(DiscoJavaRemoteVersion version) {
|
||||
if (!super.testVersion(version))
|
||||
@@ -59,23 +59,23 @@ public enum DiscoJavaDistribution implements JavaDistribution<DiscoJavaRemoteVer
|
||||
EnumSet.of(JDK, JRE, JDKFX, JREFX),
|
||||
pair(WINDOWS, EnumSet.of(X86_64, X86, ARM64)),
|
||||
pair(LINUX, EnumSet.of(X86_64, X86, ARM64, ARM32, RISCV64, PPC64LE)),
|
||||
pair(OSX, EnumSet.of(X86_64, ARM64))),
|
||||
pair(MACOS, EnumSet.of(X86_64, ARM64))),
|
||||
GRAALVM("Oracle GraalVM", "graalvm", "Oracle",
|
||||
EnumSet.of(JDK),
|
||||
pair(WINDOWS, EnumSet.of(X86_64)),
|
||||
pair(LINUX, EnumSet.of(X86_64, ARM64)),
|
||||
pair(OSX, EnumSet.of(X86_64, ARM64))),
|
||||
pair(MACOS, EnumSet.of(X86_64, ARM64))),
|
||||
SEMERU("IBM Semeru (OpenJ9)", "semeru", "IBM",
|
||||
EnumSet.of(JDK, JRE),
|
||||
pair(WINDOWS, EnumSet.of(X86_64)),
|
||||
pair(LINUX, EnumSet.of(X86_64, ARM64, PPC64LE, S390X)),
|
||||
pair(OSX, EnumSet.of(X86_64, ARM64))
|
||||
pair(MACOS, EnumSet.of(X86_64, ARM64))
|
||||
),
|
||||
CORRETTO("Amazon Corretto", "corretto", "Amazon",
|
||||
EnumSet.of(JDK),
|
||||
pair(WINDOWS, EnumSet.of(X86_64)),
|
||||
pair(LINUX, EnumSet.of(X86_64, ARM64)),
|
||||
pair(OSX, EnumSet.of(X86_64, ARM64))
|
||||
pair(MACOS, EnumSet.of(X86_64, ARM64))
|
||||
);
|
||||
|
||||
public static DiscoJavaDistribution of(String name) {
|
||||
|
||||
@@ -73,13 +73,13 @@ public final class GameJavaVersion {
|
||||
switch (operatingSystem) {
|
||||
case WINDOWS:
|
||||
case LINUX:
|
||||
case OSX:
|
||||
case MACOS:
|
||||
return Arrays.asList(JAVA_8, JAVA_16, JAVA_17, JAVA_21);
|
||||
}
|
||||
} else if (architecture == Architecture.ARM64) {
|
||||
switch (operatingSystem) {
|
||||
case WINDOWS:
|
||||
case OSX:
|
||||
case MACOS:
|
||||
return Arrays.asList(JAVA_17, JAVA_21);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public enum JavaVersionConstraint {
|
||||
if (java == null || java.getArchitecture() != Architecture.ARM64)
|
||||
return false;
|
||||
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS || OperatingSystem.CURRENT_OS == OperatingSystem.OSX)
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS || OperatingSystem.CURRENT_OS == OperatingSystem.MACOS)
|
||||
return gameVersionNumber.compareTo("1.6") < 0;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class Library implements Comparable<Library>, Validation {
|
||||
private final String url;
|
||||
private final LibrariesDownloadInfo downloads;
|
||||
private final ExtractRules extract;
|
||||
private final Map<OperatingSystem, String> natives;
|
||||
private final Map<String, String> natives;
|
||||
private final List<CompatibilityRule> rules;
|
||||
private final List<String> checksums;
|
||||
|
||||
@@ -64,7 +64,7 @@ public class Library implements Comparable<Library>, Validation {
|
||||
this(artifact, url, downloads, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
public Library(Artifact artifact, String url, LibrariesDownloadInfo downloads, List<String> checksums, ExtractRules extract, Map<OperatingSystem, String> natives, List<CompatibilityRule> rules, String hint, String filename) {
|
||||
public Library(Artifact artifact, String url, LibrariesDownloadInfo downloads, List<String> checksums, ExtractRules extract, Map<String, String> natives, List<CompatibilityRule> rules, String hint, String filename) {
|
||||
this.artifact = artifact;
|
||||
this.url = url;
|
||||
this.downloads = downloads;
|
||||
@@ -94,8 +94,8 @@ public class Library implements Comparable<Library>, Validation {
|
||||
|
||||
public String getClassifier() {
|
||||
if (artifact.getClassifier() == null)
|
||||
if (natives != null && natives.containsKey(OperatingSystem.CURRENT_OS))
|
||||
return natives.get(OperatingSystem.CURRENT_OS).replace("${arch}", Architecture.SYSTEM_ARCH.getBits().getBit());
|
||||
if (natives != null && natives.containsKey(OperatingSystem.CURRENT_OS.getMojangName()))
|
||||
return natives.get(OperatingSystem.CURRENT_OS.getMojangName()).replace("${arch}", Architecture.SYSTEM_ARCH.getBits().getBit());
|
||||
else
|
||||
return null;
|
||||
else
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public final class OSRestriction {
|
||||
|
||||
private final OperatingSystem name;
|
||||
private final String name;
|
||||
private final String version;
|
||||
private final String arch;
|
||||
|
||||
@@ -37,21 +37,27 @@ public final class OSRestriction {
|
||||
this(OperatingSystem.UNKNOWN);
|
||||
}
|
||||
|
||||
public OSRestriction(OperatingSystem name) {
|
||||
this(name, null);
|
||||
public OSRestriction(OperatingSystem os) {
|
||||
this(os, null);
|
||||
}
|
||||
|
||||
public OSRestriction(OperatingSystem name, String version) {
|
||||
this(name, version, null);
|
||||
public OSRestriction(OperatingSystem os, String version) {
|
||||
this(os, version, null);
|
||||
}
|
||||
|
||||
public OSRestriction(OperatingSystem name, String version, String arch) {
|
||||
public OSRestriction(OperatingSystem os, String version, String arch) {
|
||||
this.name = os.getMojangName();
|
||||
this.version = version;
|
||||
this.arch = arch;
|
||||
}
|
||||
|
||||
public OSRestriction(String name, String version, String arch) {
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
this.arch = arch;
|
||||
}
|
||||
|
||||
public OperatingSystem getName() {
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -64,8 +70,10 @@ public final class OSRestriction {
|
||||
}
|
||||
|
||||
public boolean allow() {
|
||||
if (name != OperatingSystem.UNKNOWN && name != OperatingSystem.CURRENT_OS
|
||||
&& !(name == OperatingSystem.LINUX && OperatingSystem.CURRENT_OS.isLinuxOrBSD()))
|
||||
OperatingSystem os = OperatingSystem.parseOSName(name);
|
||||
if (os != OperatingSystem.UNKNOWN
|
||||
&& os != OperatingSystem.CURRENT_OS
|
||||
&& !(os == OperatingSystem.LINUX && OperatingSystem.CURRENT_OS.isLinuxOrBSD()))
|
||||
return false;
|
||||
|
||||
if (version != null)
|
||||
|
||||
@@ -20,7 +20,6 @@ package org.jackhuang.hmcl.game.tlauncher;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.jackhuang.hmcl.game.*;
|
||||
import org.jackhuang.hmcl.util.Immutable;
|
||||
import org.jackhuang.hmcl.util.platform.OperatingSystem;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -36,11 +35,11 @@ public class TLauncherLibrary {
|
||||
@SerializedName("classifies") // stupid typo made by TLauncher
|
||||
private final Map<String, LibraryDownloadInfo> classifiers;
|
||||
private final ExtractRules extract;
|
||||
private final Map<OperatingSystem, String> natives;
|
||||
private final Map<String, String> natives;
|
||||
private final List<CompatibilityRule> rules;
|
||||
private final List<String> checksums;
|
||||
|
||||
public TLauncherLibrary(Artifact name, String url, LibraryDownloadInfo artifact, Map<String, LibraryDownloadInfo> classifiers, ExtractRules extract, Map<OperatingSystem, String> natives, List<CompatibilityRule> rules, List<String> checksums) {
|
||||
public TLauncherLibrary(Artifact name, String url, LibraryDownloadInfo artifact, Map<String, LibraryDownloadInfo> classifiers, ExtractRules extract, Map<String, String> natives, List<CompatibilityRule> rules, List<String> checksums) {
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
this.artifact = artifact;
|
||||
|
||||
@@ -72,14 +72,14 @@ public class DefaultLauncher extends Launcher {
|
||||
case HIGH:
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||
// res.add("cmd", "/C", "start", "unused title", "/B", "/high");
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.MACOS) {
|
||||
res.add("nice", "-n", "-5");
|
||||
}
|
||||
break;
|
||||
case ABOVE_NORMAL:
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||
// res.add("cmd", "/C", "start", "unused title", "/B", "/abovenormal");
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.MACOS) {
|
||||
res.add("nice", "-n", "-1");
|
||||
}
|
||||
break;
|
||||
@@ -89,14 +89,14 @@ public class DefaultLauncher extends Launcher {
|
||||
case BELOW_NORMAL:
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||
// res.add("cmd", "/C", "start", "unused title", "/B", "/belownormal");
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.MACOS) {
|
||||
res.add("nice", "-n", "1");
|
||||
}
|
||||
break;
|
||||
case LOW:
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||
// res.add("cmd", "/C", "start", "unused title", "/B", "/low");
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||
} else if (OperatingSystem.CURRENT_OS.isLinuxOrBSD() || OperatingSystem.CURRENT_OS == OperatingSystem.MACOS) {
|
||||
res.add("nice", "-n", "5");
|
||||
}
|
||||
break;
|
||||
@@ -159,7 +159,7 @@ public class DefaultLauncher extends Launcher {
|
||||
|
||||
res.addDefault("-Dminecraft.client.jar=", repository.getVersionJar(version).toString());
|
||||
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.MACOS) {
|
||||
res.addDefault("-Xdock:name=", "Minecraft " + version.getId());
|
||||
repository.getAssetObject(version.getId(), version.getAssetIndex().getId(), "icons/minecraft.icns")
|
||||
.ifPresent(minecraftIcns -> {
|
||||
@@ -265,7 +265,7 @@ public class DefaultLauncher extends Launcher {
|
||||
// Here is a workaround for this issue: https://github.com/HMCL-dev/HMCL/issues/1141.
|
||||
String nativeFolderPath = nativeFolder.getAbsolutePath();
|
||||
Path tempNativeFolder = null;
|
||||
if ((OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX)
|
||||
if ((OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.MACOS)
|
||||
&& !StringUtils.isASCII(nativeFolderPath)
|
||||
&& gameVersion.isPresent() && GameVersionNumber.compare(gameVersion.get(), "1.19") < 0) {
|
||||
tempNativeFolder = Paths.get("/", "tmp", "hmcl-natives-" + UUID.randomUUID());
|
||||
|
||||
@@ -201,7 +201,7 @@ public enum Architecture {
|
||||
sysArch = parseArchName(processorIdentifier.substring(0, idx));
|
||||
}
|
||||
}
|
||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.MACOS) {
|
||||
if (CURRENT_ARCH == X86_64) {
|
||||
try {
|
||||
Process process = Runtime.getRuntime().exec(new String[]{"/usr/sbin/sysctl", "-n", "sysctl.proc_translated"});
|
||||
|
||||
@@ -107,7 +107,7 @@ public final class ManagedProcess {
|
||||
// However, this method is supplied since Java 9.
|
||||
// So, there is no ways to get the pid.
|
||||
throw new UnsupportedOperationException("Cannot get the pid of a Process on Java 8 on Windows.");
|
||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.OSX || OperatingSystem.CURRENT_OS.isLinuxOrBSD()) {
|
||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.MACOS || OperatingSystem.CURRENT_OS.isLinuxOrBSD()) {
|
||||
// On Linux or Mac, we can get field UnixProcess.pid field to get the pid.
|
||||
// All the Java version is accepted.
|
||||
// See https://github.com/openjdk/jdk/blob/jdk8-b120/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux
|
||||
@@ -116,7 +116,7 @@ public final class ManagedProcess {
|
||||
pidField.setAccessible(true);
|
||||
return pidField.getInt(process);
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
throw new UnsupportedOperationException("Cannot get the pid of a Process on Java 8 on OSX / Linux.", e);
|
||||
throw new UnsupportedOperationException("Cannot get the pid of a Process on Java 8 on macOS/Linux.", e);
|
||||
}
|
||||
} else {
|
||||
// Unknown Operating System, no fallback available.
|
||||
|
||||
@@ -49,28 +49,39 @@ public enum OperatingSystem {
|
||||
*/
|
||||
LINUX("linux"),
|
||||
/**
|
||||
* Mac OS X.
|
||||
* macOS.
|
||||
*/
|
||||
OSX("osx"),
|
||||
MACOS("macos", "osx"),
|
||||
/**
|
||||
* FreeBSD.
|
||||
*/
|
||||
FREEBSD("freebsd"),
|
||||
FREEBSD("freebsd", "linux"),
|
||||
/**
|
||||
* Unknown operating system.
|
||||
*/
|
||||
UNKNOWN("universal");
|
||||
|
||||
private final String checkedName;
|
||||
private final String mojangName;
|
||||
|
||||
OperatingSystem(String checkedName) {
|
||||
this.checkedName = checkedName;
|
||||
this.mojangName = checkedName;
|
||||
}
|
||||
|
||||
OperatingSystem(String checkedName, String mojangName) {
|
||||
this.checkedName = checkedName;
|
||||
this.mojangName = mojangName;
|
||||
}
|
||||
|
||||
public String getCheckedName() {
|
||||
return checkedName;
|
||||
}
|
||||
|
||||
public String getMojangName() {
|
||||
return mojangName;
|
||||
}
|
||||
|
||||
public boolean isLinuxOrBSD() {
|
||||
return this == LINUX || this == FREEBSD;
|
||||
}
|
||||
@@ -276,7 +287,7 @@ public enum OperatingSystem {
|
||||
name = name.trim().toLowerCase(Locale.ROOT);
|
||||
|
||||
if (name.contains("mac") || name.contains("darwin") || name.contains("osx"))
|
||||
return OSX;
|
||||
return MACOS;
|
||||
else if (name.contains("win"))
|
||||
return WINDOWS;
|
||||
else if (name.contains("solaris") || name.contains("linux") || name.contains("unix") || name.contains("sunos"))
|
||||
@@ -300,7 +311,7 @@ public enum OperatingSystem {
|
||||
case WINDOWS:
|
||||
String appdata = System.getenv("APPDATA");
|
||||
return Paths.get(appdata == null ? home : appdata, "." + folder).toAbsolutePath();
|
||||
case OSX:
|
||||
case MACOS:
|
||||
return Paths.get(home, "Library", "Application Support", folder).toAbsolutePath();
|
||||
default:
|
||||
return Paths.get(home, folder).toAbsolutePath();
|
||||
|
||||
@@ -12,14 +12,14 @@ public final class Platform {
|
||||
public static final Platform LINUX_X86_64 = new Platform(OperatingSystem.LINUX, Architecture.X86_64);
|
||||
public static final Platform LINUX_ARM64 = new Platform(OperatingSystem.LINUX, Architecture.ARM64);
|
||||
|
||||
public static final Platform OSX_X86_64 = new Platform(OperatingSystem.OSX, Architecture.X86_64);
|
||||
public static final Platform OSX_ARM64 = new Platform(OperatingSystem.OSX, Architecture.ARM64);
|
||||
public static final Platform MACOS_X86_64 = new Platform(OperatingSystem.MACOS, Architecture.X86_64);
|
||||
public static final Platform MACOS_ARM64 = new Platform(OperatingSystem.MACOS, Architecture.ARM64);
|
||||
|
||||
public static final Platform CURRENT_PLATFORM = Platform.getPlatform(OperatingSystem.CURRENT_OS, Architecture.CURRENT_ARCH);
|
||||
public static final Platform SYSTEM_PLATFORM = Platform.getPlatform(OperatingSystem.CURRENT_OS, Architecture.SYSTEM_ARCH);
|
||||
|
||||
public static boolean isCompatibleWithX86Java() {
|
||||
return Architecture.SYSTEM_ARCH.isX86() || SYSTEM_PLATFORM == OSX_ARM64 || SYSTEM_PLATFORM == WINDOWS_ARM64;
|
||||
return Architecture.SYSTEM_ARCH.isX86() || SYSTEM_PLATFORM == MACOS_ARM64 || SYSTEM_PLATFORM == WINDOWS_ARM64;
|
||||
}
|
||||
|
||||
private final OperatingSystem os;
|
||||
@@ -43,8 +43,8 @@ public final class Platform {
|
||||
switch (os) {
|
||||
case WINDOWS:
|
||||
return WINDOWS_X86_64;
|
||||
case OSX:
|
||||
return OSX_X86_64;
|
||||
case MACOS:
|
||||
return MACOS_X86_64;
|
||||
case LINUX:
|
||||
return LINUX_X86_64;
|
||||
}
|
||||
@@ -52,8 +52,8 @@ public final class Platform {
|
||||
switch (os) {
|
||||
case WINDOWS:
|
||||
return WINDOWS_ARM64;
|
||||
case OSX:
|
||||
return OSX_ARM64;
|
||||
case MACOS:
|
||||
return MACOS_ARM64;
|
||||
case LINUX:
|
||||
return LINUX_ARM64;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class SystemInfo {
|
||||
DETECTOR = new WindowsHardwareDetector();
|
||||
else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX)
|
||||
DETECTOR = new LinuxHardwareDetector();
|
||||
else if (OperatingSystem.CURRENT_OS == OperatingSystem.OSX)
|
||||
else if (OperatingSystem.CURRENT_OS == OperatingSystem.MACOS)
|
||||
DETECTOR = new MacOSHardwareDetector();
|
||||
else
|
||||
DETECTOR = new HardwareDetector();
|
||||
|
||||
@@ -44,7 +44,7 @@ public final class MacOSHardwareDetector extends HardwareDetector {
|
||||
|
||||
@Override
|
||||
public @Nullable CentralProcessor detectCentralProcessor() {
|
||||
if (OperatingSystem.CURRENT_OS != OperatingSystem.OSX)
|
||||
if (OperatingSystem.CURRENT_OS != OperatingSystem.MACOS)
|
||||
return null;
|
||||
|
||||
try {
|
||||
@@ -97,7 +97,7 @@ public final class MacOSHardwareDetector extends HardwareDetector {
|
||||
|
||||
@Override
|
||||
public List<GraphicsCard> detectGraphicsCards() {
|
||||
if (OperatingSystem.CURRENT_OS != OperatingSystem.OSX)
|
||||
if (OperatingSystem.CURRENT_OS != OperatingSystem.MACOS)
|
||||
return null;
|
||||
|
||||
String json = null;
|
||||
|
||||
Reference in New Issue
Block a user