0xmachos / Lockdown

Forked from https://bitbucket.org/objective-see/lockdown
1 stars 0 forks source link

Disable Bluetooth: fix_command broken #1

Closed 0xmachos closed 6 years ago

0xmachos commented 6 years ago

Pretty sure it's no longer possible control Bluetooth state via the command line as of High Sierra.

The blueutil tool works on High Sierra but it uses the private API IOBluetoothPreference*().

Unloading then reloading the appropriate kext won't work either as I'm pretty sure that system kexts are protected by SIP.

0xmachos commented 6 years ago

The initial part of the command, sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0, seems to work.

However as far as I can tell there's no way to get the bluetooth service to read the new value. Aka no way to restart the service.

The second part of the command sudo killall -HUP blued returns No matching processes were found.

0xmachos commented 6 years ago

The service has been renamed, no idea in what version of macOS, to bluetoothd.

sudo killall -HUP bluetoothd successfully restarts the bluetooth daemon.

The correct fix_command is sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0 && sudo killall -HUP bluetoothd