We are not forcing an update, in the sense that we make the update
service run. Rather, we are ensuring that the next update wont return
after doing nothing, with the message "repos already up to date".
In this case, the repo metadata (and hence its etag) is the same,
but we made changes in the client to handle the metadata correctly.
Thus, we don't care that it hasn't changed, we want to update anyhow.
Did this by using the same query which is used to update the icon URLs
after updating the index. To make this same method accessible, without
causing sad database locking, had to expose the method from AppProvider
in a way which would let DBHelper access it. See comments in code for
further explainations.
While there, removed the final lint warning in my Android Studio for
the AppProvider. This was a warning because we could have ended up
iterating over a null object. Although it turns out there was a correct
guard in place which would ensure this didn't happen, it wasn't in such
a way that lint would understand. Thus, I changed the guard condition
around `for( String blah : CommaSeparatedList.make() ) {}` to let lint
relax and not be so pedantic.
Apply the accent color to EditTextPreference and ListPreference. They
use android.app.AlertDialog.Builder, not
android.support.v7.app.AlertDialog.Builder, so the theme has to be
specified using "android:alertDialogTheme" attribute in addition to
AppCompat's "alertDialogTheme". For the same reason those dialogs won't
be tinted on pre-Lollipop Android versions.
Apply the accent color to alert dialog buttons. Note that without
"android:windowMinWidthMajor" and "android:windowMinWidthMinor" attributes
dialog width is calculated incorrectly resulting in visual artifacts.
From the Material Design spec:
> DP unit grid
> System icons are displayed at 24dp.
See http://www.google.com/design/spec/style/icons.html#icons-system-icons
Script used to update the icons:
function download {
F-Droid/tools/download-material-icon.sh F-Droid/res $1 $2
}
download content add
download device bluetooth
download action delete
download notification do_not_disturb
download image edit
download action help
download device nfc
download av play_arrow
download navigation refresh
download action search
download action settings
download social share
download action view_headline
This drastically simplifies the very important index.jar signature
verification process by splitting out the Trust On First Use (TOFU) part of
the process into its own method, and makes the TOFU write happen separately
from the `RepoUpdateRememberer`. It requires all connections go through
the normal verification process.
Thanks to @mvdan for catching that. Turns out Java's String formatting is
not as tolerant as C's printf(). Java crashes when the format is wrong,
while C just ignores extras.
Might as well tap into the stream to get the byte counts, that's best
progress info I can think of when parsing a file.
This is a step towards a single progress bar for the whole process, instead
of showing one progress for downloading, another for parsing XML, then a
third for processing the new app info.
Now that there is only ever the index.jar, the whole flow of RepoUpdater
has changed quite a bit. This updates the logic for deciding when to store
the current repo's pubkey in the database for future reference.
This changes the flow to stop writing the unpacked index.xml and instead
stream it directly to the XML parser from the index.jar. This should speed
things up some.
refs #259https://gitlab.com/fdroid/fdroidclient/issues/259
This is also work towards running the whole thing in the background:
refs #103https://gitlab.com/fdroid/fdroidclient/issues/103
This also removes the progress stuff since it will need to change a lot to
work with the streaming mode
Before, there was an abstract RepoUpdater class with two subclasses, one
for signed and unsigned. Now there is just a single class, and it only
ever starts with the index.jar. So this removes lots of code that was
there to handle that more complicated structure. For example, there is no
longer the need to separately work on the index.xml vs index.jar.
Updated the README with details of how to run the tests. Also added a
minor fix to allow tests to run on pre-honeycomb devices. However their
behaviour may not be 100% defined - because the contentproviders are
not shuttind down correctly due to lack of an API to do so.
It broke with a recent support lib update that made the binary library be an
.aar instead of a .jar. Besides, the ant plugin has been buggy and unsupported
for a very long time.
Also dropping support for eclipse in the process, which lets us get rid of the
nasty symlinks.