From 7239730c44850a77d8133754e509f26cf54234b8 Mon Sep 17 00:00:00 2001 From: Dhinak G <17605561+dhinakg@users.noreply.github.com> Date: Wed, 31 May 2023 11:49:38 -0400 Subject: [PATCH] sys_patch_auto.py: Skip malformed kext plists Anything with `GPUCompanionBundles` should have a proper plist --- resources/sys_patch/sys_patch_auto.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/sys_patch/sys_patch_auto.py b/resources/sys_patch/sys_patch_auto.py index 255fb0018..dcf79841b 100644 --- a/resources/sys_patch/sys_patch_auto.py +++ b/resources/sys_patch/sys_patch_auto.py @@ -350,7 +350,11 @@ class AutomaticSysPatch: for kext in Path("/Library/Extensions").glob("*.kext"): if not Path(f"{kext}/Contents/Info.plist").exists(): continue - kext_plist = plistlib.load(open(f"{kext}/Contents/Info.plist", "rb")) + try: + kext_plist = plistlib.load(open(f"{kext}/Contents/Info.plist", "rb")) + except Exception as e: + logging.info(f" - Failed to load plist for {kext.name}: {e}") + continue if "GPUCompanionBundles" not in kext_plist: continue logging.info(f" - Found kext with GPUCompanionBundles: {kext.name}")