765 Commits

Author SHA1 Message Date
Daniel Martí
7f09ff0c09 Bump gradle and build-tools versions 2013-12-22 14:15:17 +01:00
Daniel Martí
2651b81792 We should not encourage all caps urls 2013-12-16 10:23:21 +01:00
Daniel Martí
71be2d8e82 Avoid a couple possible NullPointerExceptions 2013-12-14 11:47:59 +01:00
Daniel Martí
e070883934 Remove empty overrides 2013-12-14 11:41:25 +01:00
Daniel Martí
744d46161e Remove unnecessary returns 2013-12-14 11:34:26 +01:00
Daniel Martí
2ee5226d62 Remove wanted id instead of hard-coded 1... 2013-12-12 00:32:35 +01:00
Daniel Martí
a0a2fe4cf0 A few variable type fixes 2013-12-12 00:32:35 +01:00
Daniel Martí
ccbfa2744e Replace iterator with foreach 2013-12-12 00:32:35 +01:00
Daniel Martí
00a0f4399f Avoid a couple possible NullPointerExceptions 2013-12-12 00:32:35 +01:00
Daniel Martí
10fa5108da Delete a bunch of unused imports 2013-12-12 00:32:29 +01:00
Daniel Martí
9522edda74 Remove a couple unused vars 2013-12-12 00:14:26 +01:00
Daniel Martí
d042ed7508 Multiple appends are better than an append of a concatenation 2013-12-12 00:13:09 +01:00
Daniel Martí
f4fa7db8c8 Make a couple FDroid variables local as per lint suggestion 2013-12-12 00:12:52 +01:00
Daniel Martí
23dcfadefa Don't crash if an apk exists for a non-existing app 2013-12-07 13:00:10 +01:00
Daniel Martí
901112b29d Update UIL 2013-12-07 12:25:48 +01:00
Ciaran Gultnieks
4d3b7967c4 Merge branch 'merge-requests/45' 2013-12-04 17:44:34 +00:00
Ciaran Gultnieks
831a1b40fa Merge commit 'refs/merge-requests/45' of git://gitorious.org/f-droid/fdroidclient into merge-requests/45 2013-12-04 17:44:31 +00:00
Ciaran Gultnieks
708518883a Merge branch 'merge-requests/44' 2013-12-04 17:42:32 +00: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
f9d2fbb0ae if incoming repo already exists and is enabled, show Toast and hide dialog
No need to show the dialog if it won't let you take any action.
2013-12-02 21:50:08 -05:00
Hans-Christoph Steiner
c7b076e5ea add detailed checking of incoming repos based on fingerprint in DB
When a new repo is being added, whether manually or via an incoming Intent,
check the address and fingerprint against repos in the DB.  If the repo is
not in the DB, offer to add it.  If the repo address is in the DB, then do
more checks:

* If that address has no fingerprint in the DB, then offer to add the new
  repo including that fingerprint.  This might happen when upgrading a repo
  from unsigned to signed.
* if the incoming info matches a repo in the DB, offer to enable that repo
* if the address matches a repo in the DB but the incoming fingerprint does
  not match the fingerprint in the DB, warn the user, and tell them to
  delete the existing repo if they truly want to override the existing info
2013-12-02 21:50:08 -05:00
Hans-Christoph Steiner
711a1418b6 make DB.calcFingerprint() return null if pubkey is null
Handling it here seems to keep the flow simple.
2013-12-02 21:50:08 -05:00
Hans-Christoph Steiner
e063636d61 make all incoming repo URLs all lowercase 2013-12-02 21:50:08 -05:00
Hans-Christoph Steiner
ffc1f27e33 remove trailing spaces from .java files to placate the more finicky formats
the Eclipse Android mode loves to remove all trailing whitespaces quite
religiously.  This commit just removes trailing whitespace.  It was done
by running this:

sed -i 's/[[:space:]]*$//' *.java */*.java
2013-12-02 18:53:33 -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
Daniel Martí
7dfe9eac24 Add basic gradle support 2013-11-27 15:47:13 +01:00
Daniel Martí
78caf63093 Update UIL to latest master 2013-11-27 15:23:55 +01:00
Ciaran Gultnieks
62ddbe5ce1 Database upgrade fix 2013-11-27 13:54:55 +00:00
Ciaran Gultnieks
2e21f8abba Support for displaying UpstreamNonFree 2013-11-27 11:26:52 +00:00
Ciaran Gultnieks
d21788569f Accept declaration of maxage from repos 2013-11-26 19:59:42 +00:00
Ciaran Gultnieks
7dc56e6009 Add database field to enforce max age on index (per repo) db-version/30 2013-11-26 16:29:42 +00:00
Ciaran Gultnieks
46bcfcf015 Merge branch 'merge-requests/43' 2013-11-24 07:42:41 +00:00
Hans-Christoph Steiner
95f932f79f update database to store repo key fingerprint
The stored fingerprint is needed for comparing new, incoming repos that are
in the Add Repo dialog.  This is to prevent malicious use of the automated
adding of repos via QR Codes, NFC, etc.  The only other option that I could
think of for handling this situation is for the Add Repo dialog to open a
socket to the proposed repo to get its pubkey.  That seems much less
desirable than just storing the fingerprints in the database.
db-version/29
2013-11-23 13:42:22 -05:00
Hans-Christoph Steiner
ee21a2724c generate fingerprint as a hex String, leave formatting for display code
When the fingerprint is generated to be stored in the database in the repo
table, make it a single String that is a hex number.  This is a natural
format for working with the fingerprints programmatically.  The display
formatting can then be handled by the display code, and can freely change
without affecting the underlying function of the code.
2013-11-23 13:42:22 -05:00
Hans-Christoph Steiner
9b485bece3 switch repo key fingerprint to SHA-256 since SHA-1 is considered deprecated
* a number of sources have said to avoid SHA-1 in new implementations
* nothing currently depends on the SHA-1 fingerprint in the code, it is
  only used to display on the repo list.
* Java 7 requires SHA-256 to be included
* keytool -list -v shows the SHA-256 fingerprint
2013-11-23 13:42:22 -05:00
Hans-Christoph Steiner
fd28883429 break out signing key fingerprint calculation into its own method
This will be needed for checking an incoming repo URL with a fingerprint
included to see if that uri/fingerprint already exists in the database.
2013-11-23 13:42:22 -05:00
Hans-Christoph Steiner
240f03d372 add "proper" Java decorators that Android ADT insists on adding
Everytime I save a java file with Android ADT, it adds @Override decorators
and throws errors if a method is called that is not supported in API 4. My
setup might be more sensitive since its setup with the official Android
style plugin for Eclipse.  But the decorators are "correct" Java style, so
it would be nice to have them in F-Droid.
2013-11-23 13:39:26 -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
F-Droid Translatebot
fbd7a0c8e7 Translation updates 2013-11-22 21:01:19 +00:00
F-Droid Translatebot
95af56a118 Translation updates 2013-11-22 20:08:59 +00:00
Ciaran Gultnieks
6a6c2287d4 Merge branch 'merge-requests/39' 2013-11-22 09:44:54 +00:00
Hans-Christoph Steiner
36da418660 add CheckBox to enable overwriting of existing repos when adding new ones
The "Add" button is disabled until the user turns overwrite on.  It should
prevent accidental overwriting, but I imagine this could be handled better.
2013-11-20 00:06:12 -05:00
Hans-Christoph Steiner
14c525e7ff add fingerprint field to Add Repo dialog, and alert if repo already exists
Previously, anything added via the Add New Repository dialog would just
overwrite any existing repo config that was there.  This has become a
bigger issue with the QR Code scanning since it could become an attack
vector.  This is the first step towards making this Add Repo dialog give
more info to the user about the state of things, and what the user might
replace by clicking OK.
2013-11-20 00:06:12 -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
1b8ea8f3d5 Handle unrecognises antifeatures more gracefully
This allows us to add new ones without making a mess in the client.
Prior to this change it would add empty lines, and also if the only
antifeature was an unrecognised one, would enable the antifeature view
box but with nothing in it. It should now ignore them completely.
2013-11-17 11:33:05 +00:00
Aleksey Tulinov
4f717c663b Issue #413: removed "compacts" array to always re-layout reused views 2013-11-17 06:23:12 +02:00
Daniel Martí
5626adc574 Properly retab all layout xml files 2013-11-16 23:39:37 +01:00
Daniel Martí
a2b939d1fc AppList icons back to 40dp, AppDetails icons to real 48dp 2013-11-16 23:37:26 +01:00