From b0c1703b239dd4d289e8d74b364da2500e3a1d32 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sat, 7 May 2016 16:31:36 -0700 Subject: [PATCH] Send JSON preferences in crash report --- .../deadc0de/apple2ix/Apple2CrashHandler.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2CrashHandler.java b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2CrashHandler.java index 3a12696f..1bcd0467 100644 --- a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2CrashHandler.java +++ b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2CrashHandler.java @@ -25,6 +25,8 @@ import android.widget.ProgressBar; import org.deadc0de.apple2ix.basic.BuildConfig; import org.deadc0de.apple2ix.basic.R; +import org.json.JSONException; +import org.json.JSONObject; import java.io.BufferedWriter; import java.io.File; @@ -428,6 +430,22 @@ public class Apple2CrashHandler { } }); + StringBuilder jsonData = new StringBuilder(); + if (Apple2Utils.readEntireFile(new File(homeDir, Apple2Preferences.PREFS_FILE), jsonData)) { + JSONObject obj = null; + try { + obj = new JSONObject(jsonData.toString()); + } catch (JSONException e) { + Log.e(TAG, "Error reading preferences : " + e); + } + if (obj != null) { + summary.append("PREFS:\n"); + summary.append(obj.toString()); + allCrashData.append(">>>>>>> PREFS\n"); + allCrashData.append(obj.toString()); + } + } + Apple2Utils.unexposeSymbols(activity); activity.runOnUiThread(new Runnable() { @Override