Skip to content

Commit

Permalink
products.py: Better handle Apple Silicon installers
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Oct 31, 2024
1 parent 5542f10 commit b561a35
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions opencore_legacy_patcher/sucatalog/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _legacy_parse_info_plist(self, data: dict) -> dict:
# Ensure Apple Silicon specific Installers are not listed
if "VMM-x86_64" not in data["MobileAssetProperties"]["SupportedDeviceModels"]:
if self.vmm_only:
return {}
return {"Missing VMM Support": True}

version = data["MobileAssetProperties"]["OSVersion"]
build = data["MobileAssetProperties"]["Build"]
Expand All @@ -82,7 +82,7 @@ def _parse_mobile_asset_plist(self, data: dict) -> dict:
With macOS Sequoia, the Info.plist is no longer present in the InstallAssistant's assets
"""

_does_support_vmm = False
for entry in data["Assets"]:
if "SupportedDeviceModels" not in entry:
continue
Expand All @@ -94,6 +94,8 @@ def _parse_mobile_asset_plist(self, data: dict) -> dict:
if self.vmm_only:
continue

_does_support_vmm = True

build = entry["Build"]
version = entry["OSVersion"]

Expand All @@ -109,6 +111,10 @@ def _parse_mobile_asset_plist(self, data: dict) -> dict:
"Catalog": CatalogURL().catalog_url_to_seed(catalog_url),
}

if _does_support_vmm is False:
if self.vmm_only:
return {"Missing VMM Support": True}

return {}


Expand Down Expand Up @@ -325,9 +331,18 @@ def products(self) -> None:

if plist_contents:
if Path(package["URL"]).name == "Info.plist":
_product_map.update(self._legacy_parse_info_plist(plist_contents))
result = self._legacy_parse_info_plist(plist_contents)
else:
_product_map.update(self._parse_mobile_asset_plist(plist_contents))
result = self._parse_mobile_asset_plist(plist_contents)

if result == {"Missing VMM Support": True}:
_product_map = {}
break

_product_map.update(result)

if _product_map == {}:
continue

if _product_map["Version"] is not None:
_product_map["Title"] = self._build_installer_name(_product_map["Version"], _product_map["Catalog"])
Expand Down
2 changes: 1 addition & 1 deletion opencore_legacy_patcher/sys_patch/patchsets/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def _strip_incompatible_hardware(self, present_hardware: list[BaseHardware]) ->
logging.error("Stripping out Non-Metal GPUs")
for hardware in list(present_hardware):
if hardware.hardware_variant_graphics_subclass() == HardwareVariantGraphicsSubclass.NON_METAL_GRAPHICS:
print(f" Stripping out {hardware.name()}")
logging.info(f" Stripping out {hardware.name()}")
present_hardware.remove(hardware)

if metal_3802_gpu_present and metal_31001_gpu_present and self._xnu_major >= os_data.sequoia.value:
Expand Down

0 comments on commit b561a35

Please sign in to comment.