Enhance user input prompts

This commit is contained in:
Hoang Hong Quan
2025-10-21 23:31:10 +07:00
parent 108a607cb3
commit c4ed8bb4fe
5 changed files with 83 additions and 50 deletions

View File

@@ -86,25 +86,30 @@ class OCPE:
return path, data
def show_oclp_warning(self):
self.u.head("OpenCore Legacy Patcher Warning")
print("")
print("1. OpenCore Legacy Patcher is the only solution to enable dropped GPU and Broadcom WiFi")
print(" support in newer macOS versions, as well as to bring back AppleHDA for macOS Tahoe 26.")
print("")
print("2. OpenCore Legacy Patcher disables macOS security features including SIP and AMFI, which may")
print(" lead to issues such as requiring full installers for updates, application crashes, and")
print(" system instability.")
print("")
print("3. OpenCore Legacy Patcher is not officially supported for Hackintosh community.")
print("")
print("\033[91mImportant:\033[0m")
print("Please consider these risks carefully before proceeding.")
print("")
print("\033[93mNote:\033[0m")
print("If you experience black screen after login with OpenCore Legacy Patcher v2.2.0 or newer")
print("after applying root patches, please revert to version v2.1.2.")
print("")
return (self.u.request_input("Do you want to continue with OpenCore Legacy Patcher? (y/N): ").strip().lower() or "n") == "y"
while True:
self.u.head("OpenCore Legacy Patcher Warning")
print("")
print("1. OpenCore Legacy Patcher is the only solution to enable dropped GPU and Broadcom WiFi")
print(" support in newer macOS versions, as well as to bring back AppleHDA for macOS Tahoe 26.")
print("")
print("2. OpenCore Legacy Patcher disables macOS security features including SIP and AMFI, which may")
print(" lead to issues such as requiring full installers for updates, application crashes, and")
print(" system instability.")
print("")
print("3. OpenCore Legacy Patcher is not officially supported for Hackintosh community.")
print("")
print("\033[91mImportant:\033[0m")
print("Please consider these risks carefully before proceeding.")
print("")
print("\033[93mNote:\033[0m")
print("If you experience black screen after login with OpenCore Legacy Patcher v2.2.0 or newer")
print("after applying root patches, please revert to version v2.1.2.")
print("")
option = self.u.request_input("Do you want to continue with OpenCore Legacy Patcher? (yes/No): ").strip().lower()
if option == "yes":
return True
elif option == "no":
return False
def select_macos_version(self, hardware_report, native_macos_version, ocl_patched_macos_version):
suggested_macos_version = native_macos_version[1]

View File

@@ -34,11 +34,17 @@ class HardwareCustomizer:
print("If yes, please make sure to update your BIOS and enable UEFI Boot Mode in your BIOS settings.")
print("You can still proceed with Legacy if you prefer.")
print("")
answer = self.utils.request_input("Build EFI for UEFI? (Y/n): ").strip().lower() or "y"
if answer == "n":
self.customized_hardware[device_type]["Firmware Type"] = "Legacy"
else:
self.customized_hardware[device_type]["Firmware Type"] = "UEFI"
while True:
answer = self.utils.request_input("Build EFI for UEFI? (Yes/no): ").strip().lower()
if answer == "yes":
self.customized_hardware[device_type]["Firmware Type"] = "UEFI"
break
elif answer == "no":
self.customized_hardware[device_type]["Firmware Type"] = "Legacy"
break
else:
print("\033[91mInvalid selection, please try again.\033[0m\n\n")
continue
for device_name in devices:
@@ -79,7 +85,7 @@ class HardwareCustomizer:
print("")
print("All other devices of the same type have been disabled.")
print("")
self.utils.request_input("Press Enter to continue...")
self.utils.request_input()
return self.customized_hardware, self.disabled_devices, needs_oclp

View File

@@ -125,13 +125,20 @@ class KextMaestro:
print("\n\033[93mNote:\033[0m Since macOS Tahoe 26 DP2, Apple has removed AppleHDA kext and uses the Apple T2 chip for audio management.")
print("To use AppleALC, you must rollback AppleHDA. Alternatively, you can use VoodooHDA.")
print("")
print("1. \033[1mAppleALC\033[0m - Requires AppleHDA rollback with OpenCore Legacy Patcher")
print("1. \033[1mAppleALC\033[0m - Requires AppleHDA rollback with \033[1;93mOpenCore Legacy Patcher\033[0m")
print("2. \033[1mVoodooHDA\033[0m - Lower audio quality, manual injection to /Library/Extensions")
print("")
kext_option = self.utils.request_input("Select audio kext for your system (default: AppleALC): ").strip() or "1"
if kext_option == "1":
needs_oclp = True
selected_kexts.append("AppleALC")
while True:
kext_option = self.utils.request_input("Select audio kext for your system: ").strip()
if kext_option == "1":
needs_oclp = True
selected_kexts.append("AppleALC")
break
elif kext_option == "2":
selected_kexts.append("VoodooHDA")
break
else:
print("\033[91mInvalid selection, please try again.\033[0m\n\n")
else:
selected_kexts.append("AppleALC")
@@ -201,7 +208,7 @@ class KextMaestro:
if kext_option.isdigit() and 0 < int(kext_option) < max_option + 1:
selected_option = int(kext_option)
else:
print("\033[91mInvalid selection, using recommended option: {}\033[0m".format(recommended_option))
print("\033[93mInvalid selection, using recommended option: {}\033[0m".format(recommended_option))
selected_option = recommended_option
if selected_option == 1:
@@ -298,10 +305,15 @@ class KextMaestro:
print("")
print("\033[93mNote:\033[0m Since macOS Sonoma 14, iServices won't work with AirportItlwm without patches")
print("")
option = self.utils.request_input("Apply OCLP root patch to fix iServices? (y/N): ").strip().lower() or "n"
if option == "y":
selected_kexts.append("IOSkywalkFamily")
while True:
option = self.utils.request_input("Apply OCLP root patch to fix iServices? (yes/No): ").strip().lower()
if option == "yes":
selected_kexts.append("IOSkywalkFamily")
break
elif option == "no":
break
else:
print("\033[91mInvalid selection, please try again.\033[0m\n\n")
elif device_id in pci_data.AtherosWiFiIDs[:8]:
selected_kexts.append("corecaptureElCap")
if self.utils.parse_darwin_version(macos_version) > self.utils.parse_darwin_version("20.99.99"):
@@ -645,11 +657,11 @@ class KextMaestro:
print("- Forcing unsupported kexts can cause system instability. \033[0;31mProceed with caution.\033[0m")
print("\033[0m")
option = self.utils.request_input("Do you want to force load {} on the unsupported macOS version? (Y/n): ".format("these kexts" if len(incompatible_kexts) > 1 else "this kext"))
option = self.utils.request_input("Do you want to force load {} on the unsupported macOS version? (yes/No): ".format("these kexts" if len(incompatible_kexts) > 1 else "this kext"))
if option.lower() == "y":
if option.lower() == "yes":
return True
elif option.lower() == "n":
elif option.lower() == "no":
return False
def kext_configuration_menu(self, macos_version):

View File

@@ -233,9 +233,15 @@ class WifiProfileExtractor:
print(" and is useful for users installing macOS via Recovery OS")
print("")
user_input = self.utils.request_input("Would you like to scan for WiFi profiles? (Y/n): ").strip().lower() or "y"
if user_input != "y":
return []
while True:
user_input = self.utils.request_input("Would you like to scan for WiFi profiles? (Yes/no): ").strip().lower()
if user_input == "yes":
break
elif user_input == "no":
return []
else:
print("\033[91mInvalid selection, please try again.\033[0m\n\n")
profiles = []
self.utils.head("Detecting WiFi Profiles")

View File

@@ -145,15 +145,19 @@ class Updater:
print("Please check your internet connection and try again later.")
print("")
user_input = self.utils.request_input("Do you want to skip the update process? (Y/n): ").strip().lower() or "y"
if user_input == 'y':
print("")
print("Update process skipped.")
return False
else:
print("")
print("Continuing with update using default version check...")
latest_sha_version = "update_forced_by_user"
while True:
user_input = self.utils.request_input("Do you want to skip the update process? (yes/No): ").strip().lower()
if user_input == "yes":
print("")
print("Update process skipped.")
return False
elif user_input == "no":
print("")
print("Continuing with update using default version check...")
latest_sha_version = "update_forced_by_user"
break
else:
print("\033[91mInvalid selection, please try again.\033[0m\n\n")
else:
print("Current script SHA version: {}".format(current_sha_version))
print("Latest script SHA version: {}".format(latest_sha_version))