简体   繁体   中英

How to capture a screenshot of other Android applications from an app without root?

I want to capture a screen shot of Android applications that are running on my phone.

I tried using the ScreenShot UX application. This can be done on an unrooted phone also. Any idea of how to get the screen shot of the application in Android from a service that runs in the background?

I want my Service to capture screen periodically and send to a server.

The only way to take a screenshot of an app that is not your own is by getting the raw framebuffer. The framebuffer is usually located at /dev/fb0 or /dev/graphics/fb0 . On some devices (like an LG Optimus One) this can be accessed without root privileges, but on the majority (like a Nexus S) of them you need to be rooted for this. This is usually not allowed for security reasons, as a malicious app could take screenshots in the background and send them to a remote server, revealing information like email IDs and passwords, and in some cases bank account details.

查看Android-screenshot-library ,可以编程方式从Android设备捕获屏幕截图,而无需具有root访问权限。

As of Android 5.0+, you can use the new functionality in the SDK called media projections to do screen capture without root privileges. There is sample code by Google available here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM