[ROOT][QUESTION] How can an app use root in an eng build?

Search This thread

Slashazard

Member
Oct 5, 2010
34
4
Boise, ID
I am writing an app for my Pixel that calls a binary that need root to run effectively. I am currently running an eng build that I build from aosp with root access (lunch aosp_saifish-eng). I am able to run my binary in root shell through adb. However, when I try to kick it off from an app that I wrote in Android Studio, I get a permission denied error. I am calling for root using this code:

Process rootProcess = Runtime.getRuntime().exec("su");

Is there a way for an app to use su without the help of a root management app like SuperSU? Perhaps my understanding of root is lacking. I would appreciate any help or direction as to where to go to learn more about why this is not working.
 

Fed2x

Senior Member
Dec 12, 2016
70
23
I am writing an app for my Pixel that calls a binary that need root to run effectively. I am currently running an eng build that I build from aosp with root access (lunch aosp_saifish-eng). I am able to run my binary in root shell through adb. However, when I try to kick it off from an app that I wrote in Android Studio, I get a permission denied error. I am calling for root using this code:

Process rootProcess = Runtime.getRuntime().exec("su");

Is there a way for an app to use su without the help of a root management app like SuperSU? Perhaps my understanding of root is lacking. I would appreciate any help or direction as to where to go to learn more about why this is not working.
Yes, adb. Just google for something like: adb grant root



Sent from my ONEPLUS A3003 using Tapatalk