mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-16 20:30:00 +10:00
sys_patch: Add unpatch validation
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
- Limited to Ventura currently due to limitations with other color profiles
|
- Limited to Ventura currently due to limitations with other color profiles
|
||||||
- Applicable for HD3000-based machines (ex. MacBookAir4,x, MacBookPro8,x, Macmini5,x)
|
- Applicable for HD3000-based machines (ex. MacBookAir4,x, MacBookPro8,x, Macmini5,x)
|
||||||
- Ensure `Moraea_BlurBeta` is set on non-Metal systems
|
- Ensure `Moraea_BlurBeta` is set on non-Metal systems
|
||||||
|
- Implement proper Root Unpatching verification in GUI
|
||||||
|
- Removes arbitrary patch requirements used against unpatching (ex. network connection)
|
||||||
- Increment Binaries:
|
- Increment Binaries:
|
||||||
- PatcherSupportPkg 0.8.3 - release
|
- PatcherSupportPkg 0.8.3 - release
|
||||||
|
|
||||||
|
|||||||
@@ -1060,6 +1060,7 @@ class wx_python_gui:
|
|||||||
|
|
||||||
patches = sys_patch_detect.detect_root_patch(self.computer.real_model, self.constants).detect_patch_set()
|
patches = sys_patch_detect.detect_root_patch(self.computer.real_model, self.constants).detect_patch_set()
|
||||||
self.patches = patches
|
self.patches = patches
|
||||||
|
can_unpatch = patches["Validation: Unpatching Possible"]
|
||||||
if not any(not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True for patch in patches):
|
if not any(not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True for patch in patches):
|
||||||
print("- No applicable patches available")
|
print("- No applicable patches available")
|
||||||
patches = []
|
patches = []
|
||||||
@@ -1108,6 +1109,8 @@ class wx_python_gui:
|
|||||||
self.patch_label.Centre(wx.HORIZONTAL)
|
self.patch_label.Centre(wx.HORIZONTAL)
|
||||||
i = i + self.patch_label.GetSize().height + 3
|
i = i + self.patch_label.GetSize().height + 3
|
||||||
for patch in patches:
|
for patch in patches:
|
||||||
|
if patch == "Validation: Unpatching Possible":
|
||||||
|
continue
|
||||||
if patch.startswith("Validation") and patches[patch] is True:
|
if patch.startswith("Validation") and patches[patch] is True:
|
||||||
print(f"- Adding check: {patch} - {patches[patch]}")
|
print(f"- Adding check: {patch} - {patches[patch]}")
|
||||||
self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch[12:]}")
|
self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch[12:]}")
|
||||||
@@ -1210,7 +1213,8 @@ class wx_python_gui:
|
|||||||
if patches:
|
if patches:
|
||||||
if patches["Validation: Patching Possible"] is False:
|
if patches["Validation: Patching Possible"] is False:
|
||||||
self.start_root_patching.Disable()
|
self.start_root_patching.Disable()
|
||||||
self.revert_root_patches.Disable()
|
if can_unpatch is False:
|
||||||
|
self.revert_root_patches.Disable()
|
||||||
|
|
||||||
self.frame_modal.SetSize(-1, self.return_to_main_menu.GetPosition().y + self.return_to_main_menu.GetSize().height + 40)
|
self.frame_modal.SetSize(-1, self.return_to_main_menu.GetPosition().y + self.return_to_main_menu.GetSize().height + 40)
|
||||||
self.frame_modal.ShowWindowModal()
|
self.frame_modal.ShowWindowModal()
|
||||||
|
|||||||
@@ -468,6 +468,7 @@ class detect_root_patch:
|
|||||||
"Settings: Supports Auxiliary Cache": not self.requires_root_kc,
|
"Settings: Supports Auxiliary Cache": not self.requires_root_kc,
|
||||||
"Settings: Kernel Debug Kit missing": self.missing_kdk if self.constants.detected_os >= os_data.os_data.ventura.value else False,
|
"Settings: Kernel Debug Kit missing": self.missing_kdk if self.constants.detected_os >= os_data.os_data.ventura.value else False,
|
||||||
"Validation: Patching Possible": self.verify_patch_allowed(),
|
"Validation: Patching Possible": self.verify_patch_allowed(),
|
||||||
|
"Validation: Unpatching Possible": self.verify_unpatch_allowed(),
|
||||||
f"Validation: SIP is enabled (Required: {self.check_sip()[2]} or higher)": self.sip_enabled,
|
f"Validation: SIP is enabled (Required: {self.check_sip()[2]} or higher)": self.sip_enabled,
|
||||||
f"Validation: Currently Booted SIP: ({hex(py_sip_xnu.SipXnu().get_sip_status().value)})": self.sip_enabled,
|
f"Validation: Currently Booted SIP: ({hex(py_sip_xnu.SipXnu().get_sip_status().value)})": self.sip_enabled,
|
||||||
"Validation: SecureBootModel is enabled": self.sbm_enabled,
|
"Validation: SecureBootModel is enabled": self.sbm_enabled,
|
||||||
@@ -577,6 +578,10 @@ class detect_root_patch:
|
|||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def verify_unpatch_allowed(self, print_errors=False):
|
||||||
|
# Must be called after verify_patch_allowed
|
||||||
|
return not self.sip_enabled
|
||||||
|
|
||||||
def generate_patchset(self, hardware_details):
|
def generate_patchset(self, hardware_details):
|
||||||
all_hardware_patchset = sys_patch_dict.SystemPatchDictionary(self.constants.detected_os, self.constants.detected_os_minor, self.constants.legacy_accel_support)
|
all_hardware_patchset = sys_patch_dict.SystemPatchDictionary(self.constants.detected_os, self.constants.detected_os_minor, self.constants.legacy_accel_support)
|
||||||
required_patches = {}
|
required_patches = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user