Android screen capture with root (service or background thread ) -
there app capture screen when shark android phone .
1)when app on active , capture screen without root .
2)when app stack , return home, need root permission capture screen .
i want know implement function 2) root permission .
in mind, root permission means root shell, flush command , exec . confuse how capture screen in shell command .
if have root or shell permission, can use either screenshot or screencap command, reference:
root@android:/system/bin # screenshot -h unknown option -- husage: screenshot [-s soundfile] filename.png -s: play sound effect signal success -i: autoincrement avoid overwriting filename.png root@android:/system/bin # screencap -h usage: screencap [-hp] [-d display-id] [filename] -h: message -p: save file png. -d: specify display id capture, default 0. if filename ends .png saved png. if filename not given, results printed stdout.
if device not have these program in native, can write 1 yourself. source code here: https://android.googlesource.com/platform/frameworks/base/+/master/cmds/screencap/screencap.cpp
Comments
Post a Comment