From 545944cb0de33438b0584785a900045eb35ecd58 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 15 Oct 2022 12:41:16 +0200 Subject: [PATCH] refactor: support armhf Signed-off-by: Sefa Eyeoglu --- launcher/RuntimeContext.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/launcher/RuntimeContext.h b/launcher/RuntimeContext.h index c1b71318..bc2ed5c8 100644 --- a/launcher/RuntimeContext.h +++ b/launcher/RuntimeContext.h @@ -29,9 +29,14 @@ struct RuntimeContext { QString system; QString mappedJavaRealArchitecture() const { - if (javaRealArchitecture == "aarch64") { + if (javaRealArchitecture == "amd64") + return "x86_64"; + if (javaRealArchitecture == "i386" || javaRealArchitecture == "i686") + return "x86"; + if (javaRealArchitecture == "aarch64") return "arm64"; - } + if (javaRealArchitecture == "arm" || javaRealArchitecture == "armhf") + return "arm32"; return javaRealArchitecture; } @@ -48,8 +53,8 @@ struct RuntimeContext { // "Legacy" refers to the fact that Mojang assumed that these are the only two architectures bool isLegacyArch() const { - QSet legacyArchitectures{"amd64", "x86_64", "i386", "i686", "x86"}; - return legacyArchitectures.contains(mappedJavaRealArchitecture()); + const QString mapped = mappedJavaRealArchitecture(); + return mapped == "x86_64" || mapped == "x86"; } bool classifierMatches(QString target) const {