From 5d142fd19ffc8ac9dfc66ac511351d7a652f06b3 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Thu, 7 Mar 2024 17:28:30 -0700 Subject: [PATCH] bluetooth.py: Publish Controller and Dongle NVRAM variables --- CHANGELOG.md | 2 ++ resources/build/bluetooth.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f5d7a1a..2d18f81b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Update updater implementation - Resolve Keyboard/Trackpad support for MacBookAir6,x running macOS 14.4 and newer - Expands SPI Keyboard and Trackpad patch to include MacBookAir6,x +- Publish Bluetooth NVRAM variables for BCM2046 and BCM2070 chipsets + - Reduces need for NVRAM reset to restore Bluetooth support in newer OSes (Thanks @ausdauersportler) ## 1.4.0 - Refactor subprocess invocations diff --git a/resources/build/bluetooth.py b/resources/build/bluetooth.py index 8dccc7ac0..af6d1271d 100644 --- a/resources/build/bluetooth.py +++ b/resources/build/bluetooth.py @@ -2,6 +2,7 @@ # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk import logging +import binascii from resources import constants, device_probe from resources.build import support @@ -45,6 +46,8 @@ def _on_model(self) -> None: support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr" + self.config["NVRAM"]["Add"]["4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14"]["bluetoothInternalControllerInfo"] = binascii.unhexlify("0000000000000000000000000000") + self.config["NVRAM"]["Add"]["4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14"]["bluetoothExternalDongleFailed"] = binascii.unhexlify("00") elif self.computer.bluetooth_chipset == "BRCM20702 Hub": # BCM94331 can include either BCM2070 or BRCM20702 v1 Bluetooth chipsets # Note Monterey only natively supports BRCM20702 v2 (found with BCM94360) @@ -75,4 +78,6 @@ def _prebuilt_assumption(self) -> None: support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070.value: self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr" + self.config["NVRAM"]["Add"]["4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14"]["bluetoothInternalControllerInfo"] = binascii.unhexlify("0000000000000000000000000000") + self.config["NVRAM"]["Add"]["4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14"]["bluetoothExternalDongleFailed"] = binascii.unhexlify("00") support.BuildSupport(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) \ No newline at end of file