Skip to main content

Requirements

  • Android 7.0 (API 24) or later, with compileSdk 36.
  • Kotlin 2.1 or later. The AAR carries Kotlin 2.2 metadata.
  • The values from What you need from us, and a backend that creates SDK runs.
The AAR includes the native core for arm64-v8a, armeabi-v7a, x86_64 and x86. Its 64-bit libraries are 16 KB-page aligned for Android 15 and later.

Install

From mavenCentral(), which Android projects include by default:
The AAR merges its permissions, its foreground service and its R8 keep rules into your app. You don’t need extra ProGuard rules. It brings JNA, kotlinx-coroutines, androidx.webkit and the Kotlin standard library as Maven dependencies, each under its own licence. The files on Maven Central are signed with the Cr3dentials OpenPGP key, fingerprint E8588B38D6FDCC59E6C03011AE4CC59A87AD0C0B.

Build the run’s configuration

Fetch the trust bundle and the policy bundle right before each run, and build one TreeRunConfig from them and from the run your backend issued:
The fields follow the same rules as on iOS: see the table on the iOS page.

Run a verification

backend, show and message are yours. Errors has a message that covers every case. When runTree throws, or returns with neither delivered nor handedOff, nothing reached Cr3dentials. Tell your backend so it terminates the run.

What runTree returns

TreeSummary has the same fields as on iOS (table). On Android, isolation is one of these:

Things to know

  • The disclosure. TreeWebViewHost shows your TreeDisclosure before it opens any page. If the user declines, nothing opens. Write it in your own words and translate it.
  • Where the page may go. The WebView stays on the platform’s domains and on the third-party sign-in providers the pack lists. If the user follows a link anywhere else, the run ends with SdkException.Policy and the text navigation_refused: <host>.
  • Your app’s web data. On WebViews older than 123, the run wipes your app’s WebView cookies, web storage and cache before and after. Don’t start a run while your own WebViews’ data matters.
  • The foreground service. ZkTlsSessionService is a shortService. Start it when the ATTESTING phase starts and stop it on every path. Android ends it after about three minutes. It holds one run at a time, so guard as the snippet does.
  • The notification. It reads “Verifying”, in a channel named “Verification”. To translate or rebrand it, define zktls_session_notification_title, zktls_session_channel_name and the drawable zktls_session_notification_icon in your app’s resources.
  • Cancelling. cancel() ends runTree with SdkException.Cancelled and closes the page. So does the user pressing Back or closing the page. If you cancel the coroutine instead, it ends with its own CancellationException. Cancel your scope when the activity goes.
  • Threads. runTree is a suspend function that runs on the SDK’s own threads. onProgress calls you on an SDK thread, so don’t block in it.
  • Error text. SdkException.Transport and SdkException.Policy carry their text in e.v1. e.message reads v1=<text>, so match and log e.v1.
  • Logging. Log error variants and e.v1 only. Never log the run’s accessToken, cookies or your app credential.

Before you submit

The SDK adds INTERNET, ACCESS_NETWORK_STATE and FOREGROUND_SERVICE (type shortService) to your manifest. It asks for no runtime permission. Work through the release checklist for the Google Play Data safety answers and the foreground service declaration.