gui_main.py: Remove Sys Pref prompt for Ventura

This commit is contained in:
Mykola Grymalyuk
2022-09-20 17:01:24 -06:00
parent 3a641d451d
commit 0895fc8415
+26 -23
View File
@@ -1248,30 +1248,33 @@ class wx_python_gui:
if self.constants.root_patcher_succeeded is True: if self.constants.root_patcher_succeeded is True:
print("- Root Patcher finished successfully") print("- Root Patcher finished successfully")
if self.constants.needs_to_open_preferences is True: if self.constants.needs_to_open_preferences is True:
# Create dialog box to open System Preferences -> Security and Privacy if self.constants.detected_os >= os_data.os_data.ventura:
self.popup = wx.MessageDialog( self.reboot_system(message="Root Patcher finished successfully!\nIf you were prompted to open System Preferences to authorize new kexts, this can be ignored. Your system is ready once restarted.\n\nWould you like to reboot now?")
self.frame_modal, else:
"We just finished installing the patches to your Root Volume!\n\nHowever, Apple requires users to manually approve the kernel extensions installed before they can be used next reboot.\n\nWould you like to open System Preferences?", # Create dialog box to open System Preferences -> Security and Privacy
"Open System Preferences?", self.popup = wx.MessageDialog(
wx.YES_NO | wx.ICON_INFORMATION self.frame_modal,
) "We just finished installing the patches to your Root Volume!\n\nHowever, Apple requires users to manually approve the kernel extensions installed before they can be used next reboot.\n\nWould you like to open System Preferences?",
self.popup.SetYesNoLabels("Open System Preferences", "Ignore") "Open System Preferences?",
answer = self.popup.ShowModal() wx.YES_NO | wx.ICON_INFORMATION
if answer == wx.ID_YES:
output =subprocess.run(
[
"osascript", "-e",
'tell app "System Preferences" to activate',
"-e", 'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"',
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
) )
if output.returncode != 0: self.popup.SetYesNoLabels("Open System Preferences", "Ignore")
# Some form of fallback if unaccelerated state errors out answer = self.popup.ShowModal()
subprocess.run(["open", "-a", "System Preferences"]) if answer == wx.ID_YES:
time.sleep(5) output =subprocess.run(
self.OnCloseFrame(None) [
"osascript", "-e",
'tell app "System Preferences" to activate',
"-e", 'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"',
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
if output.returncode != 0:
# Some form of fallback if unaccelerated state errors out
subprocess.run(["open", "-a", "System Preferences"])
time.sleep(5)
self.OnCloseFrame(None)
else: else:
self.reboot_system(message="Root Patcher finished successfully\nWould you like to reboot now?") self.reboot_system(message="Root Patcher finished successfully\nWould you like to reboot now?")
self.return_to_main_menu.Enable() self.return_to_main_menu.Enable()