[RELEASED] Find MAC address on Android

This asset only for Android.
Find Wi-Fi MAC address. Worked on Android 4, 5, 6, 7, 8. Worked on Oculus GO with Android 7.1
If it does not work, write me, fix it. Asset has an example scene.
DEMO Apk for check on device: http://info.littlestories.ru/FindMAC.apk

[AssetStore]

Test guide

  1. Create a new empty project.
  2. Import the package (Assets/Import Package/Custom Package).
  3. Open and add in Build Settings demo scene Assets/MobileLocalNotifications/Scenes/Demo.unity.
    4 Build project to android device.
  4. Start project.

Using the plugin

FindMACClass.GetMACAddress() return string with MAC address.


Not working with Quest?
Tried to run the demo apk with a quest and it did not even show up under “Unknown Source” apps.

Sorry, but I don’t have access to this device :frowning:
How could you work together to check?

I just purchased this plugin. Tried to write an email but did not find it on the asset store or on the ReadMe within the package.

After installing the plugin, the application has the GPS permission. Is this permission necessary? Can you please remove it from the plugin manifest?

Thank you
Andres

Hi!
Sorry, but since Android 6:

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.

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

Imported to version 2020.3.21, but the manifest file does not exist

I compiled demo on Unity 2020.3.23. Can you show what kind of error you are getting?

I added ACCESS_FINE_LOCATION to my manifest file and called the FindMAC.Scripts.FindMACClass.GetMACAddress() method after building, but nothing is returned. No rogcat errors were found

Build Target is 30

Thanks for the information. It turns out that in Android 11 (target 30) this feature was disabled :frowning: If you set target 29, then it works.
https://developer.android.com/training/articles/user-data-ids#mac-addresses

From November 2021, app updates must target API level 30 or higher, so building 29 will be difficult… Thank you for your support.