diff --git a/resources/build/bluetooth.py b/resources/build/bluetooth.py index 9c1e48914..8dccc7ac0 100644 --- a/resources/build/bluetooth.py +++ b/resources/build/bluetooth.py @@ -1,5 +1,5 @@ # Class for handling Bluetooth Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import logging @@ -9,6 +9,11 @@ from data import smbios_data, bluetooth_data class BuildBluetooth: + """ + Build Library for Bluetooth Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/build.py b/resources/build/build.py index 596545b0e..b4381270e 100644 --- a/resources/build/build.py +++ b/resources/build/build.py @@ -1,5 +1,5 @@ # Class for generating OpenCore Configurations tailored for Macs -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import copy import pickle @@ -23,7 +23,11 @@ def rmtree_handler(func, path, exc_info) -> None: class BuildOpenCore: - + """ + Core Build Library for generating and validating OpenCore EFI Configurations + compatible with genuine Macs + """ + def __init__(self, model: str, global_constants: constants.Constants) -> None: self.model: str = model self.config: dict = None @@ -137,7 +141,7 @@ class BuildOpenCore: # Generate OpenCore Configuration self._build_efi() if self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True or (self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != ""): - smbios.BuildSMBIOS(self.model, self.constants, self.config)._set_smbios() + smbios.BuildSMBIOS(self.model, self.constants, self.config).set_smbios() support.BuildSupport(self.model, self.constants, self.config).cleanup() self._save_config() diff --git a/resources/build/firmware.py b/resources/build/firmware.py index 55ab81eb0..a60e27dec 100644 --- a/resources/build/firmware.py +++ b/resources/build/firmware.py @@ -1,5 +1,5 @@ # Class for handling CPU and Firmware Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import shutil import logging @@ -13,6 +13,11 @@ from data import smbios_data, cpu_data class BuildFirmware: + """ + Build Library for CPU and Firmware Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/graphics_audio.py b/resources/build/graphics_audio.py index a7c7e6b02..f8bde8601 100644 --- a/resources/build/graphics_audio.py +++ b/resources/build/graphics_audio.py @@ -1,5 +1,5 @@ # Class for handling Graphics and Audio Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import shutil import logging @@ -13,6 +13,11 @@ from data import smbios_data, model_array, os_data, cpu_data, video_bios_data class BuildGraphicsAudio: + """ + Build Library for Graphics and Audio Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/misc.py b/resources/build/misc.py index a4b5d9bab..56fd181e0 100644 --- a/resources/build/misc.py +++ b/resources/build/misc.py @@ -1,5 +1,5 @@ # Class for handling Misc Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import shutil import logging @@ -13,6 +13,11 @@ from data import model_array, smbios_data, cpu_data class BuildMiscellaneous: + """ + Build Library for Miscellaneous Hardware and Software Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/networking/wired.py b/resources/build/networking/wired.py index bf73229ec..314907492 100644 --- a/resources/build/networking/wired.py +++ b/resources/build/networking/wired.py @@ -1,5 +1,5 @@ # Class for handling Wired Networking Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk from resources import constants, device_probe from resources.build import support @@ -7,6 +7,11 @@ from data import smbios_data, cpu_data class BuildWiredNetworking: + """ + Build Library for Wired Networking Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/networking/wireless.py b/resources/build/networking/wireless.py index cc2ba8c5a..4ee971fae 100644 --- a/resources/build/networking/wireless.py +++ b/resources/build/networking/wireless.py @@ -1,5 +1,5 @@ # Class for handling Wireless Networking Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import logging @@ -9,6 +9,11 @@ from data import smbios_data class BuildWirelessNetworking: + """ + Build Library for Wireless Networking Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/security.py b/resources/build/security.py index 98e3ac746..f0818c62b 100644 --- a/resources/build/security.py +++ b/resources/build/security.py @@ -1,5 +1,5 @@ # Class for handling macOS Security Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import logging import binascii @@ -9,6 +9,11 @@ from resources.build import support class BuildSecurity: + """ + Build Library for Security Patch Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/smbios.py b/resources/build/smbios.py index 203dbd29b..6e0568680 100644 --- a/resources/build/smbios.py +++ b/resources/build/smbios.py @@ -1,5 +1,5 @@ # Class for handling SMBIOS Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import ast import uuid @@ -16,6 +16,11 @@ from data import smbios_data, cpu_data, model_array class BuildSMBIOS: + """ + Build Library for SMBIOS Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model @@ -56,7 +61,11 @@ class BuildSMBIOS: self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -no_compat_check" - def _set_smbios(self) -> None: + def set_smbios(self) -> None: + """ + SMBIOS Handler + """ + spoofed_model = self.model if self.constants.override_smbios == "Default": @@ -193,6 +202,16 @@ class BuildSMBIOS: def _minimal_serial_patch(self) -> None: + """ + Minimal SMBIOS Spoofing Handler + + This function will only spoof the following: + - Board ID + - Firmware Features + - BIOS Version + - Serial Numbers (if override requested) + """ + # Generate Firmware Features fw_feature = generate_smbios.generate_fw_features(self.model, self.constants.custom_model) # fw_feature = self.patch_firmware_feature() @@ -248,6 +267,12 @@ class BuildSMBIOS: def _moderate_serial_patch(self) -> None: + """ + Moderate SMBIOS Spoofing Handler + + Implements a full SMBIOS replacement, however retains original serial numbers (unless override requested) + """ + if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1: self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537 if self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != "": @@ -266,6 +291,12 @@ class BuildSMBIOS: def _advanced_serial_patch(self) -> None: + """ + Advanced SMBIOS Spoofing Handler + + Implements a full SMBIOS replacement, including serial numbers + """ + if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1: self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537 if self.constants.custom_serial_number == "" or self.constants.custom_board_serial_number == "": diff --git a/resources/build/storage.py b/resources/build/storage.py index 093f1f1d2..a8eb951a2 100644 --- a/resources/build/storage.py +++ b/resources/build/storage.py @@ -1,5 +1,5 @@ # Class for handling Storage Controller Patches, invocation from build.py -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import logging @@ -9,6 +9,11 @@ from data import model_array, smbios_data, cpu_data class BuildStorage: + """ + Build Library for System Storage Support + + Invoke from build.py + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model diff --git a/resources/build/support.py b/resources/build/support.py index b70a63e95..a79b14140 100644 --- a/resources/build/support.py +++ b/resources/build/support.py @@ -1,5 +1,5 @@ # Utility class for build functions -# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk +# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import shutil import typing @@ -14,6 +14,9 @@ from resources import constants, utilities class BuildSupport: + """ + Support Library for build.py and related libraries + """ def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None: self.model: str = model