Disable screenshots in android ics

2019-02-02 21:06发布

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,
Rajath

2条回答
够拽才男人
2楼-- · 2019-02-02 21:38

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.

查看更多
爷的心禁止访问
3楼-- · 2019-02-02 21:45

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.

查看更多
登录 后发表回答