Skip to content

Commit f2965af

Browse files
authored
Merge pull request #82 from LeanBitLab/security/fix-runtime-exec-logcat-5297808077530496987
🔒 Fix: Migrate Runtime.exec to ProcessBuilder for secure execution in AboutScreen
2 parents e37a19b + bde6d16 commit f2965af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/src/main/java/helium314/keyboard/settings/screens/AboutScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fun createAboutSettings(context: Context) = listOf(
169169
scope.launch(Dispatchers.IO) {
170170
ctx.getActivity()?.contentResolver?.openOutputStream(uri)?.use { os ->
171171
os.writer().use { writer ->
172-
val logcat = Runtime.getRuntime().exec("logcat -d -b all *:W").inputStream.use { it.reader().readText() }
172+
val logcat = ProcessBuilder("logcat", "-d", "-b", "all", "*:W").start().inputStream.use { it.reader().readText() }
173173
val internal = Log.getLog().joinToString("\n")
174174
writer.write(logcat + "\n\n" + internal)
175175
}

0 commit comments

Comments
 (0)