Add the Maven repository configuration to the build.gradle file in the project root directory.
allprojects {
repositories {
...
mavenCentral()
}
}If your Gradle version is 7 or higher, please add the following configuration to your project's settings.gradle file.
repositories {
...
mavenCentral()
}In the build.gradle file of the application's main module, declare the SDK package dependencies.
dependencies {
implementation 'com.trustdecision.android:mobrisk:5.2.3.1' // TDRisk
implementation 'com.trustdecision.android:apisign:1.1.3' // Bot Core Module
}The SDK currently supports multiple ABI types. It is recommended that the user add the abiFilters configuration to the build.gradle file of the main module to select the required architecture type. For specific architectures, please refer to the architectures you need to support!
defaultConfig {
...
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}public static TDAPISignResult sign(Context context, String path);The API to be protected is in the form of: https://sg.apitd.net/de/v1?name=jacky&age=12
TDAPISignResult signResult = TDRisk.sign(context, "de/v1");
if(signResult.code() == 0) {
// Get signature
String signature = signResult.signature();
} else {
// Get error messages and status codes
String message = signResult.message();
int code =
If the status code obtained from the structure returned by the signature is 0, then the signature was successful.
TDAPISignResult.code == 0If developers need to use proguard for obfuscation packaging, please add the following code to the proguard configuration file:
-keep class com.trustdecision.**{*;}