diff --git a/app/src/main/java/org/fdroid/fdroid/FDroidApp.java b/app/src/main/java/org/fdroid/fdroid/FDroidApp.java index 03518b11d..18fc3d916 100644 --- a/app/src/main/java/org/fdroid/fdroid/FDroidApp.java +++ b/app/src/main/java/org/fdroid/fdroid/FDroidApp.java @@ -27,6 +27,7 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothManager; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -415,6 +416,13 @@ public class FDroidApp extends Application { // find and process provisions if any. Provisioner.scanAndProcess(getApplicationContext()); + + // if the underlying OS version has changed, then fully rebuild the database + SharedPreferences atStartTime = getSharedPreferences("at-start-time", Context.MODE_PRIVATE); + if (Build.VERSION.SDK_INT != atStartTime.getInt("build-version", Build.VERSION.SDK_INT)) { + UpdateService.forceUpdateRepo(this); + } + atStartTime.edit().putInt("build-version", Build.VERSION.SDK_INT).apply(); } /**