From 69530de0c6efb393cf53b4bc339c83af5402a4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sat, 19 Oct 2024 21:00:53 +0100 Subject: [PATCH] Set changelog version code when restoring zip backup --- .../gadgetbridge/util/backup/ZipBackupImportJob.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/backup/ZipBackupImportJob.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/backup/ZipBackupImportJob.java index a398fde00..7372881ce 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/backup/ZipBackupImportJob.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/backup/ZipBackupImportJob.java @@ -37,6 +37,7 @@ import java.util.Locale; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import nodomain.freeyourgadget.gadgetbridge.BuildConfig; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.database.DBHandler; @@ -154,6 +155,11 @@ public class ZipBackupImportJob extends AbstractZipBackupJob { if (!jsonBackupPreferences.importInto(globalPreferences)) { LOG.warn("Global preferences were not commited"); } + + // We may be restoring from different versions - reset the changelog version + globalPreferences.edit() + .putInt("ckChangeLog_last_version_code", BuildConfig.VERSION_CODE) + .apply(); } if (isAborted()) return;