Compare commits

...

11 Commits
1.4.0 ... 1.4.2

Author SHA1 Message Date
Mykola Grymalyuk
e494906f22 sys_patch_dict.py: Fix comparison 2024-03-10 17:06:07 -06:00
Mykola Grymalyuk
cdb40d8201 Sync PatcherSupportPkg 2024-03-10 14:14:38 -06:00
neon ball
b42eb6e395 Small fix 2024-03-10 21:10:10 +02:00
neon ball
20bb0cd6d8 Fix typos and stuff 2024-03-10 21:07:51 +02:00
Mykola Grymalyuk
c6688ea922 Increment build 2024-03-10 12:01:23 -06:00
neon ball
0e490e5ae9 Switch kext removal command
Command cleans /Library/Extensions with a one shot instead of having to do it one by one per kext.
2024-03-08 20:18:59 +02:00
Mykola Grymalyuk
e58a671136 bluetooth.py: Fix GUID and delete variables 2024-03-07 17:57:11 -07:00
Mykola Grymalyuk
5d142fd19f bluetooth.py: Publish Controller and Dongle NVRAM variables 2024-03-07 17:28:30 -07:00
Mykola Grymalyuk
f55598dac8 misc.py: Resolve SPI support for MacBookAir6,x 2024-03-07 17:00:52 -07:00
Mykola Grymalyuk
321cc8dd68 Increment build 2024-03-07 14:27:56 -07:00
Jazzzny
9070f5af8d Update implementation for updater (#1126)
* Update implementation for updater

* Update changelog
2024-03-07 16:16:53 -05:00
12 changed files with 1314 additions and 78 deletions

View File

@@ -1,5 +1,21 @@
# OpenCore Legacy Patcher changelog
## 1.4.2
- Resolve Auto-Join support for Modern Wireless on macOS 14.4
- Applicable for BCM94360, 4360, 4350, 4331 and 43224 chipsets
- Resolve WiFi support for Legacy Wireless on macOS 12.7.4 and 13.6.5
- Applicable for BCM94328, BCM94322 and Atheros chipsets
- Resolve USB 1.1 on macOS Ventura regression from OCLP 1.4.0
- Increment Binaries:
- PatcherSupportPkg 1.4.8 - release
## 1.4.1
- Update updater implementation
- Resolve Keyboard/Trackpad support for MacBookAir6,x running macOS 14.4 and newer
- Expands SPI Keyboard and Trackpad patch to include MacBookAir6,x
- Publish Bluetooth NVRAM variables for BCM2046 and BCM2070 chipsets
- Reduces need for NVRAM reset to restore Bluetooth support in newer OSes (Thanks @ausdauersportler)
## 1.4.0
- Refactor subprocess invocations
- Resolve RecoveryOS support (Regression resolved in OpenCorePkg)

1210
data/css_data.py Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
# Dictionary defining patch sets used during Root Volume patching (sys_patch.py)
# Copyright (C) 2022-2023, Mykola Grymalyuk
import packaging.version
from data import os_data
@@ -9,7 +11,7 @@ class SystemPatchDictionary():
Library for generating patch sets for sys_patch.py and supporting modules
Usage:
>>> patchsets = SystemPatchDictionary(22, 0, [20, 21, 22]).patchset_dict
>>> patchsets = SystemPatchDictionary(22, 0, [20, 21, 22], "13.0").patchset_dict
Patchset Schema:
@@ -49,12 +51,13 @@ class SystemPatchDictionary():
Note: Stubbed binaries are OS specific, thus use the 'self.os_major' variable to denounce which folder variant to use
"""
def __init__(self, os_major: int, os_minor: int, non_metal_os_support: list) -> None:
def __init__(self, os_major: int, os_minor: int, non_metal_os_support: list, marketing_version: str) -> None:
"""
Parameters:
os_major (int): Major XNU Kernel version
os_minor (int): Minor XNU Kernel version
non_metal_os_support (list): List of supported non-metal OSes (XNU Major Versions)
marketing_version (str): Marketing version of the OS
'non_metal_os_support' is assumed to be sorted from oldest to newest
"""
@@ -64,6 +67,9 @@ class SystemPatchDictionary():
self.os_float: float = float(f"{self.os_major}.{self.os_minor}")
self.non_metal_os_support: list = non_metal_os_support
self.patchset_dict: dict = {}
self.marketing_version: str = marketing_version
self.affected_by_cve_2024_23227: bool = self.__is_affect_by_cve_2024_23227()
# XNU Kernel versions
self.macOS_12_0_B7: float = 21.1
@@ -120,6 +126,27 @@ class SystemPatchDictionary():
return "12.5-23.4"
def __is_affect_by_cve_2024_23227(self) -> bool:
"""
CVE-2024-23227 broke our airportd patches for 12.7.4, 13.6.5 and 14.4
Note that since the XNU version's security patch level is not increment
"""
if self.os_major > os_data.os_data.sonoma:
return True
parsed_version = packaging.version.parse(self.marketing_version)
if self.marketing_version.startswith("12"):
return parsed_version >= packaging.version.parse("12.7.4")
if self.marketing_version.startswith("13"):
return parsed_version >= packaging.version.parse("13.6.5")
if self.marketing_version.startswith("14"):
return parsed_version >= packaging.version.parse("14.4")
return False
def _generate_sys_patch_dict(self):
"""
Generates the sys_patch_dict dictionary
@@ -1151,7 +1178,7 @@ class SystemPatchDictionary():
},
"Install": {
"/usr/libexec": {
"airportd": "11.7.10" if self.os_float < self.macOS_14_4 else "11.7.10-23.4",
"airportd": "11.7.10" if self.affected_by_cve_2024_23227 is False else "11.7.10-Sandbox",
},
"/System/Library/CoreServices": {
"WiFiAgent.app": "11.7.10",
@@ -1207,16 +1234,16 @@ class SystemPatchDictionary():
},
"Install": {
"/usr/libexec": {
"airportd": "13.6.2" if self.os_float < self.macOS_14_4 else "13.6.2-23.4",
"wifip2pd": "13.6.2",
"airportd": "13.6.5",
"wifip2pd": "13.6.5",
},
"/System/Library/Frameworks": {
"CoreWLAN.framework": "13.6.2",
"CoreWLAN.framework": "13.6.5",
},
"/System/Library/PrivateFrameworks": {
"CoreWiFi.framework": "13.6.2",
"IO80211.framework": "13.6.2",
"WiFiPeerToPeer.framework": "13.6.2",
"CoreWiFi.framework": "13.6.5",
"IO80211.framework": "13.6.5",
"WiFiPeerToPeer.framework": "13.6.5",
},
},
},
@@ -1308,7 +1335,7 @@ class SystemPatchDictionary():
},
"Install": {
"/System/Library/Extensions": {
"IOUSBHostFamily.kext": "12.6.2",
"IOUSBHostFamily.kext": "12.6.2" if self.os_float < self.macOS_14_4 else "12.6.2-23.4",
},
},
},

View File

@@ -66,13 +66,13 @@ Then revert the snapshot
```sh
bless --mount "/Volumes/Macintosh HD" --bootefi --last-sealed-snapshot
```
After that, type the following
```sh
cd "/Volumes/Macintosh HD/Library/Extensions" && ls
```
You should now see bunch of .kexts. If you only see .kexts starting with "HighPoint" and "SoftRAID", you can ignore this and just restart the system. If other kexts are found, continue.
Now we're going to clean the /Library/Extensions folder from offending kexts while keeping needed ones.
Delete everything **except** for the ones that start with HighPoint and SoftRAID, by using `rm -rf "kextname"`
Run the following and **make sure to type it carefully**
```sh
cd "/Volumes/Macintosh HD/Library/Extensions" && ls | grep -v "HighPoint*\|SoftRAID*" | xargs rm -rf
```
Then restart and now your system should be restored to the unpatched snapshot and should be able to boot again.

View File

@@ -13,9 +13,9 @@
:::warning
Note that after you remove OpenCore, your Mac will no longer boot and show the "prohibited" symbol. Be ready to install an natively-supported version of macOS before you uninstall OpenCore.
Note that after you remove OpenCore, your Mac will no longer boot and show the "prohibited" symbol. Be ready to install a natively-supported version of macOS before you uninstall OpenCore.
* This does not apply to native Macs just using OpenCore to achieve features like AirPlay to Mac and Sidecar, but it is still recommended to reinstall macOS after removing OpenCore, if using SMBIOS spoofing to enable Univeral Control.
* This does not apply to native Macs just using OpenCore to achieve features like AirPlay to Mac and Sidecar, but it is still recommended to reinstall macOS after removing OpenCore, if using SMBIOS spoofing to enable Universal Control and other features.
:::
## Uninstalling the application

View File

@@ -2,6 +2,7 @@
# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import logging
import binascii
from resources import constants, device_probe
from resources.build import support
@@ -45,6 +46,9 @@ class BuildBluetooth:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
support.BuildSupport(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path)
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["bluetoothInternalControllerInfo"] = binascii.unhexlify("0000000000000000000000000000")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["bluetoothExternalDongleFailed"] = binascii.unhexlify("00")
self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["bluetoothInternalControllerInfo", "bluetoothExternalDongleFailed"]
elif self.computer.bluetooth_chipset == "BRCM20702 Hub":
# BCM94331 can include either BCM2070 or BRCM20702 v1 Bluetooth chipsets
# Note Monterey only natively supports BRCM20702 v2 (found with BCM94360)
@@ -75,4 +79,7 @@ class BuildBluetooth:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070.value:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["bluetoothInternalControllerInfo"] = binascii.unhexlify("0000000000000000000000000000")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["bluetoothExternalDongleFailed"] = binascii.unhexlify("00")
self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["bluetoothInternalControllerInfo", "bluetoothExternalDongleFailed"]
support.BuildSupport(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path)

View File

@@ -183,9 +183,9 @@ class BuildMiscellaneous:
USB/SPI Top Case Handler
"""
# macOS 14.4 Beta 1 strips SPI-based top case support for Broadwell through Kaby Lake MacBooks
# macOS 14.4 Beta 1 strips SPI-based top case support for Broadwell through Kaby Lake MacBooks (and MacBookAir6,x)
if self.model.startswith("MacBook") and self.model in smbios_data.smbios_dictionary:
if (cpu_data.CPUGen.broadwell <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.CPUGen.kaby_lake):
if self.model.startswith("MacBookAir6") or (cpu_data.CPUGen.broadwell <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.CPUGen.kaby_lake):
logging.info("- Enabling SPI-based top case support")
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleHSSPISupport.kext", self.constants.apple_spi_version, self.constants.apple_spi_path)
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleHSSPIHIDDriver.kext", self.constants.apple_spi_hid_version, self.constants.apple_spi_hid_path)

View File

@@ -13,8 +13,8 @@ from data import os_data
class Constants:
def __init__(self) -> None:
# Patcher Versioning
self.patcher_version: str = "1.4.0" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version: str = "1.4.7" # PatcherSupportPkg
self.patcher_version: str = "1.4.2" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version: str = "1.4.8" # PatcherSupportPkg
self.copyright_date: str = "Copyright © 2020-2024 Dortania"
self.patcher_name: str = "OpenCore Legacy Patcher"

View File

@@ -17,6 +17,7 @@ from pathlib import Path
from resources import utilities, updates, global_settings, network_handler, constants
from resources.sys_patch import sys_patch_detect
from resources.wx_gui import gui_entry, gui_support
from data import css_data
class AutomaticSysPatch:
@@ -70,32 +71,8 @@ class AutomaticSysPatch:
Please check the Github page for more information about this release."""
html_markdown = markdown2.markdown(changelog)
html_css = """
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
line-height: 1.5;
font-size: 13px;
margin-top: 20px;
background-color: rgb(238,238,238);
}
h2 {
line-height: 0.5;
padding-left: 10px;
}
a {
color: -apple-system-control-accent;
}
@media (prefers-color-scheme: dark) {
body {
color: #fff;
background-color: rgb(47,47,47);
}
}
</style>
"""
html_markdown = markdown2.markdown(changelog, extras=["tables"])
html_css = css_data.updater_css
frame = wx.Dialog(None, -1, title="", size=(650, 500))
frame.SetMinSize((650, 500))
frame.SetWindowStyle(wx.STAY_ON_TOP)
@@ -107,7 +84,18 @@ Please check the Github page for more information about this release."""
self.title_text.SetFont(gui_support.font_factory(19, wx.FONTWEIGHT_BOLD))
self.description.SetFont(gui_support.font_factory(13, wx.FONTWEIGHT_NORMAL))
self.web_view = wx.html2.WebView.New(panel, style=wx.BORDER_SUNKEN)
html_code = html_css+html_markdown.replace("<a href=", "<a target='_blank' href=")
html_code = f'''
<html>
<head>
<style>
{html_css}
</style>
</head>
<body class="markdown-body">
{html_markdown.replace("<a href=", "<a target='_blank' href=")}
</body>
</html>
'''
self.web_view.SetPage(html_code, "")
self.web_view.Bind(wx.html2.EVT_WEBVIEW_NEWWINDOW, self._onWebviewNav)
self.web_view.EnableContextMenu(False)

View File

@@ -35,7 +35,7 @@ class GenerateRootPatchSets:
dict: Dictionary of patches to be applied from sys_patch_dict.py
"""
all_hardware_patchset: dict = sys_patch_dict.SystemPatchDictionary(self.constants.detected_os, self.constants.detected_os_minor, self.constants.legacy_accel_support).patchset_dict
all_hardware_patchset: dict = sys_patch_dict.SystemPatchDictionary(self.constants.detected_os, self.constants.detected_os_minor, self.constants.legacy_accel_support, self.constants.detected_os_version).patchset_dict
required_patches: dict = {}
utilities.cls()

View File

@@ -104,7 +104,7 @@ class PatcherValidation:
minor_kernel (int): Minor kernel version
"""
patchset = sys_patch_dict.SystemPatchDictionary(major_kernel, minor_kernel, self.constants.legacy_accel_support).patchset_dict
patchset = sys_patch_dict.SystemPatchDictionary(major_kernel, minor_kernel, self.constants.legacy_accel_support, self.constants.detected_os_version).patchset_dict
host_os_float = float(f"{major_kernel}.{minor_kernel}")
for patch_subject in patchset:

View File

@@ -27,7 +27,7 @@ from resources import (
global_settings,
updates
)
from data import os_data
from data import os_data, css_data
class MainFrame(wx.Frame):
@@ -352,31 +352,8 @@ class MainFrame(wx.Frame):
Please check the Github page for more information about this release."""
html_markdown = markdown2.markdown(changelog)
html_css = """
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
line-height: 1.5;
font-size: 13px;
margin-top: 20px;
background-color: rgb(238,238,238);
}
h2 {
line-height: 0.5;
}
a {
color: -apple-system-control-accent;
}
@media (prefers-color-scheme: dark) {
body {
color: #fff;
background-color: rgb(47,47,47);
}
}
</style>
"""
html_markdown = markdown2.markdown(changelog, extras=["tables"])
html_css = css_data.updater_css
frame = wx.Dialog(None, -1, title="", size=(650, 500))
frame.SetMinSize((650, 500))
frame.SetWindowStyle(wx.STAY_ON_TOP)
@@ -388,7 +365,18 @@ Please check the Github page for more information about this release."""
self.title_text.SetFont(gui_support.font_factory(19, wx.FONTWEIGHT_BOLD))
self.description.SetFont(gui_support.font_factory(13, wx.FONTWEIGHT_NORMAL))
self.web_view = wx.html2.WebView.New(panel, style=wx.BORDER_SUNKEN)
html_code = html_css+html_markdown.replace("<a href=", "<a target='_blank' href=")
html_code = f'''
<html>
<head>
<style>
{html_css}
</style>
</head>
<body class="markdown-body">
{html_markdown.replace("<a href=", "<a target='_blank' href=")}
</body>
</html>
'''
self.web_view.SetPage(html_code, "")
self.web_view.Bind(wx.html2.EVT_WEBVIEW_NEWWINDOW, self._onWebviewNav)
self.web_view.EnableContextMenu(False)