Features β’ Screenshots β’ Installation β’ Setup β’ FAQ β’ Contributing
An Android app that monitors and automatically restarts background services killed by the system. Built with Flutter and powered by Shizuku for privileged shell access.
AI Disclosure: This project was built with significant AI assistance (Claude). All code has been reviewed and tested on a physical device (Android 16, API 36).
- β¨ Features
- πΈ Screenshots
- π₯ Installation
- βοΈ Setup
- π§ Building from Source
- π Permissions
- π οΈ How it Works
- π» Tech Stack
- β FAQ
- π Troubleshooting
- πΊοΈ Roadmap
- π€ Contributing
- π Support
- π License
- π Monitors background services β detects when a selected service is killed and restarts it automatically
- βΏ Monitors accessibility services β re-enables them if Android revokes access in the background
- π Monitors notification listeners β re-enables if disabled by the system
- β±οΈ Scheduled checks β configurable per-service interval (5 min to 4+ hours)
- π Audit log β full timestamped history of every detected stop, restart attempt, and outcome
- π Boot persistence β reschedules all monitors after device reboot
- π’ Per-app notifications β toggle restart alerts per service
- π― Smart app relaunch β when a service can only be recovered by relaunching its whole app, Service Keeper switches back to whatever you were doing afterward, and lets you control when that's allowed to happen (always, only when idle, only when locked, etc.)
Service Keeper is free and open source software, and is 100% offline (no network permissions, no analytics, no ads).
| Method | Details | Status |
|---|---|---|
| π¦ GitHub Releases | Download APK directly (universal or ABI-specific) | β Available |
| π Obtainium | Add https://github.com/sklndev/service_keeper as source |
β Available |
| π€ F-Droid | Official F-Droid repository | π Pending submission |
| π IzzyOnDroid | IzzyOnDroid F-Droid repo | π Pending submission |
Note: Metadata for F-Droid/IzzyOnDroid submission is available in
fastlane/metadata/android.
| Requirement | Details |
|---|---|
| Android | 8.0+ (API 26), tested on API 36 |
| Shizuku | Must be installed and running |
| ADB / Wireless Debugging | Required to start Shizuku |
Shizuku is a mandatory dependency. Without it, the app cannot execute privileged shell commands to restart services.
- Install Shizuku from the Play Store
- Enable Developer Options on your device
- Enable Wireless Debugging under Developer Options
- Open Shizuku β tap Pair using Wireless Debugging and follow the prompts
- Shizuku should now show as Running
Install from a release APK or build from source (see below). On first launch, grant Shizuku permission when prompted. The app displays a status banner at the top when Shizuku is inactive.
Tap + on the Services tab β browse running services by app β select what you want to keep alive.
# Prerequisites: Flutter 3.x, Android SDK (minSdk 26, targetSdk 35)
git clone https://github.com/sklndev/service_keeper.git
cd service_keeper
flutter pub get
flutter run # debug on connected device
flutter build apk --release # release APK
flutter build appbundle --release # Play Store bundle| Permission | Reason |
|---|---|
FOREGROUND_SERVICE |
Background monitoring service |
QUERY_ALL_PACKAGES |
Enumerate installed services for the picker |
POST_NOTIFICATIONS |
Restart event alerts |
RECEIVE_BOOT_COMPLETED |
Restore monitors after reboot |
WAKE_LOCK + REQUEST_IGNORE_BATTERY_OPTIMIZATIONS |
Prevent Doze from deferring checks |
Shizuku bridge
All privileged operations go through a single MethodChannel (com.shaunkleyn.service_keeper/shizuku). Kotlin receives calls, spawns a Shizuku process, runs the shell command, and returns stdout to Dart.
Shell commands used:
dumpsys activity services [pkg]β detect running servicesam start-foreground-service -n pkg/.Classβ restart a serviceam force-stop pkgβ hard stop before restart
Scheduling
- Interval β₯ 15 min β
WorkManagerperiodic task (battery-efficient) - Interval < 15 min β self-chaining one-off tasks (re-schedules itself after each run)
BootReceiverrestores all schedules from SharedPreferences onBOOT_COMPLETED
Service detection
Parses dumpsys activity services output with a regex that handles both standard and Android 16 output format (which appends c:<caller> before }).
App relaunch and idle detection When a service can only be recovered by relaunching its whole app, Service Keeper captures the currently foregrounded app first, launches the target, waits briefly, then switches back to what you were on. Whether that's allowed to happen right away depends on the configured mode:
- No app open: compares the foreground app against the resolved launcher/home package
- No activity for a while: reads
PowerManager's activity timer straight fromdumpsys power, since taps and scrolls reset that timer directly, unlikeUsageEvents, which doesn't fire reliably during ongoing scrolling - When locked: checks
KeyguardManager.isKeyguardLocked, and defers via a small queue that drains on the nextACTION_USER_PRESENTbroadcast
A blocked relaunch is queued and retried automatically once the device becomes idle, so nothing silently gets skipped.
- Flutter β UI and app logic
- Kotlin β Android native bridge (Shizuku, WorkManager, icon/name lookup)
- Shizuku β Privileged shell execution without root
- WorkManager β Background task scheduling
- sqflite β Audit event persistence
- flutter_local_notifications β Restart alerts
- palette_generator β Dynamic app colors extracted from icons
Does this app require root access?
No! Service Keeper uses Shizuku for privileged access, which doesn't require root. Shizuku can be started via wireless debugging (ADB) on any Android device.
Will this drain my battery?
Battery usage is minimal. Service Keeper uses WorkManager for efficient background scheduling and only performs lightweight checks at configurable intervals (5min-4hrs). The app respects Android's Doze mode while preventing check deferrals with wake locks.
Why do I need Shizuku?
Android's security model prevents regular apps from restarting services or re-enabling accessibility services. Shizuku provides a bridge to execute these privileged operations without requiring root access.
Does this collect any data?
No. Service Keeper has zero network permissions and operates 100% offline. All data stays on your device. You can verify this in the source code or by checking the app's permissions.
Can I monitor system services?
Service Keeper focuses on third-party app services. System services are managed by Android itself and generally shouldn't need external monitoring.
What happens if Shizuku stops running?
The app will display a banner notification and won't be able to restart services until Shizuku is restarted. Scheduled checks continue running and will resume operations once Shizuku is available.
Does this work with all apps?
Most apps work fine, but some apps with aggressive self-protection or special system configurations may not respond to standard restart commands. The audit log will show any failures.
Solution: Enable Start on Boot in Shizuku settings. If your device has aggressive battery optimization, add Shizuku to the battery optimization whitelist.
- Check Shizuku status β ensure it's running (green banner in Service Keeper)
- Review audit log β check for error messages explaining why restart failed
- Verify service is actually stopped β use Settings β Developer Options β Running Services
- Try manual restart β tap the refresh button in Service Keeper to force a check
- Increase check interval β some services may need time to stabilize before monitoring
- Update to latest version β check Releases
- Clear app data β Settings β Apps β Service Keeper β Storage β Clear Data
- Check Android version β minimum API 26 (Android 8.0) required
- Report the issue β open a GitHub issue with crash details
Service Keeper needs to run in the background. If your device aggressively kills background apps:
- Disable battery optimization for Service Keeper (Settings β Battery β Battery Optimization)
- Add to auto-start whitelist (varies by manufacturer)
- Lock app in recents (available on some devices)
Some devices disconnect wireless debugging when the screen is off. Solutions:
- Use USB debugging instead of wireless (requires cable to start Shizuku each boot)
- Root and use Shizuku in root mode (if you prefer root)
- Enable "Stay awake" in Developer Options when starting Shizuku
Planned features and improvements:
- Export/import monitoring configuration β backup and restore your service list
- Per-service success/failure statistics β track reliability over time
- Custom restart commands β advanced users can specify alternative restart methods
- Tasker/automation integration β trigger monitoring via external events
- Widget support β quick status view and manual trigger from home screen
- Dark theme variants β multiple AMOLED-friendly themes
- Notification grouping β better organization for multiple service alerts
- Advanced filtering in audit log β search by service, time range, outcome
- Service dependency chains β automatically restart dependent services in order
- F-Droid listing β official F-Droid and IzzyOnDroid availability
Have a feature request? Open an issue with the
enhancementlabel!
Contributions are welcome! Here's how you can help:
- π Report bugs β open an issue with detailed steps to reproduce
- π‘ Suggest features β share your ideas in the issues
- π Improve documentation β fix typos, clarify instructions, add examples
- π Translate β help localize the app (currently English only)
- π» Submit code β fork, make changes, and open a pull request
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/Service-Keeper.git - Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly on a physical device
- Commit with clear messages:
git commit -m 'Add amazing feature' - Push to your fork:
git push origin feature/amazing-feature - Open a Pull Request
- Follow existing Dart/Kotlin conventions
- Add comments for complex logic
- Test on physical devices (emulators don't support Shizuku)
- Update documentation if needed
All changes should be tested on a real Android device with Shizuku before submitting.
If you find Service Keeper useful, please consider:
- β Star the repository β helps others discover the project
- π Report bugs β help improve stability
- π‘ Share feature ideas β guide future development
- π’ Spread the word β tell others who might benefit
- π€ Contribute code β PRs are always welcome!
- Shizuku β for making privileged operations possible without root
- Claude (Anthropic) β AI pair programming assistant used during development
- Flutter & Kotlin communities β for excellent frameworks and tools
This project was prototyped and developed with heavy use of Claude (Anthropic). The development approach is commonly called "vibe coding" β iterating rapidly with an AI pair programmer. All generated code was tested on a physical device before shipping. If you find bugs, open an issue.
GNU General Public License v3.0 or later
Copyright Β© 2025 Shaun Kleyn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Made with β€οΈ and π€ β’ Report Bug β’ Request Feature
Built with Flutter β’ Powered by Shizuku β’ Enhanced by Claude








