Two drop-in files, zero-to-minimal dependencies:
| File | What it is | Dependencies |
|---|---|---|
DkmaMonster.kt |
The engine: OEM detection + deep-links to every vendor keep-alive screen for ~15 families | none |
DkmaRegistry.kt |
Generated OEM data (from data/oem_registry.json). Do not edit — run python3 tools/build_all.py |
none |
DkmaWizard.kt |
Optional Jetpack Compose wizard UI kit that renders a friendly checklist on top of the engine | Compose Material3 + lifecycle-runtime-compose |
preview/DkmaWizard-preview.html |
An interactive, browser-viewable mockup of the wizard (switch between all 16 device profiles) | — |
Preview it now: open
preview/DkmaWizard-preview.html. Use the Preview device dropdown to see the exact steps each OEM gets, and tap the buttons to watch the live state (progress bar, battery card, done badges).
if (DkmaMonster.needsAttention(context)) {
DkmaMonster.runGuidedSetup(activity) // opens each required screen in order
}
Or build your own UI from DkmaMonster.stepsFor(context) and
DkmaMonster.openStep(context, step).
Full screen:
setContent {
MaterialTheme {
DkmaWizardScreen(onFinish = { finish() })
}
}
As a bottom sheet from anywhere:
var show by remember { mutableStateOf(false) }
if (show) DkmaWizardBottomSheet(onDismiss = { show = false })
Only prompt when it actually matters:
LaunchedEffect(Unit) {
if (DkmaMonster.needsAttention(context)) show = true
}
dependencies {
implementation platform("androidx.compose:compose-bom:2024.06.00")
implementation "androidx.compose.material3:material3"
implementation "androidx.compose.material:material-icons-extended"
implementation "androidx.activity:activity-compose:1.9.0"
implementation "androidx.lifecycle:lifecycle-runtime-compose:2.8.0"
}
(Any recent Compose BOM works; these are just known-good versions.)
Merge AndroidManifest-snippet.xml for the standard permissions
(REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, RECEIVE_BOOT_COMPLETED, foreground
service types, POST_NOTIFICATIONS, WAKE_LOCK).
LifecycleResumeEffect). The battery card
turns green automatically.DkmaAutostart (pure
reflection over the hidden AppOps op — the technique the MIUI-autostart library
uses, with no dependency). When it can prove Autostart is ON, the wizard
shows a Verified chip and auto-ticks that step; needsAttention() also
factors this in so you only nag when it’s genuinely off.when (DkmaAutostart.getState(context)) {
DkmaAutostart.State.ENABLED -> // proven ON → don't nag
DkmaAutostart.State.DISABLED -> // proven OFF → send to Autostart screen
DkmaAutostart.State.UNKNOWN -> // couldn't read → fall back to guiding
DkmaAutostart.State.UNSUPPORTED -> // ROM has no readable autostart op
}
Add or fix a step in data/oem_registry.json (with an optional hint), then run
python3 tools/build_all.py to regenerate DkmaRegistry.kt — it shows up in the
wizard automatically. See ../docs/CONTRIBUTING.md.
DkmaMonster.kt — engine (detection, deep-links, needsAttention, autostartState)DkmaAutostart.kt — authoritative autostart reader (reflection, no deps)DkmaRegistry.kt — generated OEM data (do not edit)DkmaWizard.kt — Compose wizard UI kit