From 5f1e21eb0992b15346b297fdf56fad91fb12da80 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 9 Dec 2024 12:45:30 -0700 Subject: [PATCH] Sync PatcherSupportPkg --- CHANGELOG.md | 14 +++ opencore_legacy_patcher/constants.py | 2 +- opencore_legacy_patcher/support/validation.py | 2 +- .../sys_patch/patchsets/base.py | 3 +- .../sys_patch/patchsets/detect.py | 2 + .../hardware/misc/cpu_missing_avx.py | 86 +++++++++++++++++++ .../patchsets/hardware/misc/t1_security.py | 5 +- .../hardware/networking/legacy_wireless.py | 12 +-- .../hardware/networking/modern_wireless.py | 14 +-- .../patchsets/shared_patches/non_metal.py | 5 ++ 10 files changed, 127 insertions(+), 18 deletions(-) create mode 100644 opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/cpu_missing_avx.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c1bee022e..3fa98c9d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,20 @@ # OpenCore Legacy Patcher changelog ## 2.2.0 +- Resolved non-metal accessibility zoom on macOS Sonoma/Sequoia +- Resolved non-metal photos app on macOS Sequoia +- Resolved non-metal Screen Sharing on macOS Sequoia +- Resolved non-metal inverted screenshots on macOS Sequoia +- Improved non-metal beta menubar reliability +- Disabled non-metal broken weather background animations on macOS Sequoia +- Resolved non-metal safari hide distracting items crash on macOS Sequoia +- Resolved non-metal full screen transition on macOS Sonoma/Sequoia +- Resolved T1 Apple Pay on macOS Sequoia +- Resolved T1 TouchID support on macOS Sequoia 15.2 +- Resolved iCloud sync problems +- Resolved JavaScriptCore on pre-AVX Macs on macOS Sequoia 15.2/Safari 18.2 +- Increment binaries: + - PatcherSupportPkg 1.9.1 - release ## 2.1.2 - Add additional error handling for when building OpenCore errors out diff --git a/opencore_legacy_patcher/constants.py b/opencore_legacy_patcher/constants.py index 8b6f57c11a..72615590bf 100644 --- a/opencore_legacy_patcher/constants.py +++ b/opencore_legacy_patcher/constants.py @@ -14,7 +14,7 @@ class Constants: def __init__(self) -> None: # Patcher Versioning self.patcher_version: str = "2.2.0" # OpenCore-Legacy-Patcher - self.patcher_support_pkg_version: str = "1.8.4" # PatcherSupportPkg + self.patcher_support_pkg_version: str = "1.9.1" # PatcherSupportPkg self.copyright_date: str = "Copyright © 2020-2024 Dortania" self.patcher_name: str = "OpenCore Legacy Patcher" diff --git a/opencore_legacy_patcher/support/validation.py b/opencore_legacy_patcher/support/validation.py index 7557e52b1b..ae8a9ea29d 100644 --- a/opencore_legacy_patcher/support/validation.py +++ b/opencore_legacy_patcher/support/validation.py @@ -124,7 +124,7 @@ def _validate_root_patch_files(self, major_kernel: int, minor_kernel: int) -> No minor_kernel (int): Minor kernel version """ - patch_type_merge_exempt = ["MechanismPlugins"] + patch_type_merge_exempt = ["MechanismPlugins", "ModulePlugins"] patch_type_overwrite_exempt = [] patchset = HardwarePatchsetDetection(self.constants, xnu_major=major_kernel, xnu_minor=minor_kernel, validation=True).patches diff --git a/opencore_legacy_patcher/sys_patch/patchsets/base.py b/opencore_legacy_patcher/sys_patch/patchsets/base.py index fb70ca3ef2..13dbea8980 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/base.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/base.py @@ -32,4 +32,5 @@ def __init__(self) -> None: self.macOS_13_3: float = 22.4 self.macOS_14_1: float = 23.1 self.macOS_14_2: float = 23.2 - self.macOS_14_4: float = 23.4 \ No newline at end of file + self.macOS_14_4: float = 23.4 + self.macOS_15_2: float = 24.2 \ No newline at end of file diff --git a/opencore_legacy_patcher/sys_patch/patchsets/detect.py b/opencore_legacy_patcher/sys_patch/patchsets/detect.py index 011fdab201..a8f33bcbcd 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/detect.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/detect.py @@ -44,6 +44,7 @@ pcie_webcam, t1_security, usb11, + cpu_missing_avx, ) from ... import constants @@ -133,6 +134,7 @@ def __init__(self, constants: constants.Constants, pcie_webcam.PCIeFaceTimeCamera, t1_security.T1SecurityChip, usb11.USB11Controller, + cpu_missing_avx.CPUMissingAVX, ] self.device_properties = None diff --git a/opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/cpu_missing_avx.py b/opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/cpu_missing_avx.py new file mode 100644 index 0000000000..2b31baf096 --- /dev/null +++ b/opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/cpu_missing_avx.py @@ -0,0 +1,86 @@ +""" +cpu_missing_avx.py: Legacy CPUs (Lacking AVX) Detection + +Note that this system is implemented only for macOS Ventura and +machines not using the legacy/modern wireless patches (AVX patch integrated into WiFi patches). + +This commit implemented unconditional AVX usage, thus Safari 18.2 and later will crash: +https://github.com/WebKit/WebKit/commit/c15e741266db8ff9df309ce9971eda1cfd9021cc +""" + +from ..base import BaseHardware, HardwareVariant + +from ..networking.legacy_wireless import LegacyWireless +from ..networking.modern_wireless import ModernWireless + +from ...base import PatchType + +from .....constants import Constants + +from .....datasets.os_data import os_data + + +class CPUMissingAVX(BaseHardware): + + def __init__(self, xnu_major, xnu_minor, os_build, global_constants: Constants) -> None: + super().__init__(xnu_major, xnu_minor, os_build, global_constants) + + + def name(self) -> str: + """ + Display name for end users + """ + return f"{self.hardware_variant()}: Legacy CPUs (Lacking AVX)" + + + def present(self) -> bool: + """ + Targeting CPUs without AVX support + """ + if self._constants.computer.rosetta_active is True: + return False + if "AVX1.0" in self._constants.computer.cpu.flags: + return False + + return True + + + def native_os(self) -> bool: + """ + Only install this patch on macOS Ventura. + This is because we integrated the patch into the WiFi patches which all Macs use in Sonoma+. + """ + if self._xnu_major != os_data.ventura.value: + return True + + if LegacyWireless(self._xnu_major, self._xnu_minor, self._os_build, self._constants).present() is True: + return True + if ModernWireless(self._xnu_major, self._xnu_minor, self._os_build, self._constants).present() is True: + return True + + return False + + + def hardware_variant(self) -> HardwareVariant: + """ + Type of hardware variant + """ + return HardwareVariant.MISCELLANEOUS + + + def patches(self) -> dict: + """ + Patches for Legacy CPUs (Lacking AVX) + """ + if self.native_os() is True: + return {} + + return { + "CPU Missing AVX": { + PatchType.MERGE_SYSTEM_VOLUME: { + "/System/Library/PrivateFrameworks": { + "IO80211.framework": "13.7.2-22", + }, + } + }, + } \ No newline at end of file diff --git a/opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/t1_security.py b/opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/t1_security.py index 1ee79ac0f3..d98a96de9f 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/t1_security.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/hardware/misc/t1_security.py @@ -81,12 +81,13 @@ def patches(self) -> dict: }, PatchType.MERGE_SYSTEM_VOLUME: { "/System/Library/Frameworks/LocalAuthentication.framework/Support": { - "SharedUtils.framework": f"13.6-{self._xnu_major}", # Required for Password Authentication (SharedUtils.framework) + "SharedUtils.framework": f"13.6-{self._xnu_major}" if self._xnu_major < os_data.sequoia else f"13.7.1-{self._xnu_major}", # Required for Password Authentication (SharedUtils.framework) **({ "MechanismPlugins": "15.0 Beta 4" } if self._xnu_major >= os_data.sequoia else {}), # Required to add a TouchID fingerprint + **({ "ModulePlugins": "15.1" } if self._xnu_float >= self.macOS_15_2 else {}), }, "/System/Library/PrivateFrameworks": { "EmbeddedOSInstall.framework": "13.6", # Required for biometrickitd - **({ "NearField.framework": "14.5" } if self._xnu_major >= os_data.sequoia else {}), + **({ "NearField.framework": "14.7.2" } if self._xnu_major >= os_data.sequoia else {}), }, } }, diff --git a/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/legacy_wireless.py b/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/legacy_wireless.py index c856f2f524..a47da04dab 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/legacy_wireless.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/legacy_wireless.py @@ -118,18 +118,18 @@ def _extended_patch(self) -> dict: "Legacy Wireless Extended": { PatchType.OVERWRITE_SYSTEM_VOLUME: { "/usr/libexec": { - "wps": "12.7.2", - "wifip2pd": "12.7.2", + "wps": "12.7.2" if self._xnu_major < os_data.sequoia else f"12.7.2-{self._xnu_major}", + "wifip2pd": "12.7.2" if self._xnu_major < os_data.sequoia else f"12.7.2-{self._xnu_major}", }, }, PatchType.MERGE_SYSTEM_VOLUME: { "/System/Library/Frameworks": { - "CoreWLAN.framework": "12.7.2", + "CoreWLAN.framework": "12.7.2" if self._xnu_major < os_data.sequoia else f"12.7.2-{self._xnu_major}", }, "/System/Library/PrivateFrameworks": { - "CoreWiFi.framework": "12.7.2", - "IO80211.framework": "12.7.2", - "WiFiPeerToPeer.framework": "12.7.2", + "CoreWiFi.framework": "12.7.2" if self._xnu_major < os_data.sequoia else f"12.7.2-{self._xnu_major}", + "IO80211.framework": "12.7.2" if self._xnu_major < os_data.sequoia else f"12.7.2-{self._xnu_major}", + "WiFiPeerToPeer.framework": "12.7.2" if self._xnu_major < os_data.sequoia else f"12.7.2-{self._xnu_major}", }, } }, diff --git a/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/modern_wireless.py b/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/modern_wireless.py index 3a41848eb2..b8e421cffc 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/modern_wireless.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/hardware/networking/modern_wireless.py @@ -64,21 +64,21 @@ def patches(self) -> dict: "Modern Wireless": { PatchType.OVERWRITE_SYSTEM_VOLUME: { "/usr/libexec": { - "airportd": "13.6.5", - "wifip2pd": "13.6.5", + "airportd": f"13.7.2-{self._xnu_major}", + "wifip2pd": f"13.7.2-{self._xnu_major}", }, "/System/Library/CoreServices": { - **({ "WiFiAgent.app": "14.5" } if self._xnu_major >= os_data.sequoia else {}), + **({ "WiFiAgent.app": "14.7.2" } if self._xnu_major >= os_data.sequoia else {}), }, }, PatchType.MERGE_SYSTEM_VOLUME: { "/System/Library/Frameworks": { - "CoreWLAN.framework": f"13.6.5-{self._xnu_major}", + "CoreWLAN.framework": f"13.7.2-{self._xnu_major}", }, "/System/Library/PrivateFrameworks": { - "CoreWiFi.framework": f"13.6.5-{self._xnu_major}", - "IO80211.framework": f"13.6.5-{self._xnu_major}", - "WiFiPeerToPeer.framework": f"13.6.5-{self._xnu_major}", + "CoreWiFi.framework": f"13.7.2-{self._xnu_major}", + "IO80211.framework": f"13.7.2-{self._xnu_major}", + "WiFiPeerToPeer.framework": f"13.7.2-{self._xnu_major}", }, } }, diff --git a/opencore_legacy_patcher/sys_patch/patchsets/shared_patches/non_metal.py b/opencore_legacy_patcher/sys_patch/patchsets/shared_patches/non_metal.py index 83e87d37f3..544e539fad 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/shared_patches/non_metal.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/shared_patches/non_metal.py @@ -41,6 +41,11 @@ def patches(self) -> dict: "/usr/sbin": { **({ "screencapture": "14.7"} if self._xnu_major >= os_data.sequoia else {}), }, + "/System/Library/CoreServices/RemoteManagement": { + **({"ScreensharingAgent.bundle": "14.7.2"} if self._xnu_major >= os_data.sequoia else {}), + **({"screensharingd.bundle": "14.7.2"} if self._xnu_major >= os_data.sequoia else {}), + **({"SSMenuAgent.app": "14.7.2"} if self._xnu_major >= os_data.sequoia else {}), + }, }, PatchType.REMOVE_SYSTEM_VOLUME: { "/System/Library/Extensions": [