-
Notifications
You must be signed in to change notification settings - Fork 15
Prevent mnemonic capture in mobile screenshots (VZR-105) #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
piatoss3612
wants to merge
12
commits into
main
Choose a base branch
from
rowan/vzr-105
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
01d7566
Blank the app in iOS screenshots while the seed phrase is visible
piatoss3612 04752de
Extend mobile screenshot protection to the import screens
piatoss3612 3faadcb
Scope the screenshot-shield suppression to the warning sheet
piatoss3612 bc51333
Drop the native screenshot shield while a secret screen is offstage
piatoss3612 ba4a254
Re-attach the iOS screenshot shield after a window swap
piatoss3612 6ac038e
Keep the screenshot shield up through screen transitions
piatoss3612 98d055b
Guard the auth-prompt controller methods after dispose
piatoss3612 211b2bf
Test: shield stays up while the screenshot warning sheet is open
piatoss3612 3602448
Prove the warning sheet does not drop the shield, under real go_router
piatoss3612 438127f
Share one native screenshot subscription across stacked screens
piatoss3612 fd7b794
Reattach the iOS shield to the live window on scene activation
piatoss3612 a96c603
Remove the screenshot-preview shield suppression
piatoss3612 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import 'package:flutter/widgets.dart'; | ||
|
|
||
| /// Tracks whether this route has been fully covered by a route pushed on top. | ||
| /// | ||
| /// A screen that shows a secret drives a global native screenshot shield | ||
| /// (`SensitivePrivacyOverlay` → Android `FLAG_SECURE` / iOS secure-field | ||
| /// blanking). When it pushes the next step, it must drop that token so the | ||
| /// pushed, non-secret screens are not blanked — but only *after* the secret | ||
| /// screen is off-screen. Keying the drop off the route's `secondaryAnimation` | ||
| /// (rather than the push/pop `Future`) keeps the shield engaged through the | ||
| /// entire push slide-out and pop slide-in, so the secret is never visible | ||
| /// unblanked during a transition. | ||
| mixin RouteCoverageAware<T extends StatefulWidget> on State<T> { | ||
| Animation<double>? _secondaryAnimation; | ||
| bool _coveredByNextRoute = false; | ||
|
|
||
| /// True only once the next route has fully slid over this one. False while | ||
| /// this route is on top and throughout both the push and pop transitions. | ||
| bool get isCoveredByNextRoute => _coveredByNextRoute; | ||
|
|
||
| @override | ||
| void didChangeDependencies() { | ||
| super.didChangeDependencies(); | ||
| final secondary = ModalRoute.of(context)?.secondaryAnimation; | ||
| if (identical(secondary, _secondaryAnimation)) return; | ||
| _secondaryAnimation?.removeStatusListener(_onSecondaryStatus); | ||
| _secondaryAnimation = secondary; | ||
| _secondaryAnimation?.addStatusListener(_onSecondaryStatus); | ||
| // Set directly — build runs right after didChangeDependencies; the listener | ||
| // uses setState for later status changes. | ||
| _coveredByNextRoute = secondary?.status == AnimationStatus.completed; | ||
| } | ||
|
|
||
| void _onSecondaryStatus(AnimationStatus status) { | ||
| final covered = status == AnimationStatus.completed; | ||
|
piatoss3612 marked this conversation as resolved.
|
||
| if (covered == _coveredByNextRoute || !mounted) return; | ||
| setState(() => _coveredByNextRoute = covered); | ||
|
piatoss3612 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| @override | ||
| void dispose() { | ||
| _secondaryAnimation?.removeStatusListener(_onSecondaryStatus); | ||
| super.dispose(); | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.