-1

The task is: Prevent the ability to take screenshots on an 6.0.x android OS globally. What I mean by "globally" is to exclude that function and block it completely so that even if the device is to be infected with a screenshot-taking malware it should not be able to do so. I am interested in screenshot-prevention in all apps and even when no apps are running, everywhere. Thanks in advance!

upd. I am really sorry if that question is not stated clearly but I thought I could find some help here at least some points in the direction I should look for. I think this question will be useful for others too if answered.

  • As long as the malware/app has not root access, the command wm screen-capture 0 false would do the job on Android 6.0.x. – Firelord Oct 12 '16 at 15:24
  • Thanks. Where should I execute that? In the console? – DedToto Oct 12 '16 at 15:32
  • I have a rooted device and still in the console it says "java.lang.SecurityException: Only system can call ScreenCaptureDisabled." – DedToto Oct 12 '16 at 15:40
  • Do su 1000 -c 'wm screen-capture 0 false'. – Firelord Oct 12 '16 at 15:58
  • Big thanks! One more question please: In order to reverse that command an attacker needs root access? And in case I have an Xposed module that sets permission for each and every new app manually this is less likely to happen? – DedToto Oct 12 '16 at 16:12
  • No. You only need system level permissions (can be gained, albeit extremely hard, by exploiting a vulnerability) to reverse that command. Did you notice 1000 in that command? It implies execute the following command as User 1000 (System user). As for the Xposed module such as XPrivacy, yes you can decrease the attack vector considerably. – Firelord Oct 12 '16 at 16:21
  • Then that is all I wanted to know. The only thing I could do is to prevent the ability to use that "exploit" you mentioned if that is possible but if that requires a lot of your time to explain and is extremely complex to do then I just don't have a right to bother you anymore. Again, thanks for your answer that problem really worried me for weeks now and now I was able to finally breath a sigh of relief. – DedToto Oct 12 '16 at 16:25
  • It would be good if you accepted the answer provided by @Firelord, as that seems to meet your needs fully. You can do that by clicking the green Arrow below the up/down votes on the left of answer. Acceptance indicates that it helped you and would show the same for future visitors with same problem – beeshyams Oct 13 '16 at 08:47

1 Answers1

1

If the Android is rooted and is version 6.0 or above, then using console or , execute:

su 1000 -c 'wm screen-capture 0 false'

where:

  • su 1000 -c - switch to user with ID 1000 (System user) and execute the following command
  • 0 - user ID of the primary user of the device.

Now, whenever you or any app would attempt to capture the screenshot using the standard means in Android, a notification with title Couldn't capture screenshot would show up.

However, as long has the malware/app can gain root access or system level privilege or becomes a member of the user group graphics (through an exploit or other means), all restrictions would be in vain since the malware/app can access framebuffer. For details, follow: Why do we need a rooted phone to capture screenshots on older versions of Android?

Firelord
  • 25,084
  • 20
  • 124
  • 286
  • Thanks. It worked perfectly but I have another related question: I've executed that command but right after the phone restart it doesn't work anymore and I have to type it in again. Is there a way to execute it at OS startup? – DedToto Oct 12 '16 at 16:44
  • You can use an automation app, such as Tasker to do that for you. And thanks for mentioning that issue. I wasn't aware of it. – Firelord Oct 12 '16 at 16:51
  • Yeah I just realised how serious is that problem when I witnessed a court case where such screenshots were brought as evidence against a man that used a secure chat and message trimmering. – DedToto Oct 12 '16 at 16:58