public class ShellUtils
extends java.lang.Object
date: 2019/8/7 17:02 author: zengfansheng
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ShellUtils.CommandResult
result of command.
|
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
COMMAND_EXIT |
static java.lang.String |
COMMAND_LINE_END |
static java.lang.String |
COMMAND_SH |
static java.lang.String |
COMMAND_SU |
| 构造器和说明 |
|---|
ShellUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ShellUtils.CommandResult |
execCommand(java.util.List<java.lang.String> commands,
boolean isRoot)
execute shell commands
|
static ShellUtils.CommandResult |
execCommand(java.lang.String[] commands,
boolean isRoot)
execute shell commands.
|
static ShellUtils.CommandResult |
execCommand(java.lang.String command,
boolean isRoot)
execute shell command, default return result msg
|
static boolean |
hasRootPermission()
check whether has root permission
|
public static final java.lang.String COMMAND_SU
public static final java.lang.String COMMAND_SH
public static final java.lang.String COMMAND_EXIT
public static final java.lang.String COMMAND_LINE_END
public static boolean hasRootPermission()
public static ShellUtils.CommandResult execCommand(java.lang.String command, boolean isRoot)
command - commandisRoot - whether need to run with rootexecCommand(java.lang.String, boolean)public static ShellUtils.CommandResult execCommand(java.util.List<java.lang.String> commands, boolean isRoot)
commands - command listisRoot - whether need to run with rootexecCommand(java.lang.String, boolean)public static ShellUtils.CommandResult execCommand(java.lang.String[] commands, boolean isRoot)
commands - command arrayisRoot - whether need to run with root