Skip to content

Commit

Permalink
bluetooth.py: Publish Controller and Dongle NVRAM variables
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Mar 8, 2024
1 parent f55598d commit 5d142fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions resources/build/bluetooth.py
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 5d142fd

Please sign in to comment.