Package com.wireguard.android.util
Class RootShell
- java.lang.Object
-
- com.wireguard.android.util.RootShell
-
public class RootShell extends java.lang.Object
Helper class for running commands as root.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RootShell.RootShellException
-
Constructor Summary
Constructors Constructor Description RootShell(android.content.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
run(java.util.Collection<java.lang.String> output, java.lang.String command)
Run a command in a root shell.void
start()
void
stop()
-
-
-
Method Detail
-
run
public int run(@Nullable java.util.Collection<java.lang.String> output, java.lang.String command) throws java.io.IOException, RootShell.RootShellException
Run a command in a root shell.- Parameters:
output
- Lines read from stdout are appended to this list. Pass null if the output from the shell is not important.command
- Command to run as root.- Returns:
- The exit value of the command.
- Throws:
java.io.IOException
RootShell.RootShellException
-
start
public void start() throws java.io.IOException, RootShell.RootShellException
- Throws:
java.io.IOException
RootShell.RootShellException
-
stop
public void stop()
-
-