Skip query for log files and patched boot file

This commit is contained in:
vvb2060 2020-12-09 21:03:49 +08:00 committed by topjohnwu
parent 50305ca1fe
commit 8ed2dd6687
3 changed files with 4 additions and 4 deletions

View File

@ -254,14 +254,14 @@ abstract class MagiskInstallImpl : KoinComponent {
val filename = "magisk_patched_$suffix"
outStream = if (magic.contentEquals("ustar".toByteArray())) {
outFile = MediaStoreUtils.getFile("$filename.tar")
outFile = MediaStoreUtils.getFile("$filename.tar", true)
handleTar(src, outFile!!.uri.outputStream())
} else {
// Raw image
srcBoot = File(installDir, "boot.img").path
console.add("- Copying image to cache")
FileOutputStream(srcBoot).use { src.copyTo(it) }
outFile = MediaStoreUtils.getFile("$filename.img")
outFile = MediaStoreUtils.getFile("$filename.img", true)
outFile!!.uri.outputStream()
}
}

View File

@ -107,7 +107,7 @@ class FlashViewModel(
private fun savePressed() = withExternalRW {
viewModelScope.launch(Dispatchers.IO) {
val name = "magisk_install_log_%s.log".format(now.toTime(timeFormatStandard))
val file = MediaStoreUtils.getFile(name)
val file = MediaStoreUtils.getFile(name, true)
file.uri.outputStream().bufferedWriter().use { writer ->
logItems.forEach {
writer.write(it)

View File

@ -62,7 +62,7 @@ class LogViewModel(
fun saveMagiskLog() = withExternalRW {
viewModelScope.launch(Dispatchers.IO) {
val filename = "magisk_log_%s.log".format(now.toTime(timeFormatStandard))
val logFile = MediaStoreUtils.getFile(filename)
val logFile = MediaStoreUtils.getFile(filename, true)
logFile.uri.outputStream().bufferedWriter().use { file ->
file.write("---System Properties---\n\n")