Don't use root for logging getprop
Might contain sensitive info that shouldn't be shared
This commit is contained in:
parent
8ed2dd6687
commit
d089698475
@ -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(
|
|||||||
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")
|
||||||
|
Loading…
Reference in New Issue
Block a user