mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 00:20:50 +01:00
Send log files as attachments
This commit is contained in:
@@ -37,13 +37,11 @@ import android.widget.Spinner;
|
||||
import com.android.billingclient.api.BillingClient;
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
@@ -126,41 +124,6 @@ public class Helper {
|
||||
return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
|
||||
}
|
||||
|
||||
static StringBuilder getLogcat() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
Process proc = null;
|
||||
BufferedReader br = null;
|
||||
try {
|
||||
String[] cmd = new String[]{"logcat",
|
||||
"-d",
|
||||
"-v", "threadtime",
|
||||
"-t", "1000",
|
||||
TAG + ":I"};
|
||||
proc = Runtime.getRuntime().exec(cmd);
|
||||
br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
|
||||
String line;
|
||||
while ((line = br.readLine()) != null)
|
||||
sb.append(line).append("\r\n");
|
||||
} catch (IOException ex) {
|
||||
Log.e(TAG, ex + "\n" + Log.getStackTraceString(ex));
|
||||
} finally {
|
||||
if (br != null)
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
if (proc != null)
|
||||
try {
|
||||
proc.destroy();
|
||||
} catch (Throwable ex) {
|
||||
Log.w(TAG, ex + "\n" + Log.getStackTraceString(ex));
|
||||
}
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
static Address myAddress() throws UnsupportedEncodingException {
|
||||
return new InternetAddress("marcel+fairemail@faircode.eu", "FairCode");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user