Getting started

This section introduces the first steps to run our Android SDKs. If you have questions or suggestions, tell us!

You can find code examples on our Github.

Terms & Policies

When using our SDKs, please make sure that you agree with our Privacy Policy and our Terms and Conditions of Use.

Current versions

Stable

SDKDependency

com.combateafraude.sdk:document-detector:7.2.4

com.combateafraude.sdk:passive-face-liveness:5.25.12

com.combateafraude.sdk:face-authenticator:5.9.0

com.combateafraude.sdk:address-check:4.0.0

com.combateafraude.sdk:new-face-liveness:1.6.2

com.combateafraude.sdk:new-face-authenticator:1.7.2

Release Candidates

SDKDependency

com.combateafraude.sdk:passive-face-liveness:6.0.0-rc07

com.combateafraude.sdk:face-authenticator:5.8.5-rc01

com.combateafraude.sdk:document-detector:7.0.0-rc01

Compatibility

SettingsMinimum versionReason

minSdkVersion

21

- According to google, it covers 94% of the world's Android devices

- Also, it is the minimum version required by CameraX

- Document detection algorithm has API 21 as minimum version

compileSdkVersion

33

API 33 is the minimum version required by CameraX

Java version

8

Lambda functions

Project settings

Add these settings to your app-level build.gradle:

android {
    ...
    // Enable Data Binding, depending on the version of com.android.tools.build:gradle
    // If com.android.tools.build:gradle >= 4
    buildFeatures {
        dataBinding = true
    }
    // If com.android.tools.build:gradle < 4
    dataBinding.enabled = true

    // Java 1.8 compatibility, allowing lambda functions
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    // Required only for DocumentDetector
    aaptOptions {
        noCompress "tflite"
    }
}

As our SDKs activities use Data Binding, it is required that you enable this setting within your app. The compileOptions setting is required for SDK's built-in lambda functions, which were released in Java 8. The noCompress setting tells the compiler not to compress files with the .tflite extension used in the DocumentDetector.

Importing the SDKs

Remotely

To import our SDKs, add our maven repository to your project-level build.gradle:

buildscript {
    ...
}
allprojects {
    repositories {
        ...
        maven { url 'https://repo.combateafraude.com/android/release' }
    }
}

If you are using the Gradle 7+ version, add our maven repository inside the dependencyResolutionManagement method in the settings.gradle file, instead of the build.gradle:

dependencyResolutionManagement {
    repositories {
        ...
        maven { url 'https://repo.combateafraude.com/android/release' }
    }r
}

After that, add the SDK dependency you want to use in your app to the app-level build.gradle:

dependencies {
    ...
    implementation 'com.combateafraude.sdk:{sdkName}:{sdkVersion}'
}

Locally

1. Download the .aar and .pom corresponding files from our repository to directly add the transitive SDK dependencies to your project.

This is necessary as the .aar file does not carry transitive dependencies. To download, access the following URL, replacing {sdkName} and {sdkVersion} corresponding to the SDK you want to use: https://repo.combateafraude.com/android/release/com/combateafraude/sdk/{sdkName}/{sdkVersion}/{sdkName}-{sdkVersion}.aar

2. Add the .aar file to the path <project_folder>/app/libs.

3. In your app-level build.gradle add the libs folder as a dependency repository, add the .aar file downloaded earlier in step 1 and all transitive dependencies in your app's dependencies:

android {
    ...
}

dependencies {
    ...
    implementation '{packageName}:{fileName}@aar'
    // implement the other SDK transitive dependencies
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

ProGuard settings

If you use ProGuard or a similar tool that includes shrink or obfuscation rules in your project, you may need to add these exceptions for our SDKs to work properly.


-keep class com.combateafraude.** { *; }
-keep interface com.combateafraude.** { *; }
-keepclassmembers class com.combateafraude.** { *; }

R8 / PROGUARD

If you are using R8 the shrinking and obfuscation rules are included automatically.

ProGuard users must manually add the options from retrofit2.pro.

You might also need rules for OkHttp and Okio which are dependencies of this library.

Last updated

Logo

2023 © Caf. - All rights reserved