private static ADBResult ADBShell(string args, bool su = false) { var result = new ADBResult(); using (Process process = new Process()) { process.StartInfo = psi; process.StartInfo.Arguments = $"shell {(su ? "su -c " : "")}\"{args}\""; process.Start(); result.stdout = new StringReader(process.StandardOutput.ReadToEnd()); result.stderr = new StringReader(process.StandardError.ReadToEnd()); process.WaitForExit(30000); } return(result); }
private static ADBResult ADB(string args) { var result = new ADBResult(); using (Process process = new Process()) { process.StartInfo = psi; process.StartInfo.Arguments = args; process.Start(); result.stdout = new StringReader(process.StandardOutput.ReadToEnd()); result.stderr = new StringReader(process.StandardError.ReadToEnd()); process.WaitForExit(30000); } return(result); }