Skip to main content

Preparation

The Speech Verifier is a standalone, fully offline speech-verification module for Android. The user reads a passphrase (and, optionally, answers knowledge-based identity questions) on camera; the on-device engine verifies the reading live, a single continuous video is recorded, and the evidence is uploaded to the Amani backend.

It is self-contained — it does not depend on the core AmaniAi SDK, so adding it does not change the size or dependencies of the other Amani SDKs.

Requirements

  • API Level 23 (minSdk)
  • compileSDKVersion 36
  • Java / Kotlin 17

Required Permissions

The module's manifest already declares what it needs (merged automatically):

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />

Your app must still request CAMERA and RECORD_AUDIO at runtime. The screen requests them itself and calls onError(...) if they are denied.

Integration

1. Add the SDK Dependency

The module is published to its own JFrog repository (public read).

settings.gradle (dependencyResolutionManagement.repositories):

maven {
url = "https://jfrog.amani.ai/artifactory/amani-speech-verifier"
}

build.gradle (app module):

implementation 'ai.amani.android:amani-speech-verifier:<version>'

Click <version> above (or see the SDK Release Notes) for the most recent published version. The module brings its own CameraX, OkHttp and the offline recognition engine transitively.

Feature activation is server-side (Amani team)

The Speech Verifier step must be enabled from the remote configuration by the Amani team for your profile / KYC flow. Adding the dependency alone is not enough — if the step is not activated on the Amani side, it will not appear in the flow. Contact the Amani team to have it enabled for your configuration.

2. ProGuard / R8

In most cases you do NOT need to add anything. The module ships its own consumer rules (bundled in the AAR), so R8 in your app automatically keeps the public API, the reflection-created Fragment, and the reflection-mapped recognition classes.

Add the block below to your proguard-rules.pro only if you use aggressive R8 settings (e.g. -repackageclasses, custom -keep allowlists, or -dontobfuscate overrides) that could defeat the bundled consumer rules, or if you hit a ClassNotFoundException / UnsatisfiedLinkError / missing-recognition issue in a minified release:

# ── amani-speech-verifier — public API (referenced by name) ──
-keep class ai.amani.speechverifier.SpeechVerifier { *; }
-keep class ai.amani.speechverifier.SpeechVerifier$* { *; }
-keep interface ai.amani.speechverifier.observable.** { *; }
-keep class ai.amani.speechverifier.observable.** { *; }
-keep class ai.amani.speechverifier.model.** { *; }

# ── Fragment recreated by the FragmentManager via reflection ──
-keep class ai.amani.speechverifier.ui.SpeechVerifierFragment { public <init>(...); }

# ── Offline STT (JNI + JNA, reflection-mapped) — must not be renamed/stripped ──
-keep class org.vosk.** { *; }
-keep class com.sun.jna.** { *; }
-keepclassmembers class * extends com.sun.jna.Structure { *; }
-dontwarn org.vosk.**
-dontwarn com.sun.jna.**
-dontwarn java.awt.**

# ── OkHttp / Okio (upload + SSE) ──
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**

These are identical to the rules the AAR already contributes; adding them is safe and idempotent.