Skip to content

Conversation

@ItsChaceD
Copy link
Collaborator

@ItsChaceD ItsChaceD commented Oct 21, 2025

Deprecates the preventScreenshots Android config option as FLAG_SECURE is now automatically applied when the privacy screen is enabled. We have to do this since adding and removing the flag dynamically results in a race condition.

This Pr also improves reliability of the privacy screen dialog handling across different navigation modes (gesture navigation, home button, recent apps). The dialog is used in cases where FLAG_SECURE doesn't fully protect content. This happens when using gesture navigation (onPause doesn't reliably trigger), or on newer Android devices where the recent apps menu does not use a snapshot and instead uses a live view fragment which will persist until the OS decides to cache it.

@ItsChaceD ItsChaceD requested a review from a team October 21, 2025 14:23
Copy link
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, tested and seems to be working fine.

I needed to change the dependencies on capacitor framework to ^7.0.0, because it was installing next= 8.0.0-alpha.3 which uses kotlin 2.2.20, but because other modules had 1.9.X it had an error (I had package-lock.json and node_modules cleared to simulate a fresh clone, otherwise you may not get this issue if you had 8.0.0-alpha.2 or older:

lass 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.2.0, but the compiler version 1.9.0 can read versions up to 2.0.0.

Don't know if this needs to be addressed in this PR, but leaving the remark.

Comment on lines +13 to +16
* @deprecated This option is no longer necessary. FLAG_SECURE is now always applied when the privacy screen is enabled,
* which prevents screenshots and protects content in the app switcher. This option will be removed in a future version.
*
* If you need to control screenshot prevention separately, you can enable/disable the plugin as needed per screen.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this option is now a dud, should we remove this option in v2 of the plugin (next branch). Or what would be the future version this option gets removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think it makes sense to remove it in v2. I will cherry pick the changes and update to remove this option in the next branch.

@ItsChaceD
Copy link
Collaborator Author

Overall LGTM, tested and seems to be working fine.

I needed to change the dependencies on capacitor framework to ^7.0.0, because it was installing next= 8.0.0-alpha.3 which uses kotlin 2.2.20, but because other modules had 1.9.X it had an error (I had package-lock.json and node_modules cleared to simulate a fresh clone, otherwise you may not get this issue if you had 8.0.0-alpha.2 or older:

lass 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.2.0, but the compiler version 1.9.0 can read versions up to 2.0.0.

Don't know if this needs to be addressed in this PR, but leaving the remark.

I updated this PR to adjust the dependency versions since it should definitely be included in this release & It wasn't a big deal to make the changes here.

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.

4 participants