I am having Android 10 mobile in that "Use randomised MAC(default)" option is enabled by default. When ever i am getting my MAC address programmatically it is differing based on network. I want to programmatically set "Use device MAC" as default option.Instead of "Use randomised MAC(default)". To get only one MAC address every time.
Asked
Active
Viewed 1,484 times
1 Answers
0
It is not clear if you're talking about Bluetooth networks or WiFi networks, for the first case unless you've rooted your phone I'm afraid is not possible to get the actual Bluetooth address device. On the other hand for wifi you can refer to the privacy changes in Android 10:
Obtain randomized MAC address: Device owner apps and profile owner apps can retrieve the randomized MAC address assigned to a specific network by calling
getRandomizedMacAddress()
.Obtain actual, factory MAC address: Device owner apps can retrieve a device's actual hardware MAC address by calling
getWifiMacAddress()
. This method is useful for tracking fleets of devices.

Thecave3
- 762
- 12
- 27
-
Does this mean third party apps are restricted from getting the randomized mac address as well? – Brian Reinhold Jan 20 '21 at 22:07
-
@BrianReinhold I am not sure about that but I think that 3rd party applications should not have access to mac address at all. I don't know if some workarounds like [this one](https://stackoverflow.com/a/35830358/4575505) still work. – Thecave3 Jan 21 '21 at 12:31
-
well many times a third party app needs to have an identifier of a particular device and it is not for nefarious reasons. At worst, the app should just need to ask the user. That's a pain for the user but at least it can be used. – Brian Reinhold Jan 22 '21 at 13:23
-
I totally agree with you. In any case the randomized address should be the same for each app session. I would advise to associate a custom id to each mac address or directly use IP. If you're using Bluetooth it's quite a pain but there're a lot of libraries that overcome this issue internally – Thecave3 Jan 23 '21 at 14:10