Package com.wireguard.android.util
Class RootShell
- java.lang.Object
-
- com.wireguard.android.util.RootShell
-
public class RootShell extends java.lang.ObjectHelper class for running commands as root.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRootShell.RootShellException
-
Constructor Summary
Constructors Constructor Description RootShell(android.content.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intrun(java.util.Collection<java.lang.String> output, java.lang.String command)Run a command in a root shell.voidstart()voidstop()
-
-
-
Method Detail
-
run
public int run(@Nullable java.util.Collection<java.lang.String> output, java.lang.String command) throws java.io.IOException, RootShell.RootShellExceptionRun 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.IOExceptionRootShell.RootShellException
-
start
public void start() throws java.io.IOException, RootShell.RootShellException- Throws:
java.io.IOExceptionRootShell.RootShellException
-
stop
public void stop()
-
-