1194 Commits

Author SHA1 Message Date
Daniel Martí
f67527a86e Replace _i18n with _count in tab strings
All strings are internationalized. Use a name that actually says what
they mean.
2015-12-02 18:46:01 +01:00
Daniel Martí
aff3995475 tab fragments: use string resources consistently
Also, remove unnecessary "Installed" tab title duplicate.
2015-12-02 18:45:49 +01:00
F-Droid Translatebot
2154d37dc8 Pull translation updates from Weblate
Translators:

Ajeje Brazorf       Sardinian
Ldm Public          French
Mladen Pejaković    Serbian
naofum              Japanese
2015-12-02 18:37:18 +01:00
Ruben Roy
676d173cc9 Merge branch 'master' into 'master'
Add counter to "Installed" tab. Closes #497



See merge request !176
2015-12-02 00:30:23 +00:00
Ruben Roy
ab00d49737 Add counter to "Installed" tab. 2015-12-02 05:51:13 +05:30
Daniel Martí
4f8fe4e967 FileCompat: fix setExecutable signature
For some reason its first argument was "readable", while it clearly
should be "executable" as per the code below. Also see the method we
call on api 9 and newer:

https://developer.android.com/reference/java/io/File.html#setReadable(boolean, boolean)
2015-12-01 13:52:25 +01:00
Daniel Martí
30bc2cf8d5 Build fix after checkstyle changes 2015-11-30 11:36:04 +01:00
Daniel Martí
8405ba7d87 checkstyle: proper multiple empty line check
Hopefully checkstyle could catch all of these on its own one day. For
now, help it via a multiline regex.
2015-11-30 11:30:49 +01:00
Daniel Martí
098241c981 checkstyle: don't allow multiple empty lines 2015-11-30 10:40:35 +01:00
Daniel Martí
f2212e33d7 Make newer checkstyle happy
Mostly just dropping public from constructors.
2015-11-30 10:37:43 +01:00
Daniel Martí
4f34013885 Bump checkstyle to 6.12.1
Makes the existing checks a lot better (we were on 5.x) and allows us to
add checks that require newer versions.
2015-11-30 10:37:43 +01:00
Peter Serwylo
959fe9f2e3 Show indeterminate progress when persisting the temp apk table.
Will also appear as indeterminate if:
 * The repo being downloaded from doesn't send a Content-Length header.
 * While connecting to the HTTP server to begin downloading.
2015-11-30 18:46:10 +11:00
Peter Serwylo
77ee4296a5 Guard against divide by zero exceptions during progress events. 2015-11-30 18:19:34 +11:00
Peter Serwylo
096b9c20d1 Changed logging levels as per CR. 2015-11-30 18:16:11 +11:00
Peter Serwylo
a3c91e4eae Reformatted some annotations to be inline. 2015-11-30 18:16:11 +11:00
Peter Serwylo
ab33eccaa2 Replaced if with switch. Fixed typo in error. 2015-11-30 18:16:11 +11:00
Peter Serwylo
c5bf2a131b Remove unused imports. 2015-11-30 18:16:11 +11:00
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
Ruben Roy
1a54c61a50 Make progressbar in notification determinate 2015-11-27 18:43:16 +05:30
Daniel Martí
7286bafa23 Bump to 0.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