Disable screenshots in android ics

谁说我不能喝 提交于 2019-12-18 11:42:59

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/9257210/disable-screenshots-in-android-ics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!