Since Android Jelly Bean doesn’t support the logs reading permission (according to this google io 2012 video and this one too ) , i would like to know if it’s possible for rooted devices (or non-rooted devices) to be able to bypass this restriction and be able to read the logs.
How do i do that? Do i really need to make the app a system app, or is rooting enough?
You can obtain the permission on a rooted device by executing the pm grant command from your app. Probably you will have to restart the app after that for the change to take effect, though:
This code should be called from your onCreate(). Once the permission is granted, no more root powers are required.
P.S: The p.waitFor() blocks on the Superuser app, delaying your app start and potentially cause an ANR.