That fuck shit the fascists are using
1package org.tm.archive.logsubmit;
2
3import android.content.Context;
4
5import androidx.annotation.NonNull;
6
7import java.io.BufferedReader;
8import java.io.IOException;
9import java.io.InputStreamReader;
10
11public class LogSectionLogcat implements LogSection {
12
13 @Override
14 public @NonNull String getTitle() {
15 return "LOGCAT";
16 }
17
18 @Override
19 public @NonNull CharSequence getContent(@NonNull Context context) {
20 try {
21 final Process process = Runtime.getRuntime().exec("logcat -d");
22 final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
23 final StringBuilder log = new StringBuilder();
24 final String separator = System.getProperty("line.separator");
25
26 String line;
27 while ((line = bufferedReader.readLine()) != null) {
28 log.append(line);
29 log.append(separator);
30 }
31 return log.toString();
32 } catch (IOException ioe) {
33 return "Failed to retrieve.";
34 }
35 }
36}