更新对 ARM 平台的支持 (#2522)

* 修复对 Windows Arm64 的支持

* 修复对 Linux Arm64 的支持
This commit is contained in:
Glavo 2023-09-22 16:48:24 +08:00 committed by GitHub
parent 833ac2e32e
commit 5d8a56cf66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 477 additions and 404 deletions

View File

@ -87,16 +87,19 @@ public final class NativePatcher {
// Try patch natives
OperatingSystem os = javaVersion.getPlatform().getOperatingSystem();
Architecture arch = javaVersion.getArchitecture();
VersionNumber gameVersionNumber = gameVersion != null ? VersionNumber.asVersion(gameVersion) : null;
if (settings.isNotPatchNatives())
return version;
if (javaVersion.getArchitecture().isX86())
if (arch.isX86())
return version;
if (javaVersion.getPlatform().getOperatingSystem() == OperatingSystem.OSX
&& javaVersion.getArchitecture() == Architecture.ARM64
&& gameVersion != null
&& VersionNumber.VERSION_COMPARATOR.compare(gameVersion, "1.19") >= 0)
if ((os == OperatingSystem.OSX || os == OperatingSystem.WINDOWS) && arch == Architecture.ARM64
&& gameVersionNumber != null
&& gameVersionNumber.compareTo("1.19") >= 0)
return version;
Map<String, Library> replacements = getNatives(javaVersion.getPlatform());

File diff suppressed because it is too large Load Diff