Android Integration
Installation, initialization, token retrieval, and error codes for the Android SDK
Android
Resource and Overview
The Geelab Android SDK is provided to developers who are integrating it into Android native client development
| Item | Description |
|---|---|
| Product Name | Geelab Device Fingerprinting |
| Latest Version (JS) | v2.7.4 |
| Latest Release Date | 2026/4/22 |
| Main Function | Device fingerprinting collects over 300 weak feature factor data pointsand uses relationship graphs and a three-dimensional verification model to identify virtual, automated, and customized devices, providing real-time risk labels and status. |
Environment and Requirements
| Item | Resources |
|---|---|
| Development object | Android 5.0+ (minSdk 21) |
| Developing environment | Android Studio 2022.2.1+ (AGP 8+) |
| Compilation Tools | Gradle (For ant compilation, please decompress and extract jar and resource files from the package) |
| System Denpendenies | None |
| SDK Third-Party Dependencies | None |
Installation
Get the SDK
Please contact your account manager to get the SDK
Import SDK
Take the .aar file from the zip package (including geelabguard_android_vx.y.z_date.aar) and drag it into the libs folder in your project. After dragging the .aar file into the libs folder, make sure to check if the .aar file has been added to the Library. You also need to add the following code to your project's build.gradle file:
repositories {
flatDir {
dirs 'libs'
}
}And you need to manually add the aar package as a dependency:
implementation(name: 'geelabguard_android_vx.y.z_date', ext: 'aar')Add permission statement
<!--Required - Default value is apply-->
<uses-permission android:name="android.permission.INTERNET" />Configuration of Obfuscation Rules
The Geelab SDK has already undergone obfuscation. When integrating, please include the obfuscation rules and do not obfuscate the SDK again.
-dontwarn tech.geelab.core.**
-keep class tech.geelab.core.**{*;}The call logic
- Register and obtain an AppID on the dashboard
- Obtain GeeGuardReceipt through AppID
For code integration, please refer to the sample code below
Sample code
Access applicable to version 2.3.0 and above
Create the appID on the Geelab dashboard immediately after the application starts and configure server region
submitServerUrlmust be corresponding to your region settings when creating ID in the admin panel.
| Region | submitServerUrl |
|---|---|
| 🌏 Global | https://riskct-global.geelabapi.com/api/v1/client_report |
| 🇪🇺 Europe | https://riskct-eu.geelabapi.com/api/v1/client_report |
| 🇺🇸 North America | https://riskct-na.geelabapi.com/api/v1/client_report |
// Your AppID
const val appId = "123456789012345678901234567890ab"
// Specify the service URL if needed
// Global server, preconfigured in SDK
const val submitServerUrl = "https://riskct-global.geelabapi.com/api/v1/client_report"
// Europe
// const val submitServerUrl = "https://riskct-eu.geelabapi.com/api/v1/client_report"
// North America
// const val submitServerUrl = "https://riskct-na.geelabapi.com/api/v1/client_report"
class APP : Application() {
override fun onCreate() {
super.onCreate()
// Register your AppID, using global server
GeelabGuard.register(this, appId)
// Using servers in other regions
// GeelabGuard.register(this, appId, submitServerUrl)
}
}Get GeeToken
Sign the data by using the GeelabGuard SDK and obtain the environmental detection GeeToken.
// Get the respondedGeeToken, which needs to be parsed on the server-side.
// This function callback is asynchronous.
fun getRespondedGeeToken(context: Context) {
val data = "A unique transaction ID or credential to bind the GeeToken to the business context."
GeelabGuard.submitReceipt(context, data) { status ->
if (status == 200) {
//Submit along with business data, please obtain the final environmental identification result and fingerprint on the server side.
// Please refer to the server-side documentation for the API parameters.
text.postValue("RespondedGeeToken: ${receipt.respondedGeeToken}")
} else {
text.postValue("Status: $status")
}
}
}Error Code
The possible error codes that may be returned in the asynchronous retrieval method GeelabGuard.submitReceipt(Context, String, GeelabGuard.CallbackHandler) include:
| Error code | Description |
|---|---|
| -200 | Unregistered AppID, please register an AppID after starting+ |
| -300 | Network error, please refer to the information in the userInfo of the error object for details1 |
| -500 | Service response format is abnormal, please check receipt.originalResponse for details |
| -501 | Service response failure, please check receipt.originalResponse for details. |
Querying GeeToken Result
Submit respondedGeeToken or GeeToken along with business data to the business server, which will then query the result from the Geelab Device Fingerprinting Service. For more details, refer to the server-side documentation.