Don't allow to install older builds

In some cases, installing an update older than the one currently
installed requires a data wipe, so don't allow it. However, allow
to verify old updates if not verified yet (e.g. when imported).
This commit is contained in:
Gabriele M
2017-07-08 21:39:10 +02:00
parent 1c1bac67b4
commit c0bf32c097
2 changed files with 9 additions and 6 deletions

View File

@@ -85,7 +85,9 @@ public class Utils {
}
public static boolean canInstall(Update update) {
return update.getVersion().equalsIgnoreCase(SystemProperties.get(Constants.PROP_BUILD_VERSION));
return update.getTimestamp() > SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0) &&
update.getVersion().equalsIgnoreCase(
SystemProperties.get(Constants.PROP_BUILD_VERSION));
}
public static List<UpdateDownload> parseJson(File file, boolean compatibleOnly)