3019 Commits

Author SHA1 Message Date
Peter Serwylo
8a6a62833b Alert update notification when saving details to DB. 2015-11-30 18:16:11 +11:00
Peter Serwylo
6969dcb90e Change "inserting" string to not include progress for last phase of update. 2015-11-30 18:16:11 +11:00
Peter Serwylo
90290f830a Send "inserting" message to notifications while committing temp provider.
Right now it says "50%" always, will need to think whether to ditch the
percentage completely, or to have the temp app/apk providers emit progress
events some how too.
2015-11-30 18:16:11 +11:00
Peter Serwylo
71f641860a More refactoring of AppProvider to use getTableName() instead of constant.
Although not used by the temp provider, it seemed strange having some of
the code always using the `DBHelper.TABLE_APP` and other code using
`getTableName()` where all of it could have used `getTableName()`.

Also moved commiting of the temp tables to the real tables into the
`RepoPersiter` instead of in `RepoUpdater`.
2015-11-30 18:16:10 +11:00
Peter Serwylo
b22b39ea26 Fix bug with SQL generation (missing . char) from bung rebase. 2015-11-30 18:16:10 +11:00
Peter Serwylo
ad6a8e5b4e Extracted RepoPersister class from RepoUpdater to separate security and DB logic. 2015-11-30 18:16:10 +11:00
Peter Serwylo
1d951e7689 Fixed repo updater tests. Fix to temp app/apk providers.
The repo xml handler now has a different mechanism for returning
data about the parsed xml file. This is done via a callback, rather
than storing the data in member variables. The tests now deal with
this correctly.

The update/delete operations of the TempAp[pk]Provider's didn't
work, so that has now been fixed.
2015-11-30 18:16:02 +11:00
Peter Serwylo
b34853a776 Cleanup before CR. 2015-11-30 18:14:44 +11:00
Peter Serwylo
cc0adcc5ad Save app details to temp table, then flush after update verified. 2015-11-30 18:14:44 +11:00
Peter Serwylo
9a2d390279 WIP: Do repo update database work in temp table for apks, then copy at end.
At the start of a repo update, it will create a copy of the apk table.
Throughout the update, it will query the original apk table for info.
All inserts and updates happen to the temp table. After the repo has been
verified as trusted, the original apk table is emptied, and all apks are
copied from the temp table to the real one.

I realise that the work done to query the apk table for info during the update
could happen against the temp table, but it was not neccesary to move all of
the queries that are required for this task to the temp apk provider.
2015-11-30 18:14:44 +11:00
Peter Serwylo
b989ef3ecc WIP: Stream index details to database rather than waiting until end.
Refactored repo update to stream apks from network -> jar file reader ->
xml parser -> database. No longer build up large lists of app metadata
to save. Saves memory, but is MUCH slower.

Does sig verification properly, but does it at the END of the process
and DOESN'T ROLL BACK on failure.

Quick and dirty benchmarks show an increase in time from ~25 seconds
to ~30 seconds on my Nexus 4 with Android 5.0. This doesn't seem so
bad to me, for the tradeoff that people on low end devices can actually
update now.

Also, as @eighthave pointed out, if we are able to stream the download
directly from the internet, then that time will drop to essentially
the time it takes to download the index.
2015-11-30 18:14:42 +11:00
F-Droid Translatebot
e50a12731d Pull translation updates from Weblate
Translators:

Alberto Moshpirit      Spanish
naofum                 Japanese
Olexandr Nesterenko    Ukrainian
RACER                  Japanese
Rafał Michalski        Polish
Tobias Bannert         German
2015-11-29 19:52:32 +01:00
Peter Serwylo
72b3bda941 Merge branch 'master' into 'master'
Make progressbar in notification determinate



See merge request !175
2015-11-28 00:56:22 +00:00
Ruben Roy
1a54c61a50 Make progressbar in notification determinate 2015-11-27 18:43:16 +05:30
Daniel Martí
7286bafa23 Bump to 0.98-alpha1 v0.98-alpha1 2015-11-23 20:25:07 +01:00
F-Droid Translatebot
2cbaa3eaed Pull translation updates from Weblate
Translators:

Ajeje Brazorf          Sardinian
enolp                  Asturian
Ldm Public             French
Marcelo Santana        Portuguese (Brazil)
Mladen Pejaković       Serbian
naofum                 Japanese
Nathan Follens         Dutch
Olexandr Nesterenko    Ukrainian
riotism                Chinese (Hong Kong)
Sergio Oller           Catalan
2015-11-23 13:13:09 +01:00
Peter Serwylo
b9342e909b Merge branch 'master' into 'master'
Improved support for HTTP Basic Authentication

Extended DownloaderFactory to support optional username & password parameters.

Extended HttpDownloader to check for HTTP 401 Authorization Required status code
and send a simple HTTP Basic Authentication header with all requests.

Extended ManageReposActivity to support repositories that use HTTP Basic
Authentication, added a dialog to prompt for username and password.

Extended RepoDetailsActivity to be able to display and modify the authentication
credentials.

See merge request !171
2015-11-23 06:43:49 +00:00
Daniel Martí
9dceb60786 Add english to list of locales to pick
Useful to make F-Droid be in English if the system language is
different.

Fixes issue brought up in https://f-droid.org/forums/topic/f-droid-0-97-language-selection/
2015-11-22 03:01:04 -08:00
Daniel Martí
69fdaf874e Add missing sq language to langs list 2015-11-22 02:53:40 -08:00
Daniel Martí
ecff5b1832 Replace phone with device in strings 2015-11-22 02:52:16 -08:00
F-Droid Translatebot
20666ba824 Pull translation updates from Weblate
Translators:

Jack Phoenix           Finnish
Jaroslav Lichtblau     Czech
Michalis               Greek
Olexandr Nesterenko    Ukrainian
riotism                Chinese (Hong Kong)
Sergio Oller           Catalan
2015-11-22 02:50:50 -08:00
Daniel Martí
35c65fbffa Remove UnusedResource usages in translations 2015-11-19 08:17:05 -08:00
Daniel Martí
6af08494a2 Revert "Suppress lint warnings about unused categories names"
This reverts commit 5c9e314c9bfdd8df97b702c16b729ba440964168.

Error in question:

https://stackoverflow.com/questions/19526945/android-gradle-merged-values-xml-uses-wrong-namespace
2015-11-19 08:16:55 -08:00
F-Droid Translatebot
e29ae6de1a Pull translation updates from Weblate
Translators:

Indrit Bashkimi        Albanian
Kiril LastName         Bulgarian
Olexandr Nesterenko    Ukrainian
relan                  Russian
Sergio Oller           Catalan
tactmayers             Chinese (Hong Kong)
zmni                   Indonesian
2015-11-19 08:06:38 -08:00
F-Droid Translatebot
46c066468a Pull translation updates from Weblate
Translators:

Benedikt Geißler     German
Ronalds              Latvian
Sergey Vladimirov    Russian
Tobias Bannert       German
2015-11-17 19:48:48 -08:00
Christian Morgner
0df276eefc Remove initial HEAD request in HttpDownloader.setupConnection(), just add
credentials if present, fix checkstyle error in ManageReposActivity.
2015-11-16 21:02:39 +01:00
Christian Morgner
caabec7ef9 Reverted change in RepoProvider. 2015-11-16 13:48:08 +01:00
Christian Morgner
0c0342b12f Merge remote-tracking branch 'pserwylo/cmorgner-master' 2015-11-16 12:52:30 +01:00
Christian Morgner
e82382fe94 Modified return expression on MagageReposActivity.java. 2015-11-16 12:50:47 +01:00
Peter Serwylo
ee7761e1af CR: Replace String.isEmpty() with TextUtils.isEmpty(String).
String.isEmpty() is only supported in API v9, whereas we target
API v8 for now.
2015-11-16 18:05:37 +11:00
Peter Serwylo
0b3b32dab3 CR: Add overloaded createNewRepo method which provides default arguments.
Instead of passing in `null` each time you don't have a username/password,
this change provides those as meaningful default values in an overloaded
version of the method. This takes care of Java's lack of default argument
support.
2015-11-16 18:05:31 +11:00
Peter Serwylo
3426b3bb2d CR: Better deal with the possibility of crashes during database update.
This is for an abundance of caution. If the guard condition checks
for the presence of both username _and_ password fields, then a crash
or some sort of force close during the update (after adding username
but before password) will mean that next time the app runs, this
condition will evaluate to false and the password field will never
get added.
2015-11-16 18:05:16 +11:00
Peter Serwylo
97b60d937d CR: Apply database changes in chronological order.
As with the previous commit, there is probably not any harm doing this
in the way it was done. However it helps reason about the code if
changes are applied in the order that they were introduced. Especially
because each of them does something depending on the version of the
database at that point. With this change, you always know that at the
point that the function is run, the database version will be 51 (and
hence the structure of the database will be predictable).
2015-11-16 18:05:03 +11:00
Peter Serwylo
6957721479 CR: Leave old db update code as it was.
This may not have caused any trouble, but the principle behind the old
behaviour is that at the point that that was required, the fdroid_repo
table had that particular structure. There is a small chance that it
_may_ have some unintended consequences when upgrading clients with very
old database versions. Probably not, but may as well leave it as is.
2015-11-16 18:04:54 +11:00
Christian Morgner
34838fd0dc Added username & password fields to the REPO table, increased DB version to 52.
Extended DownloaderFactory to support optional username & password parameters.

Extended HttpDownloader to check for HTTP 401 Authorization Required status code
and send a simple HTTP Basic Authentication header with all requests.

Extended ManageReposActivity to support repositories that use HTTP Basic
Authentication, added a dialog to prompt for username and password.

Extended RepoDetailsActivity to be able to display and modify the authentication
credentials.
db-version/52
2015-11-15 13:04:23 +01:00
Daniel Martí
31313bc9ee Specify why the DM downloader is disabled
Closes both issues since they don't affect official builds anymore, for
as long as this is disabled.

Closes #445.
Closes #459.
2015-11-14 17:18:15 +01:00
Daniel Martí
4e81aba841 Remove spongycastle, use maven repos in zipsigner 2015-11-14 17:14:28 +01:00
Daniel Martí
51676bf255 Update spongycastle to 1.53.0.0
Which sits on top of bouncycastle 1.53.
2015-11-14 17:14:27 +01:00
Daniel Martí
34ac4319c0 Merge branch 'tests-lint' into 'master'
Close all cursors in tests



See merge request !170
2015-11-14 15:12:18 +00:00
Daniel Martí
b6e2f2d691 Remove one lone Log.d in prod code 2015-11-14 14:19:29 +01:00
Daniel Martí
11e2fb7540 test: close all cursors
This makes lint happy and avoids tons of warnings on the logcat due to
StrictMode.
2015-11-14 14:18:08 +01:00
Daniel Martí
5d048a7c53 Specify why we use proguard in debug builds 2015-11-14 14:05:15 +01:00
Daniel Martí
9fc1aba8bc Checkstyle fix 2015-11-13 20:46:52 +01:00
Daniel Martí
04e7b8d7ab Collapse identical catch statements in tests 2015-11-13 18:51:28 +01:00
Daniel Martí
52ada0131a Deduplicate types in tests 2015-11-13 18:50:43 +01:00
Daniel Martí
14a79b5577 Remove unused parameters 2015-11-13 18:50:43 +01:00
Daniel Martí
d951ccd221 Make a few declarations final 2015-11-13 18:44:08 +01:00
Daniel Martí
682cf58aa9 Merge branch 'search-widget' into 'master'
Replace search dialog with a search widget

SearchView is the recommended way to implement search UI. See https://developer.android.com/guide/topics/search/search-dialog.html#UsingSearchWidget

The UX is still far from ideal but looks much better now.

Before and after (Gingerbred):

![gingerbred-before](/uploads/f724afaf152aeef8ff9cb3e838427d22/gingerbred-before.png)
![gingerbred-after](/uploads/da67fe57d2a55e64cce7d0cba31aa181/gingerbred-after.png)

Before and after (Lollipop):

![lollipop-before](/uploads/4a50258993a8304d984450456d07e3bb/lollipop-before.png)
![lollipop-after](/uploads/4b49b2f802eca567c6713fe653b10331/lollipop-after.png)


See merge request !168
2015-11-13 17:22:19 +00:00
Daniel Martí
7581d8443e Merge branch 'lint-unused-resources' of https://gitlab.com/relan/fdroidclient
Fix some lint warnings about unused resources

No functional changes, just cleanups.
2015-11-13 18:19:13 +01:00
F-Droid Translatebot
3afe248159 Pull translation updates from Weblate
Translators:

AtomiKe                 French
Erwin Scheuch-Heilig    German
Ldm Public              French
Michal Čihař            Czech
pizzaiolo               Esperanto
2015-11-13 18:16:36 +01:00