From 8908605767603a28bc46d1f88dd91d485e09b05a Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 24 Jul 2020 03:38:45 +0800 Subject: [PATCH] Prevent future write attempts to System.out --- mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt b/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt index 50f28a4a..859caac9 100644 --- a/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt +++ b/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt @@ -445,6 +445,7 @@ class RootServer @JvmOverloads constructor(private val warnLogger: (String) -> U writer.appendln(args[0]) // echo ready signal writer.flush() }) + System.setOut(System.err) // prevent future write attempts to System.out // thread safety: usage of input should be in main thread val input = DataInputStream(System.`in`.buffered()) var counter = 0L