Disable screenshots in android ics

前端 未结 2 379
隐瞒了意图╮
隐瞒了意图╮ 2020-12-28 23:45

For one of our secure apps, there is a requirement to disable the screenshot capability for the app in Android ICS. Is this possible on a non-rooted device?
Thanks,

相关标签:
2条回答
  • 2020-12-29 00:14

    Why don't you add this line in your activity class. This will do the trick.

    // This disables screen shot to be taken for current activity
    getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
    

    You may want to have a look at Mark Murphy's blog post.

    0 讨论(0)
  • 2020-12-29 00:16

    This will never be possible, period end of story. Its also possible for the owner of the device to obtain any encryption keys used by your application by reading memory using a debugger. This can be used decrypt any "sensitive" imagery used by the app.

    0 讨论(0)
提交回复
热议问题