On Android SDK level 29 we need this exception to keep our code for
scanning for repositories on scanning SD cards working. This exception
is obsolete for sdk 30 and above.
Since we're using static methods (with static references to views) a
(IMHO likely error prone) hack to pass events from MainActivity to
NearbyViewBinder we have high coupling betweens those two classes. In
nearby buildflavor spaw is removed. So we need stubs because of
coupling.
* This never really worked, and it doesn't make sense on Android
* To downgrade an app, you have to uninstall it, which loses data
* This is most of the time, not what users would want
* Let's just remove the button to keep things simpler
Change-Id: I0bc5173c8005e1564857311db3abde43b3ba2eef
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.
On sdk level 29 and above this adds a banner to spwa_start_swap view in
the SwapWorkflowActivity. The call to action on this banner will than
kick of a Settings Panel for letting users activate Wifi.
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)
```