Skip to content

Commit 5f79695

Browse files
committed
[Fix] Fix crash when su shell isn't launched successfully.
1 parent 254d39c commit 5f79695

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/src/main/java/me/zhanghai/android/files/provider/root/RootFileService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ private static Shell.Interactive launchSuShell() throws RemoteFileSystemExceptio
141141
});
142142
shell.waitForIdle();
143143
if (!successfulHolder[0]) {
144-
shell.close();
144+
if (shell.isRunning()) {
145+
shell.closeImmediately();
146+
}
145147
throw new RemoteFileSystemException("Cannot launch su shell, exit code: "
146148
+ exitCodeHolder[0]);
147149
}

0 commit comments

Comments
 (0)