You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
18 lines
438 B
Kotlin
18 lines
438 B
Kotlin
package com.topjohnwu.magisk.tasks
|
|
|
|
import android.content.Context
|
|
import android.net.Uri
|
|
import com.topjohnwu.magisk.utils.get
|
|
import com.topjohnwu.magisk.utils.readUri
|
|
import java.io.File
|
|
|
|
object InstallerHelper {
|
|
@JvmStatic
|
|
fun copyFileTo(uri: Uri, zip: File) {
|
|
zip.deleteRecursively()
|
|
|
|
get<Context>().readUri(uri).use { input ->
|
|
zip.outputStream().use { out -> input.copyTo(out) }
|
|
}
|
|
}
|
|
} |