Java and Kotlin Android library. Uniquely identify an Android device without any permissions and API restrictions. The recommended approach using DRM API.
Gradle:
Add it in your root build.gradle at the end of repositories:
Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.devEyosiyas:AndroidID:1.0.2'
}
Or Maven:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>groupId>com.github.devEyosiyas</groupId>
<artifactId>AndroidID</artifactId>
<version>1.0.2</version>
</dependency>
Java
String widevine = JavaAndroidID.widevine; // The most reliable way
String commonPSSH = JavaAndroidID.commonPSSH;
String clearKey = JavaAndroidID.clearKey;
String playReady = JavaAndroidID.playReady;
Kotlin
val id = KotlinAndroidID()
val widevine: String = id.widevine() // The most reliable way
val commonPSSH: String = id.commonPSSH()
val clearKey: String = id.clearKey()
val playReady: String = id.playReady()
Eyosiyas Bereketab - @devEyosiyas on GitHub, and @devEyosi on Twitter