A modern, fully-customizable Advanced Power Menu for rooted Android devices
(Magisk). It hooks in at OS level: the moment you long-press the power button and
Android's stock power dialog appears, it is automatically replaced by a beautiful,
root-powered menu that exposes every reboot mode your device supports — Recovery,
Bootloader, Fastboot, Soft Reboot, Safe Mode and more. Works even on the lock
screen, with no extra taps.
This project is made by github.com/X-croot.
- Automatic, deep integration (no extra button): an AccessibilityService
detects the system power dialog and draws the custom menu on top of the System
UI as a system-level overlay (TYPE_ACCESSIBILITY_OVERLAY) — it appears over
everything, including the lock screen.
- Root powered by libsu — the official root
library from the Magisk author (topjohnwu). Fast, persistent, reliable su.
- All reboot modes & power actions:
Power Off, Reboot, Recovery, Bootloader, Fastboot, Soft Reboot,
Safe Mode, Screenshot, Lock Screen.
- In-app power operations and power-button triggered — both routed through
the same engine.
- Full customization, saved automatically (SharedPreferences):
enable/disable any action, accent color, haptic feedback.
- Themes: Light, Dark, Monochrome.
- Languages: 🇬🇧 English · 🇹🇷 Türkçe · 🇷🇺 Русский (easily extensible).
- Quick Settings tile as an optional manual trigger (reuses the lock-screen overlay).
- Extensible architecture: add a capability by appending one PowerAction; add a
language by dropping a values-xx/strings.xml folder.
- Clean Kotlin + Material 3 (Material You) codebase with ViewBinding.
- Android 7.0 (API 24) or newer.
- A rooted device — Magisk recommended. Grant root when prompted.
- Open Android Studio (Hedgehog or newer).
- File → Open and select the project root folder AdvancedPowerMenu/.
- Let Gradle sync. It uses AGP 8.5.2 / Kotlin 1.9.24 / Gradle 8.7 and pulls
libsu from JitPack (already configured in settings.gradle).
- Connect your rooted device and press Run ▶, or Build → Build APK(s).
The Gradle wrapper JAR is intentionally not bundled — Android Studio regenerates it
on first sync. From the CLI, run gradle wrapper once with a local Gradle install.
🧩 First-time setup on device (one time only)
- Install & open the app; grant root when Magisk prompts.
- Tap Enable Accessibility Service and turn on Advanced Power Menu.
(Android requires the user to flip this switch once — it's what lets the app sit
over the System UI. Some ROMs also ask to allow "restricted setting".)
- Done. Now long-press the power button anywhere — the custom menu takes over
the stock one, even on the lock screen.
Optional: add the Power Menu Quick Settings tile for a manual trigger.
app/src/main/java/com/xcroot/advancedpowermenu/
├── App.kt # Application: libsu config + locale + theme
├── MainActivity.kt # Settings / customization screen
├── PowerMenuAccessibilityService.kt # Detects the stock power dialog, replaces it
├── PowerMenuOverlay.kt # System-level overlay window (lock-screen ready)
├── PowerMenuActivity.kt # In-app / preview power menu
├── PowerMenuTileService.kt # Quick Settings tile trigger
├── PowerActionAdapter.kt # Grid adapter for the menu
├── PowerAction.kt # Data-driven action list (extend here)
├── RootUtils.kt # libsu root shell helper
├── Prefs.kt # Persistent customization storage
├── ThemeHelper.kt # Light / Dark / Monochrome
└── LocaleHelper.kt # en / tr / ru localization
- Create app/src/main/res/values-<code>/strings.xml (e.g. values-de).
- Add the code to LocaleHelper.supported and its display name in
MainActivity.setupLanguageSelector().
➕ Adding a new power action
Append a PowerAction(...) to PowerAction.all in PowerAction.kt with its
title, icon and root command(s). It appears in the menu and the settings toggles
automatically.
- Detecting the stock power dialog uses a heuristic that matches AOSP and most OEM
ROMs (com.android.systemui global-actions). If your ROM names it differently,
tune isStockPowerDialog() in PowerMenuAccessibilityService.kt.
- All power / reboot / safe-mode operations run as root. Use responsibly — the
author is not liable for any data loss or device issues.
© 2026 — Built by github.com/X-croot