OAID plugin integration

The Open Anonymous Device Identifier (OAID) is a unique identifier for Android devices. The Mobile Security Alliance (MSA) recommends all Chinese-manufactured devices provide an OAID. You can use the OAID to attribute and track devices where Google Play Services is not available.

The OAID plugin provides the OAID of a device. The SDK will continue to use other identifiers as well as the OAID. The OAID is readable on all devices using the MSA SDK or Huawei Mobile Service (HMS) Core SDK on Huawei devices.

Before you use this plugin, make sure to follow the get started guide for your platform:

Add the OAID plugin to your app

Maven

Android

Install standalone binary

Multiple platforms

Use the plugin as a Prefab

Unity

Add the MSA SDK to your app

Note:
You don't need to add the MSA SDK to read the OAID value on Huawei devices. The OAID plugin can use the HMS Core SDK for this.

Requirements

MSA SDK versionAdjust OAID plugin version
v1.0.10 and laterv4.19.0 and later
v1.0.12 and laterv4.22.0 and later
v1.0.13 and laterv4.23.0 and later
v1.0.23 and laterv4.24.1 and later
v1.0.25 and laterv4.27.0 and later
v1.0.26 and laterv4.28.4 and later
v1.1.0 and laterv4.28.9 and later
v2.0.0 and laterv4.33.0 and later

To enable the OAID plugin to read OAID values from the MSA SDK, you need to add it to your project. To do this:

  1. Copy the MSA SDK (AAR file) to the libs directory of your project and set the dependency.
  2. Copy the supplierconfig.json file to the assets directory of your project.

You can find the MSA SDK and detailed instructions at the MSA website.

Add the HMS Core SDK to your app

You can use the HMS Core SDK to access the OAID of Huawei devices. To enable the Adjust OAID plugin to read values from the HMS Core SDK, update your build.gradle as follows:

  1. Add the Huawei maven repository.

    repositories {
      maven {
          url "https://developer.huawei.com/repo/"
      }
    }
  2. Add the HMS Core SDK.

    dependencies {
       implementation 'com.huawei.hms:ads-identifier:3.4.62.300'
    }

Proguard settings

If your app is not targeting the Google Play Store, you do not need to add all the rules set out in the get started guide. You can remove rules related to Google Play Services and install referrer libraries. You only need to keep the rules that apply to the Adjust SDK.

-keep public class com.adjust.sdk.** { *; }

If you are adding the MSA SDK AAR as a dependency, add the following rules:

-keep class com.bun.miitmdid.core.** { *; }

Use the plugin

Once you have set up the plugin, you can gather the device's OAID. To do this, call the AdjustOaid.readOaid(applicationContext) method before starting the Adjust SDK.

JavaAndroid
C#Unity
AdjustOaid.readOaid(applicationContext);

// ...

Adjust.onCreate(config);

If you want to prevent the SDK from reading the OAID, call the AdjustOaid.doNotReadOaid() method.

JavaAndroid
C#Unity
AdjustOaid.doNotReadOaid();