Monterey compatibility

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2021-06-09 20:49:30 +03:00
parent 8b2af7e287
commit fd780172d3
5 changed files with 17 additions and 4 deletions

@ -1 +1 @@
Subproject commit 704c042bdb9be1e14d207276403127b7b46f4007
Subproject commit b0aac62accc46de3297b2fa3b50e34f0d03460bd

View File

@ -580,6 +580,8 @@ MacOsVersion GetOSVersion(int LoaderType, const XStringW& APFSTargetUUID, const
}else{
if ( Prop->getString()->stringValue().contains("Install%20macOS%20BigSur") || Prop->getString()->stringValue().contains("Install%20macOS%2011.0")) {
OSVersion = "11"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%2012.0")) {
OSVersion = "12"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%2010.16")) {
OSVersion = "10.16"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%20Catalina") || Prop->getString()->stringValue().contains("Install%20macOS%2010.15")) {
@ -831,6 +833,9 @@ GetOSIconName (const MacOsVersion& OSVersion)
XStringW OSIconName;
if (OSVersion.isEmpty()) {
OSIconName = L"mac"_XSW;
} else if (OSVersion.elementAt(0) == 12 ){
// Monterey
OSIconName = L"monterey,mac"_XSW;
} else if ( (OSVersion.elementAt(0) == 10 && OSVersion.elementAt(1) == 16 ) ||
(OSVersion.elementAt(0) == 11 /*&& OSVersion.elementAt(1) == 0*/ )
) {

View File

@ -83,6 +83,7 @@ CONST CHAR8* IconsNames[] = {
"os_clover", //52 == ICON_CLOVER
//other oses will be added below
"os_bigsur", //53 == ICON_BIGSUR
"os_monterey", //54 == ICON_MONTEREY
""
};
const INTN IconsNamesSize = sizeof(IconsNames) / sizeof(IconsNames[0]);

View File

@ -361,6 +361,7 @@ void DebugPause(void);
#define ICON_OTHER_OS (51)
#define ICON_CLOVER (52)
#define ICON_BIGSUR (53)
#define ICON_MONTEREY (54)
#define BUILTIN_ICON_BACKGROUND (100)
#define BUILTIN_ICON_SELECTION (101)
#define BUILTIN_ICON_ANIME (102)

View File

@ -1340,8 +1340,13 @@ void LOADER_ENTRY::StartLoader()
*/
// InstallerVersion = SearchString((CHAR8*)LoadedImage->ImageBase, LoadedImage->ImageSize, "Mac OS X ", 9);
InstallerVersion = AsciiStrStr((CHAR8*)LoadedImage->ImageBase, "Mac OS X ");
int location = 9;
if (InstallerVersion == NULL) {
InstallerVersion = AsciiStrStr((CHAR8*)LoadedImage->ImageBase, "macOS ");
location = 7;
}
if (InstallerVersion != NULL) { // string was found
InstallerVersion += 9; // advance to version location
InstallerVersion += location; // advance to version location
if (strncmp(InstallerVersion, "10.7", 4) &&
strncmp(InstallerVersion, "10.8", 4) &&
@ -1353,7 +1358,8 @@ void LOADER_ENTRY::StartLoader()
strncmp(InstallerVersion, "10.14", 5) &&
strncmp(InstallerVersion, "10.15", 5) &&
strncmp(InstallerVersion, "10.16", 5) &&
strncmp(InstallerVersion, "11.", 3)) {
strncmp(InstallerVersion, "11.", 3) &&
strncmp(InstallerVersion, "12.", 3)) {
InstallerVersion = NULL; // flag known version was not found
}
if (InstallerVersion != NULL) { // known version was found in image