Fork us on GitHub

Disable Screenshot, Copy & Paste

Making app security more aggressive for high risk apps
Disable Screenshot, Copy & Paste

Disable Screenshot, Copy & Paste

Continuing our security trend from the past month we have a couple of new features for Android security that allow us to block the user from taking a screenshot or copying & pasting data from fields. Notice that these features might fail on jailbroken devices so you might want to check for jailbreak/rooting first.

Blocking screenshots is an Android specific feature that can’t be implemented on iOS. This is implemented by classifying the app window as secure and you can do that via the build hint android.disableScreenshots=true. Once that is added screenshots should no longer work for the app, this might impact other things as well such as the task view etc.

We will add the ability to block copy & paste on Android in the coming update. We will add this feature to iOS as we move forward and it should work with the same semantics. You can block copy & paste globally or on a specific field, to block this globally use:

Display.getInstance().setProperty("blockCopyPaste", "true");

To block this on a specific field do:

textCmp.putClientProperty("blockCopyPaste", Boolean.TRUE);
Notice that the inverse of using false might not work as expected
Share this Post:

Posted by Shai Almog

Shai is the co-founder of Codename One. He's been a professional programmer for over 25 years. During that time he has worked with dozens of companies including Sun Microsystems.
For more follow Shai on Twitter & github.