add the logcat writer

This commit is contained in:
altalk23 committed 2023-10-15 16:43:05 +03:00
1 parent e34bfc50a2
commit 92228933b0
4 files changed
+31 -1

No files matched your search

@@ -70,6 +70,27 @@ object GeodeUtils {
}
}
@JvmStatic
fun writeLogcatCrashBuffer(path: String): Boolean {
try {
val logcatProcess = Runtime.getRuntime().exec("logcat -v brief -b crash -d")
val logcatFile = File(path)
logcatFile.outputStream().use { output ->
logcatProcess.inputStream.use { input ->
input.copyTo(output)
}
}
return true
}
catch (e: Exception) {
Log.e("Geode", "Failed to write logcat crash buffer", e)
return false
}
}
@JvmStatic
fun writeClipboard(text: String) {
activity.get()?.run {