128 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
7c67db22f3 reformat repo URIs to allow wifi, fingerprint, etc. in query string
Instead of ramming the fingerprint in the user field of the URI, use the
query string.  Having the fingerprint in the user field was confusing some
browsers because it was trying to log in.  The query string is the standard
place for such meta data, and has lots of room for expansion including
things like wifi network names. This will be useful later to determine if
both devices are currently on the same wifi network, and if they are local
repos, they should try syncing.
2014-01-28 20:31:46 -05:00
Hans-Christoph Steiner
126d96e4ba prevent soft keyboard from popping up on RepoDetails
Its quite annoying to have the URI EditText in focus and the soft keyboard
pop up when viewing the RepoDetails since the vast majority of the time,
the user will be viewing the info there, not editing the URL.

This commit just moves the focus to the frame, and prevents the soft
keyboard from showing up by default.  The user can still click on the URI
EditText to edit it and the soft keyboard will pop up.
2014-01-28 20:31:46 -05:00
Hans-Christoph Steiner
ea9dec34b3 include upper case URI schemes for matching URIs from QR Codes
Android's scheme matcher is case-sensitive, so include
ALL CAPS versions to support ALL CAPS URLs in QR Codes.
QR Codes have a special ALL CAPS mode that uses a reduced
character set, making for more compact QR Codes.

This reverts:
We should not encourage all caps urls
2651b81792bdeed0db3c3960d0b7283536611012
2014-01-22 22:07:03 -05:00
Peter Serwylo
f8893431fb Refactored Repo db access from DB class to ContentProvider.
The performance improvement from this will not be noticable (perhaps
there isn't one), however it is part of the bigger plan to move all of
the DB access to ContentProviders. This will make a big improvement to
the startup time of the app, given we are currently loading all of the
apps to populate the list of apps.

It will come at the cost of some apparantly weird code convensions. Most
notably, when loading data from a content provder, you only ask
for the fields that you intend to use. As a result of my Helper class which
converts results from the content providers cursor into Repo value objects,
there is no guarantee that certain attributes will be available on the
value object. E.g. if I load repos and only ask for "_ID" and "ADDRESS",
then it is meaningless to ask the resulting Repo object for its "VERSION"
(it wont be there), despite it being a perfectly legal attribute from
the Java compilers perspective.

Repo.id field has also been made private (sqlite is the only
entity should be able to set id's), and made id a long (sqlite stores
identifiers as longs rather than ints).
2014-01-23 13:03:07 +11:00
Hans-Christoph Steiner
62008e85c6 show repo name in ActionBar in "Repo Details"
Before, "Repo Details" always had a title of "Repositories". Now
it shows the name of the repo as the title.  This also enables the
ActionBar back button (aka "display home as up") to return to
"Manage Repos".
2014-01-21 19:21:34 -05:00
Daniel Martí
7c472c8e18 Merge branch 'development' 2014-01-10 22:06:43 +01:00
Daniel Martí
15c1b98d5c Release 0.58 2014-01-10 21:29:25 +01:00
Daniel McCarney
254327f9a7 Adding support for SPKI pins, trust-on-first-use of TLS certs.
In order to support F-droid repositories hosted with HTTPS using
a self-signed certificate the f-droid client should prompt the user to
trust or 'memorize' the certificate presented by a repository. The
MemorizingTrustManager[0] project enables easy integration of
a prompting activity and corresponding trust manager implementation.
This behaviour is useful to projects such as Kerplapp[1] that boostrap
an F-droid repository on a user's device where it isn't possible to
acquire a long lived CA vetted TLS certificate.

In addition to Trust-on-First-Use (TOFU) behaviour, this patch
integrates the PinningTrustManager [2] project by Moxie Marlinspike to
allow the FDroid client to ship a hardcoded set of Subject Public Key
Identifier pins [3] for the official FDroid repository TLS certificate,
and the Guardian Project TLS certificate. Additional pins can be added
to the FDroidPins.java class.

The upstream release of AndroidPinning by moxie0 uses a minsdk value of
8. The Fdroid client has a minsdk of 5, presenting compatibility issues
using the AndroidPinning lib as a submodule. Fortunately it seems there
is no technical reason preventing using a minSDK of 5 with
AndroidPinning. I have created a fork with this change and submitted
a pull req upstream. Until this pull is merged we can use my fork of
AndroidPinning as the submodule.

The new 'flow' for deciding if a repositories presented TLS certificate
should be trusted is as follows:

1) If the certificate was previously trusted by a TOFU action, then the
   certificate is accepted as trusted

2) If the certificate wasn't previously trusted by a TOFU action but
   there is a matching SPKI pin then the certificate is accepted as
   trusted

3) If the certificate wasn't previously trusted by a TOFU action and
   there is no SPKI pin but the certificate is signed by a trusted
   Certificate Authority it is accepted as trusted (This is the
   behaviour of the FDroid client prior to this patch with all other
   conditions being a hard-fail).

4) If the certificate wasn't previously trusted by a TOFU action and
   there is no SPKI pin and the certificate is not signed by a trusted
   CA (i.e. self signed or otherwise) then the user is prompted to TOFU
   the certificate. The user may choose to trust the certificate for the
   current connection or forever. If the user chooses an option other
   than "deny" the certificate is accepted as trusted for the specified
   duration.

Users currently using a TLS protected repository will see *no
difference* in user experience after this patch is merged as the only
TLS protected repositories that would function prior to this patch were
providing certificates that match condition #3.

[0] https://github.com/ge0rg/MemorizingTrustManager/wiki/Integration
[1] https://github.com/guardianproject/kerplapp
[2] https://github.com/moxie0/AndroidPinning
[3] https://www.imperialviolet.org/2011/05/04/pinning.html
2014-01-08 11:01:12 -08:00
Daniel Martí
abc3631b16 Merge branch 'master' into development 2014-01-07 23:57:25 +01:00
Daniel Martí
837683217b Release 0.57-test 2014-01-07 23:49:23 +01:00
Peter Serwylo
c1ccdcfca8 Merge branch 'master' into development
Conflicts:
	src/org/fdroid/fdroid/DB.java
	src/org/fdroid/fdroid/FDroid.java
	src/org/fdroid/fdroid/RepoXMLHandler.java
2014-01-06 15:05:37 +11:00
Peter Serwylo
ffa2c962dc Merge branch 'master' into improvement/16/manage-repos
Conflicts:
	res/layout/appdetails.xml
	res/values/strings.xml
	src/org/fdroid/fdroid/DB.java
	src/org/fdroid/fdroid/FDroid.java
	src/org/fdroid/fdroid/ManageRepo.java
2014-01-04 20:19:27 +11:00
Daniel Martí
c6e9002f2c Use a literal string for versionName in AM.xml
It's handier to have just the one resource version_name, but lint gets very
angry at this (and there must be a reason for that). We must not forget to
update the resource in res/values/no_trans.xml, since it's still used in the
code.
2014-01-04 01:23:32 +01:00
Daniel Martí
e8d3a7a4ef Raise minSdk to 5, UIL requires it 2014-01-01 22:22:21 +01:00
Daniel Martí
dc7df0fc5f Release 0.56-test 2013-12-26 00:12:46 +01:00
Daniel Martí
2651b81792 We should not encourage all caps urls 2013-12-16 10:23:21 +01:00
Peter Serwylo
82af6fc60e Merge branch 'master' into improvement/16/manage-single-repo
Phew, monster merge. Going to commit after *seemingly* resolving
conflicts, but it will no doubt take a few compile and runs to sort out
any funny stuff.

Conflicts:
	AndroidManifest.xml
	res/layout/addrepo.xml
	res/layout/appdetails.xml
	res/layout/repolisticons.xml
	res/values/strings.xml
	src/org/fdroid/fdroid/DB.java
	src/org/fdroid/fdroid/FDroid.java
	src/org/fdroid/fdroid/ManageRepo.java
	src/org/fdroid/fdroid/UpdateService.java
2013-12-06 08:43:11 +11:00
Peter Serwylo
93fec74728 WIP: implementing context and action bar menus for repo management.
SwitchCompat will return a Switch or a ToggleButton depending on the
platform (doesn't matter, both are CompoundButtons) and this will be
added to the repo_item view programatically.

I'm using some pretty specific listeners
to communicate between the details fragment and the repo list activity.
I've also split the functionality (e.g. for deleting) between the repo
list and the details view. In the future, when we have content providers
for repos, it will be easier to take care of everything from the details
screen, and automatically notify the repo list of changes.

Refactored update service.
Now has a static update method that can be called which
will setup the required intent to begin the update. It also deals with
progress listeners and dialogs for the user, so all of this is moved out
of FDroid. This was so that RepoDetailsFragment can now invoke the same
functionality.
2013-12-05 13:04:33 +11:00
Hans-Christoph Steiner
1ad693931f if incoming repo Intent is handled, then return to the sending Activity 2013-12-02 21:55:55 -05:00
Hans-Christoph Steiner
a3ac298ae4 narrowly tailor repo URL matching to avoid false matches
With so many patterns being matched, it is highly likely that there will be
false positives, i.e. random URLs will trigger the prompt of whether to use
F-Droid or not.  The updated set of patterns narrowly tailors the matches
so that it is highly unlikely to match URLs that are not fdroid repos, yet
still makes it useful both as a generic repo and a peer-to-peer
bootstrapping repo.

This set of patterns only matches URLs like this:

https://foo.org/fdroid/repo
https://foo.org/fdroid/repo/
https://foo.org/fdroid/repo/////

It does not match URLs like this:

https://f-droid.org/repo
https://myblog.com/thoughts-about-my-lovely-fdroid-repo
https://news.com/tag/repo
https://somesite.com/repo/this-is-my-stuff

It matches multiple slashes to since those are in effect the same URL, and
they sometimes show up as typos.  This does not include mvdan's proposal
for the 'fdroid-bootstrap' tag on the end because its not something that I
would use in this current project, so I don't know how best to apply it.  I
have no objection to the 'fdroid-bootstrap' proposal.
2013-12-02 15:37:49 -05:00
Hans-Christoph Steiner
c0eecabcca also match repo urls that have one, two or three extra levels to the path
Yes, you really have to do all this craziness to get it to match right!
2013-11-22 17:17:19 -05:00
Hans-Christoph Steiner
f5ce7d8588 simplify browse URL IntentFilter data for readability
Each piece of <data /> applies to the whole IntentFilter, so each scheme,
host, or pathPattern only needs to be stated once per IntentFilter.
2013-11-19 21:17:24 -05:00
Hans-Christoph Steiner
3301a57a01 handle incoming URIs based on patterns: "^https?://.*/(repo|archive)/*$"
This allows for clickable/scannable URIs for adding repos to F-Droid.
2013-11-19 15:04:48 -05:00
Hans-Christoph Steiner
6928bd1244 accept froidrepo and fdroidrepos URIs, which can be scanned via QRCode, etc
This patch makes F-Droid register with Android that it accepts the URI
schemes of fdroidrepo (HTTP) and fdroidrepos(HTTPS).  When F-Droid receives
one of these URIs, it launches the ManageRepo Activity and then launches
the New Repository dialog.

refs #2454
2013-11-19 10:56:38 -05:00
Ciaran Gultnieks
44c1dc2c44 Version 0.55 2013-11-11 10:12:32 +00:00
Daniel Martí
36cba44c07 Bump project target to android-19 2013-11-10 18:55:35 +01:00
Daniel Martí
3cedecca0c Release 0.54 2013-11-04 23:13:47 +01:00
Daniel Martí
a76a465cf1 Re-add theming, much better this time 2013-11-03 16:12:22 +01:00
Daniel Martí
8f7d09f41a Release 0.53-test 2013-10-24 21:04:02 +02:00
Daniel Martí
d6f0fbca98 New setting: Automatic app list updates only on wifi (fixes: #380) 2013-10-24 14:21:35 +02:00
Daniel Martí
e6ef9889d0 Place strings not to translate in separate file 2013-10-15 14:42:13 +02:00
Daniel Martí
96bcee1066 Try to fix HomeAsUp problems on 4.0 and below 2013-10-03 19:00:46 +02:00
Daniel Martí
f84e0e4fd6 Release 0.52-test 2013-09-29 21:00:27 +02:00
Daniel Martí
5aa2710362 Leave repo uri scheme handling for later, fix search schemes 2013-09-29 20:27:49 +02:00
Daniel Martí
da5877c9c4 Add support for fdroid.search:<query> and market://search?q=<query> 2013-09-26 08:56:09 +02:00
Daniel Martí
17302321b8 Add support for fdroid.repo:https://repo/address 2013-09-26 01:04:12 +02:00
Daniel Martí
0c12c0248e Allow Backups of fdroid 2013-09-23 21:22:56 +02:00
Daniel Martí
1161bf65d1 Release 0.51-test 2013-09-22 00:14:38 +02:00
Daniel Martí
3741c0c62b Revert all Light Theme changes
Should be done differently. Light theme before Holo is buggy.
2013-09-01 14:03:55 +02:00
Daniel Martí
ec74cbed48 Bump target sdk level to 18 2013-08-29 21:51:08 +02:00
Daniel Martí
50f0856f67 Add "Light Theme" setting
Default theme is dark (Holo dark on >=11), addition is light on <11, Holo.Ligt
on >=11 and Holo.Light.DarkActionbar on >=14
2013-08-23 14:29:50 +02:00
Ciaran Gultnieks
cf120d27e4 Version 0.50 2013-08-20 08:42:00 +01:00
Ciaran Gultnieks
e37bf801f4 Version 0.49 2013-08-19 10:02:01 +01:00
Ciaran Gultnieks
1bad4cc5f7 Version 0.48-test 2013-08-06 14:53:11 +01:00
Daniel Martí
7611a26f0a Use strings in AM.xml labels 2013-07-28 13:50:42 +02:00
Daniel Martí
a2e99c05a6 Fix f-droid.org web repo handling
Links on the site end with '/'. Using pathPrefix is IMHO better than
duplicating with and without ending slash.
2013-07-28 09:36:37 +02:00
Daniel Martí
6544ebed94 Handle www.f-droid.org as well as f-droid.org 2013-07-28 09:25:31 +02:00
Daniel Martí
aa164dd090 Also open web repo links right away
No fdid opens the app normally, listing all the apps. If fdid is present, that
app is opened.
2013-07-28 09:23:53 +02:00
Peter Serwylo
af2a9ecfb6 Safer preference managing. Fix "compact layout requires reload".
Previously, everybody had to remember the preference name and the
default value. If it was ever changed, this would have to be updated
everywhere. Now, the Preferences class is responsible for talking to the
SharedPreferences functionality of ANdroid.

I've started with just the compactlayout preference, because
that is what I required for this fix.
2013-07-26 09:38:23 +10:00
Daniel Martí
47575b5c56 Add search results label 2013-07-26 00:10:48 +02:00