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.
Install
FrommavenCentral(), which Android projects include by default:
E8588B38D6FDCC59E6C03011AE4CC59A87AD0C0B.
Build the run’s configuration
Fetch the trust bundle and the policy bundle right before each run, and build oneTreeRunConfig from them and from the run your backend issued:
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.
TreeWebViewHostshows yourTreeDisclosurebefore 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.Policyand the textnavigation_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.
ZkTlsSessionServiceis ashortService. Start it when theATTESTINGphase 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_nameand the drawablezktls_session_notification_iconin your app’s resources. - Cancelling.
cancel()endsrunTreewithSdkException.Cancelledand closes the page. So does the user pressing Back or closing the page. If you cancel the coroutine instead, it ends with its ownCancellationException. Cancel your scope when the activity goes. - Threads.
runTreeis asuspendfunction that runs on the SDK’s own threads.onProgresscalls you on an SDK thread, so don’t block in it. - Error text.
SdkException.TransportandSdkException.Policycarry their text ine.v1.e.messagereadsv1=<text>, so match and loge.v1. - Logging. Log error variants and
e.v1only. Never log the run’saccessToken, cookies or your app credential.
Before you submit
The SDK addsINTERNET, 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.