2

I am looking for a way to share my apps screen content through a secure channel with a server. Using the new MediaProjection library seems to bee a perfect solution.

The problem is, that the app / its views have to be marked as secure.

Is there anyway of making my VirtualDisplay a trusted display or to ignore the secure flag for me as I am the owner of the activity? The goal is to enable me to capture the screen but no-one else.

Thanks,

David

david
  • 662
  • 5
  • 8
  • 1
    My expectation is that SurfaceFlinger will not compose a "secure" layer, and this isn't something you can change, but I haven't looked at the API in a while. But... back up a step. Do you *need* mediaprojection? Do you want a screen grab or a video stream? How is your app doing its rendering? You can capture your own View UI or GLES rendering without MediaProjection, though it can be easier and more efficient with it. – fadden Nov 03 '15 at 17:11
  • If you happen to be writing an app that is a part of a custom ROM or device manufacturer build, you could try `VIRTUAL_DISPLAY_FLAG_SECURE` when creating your `VirtualDisplay`. – CommonsWare Nov 03 '15 at 17:24
  • @fadden Using the MediaProjection would obviously be the easiest solution since I could simply provide my own Surface to the VirtualDisplay and send the content to the server. As of what format I am trying to use. I believe I am not going to use a video stream but png's instead that only get sent if changes occurr to reduce bandwith needed. I have also thought about grabbing the content from the drawing cache, but am afraid that it is very slow... – david Nov 05 '15 at 07:46

0 Answers0