Revert "Write logcat on crash"

This reverts commit 3e7ca96f43.
pull/146/head
M66B 6 years ago
parent 3e7ca96f43
commit 75dbe669fc

@ -28,15 +28,9 @@ import android.os.DeadSystemException;
import android.os.RemoteException;
import android.util.Log;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Date;
public class ApplicationEx extends Application {
private Thread.UncaughtExceptionHandler prev = null;
@ -125,40 +119,7 @@ public class ApplicationEx extends Application {
FileWriter out = null;
try {
out = new FileWriter(file);
out.write(new Date() + "\r\n");
out.write(ex.toString() + "\r\n");
out.write(Log.getStackTraceString(ex) + "\r\n");
out.write("\r\n");
Process proc = null;
BufferedReader br = null;
OutputStream os = null;
try {
os = new BufferedOutputStream(new FileOutputStream(file));
String[] cmd = new String[]{"logcat",
"-d",
"-v", "threadtime",
//"-t", "1000",
Helper.TAG + ":I"};
proc = Runtime.getRuntime().exec(cmd);
br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line;
while ((line = br.readLine()) != null)
out.write(line + "\r\n");
} catch (Throwable exex) {
out.write(exex.toString());
} finally {
if (os != null)
os.close();
if (br != null)
br.close();
if (proc != null)
proc.destroy();
}
out.write(ex.toString() + "\n" + Log.getStackTraceString(ex));
} catch (IOException e) {
Log.e(Helper.TAG, e + "\n" + Log.getStackTraceString(e));
} finally {

@ -212,7 +212,7 @@ public class Helper {
draft.folder = drafts.id;
draft.msgid = EntityMessage.generateMessageId();
draft.to = new Address[]{Helper.myAddress()};
draft.subject = context.getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME + " unexpected error";
draft.subject = context.getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME + " crash log";
draft.content = true;
draft.received = new Date().getTime();
draft.setContactInfo(context);

Loading…
Cancel
Save