Last Modified October 2, 2026

Setting the machineID

  1. Overview
  2. Settings for Android Apps
  3. Settings for MAC Apps with multiple Users

 

Version 6 and later allow the App to modify the machineID hash for the device, providing additional licensing options, using the DNA_SetProperties() API call.

By default, the DNA Library will create a unique machineID hash for the device and capture the Computer Name of the device. This is the recommended approach for most licensing strategies.

The following are licensing scenarios where you would modify the default machineID:

  • Android OS, where the deviceID and ComputerName must be provided by the App
  • MAC OS, where you want to offer One License - many MAC Users
  • special situations such as Docker Containers - after consultation with Technical Support

See below for specific setting recommendations for tested scenarios and DNA_SetProperties API  

By modifying the machineID, the App is responsible to ensure that it is unique to the device to achieve successful licensing and protection.

 

Settings for Android devices

For Android devices, the App must set the deviceID and ComputerName properties. We recommend the following:

Property Name Recommended Value
deviceID

The recommendation from Android is to use the android_ID which is a unique identifier for the App and User. As indicated by Android:

The ANDROID_ID value won't change on package uninstall/reinstall, as long as the package name and signing key are the same. Apps can rely on this value to maintain state across reinstalls.

Use the following code in your Android App to capture the android_ID:

Settings.Secure.getString(this.getContentResolver(),Settings.Secure.ADNROID_ID)

ComputerName android.os.Build.MODEL + android.os.Build.VERSION.RELEASE

 

Settings for MAC Apps with multiple Users

To allow different Users on the same MAC computer to share the same License Code:

  • use a Multi-Computer or Multi-User License
  • set up the DNA Properties as follows:
    • DNA_SetProperties("CDMPathName","/Users/"+NSUserName()+"/Library/Application Support/<app_name>/<app_name>.CDM")
    • DNA_SetProperties("userID",NSUserName())
    The NSUserName() function will ensure each CDM License file is unique and specific to the MAC User

The userID is added to the default deviceID to determine the machineID hash which will uniquely identify this MAC User.

The Users sharing the same License may be on different computers.

Other CDM locations that can be used:

/ Users / <userName> / <app_name> / <app_name>.CDM