os-issue-tracker icon indicating copy to clipboard operation
os-issue-tracker copied to clipboard

global toggle for allowing screenshots when they disabled by apps without losing the other properties of secure views

Open emanuelb opened this issue 4 years ago • 1 comments

from twitter thread answers by GrapheneOS: https://twitter.com/GrapheneOS/status/1440759314428297216

It's important to support it but there's zero problem with adding a way to override the screenshot aspect of it. It just hasn't been implemented. We have no problem with adding a per-app toggle for that or perhaps simply a global toggle though. Someone has to submit clean patch. GrapheneOS would have to add a per-app toggle for ignoring it.

and newer tweet https://twitter.com/GrapheneOS/status/1603067211257872384

It's not a permission. Android apps can mark a view as 'secure' which disables thumbnailing for recent apps, screenshots, drawing over it and various other things. We plan to eventually provide a toggle to disable the part of this which disables taking screenshots. Low priority.

looked at how screenshots disable happen by apps:

  • using FLAG_SECURE on activity https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_SECURE
  • with setScreenCaptureDisabled Api https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#setScreenCaptureDisabled%28android.content.ComponentName,%20boolean%29
  • is there other ways?

Regarding where and which change to apply in code to override the screenshot disable, not sure, need to search & read more code to know, maybe somewhere in (screenshot/contentcapture related code): https://github.com/GrapheneOS/platform_frameworks_base/tree/0c0c3352036432e2caea4b1e8957d102906d68d1/core/java/android/view/contentcapture https://github.com/GrapheneOS/platform_frameworks_base/tree/0c0c3352036432e2caea4b1e8957d102906d68d1/packages/SystemUI/src/com/android/systemui/screenshot

looked at other "solutions" for this problem, like overriding the setFlags calls to remove the added SECURE_FLAG: https://www.securify.nl/en/blog/android-frida-hooking-disabling-flagsecure/ https://github.com/veeti/DisableFlagSecure/blob/fd8833a10a1544324f3301f647e74beee9cac58a/src/main/java/fi/veetipaananen/android/disableflagsecure/DisableFlagSecureModule.java https://forum.xda-developers.com/t/module-smali-patcher-7-4.3680053/

emanuelb avatar Sep 24 '21 00:09 emanuelb

I hope this feature will be implemented soon

System32ita avatar Apr 16 '24 22:04 System32ita

Is there any update available on this? Anyone willing to take it up?

stevenroose avatar Dec 05 '24 23:12 stevenroose

Does GrapheneOS have an issue bounty system where people can commit a donation for specific issues being implemented?

stevenroose avatar Dec 05 '24 23:12 stevenroose

Is there any update available on this?

No, and please don't ask for updates.

Does GrapheneOS have an issue bounty system where people can commit a donation for specific issues being implemented?

No, especially with issues which occurred with people doing it informally in the past and then getting upset about what was implemented.

thestinger avatar Dec 06 '24 01:12 thestinger

for some reason its possible to create screenshots in all apps as well as on home- and lockscreen by pressing power and vol down simultaneously.

tested in some Banking apps (DKB, Traderepublic) and ProtonMail, which don't allow regular screenshots.

grgpw avatar Jan 22 '25 17:01 grgpw

@grgpw Yes, but the protected apps are still blank on the screenshots. Tested with Firefox private mode; in the app itself, in the overview of open apps, and in split screen mode.

johnnynoone avatar Jan 25 '25 15:01 johnnynoone

Would be a nice feature. Maybe a per-app toggle will be better?

antonio0831 avatar May 25 '25 02:05 antonio0831

I hope we get this feature as soon as possible.

hasanbahadirkoca avatar Jun 17 '25 08:06 hasanbahadirkoca

It seems like the feature is ready, but not released https://github.com/GrapheneOS/platform_packages_apps_Settings/pull/209

Anti27 avatar Jun 30 '25 02:06 Anti27

It seems like the feature is ready, but not released GrapheneOS/platform_packages_apps_Settings#209

That PR is huge and has been open for years, not sure how likely it is to get merged?

kernitus avatar Jul 15 '25 10:07 kernitus

There's currently no pending pull request with an up-to-date and correct implementation of this feature. That PR is nowhere close to being something we can merge.

thestinger avatar Jul 15 '25 15:07 thestinger

Would the PRs be fine if I updated them (https://github.com/GrapheneOS/platform_packages_apps_Settings/pull/209/commits/fd5417fdeaf5cbda017f3c56a8f472fb451137dc, https://github.com/nycex/platform_frameworks_base/commit/3d4dcc04f7ba2c703b1f95eec78d1ed205d07eba) to the up-to-date branch (16) of the respective projects or is there something that they lack fundamentally?

nycex avatar Jul 15 '25 21:07 nycex

It would likely be fine as long as it's properly tested and then goes through serious review to make sure it's fine.

thestinger avatar Jul 15 '25 21:07 thestinger

Any news on this @nycex ?

BreakSecurity avatar Oct 12 '25 16:10 BreakSecurity

I'm currently a bit occupied, but feel free to pick up my PRs in the meantime. It's just a few lines of code, the bulk of the work is getting the development environment and testing the changes.

nycex avatar Oct 12 '25 18:10 nycex

Just adding a comment to bump this, as I'd very much like to see this one implemented. Thanks all for your effort.

aurocha avatar Oct 23 '25 12:10 aurocha

Also bumping this

LaBlazer avatar Oct 25 '25 12:10 LaBlazer

Please use the thumbs up reaction instead of leaving comments. It sends an email to all of the developers. It doesn't make the issue move in the list which is purely chronological.

thestinger avatar Oct 25 '25 12:10 thestinger

@nycex sorry for the mention I was looking through the PRs and got lost a bit. Seems like you implement the toogle on the Settings app here: https://github.com/GrapheneOS/platform_packages_apps_Settings/pull/209/commits/fd5417fdeaf5cbda017f3c56a8f472fb451137dc

But there are two actual commits for the frameworks base.

I don't know if one of them is an scrapped way of doing it since it seems to check for ALLOW_SCREENCAPTURE_DETECTION: https://github.com/GrapheneOS-Archive/platform_frameworks_base-old/pull/463/commits/4bcf215ec648d74a8dbcaed2e34867c3f454fc9e

but you ended naming it ALLOW_SCREENSHOT_SECURE which is the one used here: https://github.com/GrapheneOS-Archive/platform_frameworks_base-old/pull/467/commits/3d4dcc04f7ba2c703b1f95eec78d1ed205d07eba

Which ones are actually needed?

Eskuero avatar Oct 31 '25 12:10 Eskuero

Well I made PRs for both allowing screenshots when apps block it and for stopping apps from detecting when they are screenshotted. As this PR is about the former, ALLOW_SCREENSHOT_SECURE should be relevant.

nycex avatar Oct 31 '25 14:10 nycex

Unfortunately, those commits don't apply cleanly anymore. I am currently working on implementing this, by merging it with https://github.com/GrapheneOS/os-issue-tracker/issues/2931 so it can all be controlled by one setting.

Inhishonor avatar Oct 31 '25 16:10 Inhishonor