1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-23 16:27:55 +00:00
This commit is contained in:
M66B 2015-11-09 10:02:18 +01:00
parent 2b0628dc66
commit 3d22a70012

View file

@ -143,36 +143,6 @@ public class Util {
}
}
public static void sendCrashReport(Throwable ex, Context context) {
ApplicationErrorReport report = new ApplicationErrorReport();
report.packageName = report.processName = context.getPackageName();
report.time = System.currentTimeMillis();
report.type = ApplicationErrorReport.TYPE_CRASH;
report.systemApp = false;
ApplicationErrorReport.CrashInfo crash = new ApplicationErrorReport.CrashInfo();
crash.exceptionClassName = ex.getClass().getSimpleName();
crash.exceptionMessage = ex.getMessage();
StringWriter writer = new StringWriter();
PrintWriter printer = new PrintWriter(writer);
ex.printStackTrace(printer);
crash.stackTrace = writer.toString();
StackTraceElement stack = ex.getStackTrace()[0];
crash.throwClassName = stack.getClassName();
crash.throwFileName = stack.getFileName();
crash.throwLineNumber = stack.getLineNumber();
crash.throwMethodName = stack.getMethodName();
report.crashInfo = crash;
Intent intent = new Intent(Intent.ACTION_APP_ERROR);
intent.putExtra(Intent.EXTRA_BUG_REPORT, report);
context.startActivity(intent);
}
public static void sendLogcat(final String tag, final Context context) {
AsyncTask task = new AsyncTask<Object, Object, Intent>() {
@Override