Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I realize in order to capture screenshots of my phone, all screenshot applications require I have a rooted phone. Why is this so? Why can't we have a simple screenshot application for Android, just like we have for Windows?

share|improve this question
2  
I have always found it interesting that the iPhone implements this feature out of the box while it is a major affair to enable on Android. –  shambleh Jun 27 '11 at 12:27

3 Answers 3

up vote 14 down vote accepted

The answer is rather simple, it's a permissions issue.

Android uses what is called a framebuffer for the video display. The framebuffer is located at /dev/graphics/fb0. this "file", which is basically a stream that the device writes to when changes in the user interface occur, contains ~2 frames of the screen display.

The permissions on the framebuffer file is rw- rw- ---. Note that the last "group" has 3 "-"'s. That basically means that if you are not the owner (which is root) you do not have permission to even read from that file.

If there was a system installed application, that could take screenshots, it would have permission to read from the framebuffer. Which, I believe, is how the Motorola Xoom is able to take screenshots. It has an application installed on the device, as a system app.

Reading the framebuffer, for a developer, is actually simple, if they have access to read it.

share|improve this answer
1  
Sounds like Google should update the permissions into r--. This may create a security risk if any app can spy on your screen, but wouldn't it just be one of the permissions (This app can monitor your screen) you have to accept before installing? Either that or Google should add a built in screen capture in the menu fly-out, then no one else gets access to it. The latter my very well be the case, I mean they just now are adding print-preview to Chrome. –  JD Isaacks Jun 27 '11 at 19:59
3  
I think mod of o+r would be a security concern if just any market app could read the screen. –  kzh Jun 28 '11 at 0:26
    
I think it depends. Windows OS does not prevent applications from taking its screen shoot. So far, have we heard any security issues caused by screen shoot? –  Cheok Yan Cheng Jun 28 '11 at 7:21
    
Don't need to take screenshots in windows, there are far easier ways to get data off a windows machine. Mobile, i think, is a bigger concern. Just think about apps like Square, that processes credit cards. If I wrote a service that listened for when the card was swiped, I could possible do a screen grab and pull information like credit card number, name, etc. –  Ryan Conrad Jun 28 '11 at 13:28

Due to Android's security focus on separating all apps from each others' data, to prevent malicious apps from stealing or altering data in apps that you trust, they can't allow an app to take screenshots of other apps.

Think about how many of your apps are able to do things like OCR to translate pictures into text, I can think of at least four apps on my phone that can do this, prime example is Google Goggles OCRing book titles, and also OCRing and then translating blocks of text in foreign languages. Now think about how many of your apps put text on screen that you wouldn't want an untrustworthy app to see, I have a password database app on my phone with an encrypted database of my passwords for various systems, a malicious screensaver app could wait until that password app's running, take a picture of the screen with the login details on it, then OCR them and send them off. It could also do the same for everything in your Contacts list, even if you don't give the app permission to your Contacts database, or your browser history, or chat logs and so on. This is only one way that it could abuse access to your screen.

This is why for screenshotting to be universal it needs to be in the OS (which you already trust with all your data). This is why on phones that do have the screen shot function built-in it's been added as part of the system, not as a separate app.

If you root your phone and allow an app to take screenshots, then you are effectively saying that you implicitly trust that app to be able to do everything that the system can do, including accessing and interfering with other apps and their data, and that you totally trust it not to abuse that access. That's not something that Android's ever going to allow anything except the System/OS to do.

share|improve this answer

Short answer: Because 1) computers are Complicated and 2) the screenshot functionality is actually not very simple (for the programmer, not for the user).

In other words, taking a screenshot requires the screenshotting process to hook pretty deep into the OS internals, mess with them for a bit, and unhook again. Since Android tries to have a built-in security model (as opposed to the "bolted-on afterthought" seen in Windows), taking a screenshot trips on several security barriers. Those can be bypassed, but the only currently practical way (short of creating holes - and potential vulnerabilities - in the kernel) is to use the all-powerful root account, which is not subject to the limitations.

share|improve this answer
1  
I don't know much about computer hardware works, but I assume the GPU sends an "image" to the screen. Couldn't that image be intercepted and saved? –  JD Isaacks Jun 27 '11 at 17:38
2  
@John Isaacks, that is basically what happens with the framebuffer. see my answer as to why it still requires root. –  Ryan Conrad Jun 27 '11 at 18:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.