From 41e18643672423a550d36e8fc8a30e9bec321fe4 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 2 Jun 2024 21:16:21 +0200 Subject: [PATCH] Backup: fixed version --- app/src/main/java/eu/faircode/email/FairEmailBackupAgent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FairEmailBackupAgent.java b/app/src/main/java/eu/faircode/email/FairEmailBackupAgent.java index 0b10f3a201..b0fa5e2bf8 100644 --- a/app/src/main/java/eu/faircode/email/FairEmailBackupAgent.java +++ b/app/src/main/java/eu/faircode/email/FairEmailBackupAgent.java @@ -72,6 +72,7 @@ public class FairEmailBackupAgent extends BackupAgent { return; JSONObject jroot = new JSONObject(); + jroot.put("version", 1); JSONObject jsettings = new JSONObject(); jsettings.put("enabled", prefs.getBoolean("enabled", true)); @@ -174,7 +175,7 @@ public class FairEmailBackupAgent extends BackupAgent { EntityLog.log(this, "Restore decompressed=" + dataBuf.length); JSONObject jroot = new JSONObject(new String(dataBuf, StandardCharsets.UTF_8)); - jroot.put("version", 1); + EntityLog.log(this, "Restore version=" + jroot.optInt("version", 0)); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences.Editor editor = prefs.edit();