Send JSON preferences in crash report

This commit is contained in:
Aaron Culliney 2016-05-07 16:31:36 -07:00
parent 9e9d0333cc
commit b0c1703b23

View File

@ -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