The client was already auto-incrementing their weight anyway. But it leaked our internal weight handling into the library consumer which can cause issues like when me are making changes to how we handles repo weights as we are doing now.
so they do not override the information from older repos anymore. This is especially an issue for the official repo which historically had the lowest priority while it should have the highest.
so we can use the new repo right away without waiting for DB to inform us about change. This is important if we want to show list of apps of a repo right after adding it.
As v1 images don't have a sha256 hash, we were using the name as the glide cache key. In some cases (e.g. repo icons), this caused false re-use of a cached image. Now we use the first mirror and the file name as the cache key.
Also add a DigestInputStream variant, so we can verify the SHA-256 hash while reading from the stream.
This can be useful when we don't want to save a file, but already process a download while downloading.
for now only for initial repos, but eventually we should validate for CoreRepository as well to prevent invalid certs from entering the DB by other means.
I can't really figure out this specific issue, but seems like it
should skip apps after NameNotFoundException regardless of why. This
is used elsewhere, like `DbUpdateChecker.getSuggestedVersion()`.
Here's the error that I saw on CalyxOS:
```
android.content.pm.PackageManager$NameNotFoundException: org.calyxos.customization
at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:253)
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:213)
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:207)
at org.fdroid.index.v1.IndexV1Creator.addApp(IndexV1Creator.kt:67)
at org.fdroid.index.v1.IndexV1Creator.createIndex(IndexV1Creator.kt:49)
at org.fdroid.index.v1.IndexV1Creator.createRepo(IndexV1Creator.kt:37)
at org.fdroid.fdroid.nearby.LocalRepoManager.generateIndex(LocalRepoManager.java:259)
at org.fdroid.fdroid.nearby.LocalRepoService.runProcess(LocalRepoService.java:107)
at org.fdroid.fdroid.nearby.LocalRepoService$GenerateLocalRepoThread.run(LocalRepoService.java:96)
```