问题
when I use this code
Runtime.getRuntime().exec("su").
and listen to the ErrorStream it gives me back: Permission denied. However SuperUser successfully grants permissions. Any Ideas?
回答1:
You need to add to your AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>
回答2:
My ROM was messed up. I had to reinstall it. Adding a permission should NOT help. Edit: SuperUser is now giving warning if you don't define the permission, how ever it will still grant su.
来源:https://stackoverflow.com/questions/11283002/execsu-permission-denied