There are now 4 ways of getting HWID:

  1. ApplicationID

  2. Serial number 

  3. IMEI

  4. MAC address 


 Every Android should provide applicationID or MAC address identifiers. Neither Android serial number nor IMEI is accessible since Android 8.X OS. So basically, two licensing mechanisms are currently fully supported on Android generally:

  • ApplicationID-based licenses:
    • Bound to Android applicationID parameter of APK. (each different APK needs unique license)
    • Unlimited to number of devices (one license file for N devices)
  • MAC-basedlicenses:
    • Bounded to specific MAC address of device's network interface. (each device needs unique license )
    • Unlimited to number of APKs (one license file of device can be used for N different applications)
    • Note: From Android 11 the MAC-based licensing works only for target SDK versions less than 30

The licensing mechanisms are not equal in a business plane- the conditions are a subject of a business agreement.


1. ApplicationID based HWID - returned by IEngine_GetHardwareId function in all Innovatrics' latest SDKs or by License manager desktop utility using command license_manager -c --appid "<your_aplicationID>".


2. Serial number based HWID - returned by IEngine_GetHardwareId function in old versions of Innovatrics' SDKs (e.g. IDKit SDK v5.3.1, IFace SDK v3.2.2, ANSI&ISO SDK v2.1.0, Segmentation SDK v1.8.0 or older).


3. IMEI based HWID - returned by IEngine_GetHardwareId function if no serial number is found. You can also find the IMEI of your device in Settings->About phone->Status or by entering a special code *#06# using the device's keypad according to http://www.phonearena.com/news/How-to-find-a-phones-IMEI-number_id62867Please note that you have to add letter 'M' before the IMEI number and then add it to CRM license generator. For example if the IMEI=123456789012345 then the Hardware ID=M123456789012345. You also have to add following permission to application's manifest file in order to use IMEI as Hardware ID:

<uses-permission android:name="android.permission.READ_PHONE_STATE" />


4. MAC address based HWID - MAC address based HWID is not returned by function 
IEngine_GetHardwareId. Look for Device status in Android phone settings to read the WiFi MAC address. Eventually, see this issue Get mac address on android device to find out how to get the MAC address.

NOTE:
IEngine_GetHardwareId function in C++ (method getHardwareId() in Java) is used to get the Hardware ID in IDKit SDK only. For other SDKs there are following functions to get he Hardware ID:
  • ANSI&ISO SDK - IEngine_GetHwid in C++, method getHardwareId() in Java
  • Segmentation SDK - ISegLib_GetHwid in C++,  method getHardwareId() in Java
  • IFace SDK - IFACE_Get_HardwareId


In case you have decided to use MAC-based license, you also need to make sure the following permissions are in your project's manifest: 
     <uses-permission android:name="android.permission.INTERNET" />

     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />


Since Android 10 you need to disable MAC address randomization to get a static hardware id.

It is only possible to disable MAC address randomization per Wi-Fi connection, so if you connect to another Wi-Fi network, the randomization will be turned on.