Android: How can you get framebuffer (screenshot) on rooted device?

£可爱£侵袭症+ 提交于 2019-11-30 07:07:19

Seems to me like your problem is this sign: >. You cannot redirect output using exec. What you need to do is grab the output stream of the process (which is the input stream for you) and store it to file;

process = Runtime.getRuntime().exec("su -c cat /dev/graphics/fb0");
InputStream is = process.getInputStream();
...
Austin Hanson

The answer lies in replicating the way the device itself handles it:

fb = open("/dev/graphics/fb0", O_RDONLY);

check this

This is not an answer. The company I work for did this before, I don't know what they do, but I know you can't get buffer just use one method, it depends on the devices' hardware architecture.

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