Dari

Module Structure

The Android artifacts you add, the ones they pull in, and the Gradle plugin

You add up to three Android artifacts: dari for debug builds, dari-noop for release, and dari-core for shared code. dari pulls in two more, dari-runtime and dari-inspector-protocol; you don't declare them. The optional Gradle plugin is published separately as io.github.easyhooon.dari. iOS uses the Swift package instead.

ModuleYou add itPurpose
dari-coreOptional, for KMP commonMainShared models and the DariInterceptor contract
daridebugImplementationInspector UI, notifications, desktop connection
dari-noopreleaseImplementationSame API, records nothing
dari-runtimeNo, via dariCapture and storage: DefaultDariInterceptor, Room
dari-inspector-protocolNo, via dariWire protocol shared with the desktop app

dari-core

Kotlin Multiplatform contracts module for Android, JVM, and iOS. It has no UI, Room database, or notifications and can be added to commonMain:

commonMain.dependencies {
  implementation("io.github.easyhooon:dari-core:3.8.0")
}

Contains:

  • DariConfig: configuration data class
  • DariInterceptor: interface for capturing bridge messages
  • MessageEntry: data model for a bridge call lifecycle
  • MessageStatus: enum: IN_PROGRESS, SUCCESS, ERROR
  • MessageDirection: enum: WEB_TO_APP, APP_TO_WEB

KMP support currently covers these shared models and interception contracts. The inspector runtime, WebView integration, persistence, and UI remain Android-only, in dari and dari-runtime.

dari

Full debug implementation. Depends on dari-runtime, which depends on dari-core.

Contains:

  • Dari: singleton entry point (init, createInterceptor, settings such as masking and the desktop connection)
  • Inspector UI (Jetpack Compose), notifications and shake-to-open
  • Desktop inspector connection
  • Hooks that the Gradle plugin calls

Add to debugImplementation only.

dari-runtime

Capture and storage, pulled in by dari:

  • DefaultDariInterceptor: saves each call and pairs responses with requests
  • Room database + DAO, with the maxEntries and retentionPeriod limits

dari-inspector-protocol

The messages dari and the desktop app exchange. The two ship separately, so each side checks InspectorProtocol.VERSION when it connects and refuses a mismatch.

dari-noop

No-op stub that depends on dari-core. Dari.init() and other runtime APIs do nothing, while Dari.createInterceptor() returns null.

Add to releaseImplementation to ensure zero runtime overhead in production builds.

On this page