mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 22:00:00 +10:00
Merge branch 'main' into py3
This commit is contained in:
@@ -8,11 +8,9 @@ from pathlib import Path
|
||||
|
||||
class Constants:
|
||||
def __init__(self):
|
||||
self.default_opencore_version = "0.6.6"
|
||||
self.opencore_version = "0.6.6"
|
||||
self.available_opencore_versions = ["0.6.6"]
|
||||
self.lilu_version = "1.5.0"
|
||||
self.whatevergreen_version = "1.4.6"
|
||||
self.opencore_version = "0.6.7"
|
||||
self.lilu_version = "1.5.1"
|
||||
self.whatevergreen_version = "1.4.7"
|
||||
self.airportbcrmfixup_version = "2.1.2"
|
||||
self.bcm570_version = "1.0.0"
|
||||
self.marvel_version = "1.0.0"
|
||||
@@ -24,6 +22,7 @@ class Constants:
|
||||
self.io80211mojave_version = "1.0.0"
|
||||
self.voodoohda_version = "296"
|
||||
self.restrictevents_version = "1.0.0"
|
||||
self.piixata_version = "1.0.0"
|
||||
|
||||
# Get resource path
|
||||
self.current_path = Path(__file__).parent.parent.resolve()
|
||||
@@ -73,6 +72,8 @@ class Constants:
|
||||
def io80211mojave_path(self): return self.payload_kexts_path / Path(f"Wifi/IO80211Mojave-v{self.io80211mojave_version}.zip")
|
||||
@property
|
||||
def voodoohda_path(self): return self.payload_kexts_path / Path(f"Audio/VoodooHDA-v{self.voodoohda_version}.zip")
|
||||
@property
|
||||
def piixata_path(self): return self.payload_kexts_path / Path(f"Misc/AppleIntelPIIXATA-v{self.piixata_version}.zip")
|
||||
|
||||
# Build Location
|
||||
@property
|
||||
|
||||
@@ -393,6 +393,10 @@ HiDPIpicker = [
|
||||
"MacBookPro10,2",
|
||||
]
|
||||
|
||||
IDEPatch = [
|
||||
"MacPro3,1"
|
||||
]
|
||||
|
||||
# 11" Air
|
||||
MacBookAir61 = [
|
||||
"MacBookAir3,1",
|
||||
@@ -424,7 +428,7 @@ MacBookPro111 = [
|
||||
|
||||
# MacBook Pro 15" and 17"
|
||||
|
||||
MacBookPro112 = [
|
||||
MacBookPro113 = [
|
||||
"MacBookPro3,1",
|
||||
"MacBookPro4,1",
|
||||
"MacBookPro5,1",
|
||||
|
||||
+5
-41
@@ -68,6 +68,8 @@ class BuildOpenCore:
|
||||
("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path, lambda: self.model in ModelArray.EthernetBroadcom),
|
||||
# Legacy audio
|
||||
("VoodooHDA.kext", self.constants.voodoohda_version, self.constants.voodoohda_path, lambda: self.model in ModelArray.LegacyAudio),
|
||||
# IDE patch
|
||||
("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: self.model in ModelArray.IDEPatch),
|
||||
]:
|
||||
self.enable_kext(name, version, path, check)
|
||||
|
||||
@@ -145,9 +147,9 @@ class BuildOpenCore:
|
||||
elif self.model in ModelArray.MacBookPro111:
|
||||
print("- Spoofing to MacBookPro11,1")
|
||||
spoofed_model = "MacBookPro11,1"
|
||||
elif self.model in ModelArray.MacBookPro112:
|
||||
print("- Spoofing to MacBookPro11,2")
|
||||
spoofed_model = "MacBookPro11,2"
|
||||
elif self.model in ModelArray.MacBookPro113:
|
||||
print("- Spoofing to MacBookPro11,3")
|
||||
spoofed_model = "MacBookPro11,3"
|
||||
elif self.model in ModelArray.Macmini71:
|
||||
print("- Spoofing to Macmini7,1")
|
||||
spoofed_model = "Macmini7,1"
|
||||
@@ -319,41 +321,3 @@ Please build OpenCore first!"""
|
||||
input()
|
||||
else:
|
||||
utilities.TUIOnlyPrint(["Copying OpenCore"], "Press [Enter] to continue", ["EFI failed to mount!", "Please report this to the devs at GitHub."]).start()
|
||||
|
||||
|
||||
class OpenCoreMenus:
|
||||
def __init__(self, versions):
|
||||
self.constants: Constants.Constants = versions
|
||||
|
||||
def change_opencore_version(self):
|
||||
utilities.cls()
|
||||
utilities.header(["Change OpenCore Version"])
|
||||
print(f"\nCurrent OpenCore version: {self.constants.opencore_version}\nSupported versions: 0.6.6 (recommended)")
|
||||
version = input("Please enter the desired OpenCore version (or press Enter to cancel): ").strip()
|
||||
if not version:
|
||||
return
|
||||
while version not in self.constants.available_opencore_versions:
|
||||
utilities.cls()
|
||||
utilities.header(["Change OpenCore Version"])
|
||||
print(f"\nCurrent OpenCore version: {self.constants.opencore_version}\nSupported versions: 0.6.6 (recommended)")
|
||||
version = input(f"Invalid OpenCore version {version}!\nPlease enter the desired OpenCore version (or press Enter to cancel): ").strip()
|
||||
if not version:
|
||||
return
|
||||
self.constants.opencore_version = version
|
||||
|
||||
def build_opencore_menu(self, model):
|
||||
response = None
|
||||
while not (response and response == -1):
|
||||
title = [f"Build OpenCore v{self.constants.opencore_version} EFI", "Selected Model: " + model]
|
||||
menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True)
|
||||
|
||||
options = [
|
||||
["Build OpenCore", lambda: BuildOpenCore(model, self.constants).build_opencore()],
|
||||
["Change OpenCore Version", self.change_opencore_version],
|
||||
]
|
||||
|
||||
for option in options:
|
||||
menu.add_menu_option(option[0], function=option[1])
|
||||
|
||||
response = menu.start()
|
||||
# response = utilities.menu(title, "zoomer, Please select an option: ", options, auto_number=True, top_level=True)
|
||||
|
||||
Reference in New Issue
Block a user