I am working on a rooted Android device.
Is there a way to have linux commands executed as superuser without having to invoke
Runtime.getRuntime().exec("su")
every time? What bothers me is the Toast which appears every time saying that the app has been granted superuser permission. The first time I issue a su command a dialog appears and even if I select to remember the choice every time the command is executed I get the Toast.
Nope there is no way while using the default su binary as supplied. Both chainxx and chainfire’s SU apps have options to not have the popup but thats the users choice.
Of course you could always compile your own su binary and use that, it is open source. This could leave to security concerns having a open su binary, users will probably not like this. If you do you will want to do something like how the other su binaries operate in where its checks to see if it your application doing the calling if not refuse operation. But again this is probably not something you should do.