Android
Integrate the Geelab Device Fingerprint v2 SDK into a native Android application
Resources and Overview
The Geelab Android SDK is intended for developers integrating native Android applications.
| Item | Description |
|---|---|
| Product | Geelab Device Fingerprint |
| Latest version | v2.7.4 |
| Latest release date | April 22, 2026 |
| Main capabilities | Collects more than 300 weak device attributes and uses relationship graphs and a three-dimensional validation model to identify virtualized, automated, and customized devices, returning real-time risk signals and status information. |
Environment and Requirements
| Item | Requirement |
|---|---|
| Target platform | Android 5.0+ (minSdk 21) |
| Development environment | Android Studio 2022.2.1+ (AGP 8+) |
| Build tool | Gradle. For Ant builds, extract the JAR and resource files from the package. |
| System dependencies | None |
| Third-party SDK dependencies | None |
Installation
Obtain the SDK
Contact your account manager to obtain the SDK.
Import the SDK
Extract the .aar file (for example, geelabguard_android_vx.y.z_date.aar) from the ZIP package and place it in the project's libs directory. Confirm that it has been added as a library, then add this repository configuration to build.gradle:
repositories {
flatDir {
dirs 'libs'
}
}Add the AAR as a dependency:
implementation(name: 'geelabguard_android_vx.y.z_date', ext: 'aar')Declare Permissions
<!-- Required; the default value is apply. -->
<uses-permission android:name="android.permission.INTERNET" />Configure Obfuscation Rules
The Geelab SDK is already obfuscated. Add these rules and do not obfuscate it again:
-dontwarn tech.geelab.core.**
-keep class tech.geelab.core.**{*;}Integration Flow
- Register an application in the console and obtain its App ID.
- Use the App ID to obtain a
GeelabGuardReceipt. - Submit the returned GeeToken with the business request and query the final device intelligence result from your server.
Code Examples
The following integration applies to SDK version 2.3.0 and later.
Register the App ID at Application Startup and Configure the Region
The submitServerUrl must match the Region configured for the application in the console.
| Region | submitServerUrl |
|---|---|
| Global | https://riskct-global.geelabapi.com/api/v2/client_report |
| Europe | https://riskct-eu.geelabapi.com/api/v2/client_report |
| North America | https://riskct-na.geelabapi.com/api/v2/client_report |
// Public API Key obtained from the console
const val appId = "123456789012345678901234567890ab"
// The Global endpoint is preconfigured by the SDK.
const val submitServerUrl = "https://riskct-global.geelabapi.com/api/v2/client_report"
// Europe:
// const val submitServerUrl = "https://riskct-eu.geelabapi.com/api/v2/client_report"
// North America:
// const val submitServerUrl = "https://riskct-na.geelabapi.com/api/v2/client_report"
class APP: Application() {
override fun onCreate() {
super.onCreate()
// Register the App ID with the default Global service.
GeelabGuard.register(this, appId)
// For another Region:
// GeelabGuard.register(this, appId, submitServerUrl)
}
}Obtain a GeeToken
Use the GeelabGuard SDK to sign the supplied context and obtain an environment-detection GeeToken.
// Obtain a local GeeToken and query it from your server.
fun getGeeToken(context: Context) {
thread {
val data = "Unique transaction ID or credential that binds the GeeToken to the business context."
val receipt = Geelab.fetchReceipt(context, data)
if (receipt!= null) {
// Submit it with the business data and query the final device intelligence result from your server.
Log.i("GeeToken: ${receipt.geeToken}")
} else {
Log.w("Unable to obtain GeelabGuardReceipt. Verify that GeelabGuard.register(appId) was called.")
}
}
}
// Obtain respondedGeeToken asynchronously.
fun getRespondedGeeToken(context: Context) {
val data = "Unique transaction ID or credential that binds the GeeToken to the business context."
GeelabGuard.submitReceipt(context, data) { status, receipt ->
when (status) {
// The SDK submitted successfully. Query with respondedGeeToken.
200 -> text.postValue("RespondedGeeToken: ${receipt.respondedGeeToken}")
// Triggered only when appId or Context is empty.
-200 -> text.value = "Invalid appId or Context is null"
// Network or service response failure. Inspect receipt.originalResponse.
// You can fall back to receipt.geeToken for the query.
-300, -500, -501 -> {
text.value = "${receipt.originalResponse}"
Log.e("GeeLabGuard SubmitReceipt", receipt.geeToken)
}
else -> throw IllegalStateException("Unexpected error code")
}
}
}Error Codes
The asynchronous GeelabGuard.submitReceipt(Context, String, GeelabGuard.CallbackHandler) method can return:
| Error code | Description |
|---|---|
-200 | The App ID has not been registered. Register it after application startup. |
-300 | Network error. See the error object's userInfo for details. |
-500 | Invalid service response format. Inspect receipt.originalResponse. |
-501 | Service response failure. Inspect receipt.originalResponse. |
Query the GeeToken Result
Submit respondedGeeToken or geeToken with the business request to your server, then query the Geelab Device Fingerprint service. See Server API.