Commit 8ed2dd66 authored by vvb2060's avatar vvb2060 Committed by topjohnwu

Skip query for log files and patched boot file

parent 50305ca1
...@@ -254,14 +254,14 @@ abstract class MagiskInstallImpl : KoinComponent { ...@@ -254,14 +254,14 @@ abstract class MagiskInstallImpl : KoinComponent {
val filename = "magisk_patched_$suffix" val filename = "magisk_patched_$suffix"
outStream = if (magic.contentEquals("ustar".toByteArray())) { outStream = if (magic.contentEquals("ustar".toByteArray())) {
outFile = MediaStoreUtils.getFile("$filename.tar") outFile = MediaStoreUtils.getFile("$filename.tar", true)
handleTar(src, outFile!!.uri.outputStream()) handleTar(src, outFile!!.uri.outputStream())
} else { } else {
// Raw image // Raw image
srcBoot = File(installDir, "boot.img").path srcBoot = File(installDir, "boot.img").path
console.add("- Copying image to cache") console.add("- Copying image to cache")
FileOutputStream(srcBoot).use { src.copyTo(it) } FileOutputStream(srcBoot).use { src.copyTo(it) }
outFile = MediaStoreUtils.getFile("$filename.img") outFile = MediaStoreUtils.getFile("$filename.img", true)
outFile!!.uri.outputStream() outFile!!.uri.outputStream()
} }
} }
......
...@@ -107,7 +107,7 @@ class FlashViewModel( ...@@ -107,7 +107,7 @@ class FlashViewModel(
private fun savePressed() = withExternalRW { private fun savePressed() = withExternalRW {
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
val name = "magisk_install_log_%s.log".format(now.toTime(timeFormatStandard)) 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 -> file.uri.outputStream().bufferedWriter().use { writer ->
logItems.forEach { logItems.forEach {
writer.write(it) writer.write(it)
......
...@@ -62,7 +62,7 @@ class LogViewModel( ...@@ -62,7 +62,7 @@ class LogViewModel(
fun saveMagiskLog() = withExternalRW { fun saveMagiskLog() = withExternalRW {
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
val filename = "magisk_log_%s.log".format(now.toTime(timeFormatStandard)) 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 -> logFile.uri.outputStream().bufferedWriter().use { file ->
file.write("---System Properties---\n\n") file.write("---System Properties---\n\n")
......
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