Skip to content

Commit

Permalink
Sync PatcherSupportPkg
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Dec 9, 2024
1 parent 213e161 commit 5f1e21e
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 18 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion opencore_legacy_patcher/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion opencore_legacy_patcher/support/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion opencore_legacy_patcher/sys_patch/patchsets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
self.macOS_14_4: float = 23.4
self.macOS_15_2: float = 24.2
2 changes: 2 additions & 0 deletions opencore_legacy_patcher/sys_patch/patchsets/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
pcie_webcam,
t1_security,
usb11,
cpu_missing_avx,
)

from ... import constants
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
},
}
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}),
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit 5f1e21e

Please sign in to comment.