1785 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
8a06aa1c9b remove newlines and extra spaces when parsing repo name and description
The formatting of these texts should happen in the Android layouts, not
with inline whitespace characters.
2014-12-11 13:49:56 +01:00
Daniel Martí
e085bcd54c Use the newer plugin form 'com.android.application' 2014-12-10 10:53:37 +01:00
Daniel Martí
9d2a4eb999 Enable all java lint warnings 2014-12-10 10:50:08 +01:00
Daniel Martí
c7e9e16a6b Bump to 0.77-test 0.77-test 2014-12-09 15:55:13 +01:00
Daniel Martí
fa9690886b Merge branch 'gradle-structure'
As described on https://f-droid.org/forums/topic/gradle-directory-structure/.

This will keep things a bit weird with git for a bit, but you can always use
--follow to make it take renames into account for the commit history.

I tweaked both the ant and gradle build setups and both of them work in the
new structure. And gradle is much faster since e.g. now an 'assemble' inside
F-Droid assembles only the client, without including all the subprojects as it
happens in master.
2014-12-09 15:37:14 +01:00
Daniel Martí
06dd4c8dcb Move F-Droid project into subdir, keeping a root gradle project
Also improved .gitignore a tad
2014-12-09 15:36:07 +01:00
Peter Serwylo
f0dba2f6e7 Merge branch 'fix-111/lollipop-sadness' into 'master'
Fix issue #111 (Doesn't work on lollipop devices)

See Issue #111 (monster comment https://gitlab.com/fdroid/fdroidclient/issues/111#note_379713) for details of fix.

See merge request !41
2014-12-03 10:37:12 +00:00
Peter Serwylo
6d0207c32e More robust failure conditions for local repo keystore.
Was experiencing some problems with local repo keystore on Android 2.3.4.
Previously, the local repo keystore could fail to create, but would still
return a LocalRepoKeyStore instance to be used. Now it throws a checked
exception, and is dealt with in the relveant places.

Also cleaned up some calls to "e.printStackTrace()" and replaced with
more informative logging messages.
2014-11-29 03:58:43 +11:00
Peter Serwylo
0a4725b962 Disable spongycastle before verifying jar files.
Fixes issue #111. This is a workaround rather than a full solution,
but it solves the problem. There is a bug in Lollipop, whereby including
spongycastle as a security provider causes problems verifying .jar files.
As a result, it is now disabled when actually performing verification,
so that the libraries provided by Android do the work, and then re-enabled
afterwards.

There is an ever so slight chance that the period when this is disabled
may align with the period when spongycastle may actually be required
(i.e. for signing a local repo index). This is a risk which I cnanot
see how to avoid, and will likel7 cause either the signing to fail
due to the unavailability of the relevant security classes. However
this is very minimal, hard to reproduce (I couldn't get it to happen)
and also has the effect of the local repo failing, rather than the updating
of apps failing (which is arguably more important) and so is worth it in
my opinion.

See comments at https://gitlab.com/fdroid/fdroidclient/issues/111
for much greater detail.
2014-11-28 06:48:38 +11:00
Daniel Martí
2d78fa802f Remove values-zh-hk as it is making builds error 2014-11-15 22:13:42 +01:00
Daniel Martí
afad8fb85a Run fix-ellipsis.sh 2014-11-15 20:37:38 +01:00
F-Droid Translatebot
8de3842285 Translation updates 2014-11-14 12:12:16 +00:00
Daniel Martí
9b108e36d8 Bump build.gradle tools and plugin versions 2014-11-14 12:10:56 +01:00
Daniel Martí
eb83736dce Better fallback for sdk levels we don't yet know about 2014-11-14 12:10:07 +01:00
Daniel Martí
1248bd0523 Fix more RTL issues 2014-11-05 21:52:33 +01:00
Daniel Martí
216ec24680 Bump target sdk to 21 2014-11-05 21:44:36 +01:00
Daniel Martí
9ab4b55de1 Fix select_local_apps_list_item layout on <17 2014-11-05 21:38:55 +01:00
Daniel Martí
a845f66099 Don't abort on lint errors 2014-11-05 21:36:35 +01:00
Daniel Martí
c6811d83b2 Bump gradle plugin version to 0.14.1, upgrade properties 2014-11-05 21:31:25 +01:00
Daniel Martí
e6bce05bd2 Bump toolVersion 2014-11-05 21:16:16 +01:00
Daniel Martí
3e0df70c56 Bump support library submodule to v21.0.1 too
Assuming that the HEAD at October 30th, 2014 is what was used to release
21.0.1. We can't know for sure since it wasn't tagged.
2014-11-05 21:07:00 +01:00
Daniel Martí
9f0873a3af Update support-v4 to 21.0.1 2014-11-05 20:59:04 +01:00
Daniel Martí
c3af53a18d Update UIL to 1.9.3 2014-11-05 20:46:07 +01:00
Daniel Martí
aa0abaeb70 Add 20 and 21 to getAndroidVersionName, better out of bounds check 2014-11-05 19:57:09 +01:00
Ron Rieve
8e3b064786 On update errors, actually display an error
Previously the update silently failed, and even showed "No Repository has any package updates". The commit relays one error message per repo and adds a localized message when only a part of the repo updates failed. Also, the error message for more severe errors is made more verbose.

Also removed the "errmsg" variable.
2014-11-04 21:50:44 +11:00
Peter Serwylo
6d1801c0fd Merge branch 'feature/swap-ui-implementation' into 'master'
Initial "swap" UI implementation

This is a major rejigging of the "Local Repo" user interface, to make it easier for lay people to use F-Droid to swap their apps with their peers. I wont mention too much here, because the individual commits have more detailed information. However, it is worth  noting that major things that probably deserve testing are:
 * Going through the proccess of creating a swap
 * Scanning the QR code from another users F-Droid "swap" screen
 * Scanning the QR code from their barcode scanner
 * Entering the URL shown below the QR code into the browser and following the steps
 * Installing an app from the "Swap" success screen
 * Using NFC to add swap (I couldn't test this as only have 1 NFC device in the house)

I've actually had trouble installing from the swap screen after upgrading to Android 4.3.1 (CM) on my Nexus 4. However that issue seems to be present on the current stable "Local Repo" implementation too, so will stop banging my head against the desk in the interest of getting this initial swap implementation out.

Subsequent work will go towards refining edge cases. I'm cataloging these in my fork of fdroidclient on github. The type of things which I still need to work on include :
 * i18n all of the strings
 * Enabling NFC
 * Dealing with WIFI disconnects
 * Support WIFI AP
 * Adding back the "search" functionality in the "create swap" screen
 * ... and no doubt others will arise ...

A major feature which is missing is Bluetooth, but some earlier work has been done on that which will make it less of a burden to implement. As this is getting reviewed for merging, I will start working through these other issues.

See merge request !28
2014-10-22 12:45:00 +00:00
Peter Serwylo
58db8a1f00 Correct handling of back button presses during swap workflow.
When electing to "Swap Apps" from the main menu, and a LocalRepoService
is already running, then it jumps straight to the wifi QR fragment.
However, it didn't play nice when pressing the "back" button. This is
now fixed, by manually recreating the backstack in this situation.

It also fires up the NFC push message if NFC exists.
2014-10-22 18:08:32 +10:30
Peter Serwylo
92f71ca13a Ability to cancel swap. Made QR code larger.
Added a "Cancel" button to the swap QR code screen.
Also changed how the LocalRepoService deals with onDestroy(). Previously, it
would invoke `stopNetworkServices()` on the UI thread, blocking for a
significant portion of time (enough to cause ANR messages on my devices).
Now, it does this on a new thread.

As for the QR code size, it was getting quite small on my nexus 4,
which I think has a large screen (even though there is much larger about).
As a result, it couldn't be scanned properly using barcode scanner.
This is the first major diversion from carries mockups, in that the qr
view is now in a scroller, which means the "Open QR Code Scanner" button
may well not be visible on the main screen on small devices. Not sure about
how to manage this tradeoff between biggish qr code but everything
viewable on one screen.
2014-10-22 18:08:32 +10:30
Peter Serwylo
de74d6457d Local repo notification directs to swap wifi connect screen.
Previously it would direct to the LocalRepo screen, then when that code
was ported to the swap workflow, it did nothing :( Now it does as one
might expect, and actually directs the user to the swap screen.
2014-10-22 18:07:46 +10:30
Peter Serwylo
ddb9791e11 Incoming swap URI's (from the web browser) go to correct place.
The
2014-10-22 18:07:46 +10:30
Peter Serwylo
b0586384f8 Handle barcode scanner when user selects "back".
Previously, it would receive a valid response, but the resulting content
of the scan was null.
2014-10-22 18:01:25 +10:30
Peter Serwylo
4857ed2d45 Fixing merge saddness after rebasing my changes over master.
I had a couple of months of changes which I rebased over master.
It made me sad. After doign what I thought was required to resolve
conflicts, I've now gone and fixed a few bits here and there.

This arose because I didn't try and compile after each merge conflict.
I'll take the lesson onboard and try to remember to do this in the
future :)
2014-10-22 18:01:25 +10:30
Peter Serwylo
a299340db7 Show a different list of apps after swap is ready, rather than the default.
Previously, we would redirect to the main list of apps. Now, the swap
thing will show the specific apps in the "LocalRepo" category. It also
shows the "Swap complete" message with a nice icon carrie designed.
2014-10-22 18:01:25 +10:30
Peter Serwylo
bcb47c9490 Update the "next" button label correctly during swap workflow.
Instead of always showing "swap", sometimes it shouldn't be shown
at all (i.e. on the first and last screen) and on the NFC screen,
it says "skip".

There is a translated string called "skip_button_label" available
in the AndroidPreferenceFragment library, but I don't want to rely
on that. Prefer to have our awesome translators be in charge of
that label.
2014-10-22 18:01:24 +10:30
Peter Serwylo
6d006e70b3 Always attempt to push swap repo via NFC.
Previously, swap would only enable this if the user hadn't previously
said "Don't show NFC message again". However, we really want people
to be able to swap regardless of whether the actual UI message is shown
or not.

Refactored NfcBeamManager to NfcHelper, to allow extra utility methods
to live there. Specifically, the process of sending a URI over NFC.

Removed some superfluous debugging calls to Log.i().
2014-10-22 18:01:24 +10:30
Peter Serwylo
6b27568ac4 Correct theme applied to swappable apps list.
Took a while to figure out, but the problem was that the support
libraries ListFragment would only ever use getActivity() when
creating widgets. What we really needed was the ability to use
an alternative context, namely a ContextThemeWrapper. If this is
passed to the constructor of a widget, it is themed appropriately.

To make it work, we now create our own list view in onCreateView()
(which is really a copy of the code from the android list_content.xml
file anyway). There are also some workarounds for a bug in the
support library with regards to using your own view.
2014-10-22 18:01:24 +10:30
Peter Serwylo
3eee4f115a Make "Open QR scanner" button work for swap connect screen.
I did the same as some previous code which copied code from the zxing
library and put it in the com.google.zxing namespace (but left the license
in tact - is this okay for Apache 2.0 stuff?). The reason was that they
encourage copying the relevant two files into your project and modifying
as neccesary. In this case, it wasn't about modifying for functionalities
sake, but rather for android support libraries sake. The upstream version
doesn't support android.support.v4.app.Fragments, only android.app.Fragments.

Hooking up the intent integrator from zxing almost removes the need for
the refactoring which made FDroid.java responsible for handling "new repo"
intents. However, there is still the one case of the user not using
the QR code, but rather a web browser to connect to a swap. That is, they
will click a link on the other phones web browser, which directs them to
initiate the swap. Thus, we still need FDroid.java to be able to distinguish
between a "swap" new repo request, and a regular "add repo" new repo request.

In the process, I also commented out the "It's not working" button.
2014-10-22 18:01:24 +10:30
Peter Serwylo
b841c4b4c9 Remove public/private/hotspot icons (Fixes issue #9)
These have been temoprarily moved to an unused layout. The reason
it wasn't removed completely was because the layout still adheres
to the spec from carrie (and I couldn't be bothered looking through
the git history to find it later on when it is time to re-implement
it :)

I've also commented out the "Learn more about wifi" and "use
bluetooth instead" buttons for now.
2014-10-22 18:01:24 +10:30
Peter Serwylo
80205e94fb Implemented client connection for swap.
Listen for a new intent, show a screen to the user mentioning
they are about to start a swap. Make FDroid receive repo intents,
then dispatch to relevant Activity.

Previously manage repo always got the intents. Now FDroid does, and
chooses whether to give to ManageRepos or Client connect.
Not sure if it is required to do it this way or not, but it seems to
work.

I had a bit of an issue getting the "Welcome to F-Droid" string to
fit on one line, because it was breaking on the hyphen. That is still
not resolved in this commit.

Still need to:
 * Show error messages instead of the "connect" description
 * Jar signing seems not to work when connecting to other repo.

In order to handle returning to F-Droid after connecting (or saying no)
I tagged the intent with a "handled" extra value. That way, I can ignore
trying to connect to a repo if we've already handled that event.

Finally, I also fixed an issue regarding downloading of signed
index.jar files with an uppercase fingerprint.
The fingerprint from the jar differed from that in the swap url,
in that one was upper case and the other was lower case.
This uses an .equalsIgnoreCase check instead. It also adds an
extra guard in case the repo doesn't have a fingerprint. Although
it may not even use the signed repo updater if both the pubkey
and fingerprint are null, it is nice to have the extra assurance.

Fixes issue #19.

I also left some more TODO's around. I should put them in issues,
but I'm in a bit of a hurry.
2014-10-22 18:01:24 +10:30
Peter Serwylo
2a22a8b6cb Move "Start local repo" to the SwapActivity, rather than WifiQrFragment.
By starting the repo in the activity, both the NFC and wifi fragments
have access to it. In the future, it will make it easier to move some
of the static stuff from FDroidApp (to do with "selected apps") into
the SwapActivity, as it will not really be needed anywhere else.
2014-10-22 18:01:24 +10:30
Peter Serwylo
e84e9c15e2 Support "back" button navigation during swap process. Start service at end of swap.
The back button will take you back through each step of the swap
process now, and remove the swap Activity completely if you press
back from the first screen. Also, when the WiFi QR code is shown,
the local repo manager actually starts the relevant service.
2014-10-22 18:01:24 +10:30
Peter Serwylo
87b82a6751 Bring the swap website (hosted on the phone) in line with new designs.
The website now also has icons which it needs to worry about copying
across to the webroot, so I refactored the "symlink webroot to other
folders - such as /fdroid and /fdroid/repo".
2014-10-22 18:01:24 +10:30
Peter Serwylo
6d807793c2 Moved code from LocalRepo to the Swap UI to reuse it.
Along with a bunch of networking stuff, a lot of UI to do with selecting
apps to swap was also moved. The background on the list is transparent,
which allows blue to shine through. Also, the text on the list items is
white, which will not work with a white background.

I've temporarily dropped support for searching this list too, until
I get some feedback from carrie et al.

NOTE: This stuff was written before hans fixed apcompat problems with
LocalRepoActivity, but then rebased over it later. As such, it doesn't
contain his fixes. Will need to do that before a stable release. i.e.
Still has a bit of a dependency on API 11 which needs to be resolved.
2014-10-22 18:01:24 +10:30
Peter Serwylo
ae9cb5b89b Beginnings of an implementation for Swap.
The Fragments and an Activity which tie all of the swap views together
has begun. The first bit of implementation is to get the current
wifi network displayed, which worked out alright.

This commit contains a lot of theme related stuff, particularly
involving taking assets from carries mockups and making them suitable
to use as drawables. The process for doing this is a story for another
day, but I'll document it and put it on the wiki in the future. carrie
showed me a script that a mate of hers used on another project, and
I've adapted it a little to make it work nicely here (note - it isn't
in this commit).

The button is blue, and always shown with associated text in the
ActionBar. This required a custom drawable which was set as the
background in the styles.xml.
2014-10-22 18:01:24 +10:30
Daniel Martí
b14bffa1c5 Replace a few tabs by space indents 2014-10-16 17:18:08 +02:00
Daniel Martí
2fd8982485 Fix some formatting across the java code
A good reference is:
https://google-styleguide.googlecode.com/svn/trunk/javaguide.html

Unfortunately, since there is no checkstyle file for it, we can't check for it
programmatically.
2014-10-16 17:15:47 +02:00
Daniel Martí
93c9abb887 Use interface types where possible 2014-10-16 16:55:07 +02:00
Daniel Martí
10009dc1fe Bump to 0.76 0.76 2014-10-09 00:43:53 +02:00
Peter Serwylo
4ba45ba66f Merge branch 'stable-fixes' into 'master'
fix crasher bug in 0.75

    fix divide-by-zero crash when a repo has less than 25 apps in it

    This was introduced in e4401ed22c0f65db5d4f1a1f0e1222b061e471af

See merge request !39
2014-10-07 21:27:40 +00:00
Hans-Christoph Steiner
0a10e44778 don't check incoming repo URI is on same wifi if device does not have wifi
Fixes this crash:
              dalvikvm  W  threadid=1: thread exiting with uncaught exception (group=0xb68df4f0)
        AndroidRuntime  E  FATAL EXCEPTION: main
                        E  java.lang.RuntimeException: Unable to resume activity {org.fdroid.fdroid/org.fdroid.fdroid.views.ManageReposActivity}: java.lang.NullPointerException
                        E      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2120)
                        E      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
                        E      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
                        E      at android.app.ActivityThread.access$1500(ActivityThread.java:117)
                        E      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
                        E      at android.os.Handler.dispatchMessage(Handler.java:99)
                        E      at android.os.Looper.loop(Looper.java:130)
                        E      at android.app.ActivityThread.main(ActivityThread.java:3683)
                        E      at java.lang.reflect.Method.invokeNative(Native Method)
                        E      at java.lang.reflect.Method.invoke(Method.java:507)
                        E      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
                        E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
                        E      at dalvik.system.NativeStart.main(Native Method)
                        E  Caused by: java.lang.NullPointerException
                        E      at org.fdroid.fdroid.views.ManageReposActivity.checkIfNewRepoOnSameWifi(ManageReposActivity.java:466)
                        E      at org.fdroid.fdroid.views.ManageReposActivity.addRepoFromIntent(ManageReposActivity.java:455)
                        E      at org.fdroid.fdroid.views.ManageReposActivity.onResume(ManageReposActivity.java:144)
                        E      at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
                        E      at android.app.Activity.performResume(Activity.java:3832)
                        E      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
                        E      ... 12 more
2014-10-07 17:03:06 -04:00