Fix props reader (#1374)

* [core] Fix read props

Co-authored-by: LoveSy <shana@zju.edu.cn>
This commit is contained in:
Howard Wu 2021-11-08 16:58:37 +08:00 committed by GitHub
parent 6475dc86a0
commit 91426fc35c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -126,7 +126,11 @@ public class LogcatService implements Runnable {
exec.write(untrusted.getBytes());
}
try (var rd = new BufferedReader(new InputStreamReader(new ProcessBuilder(sh, "-c", "getprop").start().getInputStream()))) {
sb.append(rd.readLine());
String line;
while ((line = rd.readLine()) != null) {
sb.append(line);
sb.append(System.lineSeparator());
}
}
} catch (IOException e) {
Log.e(TAG, "GetProp: " + e + ": " + Arrays.toString(e.getStackTrace()));