I would like to present my situation first, I am making a kernel tweaker which passes various shell commands using Runtime.getRuntime().exec(...)
, it does the work well, but the problem is that su permission is asked every time I run a shell command with su in it.
I want the app to ask permission only once and then execute all the commands without asking for su again. Currently my application has about 30 lines with su commands, so my app user has to allow su access 30 times in order to get everything working.
I solved this by, using the same interface for my root calls in the Async Task, initally I was using methods individually as and when required in the Fragment, which caused permissions to be asked again and again. Bu then on changing it to one standard exec method, and using this to make system calls everytime. It fixed the error.