From 6fb1207ae624d6d206cb8a8013243b4f82d94841 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 8 Dec 2016 00:01:48 +0100 Subject: [PATCH] always refresh APKs in DB at start with timestamps < 2010-01-01 APKs installed in /system} will often have zeroed out timestamps, like 2008-01-01 (ziptime) or 2009-01-01. So instead anything older than 2010 every time since we have no way to know whether an APK wasn't changed as part of an OTA update. An OTA update could change the APK without changing the versionCode or lastUpdateTime. closes #819 --- .../fdroid/data/InstalledAppProviderService.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/data/InstalledAppProviderService.java b/app/src/main/java/org/fdroid/fdroid/data/InstalledAppProviderService.java index 34616230a..6f0dee7fb 100644 --- a/app/src/main/java/org/fdroid/fdroid/data/InstalledAppProviderService.java +++ b/app/src/main/java/org/fdroid/fdroid/data/InstalledAppProviderService.java @@ -124,13 +124,21 @@ public class InstalledAppProviderService extends IntentService { * is in sync with what the {@link PackageManager} tells us is installed. Once * completed, the relevant {@link android.content.ContentProvider}s will be * notified of any changes to installed statuses. - *

+ *

* The installed app cache could get out of sync, e.g. if F-Droid crashed/ or * ran out of battery half way through responding to {@link Intent#ACTION_PACKAGE_ADDED}. * This method returns immediately, and will continue to work in an * {@link IntentService}. It doesn't really matter where we put this in the * bootstrap process, because it runs in its own thread, at the lowest priority: * {@link Process#THREAD_PRIORITY_LOWEST}. + *

+ * APKs installed in {@code /system} will often have zeroed out timestamps, like + * 2008-01-01 (ziptime) or 2009-01-01. So instead anything older than 2010 every + * time since we have no way to know whether an APK wasn't changed as part of an + * OTA update. An OTA update could change the APK without changing the + * {@link PackageInfo#versionCode} or {@link PackageInfo#lastUpdateTime}. + * + * @see