Skip to content

Lock a lost R1 through Android's lockdown when device admin is missing - #63

Merged
windoze95 merged 1 commit into
mainfrom
root-lockdown
Oct 13, 2026
Merged

windoze95 merged 1 commit into
mainfrom
root-lockdown

Conversation

@windoze95

Copy link
Copy Markdown
Owner

On the R1, activating robotOS's device admin did nothing. Android reported success and stored nothing, because this Android build doesn't declare android.software.device_admin. So lost mode couldn't lock Android.

  • DeviceLock:
    • Uses device admin's lockNow() where Android supports it.
    • Otherwise uses root: cmd lock_settings require-strong-auth STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN plus the sleep key. That's Android's "Lockdown", which locks at once and requires the screen lock; verified by hand on the R1.
    • available() needs a screen lock and either path. Root.verified records that a root command has succeeded in this process.
  • Lost mode: refreshProtection and the lock command use it. The root path runs off the main thread; the admin path stays synchronous, as the existing test expects.
  • Return message over the lock screen: a quarantined R1's activity calls setShowWhenLocked(true), only on transitions because the gate runs on every layout pass. The finder sees the lost page and return message, and content stays behind the cover. Unchanged: a press on a locked R1 is still ignored, and it can still stop ringing.
  • Host & devices: hides "Enable Android device admin" without the feature. Its protection note mentions root.
  • Docs: INSTALL.md and HUB.md, plus release notes for 0.6.9.

Validation: 392 Android tests pass, 3 new:

  • lockdown through root without admin;
  • no remote lock without a screen lock, or without both device admin and root;
  • lost mode locking through root.

The lost-R1 test also checks the over-lock flag turns on and off. Lint has no new warnings.

On the R1 with a pattern set, the lockdown command locked Android immediately (deviceLocked=1, strongAuthRequired=0x20).

The R1's Android build doesn't declare android.software.device_admin, so
activating robotOS's admin succeeds silently and does nothing, and lost
mode couldn't lock Android.

- DeviceLock uses device admin's lockNow() where it exists. Otherwise it
  uses root: `cmd lock_settings require-strong-auth
  STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN` plus the sleep key, Android's
  "Lockdown", which locks at once and requires the screen lock. It's
  available with a screen lock and either path. Root.verified records
  that a root command has succeeded. The root path runs off the main
  thread; the admin path stays synchronous.
- A quarantined R1's page shows over the lock screen (setShowWhenLocked,
  changed only on transitions), so the finder still sees the return
  message. Content stays behind the cover.
- Host & devices hides "Enable Android device admin" when Android lacks
  the feature, and the protection note mentions root.
- Docs and release notes for 0.6.9.
@windoze95
windoze95 merged commit d333dde into main Oct 13, 2026
3 checks passed
@windoze95
windoze95 deleted the root-lockdown branch October 13, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant