Repository navigation
Conversation
When the vault locks while MainActivity is stopped (screen off, minimize), only finish the activities above it; MainActivity's onStart already asks for auth when the user returns. The reflective finish(int) that used to keep the task in recents is denied for apps targeting above Android 11, so the fallback finishAndRemoveTask() closed the app on every screen lock.
lacostej
marked this pull request as ready for review
October 23, 2026 09:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since targeting above Android 11, the reflective
Activity.finish(int)from #714 is denied (hiddenapi: ... finish(I)V (api=max-target-r) ... denied), so every auto lock falls back tofinishAndRemoveTask()and Aegis vanishes from recents on each screen lock (#991).With this PR, a lock that arrives while Aegis is in the background no longer removes the task: activities opened on top of MainActivity (such as the entry editor) are closed, MainActivity clears its entries but stays open, and its existing
onStartopensAuthActivitywhen the user returns, showing the same unlock screen as a cold start, so no background activity launch is needed. Locks that arrive while Aegis is visible (back-button lock, panic, the lateSCREEN_OFFfrom #1576) behave as before.With secure screen disabled, the recents thumbnail can show the codes from before the lock, which is the same exposure #714 had.
Tested on a Samsung phone with targetSdk 36 (lock on the entry list, lock on the edit screen, back-button lock), and with the new
AutoLockTeston an API 35 emulator; with the fix reverted,testLockInBackgroundKeepsMainActivityfails.