Skip to content

Commit

Permalink
Strip invalid characters from logcat filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Feb 15, 2025
1 parent 6610e3c commit a949fb0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ object Debug {
}

private fun writeLogcat(subject: String, logText: String) {
FileOutputStream(File(Storage.getDownloadDir(null), "${subject}-${System.currentTimeMillis()}.txt")).use {
val fileName = "${subject.replace(":", "")}.${System.currentTimeMillis()}.txt"
FileOutputStream(File(Storage.getDownloadDir(null), fileName)).use {
it.write(logText.toByteArray())
}
}
Expand Down

0 comments on commit a949fb0

Please sign in to comment.