Magisk Update checker use prefs listener

This commit is contained in:
topjohnwu
2016-09-28 18:05:55 +08:00
parent cb5187fd8d
commit 0acc5e33b3
11 changed files with 411 additions and 276 deletions

View File

@@ -164,9 +164,9 @@ public class Shell {
STDOUT.join();
process.destroy();
} else {
STDIN.write(("echo \' \'\n").getBytes("UTF-8"));
STDIN.write(("echo\n").getBytes("UTF-8"));
STDIN.flush();
STDIN.write(("echo \'-done-\'\n").getBytes("UTF-8"));
STDIN.write(("echo \'-root-done-\'\n").getBytes("UTF-8"));
STDIN.flush();
while (true) {
try {
@@ -177,9 +177,11 @@ public class Shell {
// Process still running, gobble output until done
int end = res.size() - 1;
if (end > 0) {
if (res.get(end).equals("-done-")) {
if (res.get(end).equals("-root-done-")) {
res.remove(end);
res.remove(end - 1);
if (res.get(end -1).isEmpty()) {
res.remove(end -1);
}
break;
}
}