2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

Do not filter logs by PID

So we can see crashes in previous sessions of the app. Also, Android only
lets apps see their own logs anyway (at least in recent versions), so there
should be no privacy concerns from someone sharing those logs.
This commit is contained in:
Albert Vaca Cintora
2025-05-02 17:02:40 +02:00
parent b981f9234b
commit 26c72fae89

View File

@@ -236,8 +236,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
) { uri: Uri? -> ) { uri: Uri? ->
val output = uri?.let { context?.contentResolver?.openOutputStream(uri) } ?: return@registerForActivityResult val output = uri?.let { context?.contentResolver?.openOutputStream(uri) } ?: return@registerForActivityResult
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
val pid = android.os.Process.myPid() val process = Runtime.getRuntime().exec(arrayOf("logcat", "-d"))
val process = Runtime.getRuntime().exec(arrayOf("logcat", "-d", "--pid=$pid"))
val reader = InputStreamReader(process.inputStream) val reader = InputStreamReader(process.inputStream)
output.use { output.use {
it.write("KDE Connect ${BuildConfig.VERSION_NAME}\n".toByteArray(Charsets.UTF_8)) it.write("KDE Connect ${BuildConfig.VERSION_NAME}\n".toByteArray(Charsets.UTF_8))