This affects anti-features and categories. Reflection diffing has been made more robust in the process with the earlier FileV2 hack removed and better error messages.
This is done, because index v2 is signed with apksigner --min-sdk-version 23 by fdroidserver. So to ensure that the client will always be able to verify a v2 index, we force clients to run SDK 23 at least. If they were running 22 and apksigner ever upgrades to incompatible signing algorithms, those clients would get locked out.
When we had already read bytes from one mirror, but needed to fail-over to another mirror, we would re-read the same bytes again corrupting our download.
Fixes#2412
This commit resumes the download where the last mirror left off.
This uses IndexFile objects instead of String file names everywhere. The general advantage of that is that we can now pass the hash and the file size to the downloader. For index v2 the hash can then get validated while downloading.
This refactors the library so that Downloaders receive the IndexFile directly so that they get access to the IPFS CID, but also to the SHA256 hash and the file size. Mirrors can now be marked as IPFS gateways.
Originally, we were showing "Unknown application" in English, no matter the user's locale. Then here we were actually showing "null". Both isn't good, so best to not show anything.
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