Add AMFIPass (#1051)

This commit is contained in:
Dhinak G
2023-07-26 08:29:46 -04:00
committed by GitHub
parent aa1739c1d6
commit 43be00e9e7
17 changed files with 247 additions and 138 deletions
+14 -9
View File
@@ -604,6 +604,7 @@ class Computer:
oclp_sys_version: Optional[str] = None
oclp_sys_date: Optional[str] = None
oclp_sys_url: Optional[str] = None
oclp_sys_signed: Optional[bool] = False
firmware_vendor: Optional[str] = None
rosetta_active: Optional[bool] = False
@@ -927,15 +928,19 @@ class Computer:
def oclp_sys_patch_probe(self):
path = Path("/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist")
if path.exists():
sys_plist = plistlib.load(path.open("rb"))
if sys_plist:
if "OpenCore Legacy Patcher" in sys_plist:
self.oclp_sys_version = sys_plist["OpenCore Legacy Patcher"]
if "Time Patched" in sys_plist:
self.oclp_sys_date = sys_plist["Time Patched"]
if "Commit URL" in sys_plist:
self.oclp_sys_url = sys_plist["Commit URL"]
if not path.exists():
self.oclp_sys_signed = True # No plist, so assume root is valid
return
sys_plist = plistlib.load(path.open("rb"))
if sys_plist:
if "OpenCore Legacy Patcher" in sys_plist:
self.oclp_sys_version = sys_plist["OpenCore Legacy Patcher"]
if "Time Patched" in sys_plist:
self.oclp_sys_date = sys_plist["Time Patched"]
if "Commit URL" in sys_plist:
self.oclp_sys_url = sys_plist["Commit URL"]
if "Custom Signature" in sys_plist:
self.oclp_sys_signed = sys_plist["Custom Signature"]
def check_rosetta(self):
result = subprocess.run("sysctl -in sysctl.proc_translated".split(), stdout=subprocess.PIPE).stdout.decode()