I'm doing some simple scanning + advertising testing on bluetooth LE feature for Android using this sample-code
I'm testing it using a Samsung 6 and a Nexus 9, and for some reason if I leave the app running on the Samsung and restart the app on the Nexus, the next time the Samsung devices finds the other device, it has a different address.
In code:
On the device:
The funny thing it doesn't happen the other way around. (Samsung always has the same address when discovered from the Nexus 9)
This address never changes and is guaranteed to be unique for a Bluetooth device. However, there is a fee associated with obtaining/reserving a block with the IEEE. The following diagram represents the simplified format of a Public Bluetooth Address.
Can someone connect to my Bluetooth without me knowing? Theoretically, anyone can connect to your Bluetooth and gain unauthorized access to your device if the visibility of your Bluetooth device is on.
How Do I Make My Android Phone Automatically Connect To Bluetooth? enable Bluetooth automatically by selecting Settings > Connected devices > Connection preferences > Driving mode > Turn on automatically > Advanced. For your convenience, you can find out whether this switch is enabled.
How Do I Change My Bluetooth Device Id? The Bluetooth settings will tell you what device name you are using.In some cases, changing the name will be done simply by tapping it. Other times, however, you'll need to open the three-dot menu in order to do so.To rename a device, enter its name, then tap “Rename.”.
As CommonsWare mentioned, as of Android 6.0, Android has removed access to the hardware address programmatically, and made it so that the address appears to be randomly generated to scanning devices. The change log can be found here:
http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id
The fact that scanning devices see a random Bluetooth address rather than the actual one is a highly useful privacy feature. It was adopted by the Bluetooth specification as of BTv4.0 and is known as LE privacy:
"This feature causes the MAC address within the advertising packets to be replaced with a random value that changes at timing intervals determined by the manufacturer. Any malicious device(s), placed at intervals along your travel route, would not be able to determine that the series of different, randomly generated MAC addresses received from your device actually relates to the same physical device. It actually looks like a series of different devices, thus, it will not be possible to track you using the advertised MAC address"[1]
You can find a similar question here:-
Since marshmallow update Bluetooth discovery using BluetoothAdapter.getDefaultAdapter().startDiscovery(); is broken
[1] http://blog.bluetooth.com/bluetooth-technology-protecting-your-privacy/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With