OCSInventory-NG / AndroidAgent

OCS Inventory NG Android Agent
http://www.ocsinventory-ng.org/en/
GNU General Public License v2.0
28 stars 23 forks source link

Doesn't detect MAC correctly #32

Closed Voyager69 closed 3 years ago

Voyager69 commented 3 years ago

It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.

General informations

Android version :
9

OCS Inventory informations

Android agent version : v.2.3.1

Problem's description

It does not correctly bring the MAC number, an essential item as an index to identify duplication of equipment. in my particular case it detects all the computers as 02: 00: 00: 00: 00: 00

gillesdubois commented 3 years ago

Hi,

Unfortunately, this behavior is not from our side but its due to Android API restrictions.

Quote from API Changelog :

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.

We are working on a solution but we didn't found anything interesting so far. Any help is appreciated if you have a idea.

Regards, Gilles.