UI Hardening (Android)
Integration
The UI Hardening feature, which is newly added, comes as a separate file named uihardening*.aar alongside the SDK library.
-
Begin by copying the library files into your project.
We recommend placing the uihardening*.aar file inside the 'artifacts/libs' directory, similar to other libraries as mentioned here.
-
Next, specify the path to these library files in the dependencyResolutionManagement section of your project's settings.gradle file.
dependencyResolutionManagement {
...
repositories {
...
flatDir {
dirs 'artifacts/libs'
}
...
}
}
- Now, you can add the library as a dependency in your
:app:build.gradlefile.
// For Java:
debugImplementation (':uihardening-debug@aar') {
transitive = true
}
releaseImplementation (':uihardening-release@aar') {
transitive = true
}
// For Kotlin:
debugImplementation (':uihardening-debug@aar') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
transitive = true
}
releaseImplementation (':uihardening-release@aar') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
transitive = true
}
Setting Logging Callbacks
Hardening.getInstance().viewloggingCallBack();
This function sets up a way for the hardening library to report events by calling a specified function. If no function is specified, the library will still log events to the system's logcat output. However, it is crucial to note that in release versions, a callback function must be set up to avoid logging unencrypted data.