mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-24 08:45:53 +00:00
Cleanup
This commit is contained in:
parent
2b0628dc66
commit
3d22a70012
1 changed files with 0 additions and 30 deletions
|
@ -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) {
|
public static void sendLogcat(final String tag, final Context context) {
|
||||||
AsyncTask task = new AsyncTask<Object, Object, Intent>() {
|
AsyncTask task = new AsyncTask<Object, Object, Intent>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue