KeyStar can run a Tasker shutdown task from the lock screen. Start Shizuku with TCP mode enabled, create a Tasker ADB Wifi action with the "svc power shutdown" command and 127.0.0.1 host, then assign that task to a button in KeyStar's lock screen context. After powering on again, your device will be in Before First Unlock (BFU) mode and require your PIN, pattern, or password to unlock.
Shutdown, lockdown mode, and biometric unlocking
KeyStar can give any Android phone a shutdown shortcut that uses just one button. This example uses five short Volume Down presses while the phone is locked. It can be a discreet way to power off your phone without navigating the power menu or holding multiple buttons together.
This task shuts the phone down. After you turn the phone back on, Android requires your PIN, pattern, or password for the first unlock before fingerprint or face unlock becomes available again.
On devices that provide it, Android's Lockdown mode disables biometric unlocking until you enter your screen-lock credential, while keeping the phone on. However, when protecting your privacy from authorities, a device shutdown is preferable.
Why shutdown offers stronger protection than lockdown: BFU vs AFU
Shutting down is better than enabling lockdown when your goal is stronger protection of data at rest. The next time the phone turns on, it starts in Before First Unlock (BFU). On Android phones using file-based encryption, credential-encrypted storage, where apps keep private user data by default, is unavailable until you enter your PIN, pattern, or password for the first unlock.
After that first unlock, the phone is in After First Unlock (AFU). Credential-encrypted storage remains available to the operating system and authorised apps even when you lock the screen again. Lockdown disables fingerprint and face unlocking, but it does not restart the phone or return an already-unlocked phone to BFU. Android's Direct Boot documentation explains that credential-encrypted storage remains available after the first unlock until the device restarts.
That is the extra benefit of this shutdown shortcut: it restores the need to unlock credential-encrypted storage on the next boot, as well as requiring your screen-lock credential before biometrics can be used again. The distinction applies across Android brands. Android's file-based encryption documentation notes that devices launching with Android 10 or later must use file-based encryption, so older devices may use a different encryption scheme.
BFU limits accessible user data; it does not make every file inaccessible or guarantee protection against forensic tools. Device-encrypted storage and Direct Boot features can still be available before the first unlock.
What you need
- KeyStar, with setup completed and its service enabled. Volume button mapping is free.
- Tasker, installed separately, to run the shutdown command.
- The thedjchi fork of Shizuku, running with TCP mode enabled. This setting opens an Android Debug Bridge (ADB) TCP listener on the phone.
- A PIN, pattern, or password that you know and have configured as your screen lock. A Swipe or None screen lock will not provide the credential protection described here.
No root is needed for this procedure. The on-device Wireless Debugging pairing steps assume Android 11 or later; for older devices, follow Shizuku's startup instructions.
1. Start Shizuku and enable TCP mode
- Install the fork. Use the thedjchi/Shizuku releases page. These instructions use that fork's settings.
- Pair and start Shizuku. Follow its Wireless Debugging instructions while connected to Wi-Fi. Confirm that its service is running; pairing alone is not enough.
- Enable TCP mode in Shizuku settings. Apply any requested service restart. Note the configured TCP port: use
5555in the example below if that is the port your setup uses. - Connect KeyStar. Enable Run logcat through Shizuku in KeyStar settings, then turn the KeyStar service on again, allowing any Shizuku access request.
The Shizuku setup guide covers log access and the fork's Start on boot and Watchdog options. Those options help with startup and recovery, but check readiness after every reboot.
Tasker connects to the ADB listener separately. Giving KeyStar Shizuku permission does not automatically authorise Tasker's ADB connection. Use the TCP port configured in Shizuku, rather than the temporary Wireless Debugging pairing port.
Understand the debugging access: ADB TCP mode exposes privileged debugging access. As Tasker's ADB Wifi help explains, other apps can request access too. Approve only clients you trust. Using 127.0.0.1 makes Tasker connect to the same device; it does not restrict the listener itself to local connections.
2. Create the Tasker shutdown task
- Create a named task in Tasker. For example, name it Shutdown Device.
- Add an ADB Wifi action. Search Tasker's action picker for ADB Wifi and enter the values below.
- Command:
svc power shutdown - Host:
127.0.0.1 - Port:
5555, or the TCP port configured in your Shizuku settings.
Enter the command exactly as shown, without adding adb shell. The ADB Wifi action already runs it through an ADB shell. 127.0.0.1 is the loopback address, meaning the address of the device itself rather than another device on your Wi-Fi network.
Authorise and test the connection first: temporarily use id as the command and run the task while the phone is unlocked. Accept the debugging authorisation prompt for Tasker's connection, if shown, and confirm that the action completes successfully. Then change the command back to svc power shutdown and save.
Android's power command implementation defines this as a shutdown and power-off request without a confirmation dialog. Save anything you are working on before testing the final command; it will turn the phone off.
4. Test the shortcut while locked
- Save your work and lock the phone. Keep it locked while you perform the test.
- Press Volume Down five times. Use the trigger configured in KeyStar. Confirm that the phone powers off.
- Turn it back on. The phone starts in Before First Unlock (BFU). Confirm that your first unlock requires your PIN, pattern, or password, and that fingerprint or face unlock alone cannot perform that first unlock.
- Restore readiness. Once unlocked, check Shizuku, its TCP listener, Tasker's ADB authorisation, and the KeyStar service again before relying on the shortcut.
If you intend to use it with the screen fully off, test that state as well as the visible lock screen. Test again after Android, KeyStar, Tasker, or Shizuku updates. A working task in an unlocked Tasker session does not by itself verify a lock screen mapping.
If the shutdown shortcut does not work
- Tasker cannot connect: check that TCP mode was applied, the listener is active, and Tasker's port matches Shizuku's TCP port. Use
127.0.0.1as the host. Complete debugging authorisation while unlocked. - The task works manually but the button does nothing: check the lock screen context, Quintuple trigger, saved task selection, KeyStar service, and Run Tasker Tasks access.
- Five presses are not recognised: adjust KeyStar's standard press delay to a comfortable interval and check other mappings that use the same button.
- It stops after restarting: re-establish Shizuku and ADB access. The fork's automatic startup may need a Wi-Fi connection after boot; do not assume the listener is already available.
- Background services stop: review battery optimisation and background restrictions for KeyStar, Tasker, and Shizuku. See KeyStar's service troubleshooting.
When asking for help, include your phone model, Android version, app versions, TCP port, and whether the task succeeds directly in Tasker.
Your rights
Concerns about police searches, forced biometric unlocking, and compelled passcode disclosure often bring up the U.S. Constitution. The Fourth Amendment addresses unreasonable searches and seizures; the Fifth Amendment protects against compelled self-incrimination. You can read both in the National Archives' Bill of Rights transcript.
The technical purpose of this shortcut is specific: power the device off to disable biometrics and put it in Before First Unlock (BFU) mode. It does not guarantee protection against forensic access or determine your legal rights.