The Android SDK for Porter, a minimal, maintained Shizuku fork that gives apps ADB access, with optional root support. It builds on Shizuku-API and the maintenance work by thedjchi and contributors. It keeps the Shizuku Binder protocol on the wire, so an app can add Porter support and keep its Shizuku support.
Add JitPack in settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://jitpack.io") {
content { includeGroup("com.github.d4rken-org.porter-api") }
}
}
}Then add the SDK, pinned to a version from the releases page. sdk-extras brings sdk and adds shell commands, PorterSystemServices and typed system property getters; depend on sdk alone if you need none of those.
implementation("com.github.d4rken-org.porter-api:sdk-extras:<version>")Wait for Porter, ask for access, run a command at its identity:
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
Porter.connection.filterNotNull().collect { connection ->
try {
var state = connection.checkPermission()
if (state is PermissionState.Denied && !state.permanentlyDenied) {
state = connection.requestPermission()
}
if (state is PermissionState.Granted) {
show(connection.exec("pm", "list", "packages", "-3").output)
}
} catch (e: PorterException) {
// Porter refused or went away; the next connection arrives on the flow
} catch (e: PorterShellException) {
// The shell service stopped or could not run the command
}
}
}
}Code written against Shizuku-API, or a library built on it, can run on Porter unchanged instead: depend on shizuku-bridge and call PorterShizukuBridge.start(appScope) once per process. The API reference says which calls it answers.
A shipping app also tells the user why no connection arrives, handles a permanent denial, and may run its own code or call system services as shell or root. The integration guide covers those.
- Integration guide: adding Porter support, step by step, including Shizuku and multi-process apps.
- API reference: what each call does exactly.
- Setup guide: link your users here.
- Releases: versions and what changed.
Upstream API code is MIT with RikkaW attribution; shizuku-compat is a Kotlin port of one upstream class under the same license, with the class name and parcel layout unchanged. The Porter SDK (protocol, sdk, sdk-extras, shizuku-bridge) is Apache 2.0, with portions of sdk and sdk-extras derived from the MIT code.