Commit d0896984 authored by topjohnwu's avatar topjohnwu

Don't use root for logging getprop

Might contain sensitive info that shouldn't be shared
parent 8ed2dd66
...@@ -18,12 +18,9 @@ import com.topjohnwu.magisk.ktx.timeFormatStandard ...@@ -18,12 +18,9 @@ import com.topjohnwu.magisk.ktx.timeFormatStandard
import com.topjohnwu.magisk.ktx.toTime import com.topjohnwu.magisk.ktx.toTime
import com.topjohnwu.magisk.utils.set import com.topjohnwu.magisk.utils.set
import com.topjohnwu.magisk.view.TextItem import com.topjohnwu.magisk.view.TextItem
import com.topjohnwu.superuser.CallbackList
import com.topjohnwu.superuser.Shell
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.util.concurrent.Executor
class LogViewModel( class LogViewModel(
private val repo: LogRepository private val repo: LogRepository
...@@ -66,13 +63,8 @@ class LogViewModel( ...@@ -66,13 +63,8 @@ class LogViewModel(
logFile.uri.outputStream().bufferedWriter().use { file -> logFile.uri.outputStream().bufferedWriter().use { file ->
file.write("---System Properties---\n\n") file.write("---System Properties---\n\n")
val fileList = object : CallbackList<String>(Executor { it.run() }) { ProcessBuilder("getprop").start()
override fun onAddElement(e: String) { .inputStream.reader().use { it.copyTo(file) }
file.write(e)
file.newLine()
}
}
Shell.su("getprop").to(fileList).exec()
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")
......
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