Skip to content

Commit

Permalink
Fix new non-root shell crash
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Jan 20, 2018
1 parent fa5e659 commit ab447b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions superuser/src/main/java/com/topjohnwu/superuser/Shell.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ private static void testShell(Shell shell) throws IOException {
shell.STDIN.flush();
String s = new BufferedReader(new InputStreamReader(shell.STDOUT)).readLine();
if (TextUtils.isEmpty(s) || !s.contains("SHELL_TEST")) {
shell.close();
throw new IOException();
}
}
Expand All @@ -96,7 +95,6 @@ private static void testRootShell(Shell shell) throws IOException {
shell.STDIN.flush();
String s = new BufferedReader(new InputStreamReader(shell.STDOUT)).readLine();
if (TextUtils.isEmpty(s) || !s.contains("uid=0")) {
shell.close();
throw new IOException();
}
}
Expand Down Expand Up @@ -150,6 +148,7 @@ private static Shell getShell(ShellContainer container) throws NoShellException
} catch (IOException e) {
// Shell initialize failed
Utils.stackTrace(e);
shell = null;
}
}

Expand All @@ -167,6 +166,7 @@ private static Shell getShell(ShellContainer container) throws NoShellException
} catch (IOException e) {
// Shell initialize failed
Utils.stackTrace(e);
shell = null;
}
}

Expand Down

0 comments on commit ab447b2

Please sign in to comment.