linux - Android Screenshot and Screencap Permissions -


i'm trying take screensshot on adb logged root , i'm getting "permission denied" error.

screenshot -i /sdcard/screen.png error: writing file /sdcard/screen.png: permission denied 

but if use screencap works.

screencap -p /sdcard/screen.png 

why happening ?

according source code screenshot sets uid aid_shell (shell user) before writing file:

/* switch non-root user , group */ gid_t groups[] = { aid_log, aid_sdcard_rw }; setgroups(sizeof(groups)/sizeof(groups[0]), groups); setuid(aid_shell);  png = fopen(outfile, "w"); if (!png) {     fprintf(stderr, "error: writing file %s: %s\n",             outfile, strerror(errno));     exit(1); } 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -