1612 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
bbb91e8eca fix bug where "app repo" dialog gets created twice for an incoming Intent
onNewIntent() is called because ManageReposActivity is set to "singleTask"
launchMode, but it is only called if ManageReposActivity is already
running.  onResume() is always called, and called after onNewIntent() if it
is called, so use onNewIntent() only to set the current Intent, then parse
the Intent only in onResume().

Here is how to reproduce the original bug:

1. Close F-Droid properly and start it again.
2. Click on https://guardianproject.info/fdroid/repo in a browser (and tell
   it to open with F-Droid)
3. Hit cancel on the add repo dialog
4. Leave F-Droid open and switch back to the browser
5. Open that link again.

This should result in two dialogs on top of one another. Happened from both
Firefox, Chrome, and Android browsers.
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
182aea0f98 support 1 and 2 level nested repos in QR Code URLs
This adds support for QR Code URLs nested in dirs 1 or two levels deep.
This supports things like the Amazon S3 URLs.
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
13f52e1b50 change title to "F-Droid" for VIEW Intent receiver chooser
When someone clicks on a URL that F-Droid can accept, i.e. a repo URL, then
Android puts up a chooser where the user can select which app to VIEW the
URL with.  That was showing up with the title "Repositories", which is the
title used for that Activity when viewing it.  This keeps the Activity
title the same while changing the title in the chooser.
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
56933cdbd6 sanitize URL from clipboard and parse fingerprint (fixes #50)
Instead of just sticking whatever URL is in the clipboard into the "Add
Repo" dialog, this attempts to sanitize the URL in case it has some garbage
or came from a QR Code, and therefore was all uppercase (that makes for
smaller QR Codes).  It also checks if there is a fingerprint in the query
string of the URL, and sticks that into the fingerprint box.

fixes #50 https://gitlab.com/fdroid/fdroidclient/issues/50
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
a525bca1cf split out new, incoming repo configs into a separate class: NewRepoConfig
The swap stuff will also need to handle incoming Intents that represent
new repos, so the parsing logic is now its own class NewRepoConfig, which
is something like the Repo class, but using getters instead of properties.
Since the new repo data does not change once FDroid receives it, the only
way to set the values of a NewRepoConfig is via the constructor.

This is based on some incomplete work from @pserwylo:
71cb12ef5c (diff-6)
and
71cb12ef5c (diff-7)
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
92199f2f01 merge dimen.xml into dimens.xml (the standard name)
'dimen' resources go in dimens.xml, 'color' resources go into colors.xml,
etc. etc.
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
c1e5e287b7 rename AppListFragmentPagerAdapter to fix typo
AppListFragmentPageAdapter is a subclass of FragmentPagerAdapter, so it
should include the same spelling to make that clear and easy to trace,
grep for, etc.
2014-07-15 12:28:40 -04:00
Hans-Christoph Steiner
0945661c9d ManageReposActivity: move as much out of the Fragment; use appcompat menu
Now that the Fragment is embedded in the Activity, and the menu has been
moved to the Activity in ActionBar style, most of the utility functions and
the Dialogs can be based out of the Activity, which is how they are
designed to work.  This makes things work a lot easier.

fixes #3 https://gitlab.com/fdroid/fdroidclient/issues/3
2014-07-15 12:28:40 -04:00
Hans-Christoph Steiner
d41499d656 move RepoListFragment into ManageReposActivity
This will make it a lot easier to deal with the ActionBar menu and handling
rotations when the "add repo" dialog is showing.
2014-07-15 12:28:40 -04:00
Hans-Christoph Steiner
7a08ab532f run code formatter on ManageReposActivity and RepoListActivity
This should ease future comparisons after these two files are merged into
one.
2014-07-15 12:28:40 -04:00
Hans-Christoph Steiner
83072bc2c4 rename ManageRepo.java to be with all the rest of the Activity files
This moves it to the org.fdroid.fdroid.views package and names it in the
same style as the Activities in that package.
2014-07-15 12:28:40 -04:00
Hans-Christoph Steiner
cba8f3b68f convert main menu to appcompat ActionBar style
This allows the main menu to act like a proper ActionBar using appcompat.
It also allows for making the search happen live on the ListView, rather
than having to launch a separate Activity to show the results.
2014-07-15 12:28:40 -04:00
Hans-Christoph Steiner
b06792524e port everything to appcompat-v7 (#42, #51)
I went through all of the source code replacing anything that is now
possible using appcompat-v7.  appcompat-v7 is the official way to handle
backwards compatibility, and it is supported by Google and others. Using it
as much as possible should make the code more maintainable and readable by
others since they'll be used to seeing the appcompat-v7 patterns from other
projects.

fixes #51 https://gitlab.com/fdroid/fdroidclient/issues/51
fixes #42 https://gitlab.com/fdroid/fdroidclient/issues/42
2014-07-15 12:28:23 -04:00
Hans-Christoph Steiner
3fef37a5f4 added test of "Master Key"-style exploit based
This does not seem affected, I made a quick and dirty zip with two
index.xml files in it following these instructions:
http://www.saurik.com/id/17

refs #39 https://gitlab.com/fdroid/fdroidclient/issues/39
2014-07-10 13:30:44 -04:00
Daniel Martí
8af69afba6 Merge branch 'fix/issue-51-search-action-compat' of https://gitlab.com/pserwylo/fdroidclient 2014-07-06 11:22:59 +02:00
Daniel Martí
96333c1cba Merge branch 'fix/issue-3-repo-update-rotate' of https://gitlab.com/pserwylo/fdroidclient 2014-07-06 11:13:26 +02:00
Peter Serwylo
c6e86392ff Fix issue #51. Made SearchView stuff use appcompat-v7.
Previously, it was using the native android.widget.SearchView.
Now it uses the widget from appcompat. For good measure, I also
made it so that the search button is always in the action bar,
rather than being hidden behind a menu sometimes.
2014-07-06 01:11:14 +09:30
Peter Serwylo
5ff0ef8de7 Fix issue #3: Retain progress dialog for repo update during orientation change
Do so by:

 - Making RepoDetailsFragment/RepoListFragment retain their instances
 - Move the management of the update repo dialog to UpdateReceiver
 - Let the fragments tell the UpdateReceiver when to show/hide
2014-07-05 22:45:15 +09:30
Daniel Martí
eb841a88ca Update build-tools version 2014-07-02 14:04:05 +02:00
Daniel Martí
4e52611d36 Prepare for 0.70-test 0.70-test 2014-06-26 13:23:50 +02:00
Daniel Martí
72f238ac84 Remove useless LinearLayout that only holds a RelativeLayout 2014-06-26 13:22:05 +02:00
Daniel Martí
216acf5ae8 Run fix-ellipsis 2014-06-25 11:42:56 +02:00
Peter Serwylo
1d4581a78e Reverted layout of app details to what it was before. 2014-06-24 08:30:25 +09:30
F-Droid Translatebot
a030c25f4f Translation updates 2014-06-19 23:05:53 +01:00
Daniel Martí
98a333b7fa "Other" should be the last preferences category 2014-06-19 10:20:01 +02:00
Daniel Martí
4c94203fd9 Clean up changelog 2014-06-19 10:04:19 +02:00
Peter Serwylo
d13a8c101a Merge branch 'proxy-and-jenkins-script' into 'master'
HTTP Proxy preference for Tor, I2P, etc; add jenkins script

This adds a preference to set the HTTP Proxy so that FDroid can funnel all traffic through Tor, I2P, psiphon, or any other HTTP proxy.

Also, there is a script for jenkins to run before calling `ant clean debug` for the whole setup process.  This script sets the `versionCode` to the UNIX time in seconds, and adds the date/time to the `versionName` so that the debug builds are very clearly marked from real builds, and they will automatically update when included in a debug repo:
https://dev.guardianproject.info/issues/2601
2014-06-16 20:45:30 +00:00
Hans-Christoph Steiner
b7f0195234 add "HTTP Proxy" preference to support Tor, I2P, or any other proxy
This is the most basic support for channeling all downloads through Tor or
I2P.  This does not include Orbot integration, so the use will have to know
to start Orbot before using this.  I don't know anything about I2P.

closes #2367 https://dev.guardianproject.info/issues/2367
https://f-droid.org/repository/issues/?do=view_issue&issue=404
https://f-droid.org/repository/issues/?do=view_issue&issue=424
2014-06-05 17:23:44 -04:00
Hans-Christoph Steiner
ff5d2b571f include script for jenkins to run for setting up the ant build
Jenkins will then call ant directly after running this script.  This then sets
the debug builds made by Jenkins to have a versionCode of the UNIX time in
seconds and adds the data to the versionName.  This clearly marks these as
debug builds and also makes it possible to have an fdroid repo of debug builds
that will automatically update after each build.
2014-06-05 17:23:44 -04:00
Daniel Martí
2f9c3b8056 Switch to java 1.7
Taken from the gradle plugin user guide:

With Android KitKat (buildToolsVersion 19) you can use the diamond operator,
multi-catch, strings in switches, try with resources, etc.

Note that you can use minSdkVersion with a value earlier than 19, for all
language features except try with resources. If you want to use try with
resources, you will need to also use a minSdkVersion of 19.

You also need to make sure that Gradle is using version 1.7 or later of the
JDK. (And version 0.6.1 or later of the Android Gradle plugin.)
2014-06-05 10:32:57 +02:00
Daniel Martí
5dac28f882 Make it explicit that we're using 1.6
Can be bumped to 1.7 if minsdk is bumped to 8
2014-06-05 10:23:55 +02:00
Daniel Martí
67b608e4e5 Set the gradle project name to F-Droid like ant 2014-06-05 10:20:06 +02:00
Daniel Martí
ce42783583 Move support-v4 jars around in ant-prepare 2014-06-05 10:15:26 +02:00
Daniel Martí
4929a8c15d Remove now unnecessary -pre-build from ant 2014-06-05 09:49:41 +02:00
Daniel Martí
5d3372207a Hard-code v7-appcompat target to android-19
Taken from v7/appcompat/build.gradle
2014-06-05 09:47:56 +02:00
Peter Serwylo
5af5306311 Merge branch 'appcompat-on-top-of-pserwylo' into 'master'
Appcompat on top of pserwylo

This is a refactor of @pserwylo's !19 to get appcompat building with `ant` and Eclipse.  I reviewed @pserwylo's commits and they are ready to go as they are in this merge request.
2014-06-05 05:38:53 +00:00
Hans-Christoph Steiner
81cbef82b4 finish ant/gradle build for appcompat-v7
Both preferencefragment and appcompat-v7 submodules need the
android-support-v4.jar to be included in their respective libs/ dirs in
order for ant to build those projects.
2014-06-04 23:19:54 -04:00
Peter Serwylo
208146882e Fixed light theme on API > 11
Forgot that it also needed to go in the values-v11 styles file.
2014-06-04 23:19:54 -04:00
Peter Serwylo
b82be525b9 Rotation of app details with fragments implemented.
This was a bit more complex than all the other views, because it supports
rotation, and different views for when it is rotated. The end result is
that the way in which the views were constructed needed to be completely
redone.

In the process, I also moved the layout of the app summary to a Relative
Layout. This adds more flexibility, and is also the suggested layout
for complex views (as apposed to nested linear layouts). I believe this
is due to the performance of relative vs linear layotus.

It was aprticularly hard to figure out what was going on
when rotating an Activity which had a list fragment
that had another fragment as a header. I don't think fragments
were designed to work like this, but I believe it is all working
as expected now.

Conflicts:
	src/org/fdroid/fdroid/Preferences.java
2014-06-04 23:19:54 -04:00
Peter Serwylo
659b46fd4e Fix to sdkLoc in build. Added light (without dark action bar) theme.
NOTE: I don't know how android will go with adding a new property
to a string-array resource, but not having it translated everywhere.
Will it struggle because the EN version has three values for "theme",
but other translations only have two?
2014-06-04 23:19:54 -04:00
Peter Serwylo
3050e3dbc5 Migrating activities to appcompat-v7
The only remaining activity is the AppDetails acvitity, which will require
a little more than just making it extend ActionBarActivity. Currently,
it extends ListActivity. To support appcompat-v7, it really should have
two fragments - the details one and the list one. Then, when the orientation
is changed, it should load a different layout with the fragments side by side.

Although Google is encouraging people to make old devices run apps
with the action bar (via appcompat-v7), they haven't provided a way
for people to create preference/setting screens with an action bar.

There are plenty of issues in the Android issue tracker relating
to this, but it doesn't yet seem to be on the radar of the Android
devs.

Until there is a native implementation of PreferenceFragment in
the appcompat-v7 support library, this submodule provides is a 3rd
party solution. It is actually a fork of the first repo in github,
though that was a bit of an upload and dump, without accepting MR's.
This fork includes gradle support.
2014-06-04 23:19:37 -04:00
Peter Serwylo
59b9fd6a8c add PreferenceFragment lib since appcompat lacks such a thing
Although Google is encouraging people to make old devices run apps
with the action bar (via appcompat-v7), they haven't provided a way
for people to create preference/setting screens with an action bar.

There are plenty of issues in the Android issue tracker relating
to this, but it doesn't yet seem to be on the radar of the Android
devs.

Until there is a native implementation of PreferenceFragment in
the appcompat-v7 support library, this submodule provides is a 3rd
party solution. It is actually a fork of the first repo in github,
though that was a bit of an upload and dump, without accepting MR's.
This fork includes gradle support.
2014-06-04 23:16:26 -04:00
Peter Serwylo
92421bac05 WIP: Migrating activities to appcompat-v7.
Conflicts:
	src/org/fdroid/fdroid/FDroidApp.java
	src/org/fdroid/fdroid/views/LocalRepoActivity.java
	src/org/fdroid/fdroid/views/QrWizardDownloadActivity.java
2014-06-03 08:13:53 +09:30
Peter Serwylo
58ff02a3f4 Build with dependency on support-appcompat-v7.
Thanks to the awesome work of mvdan, this was mostly ready to roll.
However, I had to wrestle for a while for two reasons:

 1) I forgot to add the dependency in the build.gradle file (it was
    already present in settings.gradle)
 2) My IDE was unable to read the ANDROID_HOME env variable, and
    despite my internet-search-fu, I couldn't figure out how to
    make IntelliJ specify env variables for a gradle build. It took
    a while to figure out, because it was failing silently in weird
    ways.

After slaving away on a nice method to parse both the ANDROID_HOME
and the local.properties file (looking for sdk.dir), and then emmiting
nice error messages if neither were found or pointed to an invalid
location, I discovered it had already be done:

android.plugin.sdkDirectory ends up here:

https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/internal/Sdk.groovy#161

Which does exactly all that and more. So now sdkLoc is initialized to
the value of android.plugin.sdkDirectory.
2014-06-03 08:11:59 +09:30
Daniel Martí
728d1467b9 Prepare for 0.69-test 0.69-test 2014-06-01 18:38:04 +02:00
Peter Serwylo
95180512c7 Merge branch 'jmdns-fixes-and-tor-onion-support' into 'master'
Jmdns fixes and tor onion support

There are three groups of work in this collection of commits:

* improvements to the `WifiStateChangeService` and related activities like JmDNS to eliminate problems that happen when there are a lot of wifi change events.

* add rework the `.net.Downloader` stuff to add Tor support and lay the groundwork for Bluetooth support

* add support for repos on Tor Hidden Service .onion addresses
2014-05-31 02:25:19 +00:00
Hans-Christoph Steiner
c1b5bf5279 implemented IconDownloader for UIL downloads with FDroid classes
This lets UniversalImageLoader (UIL) use FDroid's generic Downloader
infrastucture so that connection configuration all happens based on the URL
in DownloaderFactory.

refs #2598 https://dev.guardianproject.info/issues/2598
refs #2367 https://dev.guardianproject.info/issues/2367
2014-05-30 15:23:33 -04:00
Hans-Christoph Steiner
d19e77049a rename Downloader.inputStream() to getInputStream()
This follows:
URLConnection.getInputStream()
BaseImageDownloader.getStream()
2014-05-30 15:23:33 -04:00
Hans-Christoph Steiner
b619716669 add TorHttpDownloader for handling repos on Tor Hidden Services
Tor Hidden Services are on domain names that always end in .onion, so there
is a URL pattern matcher that chooses which Downloader subclass to use
based on testing for .onion.  This is a quick, dumb implementation.  It
does make any attempt to see if Tor is running or even installed.  That
can come once NetCipher is easy to handle in the context of FDroid.

refs #2367 https://dev.guardianproject.info/issues/2367
2014-05-30 15:23:33 -04:00
Hans-Christoph Steiner
910f9a68a6 make DownloaderFactory for creating any kind of Downloader
This will ultimately be used to create the right Downloader subclass
instance based on the URL of the file to download (i.e. rfcomm://, .onion
address, ssh://, new socket protocols, etc).

Also delete unused constructors, they can trivially be readded if they are
ever used, and they are currently just clutter.
2014-05-30 15:23:33 -04:00