Slocker Launcher
Turns an old rooted Android phone into a headless container player. On
boot, Slocker Launcher starts itself automatically, shows a brief
countdown, then takes over the screen — fullscreen, solid black, and kept
on — while it runs a command of your choice in the background (typically
a rooted bwrap chroot that brings up SSH). No cable, no adb shell
needed after the first setup.
Requirements
- A rooted Android phone with Magisk installed.
adbon your computer, and USB debugging enabled on the phone, to install the app (it isn't published anywhere — you sideload it).
Install
From a computer with the phone connected over USB:
./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk
Or just copy the built app-debug.apk to the phone and open it with a
file manager (allow "install from unknown sources" if asked).
First-time setup
- Open the app once by hand. This does two things that only an
on-screen app (not a boot-time background process) is allowed to do:
- Shows a system prompt asking for notification permission — allow it. Without this, the app can't auto-launch itself after a reboot (see How boot auto-launch works below).
- When it later calls
su, Magisk will ask you to grant Slocker Launcher superuser access — allow it. This only needs to happen once.
- Tap Settings and fill in:
-
Countdown (seconds) — how long the Start/Settings/Exit menu stays on screen before it proceeds on its own. Default
60. -
Command to run — whatever you want running in the background once the black screen comes up. This is run as-is, not automatically as root — if you need root, write it yourself, e.g.:
su -c '/path/to/your/bwrap-command ...'The default,
sleep 180, is just a harmless placeholder for testing that the app itself works before wiring up your real command.If your command daemonizes/detaches (
tmux new-session -d,screen -d,nohup ... &, etc.), the app sees the launching command exit successfully the moment the detached thing is created — not when the real workload actually ends — and will show the "process exited" screen (see below) even though your daemon is still running fine. Make the command wait on the real thing instead, e.g.:su -c '... -- sh -c "tmux new-session -d ...; while tmux has-session 2>/dev/null; do sleep 5; done"'
-
- Tap Save.
- (Recommended) In Android's own Settings → Apps → Slocker Launcher → Battery, turn off any "put app to sleep" / battery optimization for this app, so it doesn't get killed while running unattended in the background.
Using it
- On launch (by hand, or automatically after boot) you get a countdown
with three buttons:
- Start — skip the countdown and go straight to the black screen.
- Settings — go back and change the countdown or command.
- Exit — close the app without running anything.
- Once the countdown reaches zero (or you tap Start), the screen goes fullscreen black and stays on, and your configured command starts running in the background. There's no way back to the menu from here by design — this mode is meant to run unattended. To change settings again, close/reopen the app (or reboot).
- If your command exits (crashes, finishes, or never started), the screen stays black and on, but a small message + Exit button appear at a random position, moving to a new random spot every minute — so a device left unattended in this state for a long time doesn't develop burn-in from a static message. Tap Exit to close the app.
- Output (and any startup errors) from your command is logged to a file
inside the app's own storage, useful if something didn't start the way
you expected. Pull it with:
adb shell run-as ro.ceamac.slockerlauncher cat files/workload.log
How boot auto-launch works
Getting a plain background-started activity to actually appear after a
real, untouched reboot needed more than the obvious approach — see
CLAUDE.md in this repo for the full technical story if you're curious
or something stops working. The short version: it uses a full-screen
notification (the same mechanism alarm and incoming-call apps use), which
needs the notification permission granted in the first-time setup above.
If auto-launch ever stops working after an app update or a fresh install,
re-open the app by hand once to make sure that permission is still
granted.
License
Apache License 2.0 — see LICENSE.