mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
Add AMFI check
This commit is contained in:
@@ -676,6 +676,7 @@ class BuildOpenCore:
|
|||||||
if self.constants.disable_cs_lv is True:
|
if self.constants.disable_cs_lv is True:
|
||||||
print("- Disabling Library Validation")
|
print("- Disabling Library Validation")
|
||||||
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable Library Validation Enforcement")["Enabled"] = True
|
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable Library Validation Enforcement")["Enabled"] = True
|
||||||
|
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += "-allow_amfi"
|
||||||
if self.constants.secure_status is False:
|
if self.constants.secure_status is False:
|
||||||
print("- Disabling SecureBootModel")
|
print("- Disabling SecureBootModel")
|
||||||
self.config["Misc"]["Security"]["SecureBootModel"] = "Disabled"
|
self.config["Misc"]["Security"]["SecureBootModel"] = "Disabled"
|
||||||
|
|||||||
@@ -131,7 +131,9 @@ def friendly_hex(integer: int):
|
|||||||
def amfi_status():
|
def amfi_status():
|
||||||
amfi_1 = "amfi_get_out_of_my_way=0x1"
|
amfi_1 = "amfi_get_out_of_my_way=0x1"
|
||||||
amfi_2 = "amfi_get_out_of_my_way=1"
|
amfi_2 = "amfi_get_out_of_my_way=1"
|
||||||
if get_nvram("boot-args", decode=False) and (amfi_1 in get_nvram("boot-args", decode=False) or amfi_2 in get_nvram("boot-args", decode=False)):
|
if (get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False) and "-allow_amfi" in get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False)) or (
|
||||||
|
get_nvram("boot-args", decode=False) and (amfi_1 in get_nvram("boot-args", decode=False) or amfi_2 in get_nvram("boot-args", decode=False))
|
||||||
|
):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -165,6 +167,7 @@ def check_metal_support(device_probe, computer):
|
|||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def check_filevault_skip():
|
def check_filevault_skip():
|
||||||
# Check whether we can skip FileVault check with Root Patching
|
# Check whether we can skip FileVault check with Root Patching
|
||||||
if get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False) and "-allow_fv" in get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False):
|
if get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False) and "-allow_fv" in get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False):
|
||||||
@@ -172,6 +175,7 @@ def check_filevault_skip():
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def patching_status(os_sip, os):
|
def patching_status(os_sip, os):
|
||||||
# Detection for Root Patching
|
# Detection for Root Patching
|
||||||
sip_enabled = True # System Integrity Protection
|
sip_enabled = True # System Integrity Protection
|
||||||
@@ -183,8 +187,7 @@ def patching_status(os_sip, os):
|
|||||||
gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext"
|
gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext"
|
||||||
gen7_kext = "/System/Library/Extension/AppleIntelHD3000Graphics.kext"
|
gen7_kext = "/System/Library/Extension/AppleIntelHD3000Graphics.kext"
|
||||||
|
|
||||||
if os > Constants.Constants().catalina and not check_oclp_boot():
|
if os > Constants.Constants().catalina:
|
||||||
# Assume non-OCLP Macs don't patch _cs_require_lv
|
|
||||||
amfi_enabled = amfi_status()
|
amfi_enabled = amfi_status()
|
||||||
else:
|
else:
|
||||||
# Catalina and older supports individually disabling Library Validation
|
# Catalina and older supports individually disabling Library Validation
|
||||||
|
|||||||
Reference in New Issue
Block a user