If F-Droid gets killed during the install/update process, then the install
procedure would keep getting readded and redownloaded since it is a sticky
Intent. The test is very specific so that this does not block things like
installing updates with the same versionCode, which happens sometimes, and
is allowed by Android.
#1271
The "Only on WiFi" pref originally only controlled index updates, but now
it makes sense to include all of the various files that are downloaded.
#1381
The standard pattern is to pass a Context in rather than call things like
getPackageManager in. It should only pass a PackageManager if that is
actually being reused.
This shouldn't change the logic at all.
The permissions from uses-permission and uses-permission-sdk-23 should be
combined into a single list of permissions that are being requested for the
current SDK version. The previous code was overwriting one or the other,
based on the order that Jackson happen to call setRequestedPermissions().
closes#1139#890#1394
admin#65
This completes the work started in 195aaae7e52dc1c47741965904ed17bdc816a71c
closes#1395closes#1400
# Conflicts:
# app/src/main/java/org/fdroid/fdroid/UpdateService.java
In order to save disk space and memory, at a cost of some CPU time,
this makes sure that all downloaded images are not bigger than the
device can support. A nice side effect of this process is that EXIF
information is stripped from JPEG files since they are read into a
Bitmap, then written out as a PNG. This should complete the JPEG EXIF
stripping started in 2a3aaacf2347679f30e2c8feffb92f25bb882c8b with
considerExifParams(false)
!653
This adds some case normalization to both the scheme and the host. This was
previously messing up TreeUri content:// URLs like this:
content://com.android.externalstorage.documents/tree/1AFB-2402%3A/document/1AFB-2402%3Atesty.at.or.at%2Ffdroid%2Frepo
Turning them into:
content://com.android.externalstorage.documents/tree/1AFB-2402:/document/1AFB-2402:testy.at.or.at/fdroid/repo
java.net.URL barfs on custom URL schemes, and making it handle them is
really hard. Basically, there needs to be a Handler stub class, then
URL.setURLStreamHandlerFactory() must run when F-Droid starts, since
it has to be set before any URL instance is used. This all leaves
some weird logic that gives the false impression that URLConnection
will handle these custom schemes.
Switching to Uri/urlString throughout the code matches the other
classes that use urlString as the unique ID, and this doesn't add more
lines of code.
This was int because it was written arond UrlConnection.getContentLength()
which returns an int. But that doesn't make sense since this will
definitely handle files large than 16MB.
!647#1192