Getting Started With Android Trust SDK
Add the Trust SDK to your Gradle Project
Copy the following AAR files to your module 'libs' folder. If you don't have a 'libs' folder then create one. New projects module 'libs' folder location should be 'My Application/app/libs'.
- daon-trust-sdk-1.0.x.aar
- com.daon.sdk.nfc-1.0.x.aar
Open your module level Gradle settings file. New projects module Gradle settings location should be
My Application/app/build.gradle
.Make the ‘libs’ folder easily accessible. To do that, add the following lines to your ‘module’ level Gradle file:
repositories {
flatDir {
dirs 'libs'
}
}
By default, you might not have any settings for repositories in your ‘module’ level ‘build.gradle’ file. If this is the case, you can simply add it to the end of the file outside any other objects. Also, it is possible that you already have flatDir { dirs 'libs' } in your repositories. In this case, no change is necessary. If you are using a newer gradle version, there may be a requirement to add flatDir support to the ‘settings.gradle‘ file. It should be located in the same folder as the project-level ‘build.gradle‘ file. In ‘settings.gradle‘ add following lines:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
//Posible some other repositories
flatDir {
dirs 'libs'
}
}
}
- Add libraries for the Daon Trust SDK along with other necessary dependencies to your ‘module’ Gradle dependencies:
// Your might already have other librarires/dependencies here you should leave them
// as they are and just add yours in the new line
//Daon Trust SDK and NFC SDK that are located in 'libs' folder
implementation fileTree(dir: 'libs', include: ['*.aar'])
//QR Code Scanner
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'
//NFC - OPTIONAL
implementation 'org.jmrtd:jmrtd:0.7.19'
implementation 'net.sf.scuba:scuba-sc-android:0.0.26'
implementation 'com.madgag.spongycastle:prov:1.54.0.0'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.0'
//Gson
implementation 'com.google.code.gson:gson:2.11.0'
//AppCompat, Material, Kotlin core
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//Reflection
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.7.10'
- And finally, add proguard changes in case the minify option is enabled for your build, to ensure that all of the necessary classes for NFC SDK are present when the project is built:
-keep class org.jmrtd.** { *; }
-keep class net.sf.scuba.** { *; }
-keep class com.github.mhshams.** {*;}
-keep class com.madgag.spongycastle.** {*;}
-keep class org.bouncycastle.** {*;}