Close streams
This commit is contained in:
parent
a22a1dd284
commit
0e5a32b476
@ -344,7 +344,9 @@ abstract class MagiskInstallImpl : KoinComponent {
|
||||
private suspend fun postOTA(): Boolean {
|
||||
val bootctl = SuFile("/data/adb/bootctl")
|
||||
try {
|
||||
service.fetchBootctl().byteStream().copyTo(SuFileOutputStream(bootctl))
|
||||
withStreams(service.fetchBootctl().byteStream(), SuFileOutputStream(bootctl)) {
|
||||
it, out -> it.copyTo(out)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
console.add("! Unable to download bootctl")
|
||||
Timber.e(e)
|
||||
|
Loading…
Reference in New Issue
Block a user