
Androidβs biggest reliability problem isnβt Android β itβs what OEMs bolt on top. Xiaomi (MIUI/HyperOS), Huawei, OPPO, vivo, Samsung and others ship aggressive, undocumented background killers with no public API. Your alarm, tracker, messenger or sync silently dies and users blame your app.
DKMA Monster attacks the problem from every angle at once, all driven by a
single source of truth β data/oem_registry.json.
| Vector | What it does | Automatic? |
|---|---|---|
π ADB installer (adb/dkma.py) |
Detects the OEM, grants what ADB can, opens each vendor screen, then verifies each step | Semi (taps for UI-only toggles) |
π₯οΈ Desktop GUI (gui/server.py) |
Point-and-click front end over the ADB engine: plug in phone β pick app β Fix | Semi (browser-driven) |
π§Ώ Root installer (root/dkma-root.sh) |
Flips appops / doze / standby / vendor autostart with su |
β Fully |
π§© Magisk module (magisk/) |
Re-applies keep-alive settings on every boot for a package list | β Fully, persistent |
π± Android library (android/) |
In-app guided wizard + authoritative MIUI autostart read | Semi (guided) |
𧬠KMP module (kmp/) |
Share the registry + detection across Android / iOS / JVM / JS | Library |
π Web dashboard (web/build.py) |
Generates a searchable, self-hostable keep-alive guide from the registry | β |
π§ OEM registry (data/oem_registry.json) |
Single source of truth β components + fallbacks for 15 OEM families | β |
Xiaomi / Redmi / POCO Β· Samsung Β· Huawei / Honor Β· OPPO Β· vivo / iQOO Β· OnePlus Β· realme Β· Meizu Β· ASUS Β· Sony Β· Nokia / HMD Β· Google / Android One Β· Motorola / Lenovo Β· Nothing Β· Tecno / Infinix / itel β plus a generic fallback for anything unknown.
On a stock, non-rooted phone, no tool can silently flip Autostart, βMIUI optimizationsβ, βprotected appsβ or the per-app battery profile β they are UI-only toggles with no API, by vendor design. So:
Anyone promising a stock, no-root, zero-tap βfixβ is either using root or lying.
After each step, DKMA re-reads device state to prove whether it worked, and is honest when it canβt:
| Step | Proven via | API? |
|---|---|---|
| battery optimization / stamina | dumpsys deviceidle whitelist |
β |
| background / keep-running | appop RUN_ANY_IN_BACKGROUND + standby bucket |
β |
| autostart | appop AUTO_START (MIUI) / DkmaAutostart reflection |
β οΈ ROM-dependent |
| MIUI optimizations / protected apps / battery profile | no readable state | β β honestly flagged |
# prerequisites: adb on PATH + USB debugging enabled on the phone
python3 adb/dkma.py com.your.app # detect OEM β grant β guide β verify
python3 adb/dkma.py com.your.app --tui # interactive checklist (arrow keys)
python3 adb/dkma.py com.your.app --auto # grants only, no pauses
python3 adb/dkma.py com.your.app --dry-run # print commands, change nothing
python3 adb/dkma.py com.your.app --json # machine-readable report (CI/QA)
python3 adb/dkma.py --list # list connected devices
Exit codes: 0 ok Β· 1 usage/device error Β· 2 adb missing Β· 3 partial.
python3 gui/server.py # opens http://127.0.0.1:8765
Plug in the phone, pick the app, click Fix everything (or Dry run).
Preview the UI without a phone: open gui/preview.html.
python3 web/build.py # generate the site into web/site/
python3 -m http.server -d web/site 8080 # optional local preview
Static output β host on GitHub Pages, Netlify, Cloudflare Pages, S3, or open
web/site/index.html directly.
adb push root/dkma-root.sh /sdcard/
adb shell "su -c 'sh /sdcard/dkma-root.sh com.your.app'"
cd magisk && sh build-zip.sh # β dkma-monster-magisk.zip
# flash in Magisk, then add packages to /data/adb/dkma/apps.list and reboot
// zero-dependency engine
if (DkmaMonster.needsAttention(context)) {
DkmaMonster.runGuidedSetup(activity) // opens each required screen in order
}
// or the ready-made Compose wizard UI kit
setContent { MaterialTheme { DkmaWizardScreen(onFinish = { finish() }) } }
// authoritative MIUI/HyperOS autostart read (no external dependency)
when (DkmaAutostart.getState(context)) {
DkmaAutostart.State.ENABLED -> { /* proven ON β don't nag */ }
DkmaAutostart.State.DISABLED -> { /* proven OFF β send to Autostart screen */ }
else -> { /* unknown/unsupported β fall back to guiding */ }
}
See android/README.md. For multiplatform apps, use the
kmp/ module instead.
data/oem_registry.json β edit ONLY this
β
βββββββββββββββββ¬βββββββββββΌββββββββββββ¬βββββββββββββββββββ¬ββββββββββββββ
βΌ βΌ βΌ βΌ βΌ βΌ
adb/dkma.py gui/server.py web/build.py tools/gen_*.py root/ Β· magisk/
(reads JSON) (reads JSON) (reads JSON) β DkmaRegistry.kt (Android)
β DkmaRegistryData.kt (KMP)
tools/build_all.py generates their registries from it β and
tools/build_all.py --check (run in CI) fails the build if theyβre stale.python3 tools/build_all.py # regenerate every derived artifact
python3 tools/build_all.py --check # CI: validate + fail on drift
dkma-monster/
βββ data/oem_registry.json # π§ single source of truth (15 OEMs)
βββ adb/dkma.py # cross-platform ADB installer (TUI/JSON/dry-run/verify)
βββ gui/ # desktop GUI: stdlib server + HTML front end (+ preview)
βββ web/build.py # static-site generator β web/site/
βββ android/ # DkmaMonster, DkmaAutostart, DkmaWizard, DkmaRegistry(gen)
βββ kmp/ # Kotlin Multiplatform module (common + android/jvm/ios/js)
βββ root/dkma-root.sh # fully-automatic root installer
βββ magisk/ # persistent Magisk module + build-zip.sh
βββ tools/ # codegen + single-source build/drift orchestrator
βββ docs/ # HOW-IT-WORKS Β· CONTRIBUTING Β· ROADMAP
βββ .github/workflows/ci.yml # registry validation + drift guard + compiles
Plus: for genuinely long-lived work, run a foreground service β the most reliable pattern on aggressive OEMs regardless of these toggles.
The most valuable contribution is accurate vendor Activity names for new ROM versions. Itβs a one-file edit + regenerate:
data/oem_registry.json
(see docs/CONTRIBUTING.md).python3 tools/build_all.py.CI drift-checks everything, so nothing can fall out of sync.
Knowledge distilled from the community effort at dontkillmyapp.com and the MIUI-autostart technique. Design language inspired by and built by David Linacre Β· linacre.site.
MIT β do whatever, no warranty. Killing OEM battery managers is a public service.