Skip to content

Commit 1ce7712

Browse files
committed
Simplify exception handler
1 parent d5729bd commit 1ce7712

1 file changed

Lines changed: 3 additions & 28 deletions

File tree

app/src/main/java/com/njlabs/showjava/utils/ExceptionHandler.java

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import android.content.Context;
44
import android.content.Intent;
5-
import android.os.Build;
65
import android.util.Log;
76
import android.widget.Toast;
87

8+
import com.crashlytics.android.Crashlytics;
99
import com.njlabs.showjava.ui.JavaExplorer;
1010

1111
import java.io.PrintWriter;
@@ -30,39 +30,14 @@ public ExceptionHandler(Context context, String sourceDir, String packageID) {
3030

3131
public void uncaughtException(Thread thread, Throwable exception) {
3232

33+
Crashlytics.logException(exception);
34+
3335
StringWriter stackTrace = new StringWriter();
3436
exception.printStackTrace(new PrintWriter(stackTrace));
3537
StringBuilder errorReport = new StringBuilder();
3638
errorReport.append("************ CAUSE OF ERROR ************\n\n");
3739
errorReport.append(stackTrace.toString());
3840

39-
errorReport.append("\n************ DEVICE INFORMATION ***********\n");
40-
errorReport.append("Brand: ");
41-
errorReport.append(Build.BRAND);
42-
errorReport.append(LINE_SEPARATOR);
43-
errorReport.append("Device: ");
44-
errorReport.append(Build.DEVICE);
45-
errorReport.append(LINE_SEPARATOR);
46-
errorReport.append("Model: ");
47-
errorReport.append(Build.MODEL);
48-
errorReport.append(LINE_SEPARATOR);
49-
errorReport.append("Id: ");
50-
errorReport.append(Build.ID);
51-
errorReport.append(LINE_SEPARATOR);
52-
errorReport.append("Product: ");
53-
errorReport.append(Build.PRODUCT);
54-
errorReport.append(LINE_SEPARATOR);
55-
errorReport.append("\n************ FIRMWARE ************\n");
56-
errorReport.append("SDK: ");
57-
errorReport.append(Build.VERSION.SDK_INT);
58-
errorReport.append(LINE_SEPARATOR);
59-
errorReport.append("Release: ");
60-
errorReport.append(Build.VERSION.RELEASE);
61-
errorReport.append(LINE_SEPARATOR);
62-
errorReport.append("Incremental: ");
63-
errorReport.append(Build.VERSION.INCREMENTAL);
64-
errorReport.append(LINE_SEPARATOR);
65-
6641
Log.e("com.njlabs.showjava", errorReport.toString());
6742

6843
Toast.makeText(myContext, "There was an error decompiling this app. Showing incomplete source.", Toast.LENGTH_LONG).show();

0 commit comments

Comments
 (0)