From 5a96852ea5cbfdad5fddd786f284acc3f0c2cf66 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Tue, 28 Jun 2022 10:34:18 -0600 Subject: [PATCH 01/11] install.py: Avoid OC icon if Windows detected --- CHANGELOG.md | 1 + resources/install.py | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 369c157f5..f57f8113c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.4.8 - Ensure Apple Silicon-specific installers are not listed - ie. M2 specific build (21F2092) +- Avoid adding OpenCore icon in boot picker if Windows bootloader on same partition ## 0.4.7 - Fix crashing on defaults parsing diff --git a/resources/install.py b/resources/install.py index d02134a07..06e9c8c9a 100644 --- a/resources/install.py +++ b/resources/install.py @@ -229,18 +229,22 @@ Please build OpenCore first!""" Path(mount_path / Path("EFI/BOOT")).mkdir() shutil.move(mount_path / Path("System/Library/CoreServices/boot.efi"), mount_path / Path("EFI/BOOT/BOOTx64.efi")) shutil.rmtree(mount_path / Path("System"), onerror=rmtree_handler) - if determine_sd_card(sd_type) is True: - print("- Adding SD Card icon") - shutil.copy(self.constants.icon_path_sd, mount_path) - elif ssd_type is True: - print("- Adding SSD icon") - shutil.copy(self.constants.icon_path_ssd, mount_path) - elif disk_type == "USB": - print("- Adding External USB Drive icon") - shutil.copy(self.constants.icon_path_external, mount_path) + # Due to how OpenCore processes on-volume icons, Windows may appear as OC's icon + if (mount_path / Path("EFI/Microsoft")).exists(): + print("- Windows Boot Loader detected, skipping volume icon") else: - print("- Adding Internal Drive icon") - shutil.copy(self.constants.icon_path_internal, mount_path) + if determine_sd_card(sd_type) is True: + print("- Adding SD Card icon") + shutil.copy(self.constants.icon_path_sd, mount_path) + elif ssd_type is True: + print("- Adding SSD icon") + shutil.copy(self.constants.icon_path_ssd, mount_path) + elif disk_type == "USB": + print("- Adding External USB Drive icon") + shutil.copy(self.constants.icon_path_external, mount_path) + else: + print("- Adding Internal Drive icon") + shutil.copy(self.constants.icon_path_internal, mount_path) print("- Cleaning install location") if not self.constants.recovery_status: From d17372dd65170750c8aec5fdade993c705ffd606 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Thu, 30 Jun 2022 10:40:47 -0600 Subject: [PATCH 02/11] utitilities: Add NVRAM error handling --- CHANGELOG.md | 1 + resources/utilities.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f57f8113c..aede60371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Ensure Apple Silicon-specific installers are not listed - ie. M2 specific build (21F2092) - Avoid adding OpenCore icon in boot picker if Windows bootloader on same partition +- Add error-handling to corrupt/non-standard NVRAM variables ## 0.4.7 - Fix crashing on defaults parsing diff --git a/resources/utilities.py b/resources/utilities.py index f81a73a76..71d3864dd 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -346,7 +346,12 @@ def get_nvram(variable: str, uuid: str = None, *, decode: bool = False): if decode: if isinstance(value, bytes): - value = value.strip(b"\0").decode() + try: + value = value.strip(b"\0").decode() + except UnicodeDecodeError: + # Some sceanrios the firmware will throw garbage in + # ie. iMac12,2 with FireWire boot-path + value = None elif isinstance(value, str): value = value.strip("\0") return value From 1fba4901c485f1e5a59cb35840d1002b866494d9 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 1 Jul 2022 22:24:54 -0600 Subject: [PATCH 03/11] =?UTF-8?q?Add=20=E2=80=98Allow=20native=20models?= =?UTF-8?q?=E2=80=99=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ data/os_data.py | 64 ++++++++++++++++++++++++++++++++++++------------- gui/gui_main.py | 15 ++++++++++++ 3 files changed, 65 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aede60371..82085f665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ - ie. M2 specific build (21F2092) - Avoid adding OpenCore icon in boot picker if Windows bootloader on same partition - Add error-handling to corrupt/non-standard NVRAM variables +- Add warning prompt when using 'Allow native models' + - Attempt to avoid misuse of option ## 0.4.7 - Fix crashing on defaults parsing diff --git a/data/os_data.py b/data/os_data.py index 65dbd5bc8..92952c3b2 100644 --- a/data/os_data.py +++ b/data/os_data.py @@ -3,22 +3,26 @@ import enum class os_data(enum.IntEnum): # OS Versions, Based off Major Kernel Version - tiger = 8 - leopard = 9 - snow_leopard = 10 - lion = 11 + cheetah = 4 # Actually 1.3.1 + puma = 5 + jaguar = 6 + panther = 7 + tiger = 8 + leopard = 9 + snow_leopard = 10 + lion = 11 mountain_lion = 12 - mavericks = 13 - yosemite = 14 - el_capitan = 15 - sierra = 16 - high_sierra = 17 - mojave = 18 - catalina = 19 - big_sur = 20 - monterey = 21 - ventura = 22 - max_os = 99 + mavericks = 13 + yosemite = 14 + el_capitan = 15 + sierra = 16 + high_sierra = 17 + mojave = 18 + catalina = 19 + big_sur = 20 + monterey = 21 + ventura = 22 + max_os = 99 class os_conversion: @@ -45,4 +49,32 @@ class os_conversion: if source_minor < target_minor: return True else: - return False \ No newline at end of file + return False + + def convert_kernel_to_marketing_name(kernel): + # Convert major XNU version to Marketing Name + try: + # Find os_data enum name + os_name = os_data(kernel).name + + # Remove "_" from the string + os_name = os_name.replace("_", " ") + + # Upper case the first letter of each word + os_name = os_name.title() + except ValueError: + # Handle cases where no enum value exists + # Pass kernel_to_os() as a substitute for a proper OS name + os_name = os_conversion.kernel_to_os(kernel) + + return os_name + + def convert_marketing_name_to_kernel(marketing_name): + # Convert Marketing Name to major XNU version + try: + # Find os_data enum value + os_kernel = os_data[marketing_name.lower().replace(" ", "_")] + except KeyError: + os_kernel = 0 + + return int(os_kernel) \ No newline at end of file diff --git a/gui/gui_main.py b/gui/gui_main.py index 9c5576d6d..1dbc373e6 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -2175,6 +2175,21 @@ class wx_python_gui: def allow_native_models_click(self, event=None): if self.checkbox_allow_native_models.GetValue(): + # Throw a prompt warning about this + dlg = wx.MessageDialog(self.frame_modal, "This option should only be used if your Mac natively supports the OSes you wish to run.\n\nIf you are currently running an unsupported OS, this option will break booting. Only toggle for enabling OS features on a native Mac.\n\nAre you sure you want to continue?", "Warning", wx.YES_NO | wx.ICON_WARNING) + if dlg.ShowModal() == wx.ID_NO: + self.checkbox_allow_native_models.SetValue(False) + return + # If the system is running an unsupported OS, throw a second warning + if self.constants.computer.real_model in smbios_data.smbios_dictionary: + if self.constants.detected_os > smbios_data.smbios_dictionary[self.constants.computer.real_model]["Max OS Supported"]: + chassis_type = "aluminum" + if self.constants.computer.real_model in ["MacBook4,1", "MacBook5,2", "MacBook6,1", "MacBook7,1"]: + chassis_type = "plastic" + dlg = wx.MessageDialog(self.frame_modal, f"This model, {self.constants.computer.real_model}, does not natively support macOS {os_data.os_conversion.kernel_to_os(self.constants.detected_os)}, {os_data.os_conversion.convert_kernel_to_marketing_name(self.constants.detected_os)}. The last native OS was macOS {os_data.os_conversion.kernel_to_os(smbios_data.smbios_dictionary[self.constants.computer.real_model]['Max OS Supported'])}, {os_data.os_conversion.convert_kernel_to_marketing_name(smbios_data.smbios_dictionary[self.constants.computer.real_model]['Max OS Supported'])}\n\nToggling this option will breaking booting on this OS. Are you absolutely certain this is desired?\n\nYou may end up with a nice {chassis_type} brick 🧱", "Are you certain?", wx.YES_NO | wx.ICON_WARNING) + if dlg.ShowModal() == wx.ID_NO: + self.checkbox_allow_native_models.SetValue(False) + return print("Allow Native Models") self.constants.allow_oc_everywhere = True self.constants.serial_settings = "None" From b7b3f19fa055495caa6d081de2cb8ccc13853d60 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 2 Jul 2022 11:13:44 -0600 Subject: [PATCH 04/11] Copy IAs to tmp during CIM --- Build-Binary.command | 3 +++ gui/gui_main.py | 25 ++++++++++++++++++++++--- resources/installer.py | 20 +++++++++++++++++++- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Build-Binary.command b/Build-Binary.command index 1da9a6a71..65e913da6 100755 --- a/Build-Binary.command +++ b/Build-Binary.command @@ -123,6 +123,9 @@ class create_binary: if file.name in delete_files: print(f" - Deleting {file.name}") file.unlink() + elif (Path(file) / Path("Contents/Resources/createinstallmedia")).exists(): + print(f" - Deleting {file}") + subprocess.run(["rm", "-rf", file]) def download_resources(self): patcher_support_pkg_version = constants.Constants().patcher_support_pkg_version diff --git a/gui/gui_main.py b/gui/gui_main.py index 1dbc373e6..b73f9ac9a 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -31,6 +31,7 @@ class wx_python_gui: self.finished_cim_process = False self.target_disk = "" self.pulse_forward = False + self.prepare_result = False self.non_metal_required = self.use_non_metal_alternative() self.hyperlink_colour = (25, 179, 231) @@ -1832,9 +1833,8 @@ class wx_python_gui: 20 ) self.progress_bar.Centre(wx.HORIZONTAL) - self.progress_bar.SetValue(0) - self.progress_label = wx.StaticText(self.frame, label="Bytes Written: 0") + self.progress_label = wx.StaticText(self.frame, label="Preparing files, beginning shortly...") self.progress_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.progress_label.SetPosition( wx.Point( @@ -1863,7 +1863,19 @@ class wx_python_gui: print("- Creating installer.sh script") print(f"- Disk: {disk}") print(f"- Installer: {installer_path}") - if installer.generate_installer_creation_script(self.constants.installer_sh_path, installer_path, disk): + + self.prepare_script_thread = threading.Thread(target=self.prepare_script, args=(installer_path,disk)) + self.prepare_script_thread.start() + self.progress_bar.Pulse() + + while self.prepare_script_thread.is_alive(): + self.pulse_alternative(self.progress_bar) + wx.GetApp().Yield() + + self.progress_bar.SetValue(0) + if self.prepare_result is True: + self.progress_label.SetLabel("Bytes Written: 0") + self.progress_label.Centre(wx.HORIZONTAL) print("- Sucessfully generated creation script") print("- Starting creation script as admin") wx.GetApp().Yield() @@ -1918,8 +1930,15 @@ class wx_python_gui: self.build_install_menu() else: print("- Failed to create installer script") + self.progress_label.SetLabel("Failed to copy files to tmp directory") + self.progress_label.Centre(wx.HORIZONTAL) + popup_message = wx.MessageDialog(self.frame, "Failed to prepare the base files for installer creation.\n\nPlease ensure you have 20GB~ free on-disk before starting to ensure the installer has enough room to work.", "Error", wx.OK) + popup_message.ShowModal() self.return_to_main_menu.Enable() + def prepare_script(self, installer_path, disk): + self.prepare_result = installer.generate_installer_creation_script(self.constants.payload_path, installer_path, disk) + def start_script(self): utilities.disable_sleep_while_running() args = [self.constants.oclp_helper_path, "/bin/sh", self.constants.installer_sh_path] diff --git a/resources/installer.py b/resources/installer.py index e13b3c7e4..70d988586 100644 --- a/resources/installer.py +++ b/resources/installer.py @@ -332,7 +332,7 @@ def list_disk_to_format(): return list_disks -def generate_installer_creation_script(script_location, installer_path, disk): +def generate_installer_creation_script(tmp_location, installer_path, disk): # Creates installer.sh to be piped to OCLP-Helper and run as admin # Goals: # - Format provided disk as HFS+ GPT @@ -341,6 +341,24 @@ def generate_installer_creation_script(script_location, installer_path, disk): # OCLP-Helper once to avoid nagging the user about permissions additional_args = "" + script_location = Path(tmp_location) / Path("Installer.sh") + + # Due to a bug in createinstallmedia, running from '/Applications' may sometimes error: + # 'Failed to extract AssetData/boot/Firmware/Manifests/InstallerBoot/*' + # This affects native Macs as well even when manually invoking createinstallmedia + + # To resolve, we'll copy into our temp directory and run from there + + # Remove all installers from tmp + for file in Path(tmp_location).glob(pattern="*"): + if (Path(file) / Path("Contents/Resources/createinstallmedia")).exists(): + subprocess.run(["rm", "-rf", file]) + + # Copy installer to tmp + subprocess.run(["cp", "-R", installer_path, tmp_location]) + + # Adjust installer_path to point to the copied installer + installer_path = Path(tmp_location) / Path(Path(installer_path).name) createinstallmedia_path = str(Path(installer_path) / Path("Contents/Resources/createinstallmedia")) plist_path = str(Path(installer_path) / Path("Contents/Info.plist")) From fdb82b8e1335d6dbe49658d26aec0ae1605edcf9 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 2 Jul 2022 13:31:50 -0600 Subject: [PATCH 05/11] installer.py: Use Copy on Write for tmp Credit to @flagersgit for suggestion --- resources/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/installer.py b/resources/installer.py index 70d988586..6ef8a2c79 100644 --- a/resources/installer.py +++ b/resources/installer.py @@ -354,8 +354,8 @@ def generate_installer_creation_script(tmp_location, installer_path, disk): if (Path(file) / Path("Contents/Resources/createinstallmedia")).exists(): subprocess.run(["rm", "-rf", file]) - # Copy installer to tmp - subprocess.run(["cp", "-R", installer_path, tmp_location]) + # Copy installer to tmp (use CoW to avoid extra disk writes) + subprocess.run(["cp", "-cR", installer_path, tmp_location]) # Adjust installer_path to point to the copied installer installer_path = Path(tmp_location) / Path(Path(installer_path).name) From e1078faf8538a2c30f1090dc95be34dc985f48b1 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 2 Jul 2022 14:09:27 -0600 Subject: [PATCH 06/11] installer.py: Adjust for disk image CoW --- resources/installer.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/resources/installer.py b/resources/installer.py index 6ef8a2c79..cbc56a2a0 100644 --- a/resources/installer.py +++ b/resources/installer.py @@ -3,6 +3,7 @@ from pathlib import Path import plistlib import subprocess import requests +import tempfile from resources import utilities, tui_helpers def list_local_macOS_installers(): @@ -349,16 +350,16 @@ def generate_installer_creation_script(tmp_location, installer_path, disk): # To resolve, we'll copy into our temp directory and run from there - # Remove all installers from tmp - for file in Path(tmp_location).glob(pattern="*"): - if (Path(file) / Path("Contents/Resources/createinstallmedia")).exists(): - subprocess.run(["rm", "-rf", file]) + # Create a new tmp directory + # Our current one is a disk image, thus CoW will not work + ia_tmp = tempfile.mkdtemp() + print(f"Creating temporary directory at {ia_tmp}") # Copy installer to tmp (use CoW to avoid extra disk writes) - subprocess.run(["cp", "-cR", installer_path, tmp_location]) + subprocess.run(["cp", "-cR", installer_path, ia_tmp]) # Adjust installer_path to point to the copied installer - installer_path = Path(tmp_location) / Path(Path(installer_path).name) + installer_path = Path(ia_tmp) / Path(Path(installer_path).name) createinstallmedia_path = str(Path(installer_path) / Path("Contents/Resources/createinstallmedia")) plist_path = str(Path(installer_path) / Path("Contents/Info.plist")) From 524a7cb753cd65dfbbcb499093752581daa5fd89 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Jul 2022 11:44:20 -0600 Subject: [PATCH 07/11] installer.py: Ensure tmp dir is destroyed on exit --- gui/gui_main.py | 2 +- resources/installer.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gui/gui_main.py b/gui/gui_main.py index b73f9ac9a..d42ce245c 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -1872,7 +1872,6 @@ class wx_python_gui: self.pulse_alternative(self.progress_bar) wx.GetApp().Yield() - self.progress_bar.SetValue(0) if self.prepare_result is True: self.progress_label.SetLabel("Bytes Written: 0") self.progress_label.Centre(wx.HORIZONTAL) @@ -1887,6 +1886,7 @@ class wx_python_gui: self.download_thread = threading.Thread(target=self.download_and_unzip_pkg) self.download_thread.start() default_output = float(utilities.monitor_disk_output(disk)) + self.progress_bar.SetValue(0) while True: time.sleep(0.1) output = float(utilities.monitor_disk_output(disk)) diff --git a/resources/installer.py b/resources/installer.py index cbc56a2a0..0217087cc 100644 --- a/resources/installer.py +++ b/resources/installer.py @@ -332,6 +332,8 @@ def list_disk_to_format(): }) return list_disks +# Create global tmp directory +tmp_dir = tempfile.TemporaryDirectory() def generate_installer_creation_script(tmp_location, installer_path, disk): # Creates installer.sh to be piped to OCLP-Helper and run as admin @@ -352,8 +354,13 @@ def generate_installer_creation_script(tmp_location, installer_path, disk): # Create a new tmp directory # Our current one is a disk image, thus CoW will not work - ia_tmp = tempfile.mkdtemp() + global tmp_dir + ia_tmp = tmp_dir.name + print(f"Creating temporary directory at {ia_tmp}") + # Delete all files in tmp_dir + for file in Path(ia_tmp).glob("*"): + subprocess.run(["rm", "-rf", str(file)]) # Copy installer to tmp (use CoW to avoid extra disk writes) subprocess.run(["cp", "-cR", installer_path, ia_tmp]) From 7c8ea41c37010418b49b1f905c97f160b0005fc7 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Jul 2022 11:59:35 -0600 Subject: [PATCH 08/11] Sync Changelog --- CHANGELOG.md | 2 ++ resources/sys_patch_helpers.py | 29 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82085f665..46a56a55c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ - Add error-handling to corrupt/non-standard NVRAM variables - Add warning prompt when using 'Allow native models' - Attempt to avoid misuse of option +- Work-around `Failed to extract AssetData` during installer creation + - Apple bug, resolved by using CoW into a different directory than `/Applications` ## 0.4.7 - Fix crashing on defaults parsing diff --git a/resources/sys_patch_helpers.py b/resources/sys_patch_helpers.py index f46f5b3a8..4f8a16f02 100644 --- a/resources/sys_patch_helpers.py +++ b/resources/sys_patch_helpers.py @@ -28,20 +28,23 @@ class sys_patch_helpers: board_to_patch_hex = bytes.fromhex(board_to_patch.encode('utf-8').hex()) reported_board_hex = bytes.fromhex(self.constants.computer.reported_board_id.encode('utf-8').hex()) - if len(board_to_patch_hex) != len(reported_board_hex): - print(f"- Error: Board ID {self.constants.computer.reported_board_id} is not the same length as {board_to_patch}") - raise Exception("Host's Board ID is not the same length as the kext's Board ID, cannot patch!!!") + if len(board_to_patch_hex) > len(reported_board_hex): + # Pad the reported Board ID with zeros to match the length of the board to patch + reported_board_hex = reported_board_hex + bytes(len(board_to_patch_hex) - len(reported_board_hex)) + elif len(board_to_patch_hex) < len(reported_board_hex): + print(f"- Error: Board ID {self.constants.computer.reported_board_id} is longer than {board_to_patch}") + raise Exception("Host's Board ID is longer than the kext's Board ID, cannot patch!!!") + + path = source_files_path + "/10.13.6/System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS/AppleIntelSNBGraphicsFB" + if Path(path).exists(): + with open(path, 'rb') as f: + data = f.read() + data = data.replace(board_to_patch_hex, reported_board_hex) + with open(path, 'wb') as f: + f.write(data) else: - path = source_files_path + "/10.13.6/System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS/AppleIntelSNBGraphicsFB" - if Path(path).exists(): - with open(path, 'rb') as f: - data = f.read() - data = data.replace(board_to_patch_hex, reported_board_hex) - with open(path, 'wb') as f: - f.write(data) - else: - print(f"- Error: Could not find {path}") - raise Exception("Failed to find AppleIntelSNBGraphicsFB.kext, cannot patch!!!") + print(f"- Error: Could not find {path}") + raise Exception("Failed to find AppleIntelSNBGraphicsFB.kext, cannot patch!!!") def generate_patchset_plist(self, patchset, file_name): From b06822ec57aaa5e73a8a5759c2aa397c89d654c3 Mon Sep 17 00:00:00 2001 From: Dhinak G <17605561+dhinakg@users.noreply.github.com> Date: Sun, 3 Jul 2022 14:29:41 -0400 Subject: [PATCH 09/11] Fix build info for releases --- .github/workflows/build-app-wxpython.yml | 6 +++--- .github/workflows/build-app.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-app-wxpython.yml b/.github/workflows/build-app-wxpython.yml index ecd65e5ca..ecc21b880 100644 --- a/.github/workflows/build-app-wxpython.yml +++ b/.github/workflows/build-app-wxpython.yml @@ -11,9 +11,9 @@ jobs: name: Build wxPython runs-on: x86_64_mojave env: - branch: ${{ github.event.ref }} - commiturl: ${{ github.event.head_commit.url }} - commitdate: ${{ github.event.head_commit.timestamp }} + branch: ${{ github.ref }} + commiturl: ${{ github.event.head_commit.url }}${{ github.event.release.html_url }} + commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }} steps: - uses: actions/checkout@v3 - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 Build-Binary.command --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}" diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 69035987c..fbf9a176f 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -11,9 +11,9 @@ jobs: name: Build TUI runs-on: x86_64_mojave env: - branch: ${{ github.event.ref }} - commiturl: ${{ github.event.head_commit.url }} - commitdate: ${{ github.event.head_commit.timestamp }} + branch: ${{ github.ref }} + commiturl: ${{ github.event.head_commit.url }}${{ github.event.release.html_url }} + commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }} steps: - uses: actions/checkout@v3 - run: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 Build-Binary.command --build_tui --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}" From 885a1efbdc344b7d4a64847ff0db84fe9d63a77a Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 3 Jul 2022 12:57:34 -0600 Subject: [PATCH 10/11] gui_main.py: Add warning to serial spoofing --- gui/gui_main.py | 4 ++++ resources/build.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gui/gui_main.py b/gui/gui_main.py index d42ce245c..249a751ae 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -2779,6 +2779,10 @@ class wx_python_gui: self.constants.custom_board_serial_number = self.smbios_board_serial_textbox.GetValue() def generate_new_serials_clicked(self, event): + # Throw pop up warning about misusing this feature + dlg = wx.MessageDialog(self.frame_modal, "Please take caution when using serial spoofing. This should only be used on machines that were legally obtained and require reserialization.\n\nNote: new serials are only overlayed through OpenCore and are not permanently installed into ROM.\n\nMisuse of this setting can break power management and other aspects of the OS if the system does not need spoofing\n\nDortania does not condone the use of our software on stolen devices.", "Warning", wx.YES_NO | wx.ICON_WARNING) + if dlg.ShowModal() == wx.ID_NO: + return macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.constants.custom_model or self.computer.real_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) macserial_output = macserial_output.stdout.decode().strip().split(" | ") if len(macserial_output) == 2: diff --git a/resources/build.py b/resources/build.py index f0bc531ef..2cacdcbc2 100644 --- a/resources/build.py +++ b/resources/build.py @@ -1181,6 +1181,8 @@ class BuildOpenCore: self.config["UEFI"]["ProtocolOverrides"]["DataHub"] = True self.config["PlatformInfo"]["Generic"]["SystemSerialNumber"] = self.constants.custom_serial_number self.config["PlatformInfo"]["Generic"]["MLB"] = self.constants.custom_board_serial_number + self.config["PlatformInfo"]["Generic"]["MaxBIOSVersion"] = False + self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Spoofed-SN"] = self.constants.custom_serial_number self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Spoofed-MLB"] = self.constants.custom_board_serial_number From 28c4909b7edb46b82a546ff6c78c12098c8ecf29 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 4 Jul 2022 13:11:33 -0600 Subject: [PATCH 11/11] Docs: Add 5k iMac note --- docs/UNINSTALL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/UNINSTALL.md b/docs/UNINSTALL.md index f3729b220..268bee612 100644 --- a/docs/UNINSTALL.md +++ b/docs/UNINSTALL.md @@ -7,6 +7,7 @@ To remove OpenCore is actually quite simply: * You'll need to mount the drive's EFI partition, and delete the `EFI/OC` and `System` folders * Note **do not** delete the entire EFI folder, this will likely break any existing Windows and Linux installations * [See here for an example on how to mount](https://dortania.github.io/OpenCore-Post-Install/universal/oc2hdd.html) + * For 5k iMac users, you will also need to delete `boot.efi` on the root of the EFI partition 2. [Reset NVRAM](https://support.apple.com/HT204063)