mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 06:30:52 +10:00
sys_patch.py: Avoid prompts if kext has already been accepted
This commit is contained in:
+3
-1
@@ -49,7 +49,9 @@ class OpenCoreLegacyPatcher:
|
|||||||
|
|
||||||
# Now that we have commit info, update nightly link
|
# Now that we have commit info, update nightly link
|
||||||
if self.constants.commit_info[0] != "Running from source":
|
if self.constants.commit_info[0] != "Running from source":
|
||||||
self.constants.installer_pkg_url_nightly = self.constants.installer_pkg_url_nightly.replace("main", self.constants.commit_info[0])
|
branch = self.constants.commit_info[0]
|
||||||
|
branch = branch.replace("refs/heads/", "")
|
||||||
|
self.constants.installer_pkg_url_nightly = self.constants.installer_pkg_url_nightly.replace("main", branch)
|
||||||
|
|
||||||
defaults.generate_defaults.probe(self.computer.real_model, True, self.constants)
|
defaults.generate_defaults.probe(self.computer.real_model, True, self.constants)
|
||||||
|
|
||||||
|
|||||||
@@ -327,6 +327,24 @@ class PatchSysVolume:
|
|||||||
plist_data["OSBundleRequired"] = "Auxiliary"
|
plist_data["OSBundleRequired"] = "Auxiliary"
|
||||||
plistlib.dump(plist_data, plist_path.open("wb"))
|
plistlib.dump(plist_data, plist_path.open("wb"))
|
||||||
|
|
||||||
|
# Verify whether the user needs to authenticate in System Preferences
|
||||||
|
# Specifically under 'private/var/db/KernelManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist'
|
||||||
|
# ["kextsToBuild"][i]:
|
||||||
|
# ["bundlePathMainOS"] = /Library/Extensions/Test.kext
|
||||||
|
# ["cdHash"] = Bundle's CDHash (random on ad-hoc signed, static on dev signed)
|
||||||
|
# ["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
|
||||||
|
except PermissionError:
|
||||||
|
pass
|
||||||
|
|
||||||
self.constants.needs_to_open_preferences = True
|
self.constants.needs_to_open_preferences = True
|
||||||
|
|
||||||
return updated_install_location
|
return updated_install_location
|
||||||
|
|||||||
Reference in New Issue
Block a user