sys_patch.py: Add proper KDK handling during root patching

This commit is contained in:
Mykola Grymalyuk
2022-06-14 15:02:01 -06:00
parent 8285be259c
commit d0dbf8e399
3 changed files with 41 additions and 9 deletions

View File

@@ -60,4 +60,14 @@ class sys_patch_helpers:
plistlib.dump(data, Path(source_path_file).open("wb"), sort_keys=False)
if Path(source_path_file).exists():
return True
return False
return False
def determine_kdk_present(self):
# Check if KDK is present
if Path("/Library/Developer/KDKs").exists():
for kdk_folder in Path("/Library/Developer/KDKs").iterdir():
# We don't want to support mismatched KDKs
if self.constants.detected_os_build in kdk_folder.name:
return kdk_folder
return None