1

I'm trying to capture screenshots in my android app using MediaProjection by creating VirtualDisplay. It's working fine except in some banking or streaming apps where I get a black screen. I know that it's because in those apps SECURE_FLAG is applied.

My question is, How to detect in my app that the app I'm trying to screenshot has SECURE_FLAG?

Divyang M
  • 101
  • 1
  • 5
  • If the screenshot is all black or all white, it was a secure app. If you're looking to work around this- you can't, and if you find a way Google will block it as soon as it finds out. This feature is to protect passwords and personal information. – Gabe Sechan Jun 15 '22 at 05:28
  • But is it possible to check before capturing a screenshot so I can show a notification or something that "Screenshot is not possible because of app security" – Divyang M Jun 15 '22 at 05:40
  • I am not sure how to detect what package has the secure content, but you need the permission android.permission.CAPTURE_SECURE_VIDEO_OUTPUT to capture the event. – Rajat Gupta Dec 23 '22 at 19:52
  • I didn't find any solution for this but I just check if the screenshot is 92% blank then I determine that the app has a SECURE_FLAG. – Divyang M Feb 21 '23 at 04:36

0 Answers0