sys_patch.py: Don’t prompt for auth if kext already approved

This commit is contained in:
Mykola Grymalyuk
2022-09-03 12:21:13 -06:00
parent 4e9428b8e0
commit 955d147638

View File

@@ -362,13 +362,13 @@ class PatchSysVolume:
# ["teamID"] = Team ID (blank on ad-hoc signed)
# To grab the CDHash of a kext, run 'codesign -dvvv <kext_path>'
try:
aux_cache_path = Path(self.mount_location_data) / Path("private/var/db/KernelManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist")
if Path(aux_cache_path).exists():
aux_cache_data = plistlib.load((aux_cache_path).open("rb"))
for kext in aux_cache_data["kextsToBuild"]:
if "bundlePathMainOS" in kext:
if kext["bundlePathMainOS"] == f"/Library/Extensions/{install_file}":
return updated_install_location
aux_cache_path = Path(self.mount_location_data) / Path("/private/var/db/KernelExtensionManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist")
if aux_cache_path.exists():
aux_cache_data = plistlib.load((aux_cache_path).open("rb"))
for kext in aux_cache_data["kextsToBuild"]:
if "bundlePathMainOS" in aux_cache_data["kextsToBuild"][kext]:
if aux_cache_data["kextsToBuild"][kext]["bundlePathMainOS"] == f"/Library/Extensions/{install_file}":
return updated_install_location
except PermissionError:
pass