mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-30 13:35:27 +00:00
Add mount info to log file
This commit is contained in:
parent
e990ffd4a0
commit
2cbc048352
@ -21,6 +21,7 @@ import com.topjohnwu.magisk.view.TextItem
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
import java.io.FileInputStream
|
||||||
|
|
||||||
class LogViewModel(
|
class LogViewModel(
|
||||||
private val repo: LogRepository
|
private val repo: LogRepository
|
||||||
@ -62,10 +63,12 @@ class LogViewModel(
|
|||||||
val logFile = MediaStoreUtils.getFile(filename, true)
|
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")
|
||||||
|
|
||||||
ProcessBuilder("getprop").start()
|
ProcessBuilder("getprop").start()
|
||||||
.inputStream.reader().use { it.copyTo(file) }
|
.inputStream.reader().use { it.copyTo(file) }
|
||||||
|
|
||||||
|
file.write("---System MountInfo---\n\n")
|
||||||
|
FileInputStream("/proc/self/mountinfo").reader().use { it.copyTo(file) }
|
||||||
|
|
||||||
file.write("\n---Magisk Logs---\n")
|
file.write("\n---Magisk Logs---\n")
|
||||||
file.write("${Info.env.magiskVersionString} (${Info.env.magiskVersionCode})\n\n")
|
file.write("${Info.env.magiskVersionString} (${Info.env.magiskVersionCode})\n\n")
|
||||||
file.write(consoleText)
|
file.write(consoleText)
|
||||||
|
Loading…
Reference in New Issue
Block a user