Rewrite root shell

This commit is contained in:
topjohnwu
2017-07-16 01:20:39 +08:00
parent cc14a1c361
commit 87ea2a2bef
17 changed files with 159 additions and 255 deletions
@@ -1,5 +1,7 @@
package com.topjohnwu.magisk.utils;
import android.text.TextUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -43,10 +45,10 @@ public class StreamGobbler extends Thread {
try {
String line;
while ((line = reader.readLine()) != null) {
if (TextUtils.equals(line, "-root-done-"))
return;
writer.add(line);
if (!line.equals("-root-done-") && !line.isEmpty()) {
Logger.shell(isRoot, "OUT: " + line);
}
Logger.shell(isRoot, "OUT: " + line);
}
} catch (IOException e) {
// reader probably closed, expected exit condition