Parsing of JSON is now done inside the index library using kotlinx.serialization multi-platform library.
Another small usage in FDroidMetricsWorker was replaced with native JSONObject.
We don't need to cache installed apps locally as they are available via the PackageManager as well. This avoids an entire class of bugs where our cache gets out of sync with reality. Also, it simplifies the code the database. We no longer need to listen to broadcast about which packages get installed and removed which is more tricker when targetting newer Android SDKs.
Tests for v0 index have been removed with their assets.
AntiFeaturesTest is not needed anymore, because filtering doesn't happen in new DB
PanicResponderActivityTest can not be tested as easily anymore
MultiIndexUpdaterTests are now spread over various database tests
LocaleSelectionTest is now in org.fdroid.database.BestLocaleTest
Most tests org.fdroid.fdroid.data now have equivalents in the new database library
and remove sharedTest symlink hack. The shared tests are now a proper gradle module to avoid issues with using the same source files in different modules.
This is much faster and doesn't require a device. However, the test should also continue to run on-device as this is the sqlite version used in practice.
The IndexV2Updater fetches the new entry.jar, verifies it and then either processes a diff or the full index.
The RepoUpdater is a convenience class that encapsulates updating repos with potentially more than one format. It tries v2 first (in case the repo has upgraded) and falls back to v1 if the repo isn't known to support v2 already (downgrade protection).
One of those last minute requests for changing index structure...
We don't bother with making a new table for localizable repo icons. They just get serialized into the DB. If we ever need to update the structure, we can consider wiping the icons. They can get updated with a full index update.
In JSON, keys can come in any order, so we need to handle the case that we receive packages before the repo metadata. Now we explicitly clear data and rename the insert method to insertOrReplace in order to make it clear that data gets replaced.
Also, we pass the repoId into the constructor of the DB stream receivers to make clear that one receiver is meant to receive a single pre-existing repo.