Android bluetooth MAC obtained is 02:00:00:00:00:00

Viewed 10036

Trying to get the Bluetooth of an android phone with

BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
String bleMAC = bluetoothAdapter.getAddress();

the result of the function is 02:00:00:00:00:00, i am expecting some thing the lines of 00:04:61:02:AA:FF

Also noticed that wifi mac address are same as Bluetooth mac address. Can the wifi MAC address be used?

2 Answers

As Per Android 6.0 Changes:

https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id

To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs. The WifiInfo.getMacAddress() and the BluetoothAdapter.getAddress() methods now return a constant value of 02:00:00:00:00:00.

To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions.

According to Android document WifiInfo API, an Android app has to be a system app and get below 2 permissions:

  • android.Manifest.permission.LOCAL_MAC_ADDRESS
  • Manifest.permission.ACCESS_FINE_LOCATION

I tried on a rooted device of Android 10, it worked well.

Related