1194 Commits

Author SHA1 Message Date
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.
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í
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í
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
Daniel Martí
04a2c4b70d Fix tests by never caching a null signature
This also keeps us from future possible NPE or null signature issues, if
we ever call getPackageSig on a PackageInfo with no signatures.
2015-11-13 11:42:47 +01:00
Christian Morgner
405e411200 Enable HttpDownloader to use URL-based HTTP Basic Authentication. 2015-11-13 09:30:08 +01:00
relan
c3fd3984b8 Remove the code related to the compact layout
Compact layout preference is gone.
2015-11-13 09:25:49 +03:00
relan
7458dff6e9 Remove unused string repo_icon 2015-11-13 09:14:45 +03:00
relan
0324631a4e Remove unused string repo_update 2015-11-13 09:14:44 +03:00
relan
bb5665ab23 Remove unused color 2015-11-13 08:58:06 +03:00
relan
5c9e314c9b Suppress lint warnings about unused categories names
They are actually used from the code.
2015-11-13 08:58:06 +03:00
relan
e841d63ea9 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
2015-11-13 08:27:55 +03:00
relan
f0d72a3ec4 Remove search button from the search results activity
It violates app navigation logic.
2015-11-13 08:27:55 +03:00
relan
32413a2753 Put empty text below the categories spinner
When an on-screen keyboard is used to enter a search query, empty text
can overlap categories spinner on small screens.
2015-11-13 08:19:57 +03:00
Daniel Martí
f7a0063495 proguard: only keep zipsigner 2015-11-12 20:21:48 +01:00
F-Droid Translatebot
e0c09853b9 Pull translation updates from Weblate
Translators:

ageru               French
Benedikt Geißler    German
Kiril LastName      Bulgarian
Marcelo Santana     Portuguese (Brazil)
Marvin W            German
2015-11-09 17:12:35 +01:00
relan
b533bc2112 Remove unused string swap_tap_to_select_apps 2015-11-09 15:51:18 +03:00
relan
3bbcca9966 Remove unused string update_all 2015-11-09 15:47:20 +03:00
relan
96ffb5f0fd Remove unused layouts 2015-11-09 15:45:47 +03:00
relan
7fdcd706fd Split tabs layouts
Use separate layouts for the three tabs. This simplifies code and improves
maintainability.
2015-11-09 15:43:09 +03:00
relan
950854318b Add styles for app list and empty text
Those styles will be used in the three layouts that will define the
look of the fragments.
2015-11-09 15:43:09 +03:00
relan
080527bf2e Remove ThemeableListFragment
Not sure why it was added initially but now it appears to be unneeded:
the support library does everything right and the lists are themed
properly without any hacks.
2015-11-09 15:42:52 +03:00
relan
817cac3002 Remove dead code in CanUpdateAppsFragment
Remove unused layout creation code. If needed, it can be re-added later as
an XML resource which is a much more maintainable way to define layouts.
2015-11-09 15:08:53 +03:00
Peter Serwylo
1a5bd84fad Never fallback to UIL for handling image downloads, only use for displaying.
Our `IconDownloader` extended `BaseImageDownloader` from UIL. There was an
explicit check in the F-Droid `IconDownloader` which looks for
HTTP/HTTPS/Bluetooth schemes. If it wasn't one of these, it fell back
to the base class. This was what was happening for local cached image
files. As such, when the `getInputStream(...)` method was refactored
to only use F-Droids `DownloadFactory` and not delegate to the base class,
it failed on local "file://" URLs.

This change introduces a `LocalFileDownloader` and makes the `DownloaderFactory`
aware of it.

The `BaseImageDownloader` class only provides support for the following schemes:

 * HTTP
 * HTTPS
 * File
 * Android content providers
 * Android assets
 * Android drawables

F-Droid now supports HTTP, HTTPS, and File URLs. There is not currently any
need for content proiders, assets or drawables to get icons for apps in F-Droid.
If there is a need in the future (e.g. an issue currently discusses loading
icons from installed apps if possible) then that specific `Downloader` can get
introduced to solve the problem.
2015-11-08 10:30:23 +11:00
F-Droid Translatebot
447dbe73ea Pull translation updates from Weblate
Translators:

ageru                French
Phạm Nguyễn Hoàng    Esperanto
Phạm Nguyễn Hoàng    Vietnamese
2015-11-07 14:03:48 +01:00
Daniel Martí
eefbee969e Store installed app signature in cache
This means we can fetch the signatures only once instead of every time we need
them. Start by using the cache in AppDetails.
2015-11-07 13:57:34 +01:00
Daniel Martí
bb9426763c Remove <p> from comments
These are written manually and mostly don't contain HTML. Some html is
fine if you want to use links or markup, but <p> elements are just
pointless and very seldom used. Be consistent in not using them.
2015-11-07 13:25:01 +01:00
Daniel Martí
40092a07dd Don't duplicate repo info in UpdateException
The exception already contains the repo object, so don't hard-code the
address in the message string again.
2015-11-07 13:19:30 +01:00
Daniel Martí
dd9a7207ac Bump to 0.98-alpha0 after stable 2015-11-07 13:15:21 +01:00
Daniel Martí
94b30a54a6 Merge branch 'test-multi-repos' into 'master'
Added tests for multiple repositories providing same apks

Right now, multi repo support works, but is kinda funky. While fixing #324, I accidentally broke this support without realising it. So in the interests of making my approach to #324 more test driven, I've written some tests for multi repo support.

Initially I wrote tests for the actual correct, desirable behaviour. Then when it became apparant that we dont' do this, I commented those tests out (but left them there for hopefully future multi-repo work) and then added tests for the current behaviour to make sure we don't introduce regressions.

Android unit testing framework is nice for testing content providers. It is nice for testing file handling. However I really struggled to get it working with both. Had to do some interesting things with instrumentation and contexts in order to get it to work.

I'm sure Android has nice `Service` testing capabilities too. But given the trouble with instrumentation/contexts/files/providers/etc, it was easier for me to refactor the parts of `UpdateService` that I needed to test into a separate, testable class. 

See merge request !163
2015-11-07 11:45:47 +00:00
Peter Serwylo
47196234fe Merge branch 'improve-downloader-close-handling' into 'master'
Make closing of `Downloader`s more concise.

*NOTE: This is  only a WIP branch in so far as I haven't tested it, as it was done on the train before my holiday. The code is final though, so if people are happy it works, please merge.*

The base `Downloader` class now wraps the `InputStream` returned by
any child classes, in order to notify the child class when that stream
is closed. This prevents each child class having to figure out a way
to be notified of this.

This helps keep the API concise, because close handling is dealt with
without the need to add any public methods to the `Downloader` class
hierarchy.

Also removed some dead code which was unused.

See merge request !139
2015-11-06 22:47:11 +00:00
Peter Serwylo
12d5c5c7b4 Format to make checkstyle happy. Remove unused code. 2015-11-07 09:40:44 +11:00
Peter Serwylo
002d356ece Ensure the "no apps to display" doesn't overlap with the category spinner.
There is no layout .xml file for the updated/installed list,
but there is for the available apps list. As a result, the `TextView` containing
the empty list message is added dynamically. With the recent improvements to
the category spinner, a `RelativeLayout` was used instead of a `ListView`. To
remedy this, the layout has been augmented to ensure the dynamically added
`TextView` still displays correctly.
2015-11-07 09:05:10 +11:00
Peter Serwylo
94410c5dbc Code formatting to pass checkStyle. 2015-11-07 08:39:23 +11:00
Peter Serwylo
3ad429aa6b Guard against null activity.
Came across this whibluetooth swap.
I think it is reasonable to guard against null activities here, because
we are likely not releasing observers correctly, and thus the observer
may receieve a notification when the activity is not attached.
2015-11-07 08:39:23 +11:00
Peter Serwylo
f388f32fcf Don't use download manager for Bluetooth downloads.
The F-Droid Bluetooth downloader must be used for these, as it is a
custom protocol and Android download manager only understands HTTP
and HTTPS.
2015-11-07 08:39:23 +11:00
Peter Serwylo
012cdce37b Make closing of Downloaders more concise.
The base `Downloader` class now wraps the `InputStream` returned by
any child classes, in order to notify the child class when that stream
is closed. This prevents each child class having to figure out a way
to be notified of this.

Also removed some dead code which was unused.
2015-11-07 08:36:17 +11:00
Peter Serwylo
938c992023 Comment out tests for future, desirable behaviour.
Leave only the ones which align with the current multi-repo behaviour
that F-Droid exhibits.

The commented out tests can be uncommented in the future when working
on proper multi-repo support.
2015-11-07 08:05:13 +11:00
Peter Serwylo
1c179848b7 Added tests for current multi-repo behaviour.
This is the bare minimum of what must be maintained going forward.
Ideally the behaviour sohould be better, but that is for the future.
2015-11-07 08:05:13 +11:00
Peter Serwylo
0685c16efe More work on multi-repo tests, currently broken due to F-Droid being broken.
(One of) the problems with F-Droid's multiple support is that there is
a primary key on the fdroid_apk table which is a composite of:

 * id
 * vercode

Which means that two repos providing the same version means one will
update the other, rather than ending up with two different versions.

Instead, there should be some other way to differentiate apks from
different sources. Firstly, it should take into account the signing
cert. Secondly, it may taken into account the hash, because two people
could sign different apks with the same cert and then we are back at
square one.
2015-11-07 08:05:13 +11:00