Commit 0e5a32b4 authored by topjohnwu's avatar topjohnwu

Close streams

parent a22a1dd2
...@@ -344,7 +344,9 @@ abstract class MagiskInstallImpl : KoinComponent { ...@@ -344,7 +344,9 @@ abstract class MagiskInstallImpl : KoinComponent {
private suspend fun postOTA(): Boolean { private suspend fun postOTA(): Boolean {
val bootctl = SuFile("/data/adb/bootctl") val bootctl = SuFile("/data/adb/bootctl")
try { try {
service.fetchBootctl().byteStream().copyTo(SuFileOutputStream(bootctl)) withStreams(service.fetchBootctl().byteStream(), SuFileOutputStream(bootctl)) {
it, out -> it.copyTo(out)
}
} catch (e: IOException) { } catch (e: IOException) {
console.add("! Unable to download bootctl") console.add("! Unable to download bootctl")
Timber.e(e) Timber.e(e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment