* Don't apply android plugin in root project
This results in the root project being treated like and Android project.
That is, gradle will expect an AndroidManifest, a targetSdk property, and
all sorts of stuff that is not relevant to the root project.
Perhaps more importantly, this breaks integration with Android Studio,
which is the tool that many potential contributors will be using.
Finally, it also allows runing gradle tasks in the root project, rather
than having to cd into the F-Droid directory, which is a minor nicety.
The reason it was there in the first place was to make it so that we could
find the location of the Android SDK using the same mechanism that the
plugin used. To deal with this, this commit adapts the SDK finding code
from the gradle plugin.
* Make gradle error out when missing depenencies.
The support v4 library requires some obsolte SDKs that are likely
not installed. It caused non-intuitive errors to come up for me,
so I've made gradle tell the user when this occurs.
* Documented the main build.gradle file
This is primarily to explain the hacks we use in order to build the
Android support libraries.
The specific reason for this is that it provides @Null and @NotNull
annotations which should increase the safety of our code. Many of the
bugs which get filed are due to NullPointerExceptions, which could be
avoided by tooling using these annotations. The goal is to statically
catch this specific class of errors in as many situations as possible,
rather than waiting for them to occur at runtime.
The README documentation was not updated after the move of the f-droid client
code to the F-Droid directory. The instruction where therefore wrong
The troubleshooting documentation about determining the used Android versions
in the project was also outdated. While the script was made functional the tip
to install the various sdk from the command line did does not work for me.
This script should be in the root of the git repo so that the config in
Jenkins' web interface is always just:
./jenkins-build
This commit also includes a little code to make it easier for people to run
this script on their own machines, if they want to reproduce the Jenkins
build setup.
This now figures out the root of the fdroidclient project and works there,
rather than just working in the root on the project. So it can be run like
./tools/zip-build.sh or (cd tools && ./zip-build.sh) or whatever.
I also removed the pointless function, since it is only called once in the
script.
This is a basic set of tests. These tests should be extended in three ways:
* make sure all of the apps are parsed
* make sure all of the APKs are parsed
* make sure the ProgressListener is called
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.
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.
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.
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.
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
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.
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.
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.