global toggle for allowing screenshots when they disabled by apps without losing the other properties of secure views
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/
I hope this feature will be implemented soon
Is there any update available on this? Anyone willing to take it up?
Does GrapheneOS have an issue bounty system where people can commit a donation for specific issues being implemented?
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.
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 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.
Would be a nice feature. Maybe a per-app toggle will be better?
I hope we get this feature as soon as possible.
It seems like the feature is ready, but not released https://github.com/GrapheneOS/platform_packages_apps_Settings/pull/209
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?
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.
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?
It would likely be fine as long as it's properly tested and then goes through serious review to make sure it's fine.
Any news on this @nycex ?
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.
Just adding a comment to bump this, as I'd very much like to see this one implemented. Thanks all for your effort.
Also bumping this
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.
@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?
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.
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.