Close streams
This commit is contained in:
parent
a22a1dd284
commit
0e5a32b476
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user