147 Commits

Author SHA1 Message Date
Daniel Martí
f17482f1eb Bump compile/target sdk versions to 24 2016-07-13 16:08:55 +01:00
Daniel Martí
8d60e70f5d Bump buildToolsVersion to 24.0.0 2016-07-13 14:59:14 +01:00
Daniel Martí
bd0efe8ffa Bump to 0.101-alpha2 2016-07-06 20:22:02 +01:00
Daniel Martí
6d52bc1022 Revert to build-tools 23 until we can have 64-bit
As long as we're stuck with 32-bit on the buildserver, avoid both target
and build-tools 24. Necessary to do an alpha.
2016-07-06 11:38:25 +01:00
Daniel Martí
7fe15e6c7d PMD: bump to 5.5.0 2016-07-04 11:32:29 +01:00
Daniel Martí
8af44b1af5 checkstyle: bump to 7.0
Remove LITERAL_DO from the config in RightCurly as we want this:

        do {
            foo;
        } while (bar);

Not this:

        do {
            foo;
        }
        while (bar);

This went unnoticed as LITERAL_DO was broken in RightCurly in earlier
Checkstyle versions.
2016-07-04 11:31:41 +01:00
Daniel Martí
3b649138bd Bump buildToolsVersions
The new CI image has 24, not 23.0.3.
2016-06-23 11:42:53 +01:00
Daniel Martí
cd1f59fb29 Bump ACRA to 4.9.0
Also change the overrides from onCreate to init as suggested in the
changelog:

https://github.com/ACRA/acra/wiki/ChangeLog#acra-490-rc-1-2-may-2016

The behaviour should be very similar, although overriding the wrong
method (which we were doing) could cause all sorts of weird issues.
2016-06-21 13:35:29 +01:00
Daniel Martí
26f5286f97 lint: don't unnecessarily disable warnings
Those that are sometimes false positives but could still point out valid
issues should be warnings, not disabled entirely.

The first two are warnings already, the third is an error.
2016-06-21 13:26:56 +01:00
Hans-Christoph Steiner
80b158e7d6 enable build fail on lint error to catch them in CI builds
The spongycastle issue is taking a long time to get resolved, has not yet
affected us, and would be a lot of work to fix in a different way. So the
'InvalidPackage' error is just disabled for now.
2016-06-21 12:52:05 +02:00
Daniel Martí
015343f9df Bump to 0.101-alpha1 2016-06-20 21:52:26 +01:00
Daniel Martí
4fbc327a91 Bump robolectric to 3.1 now that it's out
And remove the now unnecessary -rc justification comment.
2016-06-17 15:51:50 +01:00
Daniel Martí
3d59f4f192 Bump commons-net to 3.5 2016-06-17 15:51:50 +01:00
Daniel Martí
b71cb37cad Bump commons-io to 2.5 2016-06-17 15:51:50 +01:00
Daniel Martí
1ac53078ee Bump support libs to 24.0.0
Also bump the docker image since it contains the newer support m2 repo.
2016-06-17 15:51:25 +01:00
Peter Serwylo
4e73d1e5e6 Finish porting tests to Robolectric, and appease PMD.
To appease PMD, we now have a three rulesets in `config/pmd/*.xml`:

 * `rules.xml`: The bulk of the rules, used by both main and test code.
 * `rules-main.xml`: Rules specific to the andoid client code.
 * `rules-test.xml`: Rules specific to test code.

The rationale is because checkstyle by default checks for "too many static
imports", which is a fair call. However in JUnit4 code, it is common to
import many `assert*` static methods.
2016-06-09 10:44:40 +10:00
Peter Serwylo
4e66bb810f Ported AppProvider tests to Robolectric.
Get around silly `final` methods in `ContentResolver` with Mockito and `delegatesTo`.

The Robolectric library presumes that people always want to test content providers by
manually invoking the `query`/`update`/`delete` methods on the `ShadowContentResolver`.
While that is a great feature for testing, we have helper methods that require testing,
and these methods accept either a _real_ `ContentResolver` or `Context`. Robolectric
did some cool magic in terms of intercepting runtime calls to content resolvers and
forwarding them to the "shadow" verison, to deal with final/package private/etc methods.
However, as a side effect, the `ShadowContentProvider` _is not a `ContentProvider` as
far as the Java compiler is concerned.

By utilising Mockito + `delegatesTo` method, we are able to achieve what is required:
 * An actual `ContentProvider` instance.
 * It forwards calls to the `ShadowContentProvider` provided by Robolectric.
2016-06-09 10:44:40 +10:00
Peter Serwylo
09fd3d188c Robolectric testing support + InstallAppProvider testing now run in JVM.
Robolectric provides testing support for Android via the JVM, including testing
of content providers. In order to get these tests to work, we need to avoid
the default behaviour of starting up FDroidApp.onCreate(). This method has a lot
of static state which fails if set multiple times. Instead of trying to ensure
we correctly zero out that state each test, it is preferable to instead never
bother with that in the first place. Expecially when that is not what is under
test (as is the case with content provider tests).
2016-06-09 10:44:40 +10:00
Daniel Martí
52e4548755 Sync changelog with 0.100 release
Also, bump versionCode to 0.101-alpha0 to allow upgrading from 0.100 to
master.
2016-06-07 21:44:22 +01:00
Daniel Martí
08e067c6ba pmd: bump to 5.4.2
This is a bugfix release where they mostly fixed false positives. No
changes required.
2016-05-30 22:08:19 +01:00
Daniel Martí
d4bb97db72 checkstyle: bump to 6.19
Seems like they finally fixed the hanging throws indent issue.
2016-05-30 22:04:33 +01:00
Hans-Christoph Steiner
d4d5fb1908 Merge branch 'check-repo-index-timestamps' into 'master'
Check repo index timestamps

The Update Framework documents provide a [nice discussion of possible attacks](https://github.com/theupdateframework/tuf/blob/develop/SECURITY.md) against update systems.  One example is a "rollback attack", where the attacker just serves the old signed `index.jar` to keep all clients from updating their apps.  That allows the attacker to exploit known vulnerabilities in those un-updated apps.

While this is a reasonably hard attack, this fix is an important step towards removing the requirement for trusting the web server operator.  Ultimately, it should be able trusting the index signing key only.  Then it doesn't matter were the files come from, it just matters that they are verifiably signed by the index signing key.

This does not address "freeze attacks" since it allows an index update with the same timestamp.  I did that deliberately to slowly ramp up the security checks in order to avoid problems along the way. Code-wise, blocking freeze-attacks is mostly a matter of changing the timestamp check from `<` to `<=`.

See merge request !302
2016-05-21 19:56:49 +00:00
Hans-Christoph Steiner
086ff54b5f move versionCode to app/build.gradle to match versionName
on @mvdan's request
2016-05-20 12:19:17 +02:00
Daniel Martí
30eaf328fd Bump support libs to 23.4.0 2016-05-20 11:12:34 +01:00
Hans-Christoph Steiner
f7c043b3fc set versionName based on git release tag
This makes it easy to tell which debug build a device is running, since the
versionName now automatically describes the exact commit that was built,
based on `git describe`, e.g.:  0.100-alpha7-33-gc2e8e8a

For release builds, i.e. builds from commits that are tagged as releases,
the versionName will be just the tag name: 0.100-alpha8

closes #664 https://gitlab.com/fdroid/fdroidclient/issues/664
2016-05-20 08:42:28 +02:00
Daniel Martí
7de5d4d551 Remove broken test coverage
This never worked properly with the Gitlab UI. Now it's even more broken
since we run the tests in different jobs.
2016-05-12 15:40:47 +01:00
Hans-Christoph Steiner
cff807e191 include useful output logs for failing tests
This helps when tests fail on the gitlab-ci builds.
2016-05-10 14:34:15 +02:00
Daniel Martí
6e9437b1f4 checkstyle: bump to 6.18
Also, forgot to simplify the checkstyle setup in the extension after we
moved from an ant folder hierarchy to a gradle one. Do that now.
2016-05-03 11:36:57 +01:00
Daniel Martí
32c67d05ec PMD: XML config file, enable most of unnecessary 2016-04-23 15:59:04 +01:00
Daniel Martí
a484c03816 PMD: Re-enable on test files
This used to be the case, which is why only minimal changes were
required to bring it back. This also makes it take the same files that
checkstyle does, which is more consistent.
2016-04-23 01:45:04 +01:00
Daniel Martí
00c138e42f PMD: enable and obey java-unusedcode 2016-04-23 01:16:14 +01:00
Daniel Martí
132519590f Bump accesspoint library to 0.2.0
This release allows for Android 6+ support, but we'll need to ask for
permissions at runtime too. This commit simply does one half of the work
needed to support Android 6 with all things wi-fi.

See the issue and example app commit for reference:

https://github.com/mvdan/accesspoint/issues/6
6284f0376b
2016-04-14 15:31:47 +01:00
Daniel Martí
27c9a21764 Gradle: Bump android plugin to 2.0.0
Also add useProgard true, since minifyEnabled now refers to the new
experimental code shrinker.

I'm not removing proguard yet as we depend on it for the samsung
workaround. I also do not know how to port the rest of the config
options to the new shrinker.
2016-04-14 15:31:47 +01:00
Daniel Martí
127c65b78d Bump support libs to 23.3.0
Also bump the CI image to include the updated support lib maven repo.
2016-04-14 15:31:47 +01:00
Daniel Martí
db798afb67 PMD: Do all java files like checkstyle
Not just the org.fdroid.* classes. No changes needed.
2016-04-14 15:31:47 +01:00
Hans-Christoph Steiner
22e40bfee1 port all but Provider tests to JUnit4 semantics
Android recently switched from JUnit 3 to 4 for its base testing classes.
It doesn't seem to support the old JUnit3 methods with gradle and AS. So
all the tests need to be ported to JUnit4 to work again.

#607 https://gitlab.com/fdroid/fdroidclient/issues/607
2016-04-11 11:26:21 -04:00
Hans-Christoph Steiner
70864e3479 use custom proguard config for running tests
The new Android Testing Support library stuff causes proguard to freak
out, so make proguard ignore all that stuff when running tests.
2016-04-05 12:44:01 +02:00
Daniel Martí
53c8752444 Update to april 5th docker image
* Debian 8.4
* Now includes curl
* No longer has android-10
* build-tools 23.0.3
2016-04-05 10:43:48 +01:00
Hans-Christoph Steiner
bc3d8a89b6 add tests of HttpDownloader 2016-04-04 10:53:12 +02:00
Daniel Martí
fddce692db PMD: Get closer to obeying unnecessary
Don't enable it just yet, it's way too pedantic with parenthesis.
2016-03-31 21:54:11 +01:00
Daniel Martí
0e76a2e1fe Fix source directories after gradle layout switch
'src' works because we're only doing java files under that directory.
But it would be slower than needed, and in the case of PMD it would also
use the test files which wasn't intended at all.
2016-03-31 21:40:33 +01:00
Daniel Martí
f34237f333 Remove duplicated commons-io dep
It seems like having it as a compile dependency already works for the
tests. Having it duplicated seems to sometimes trigger errors (e.g. a
user reported a duplicate zip entry due to the duplication) and might
also be problematic if we don't keep the two versions in sync.
2016-03-31 12:01:58 +01:00
Daniel Martí
58c23c0a0e Fix binaryDeps with new app folder
Little remaining breakage in our main build.gradle. Went unnoticed
because we rarely use this. And hopefully we can get rid of it soon.
2016-03-29 17:57:21 +01:00
Daniel Martí
d5456e1bbf Bump ACRA to 4.8.5
Minor bugfix release.
2016-03-29 17:54:24 +01:00
Daniel Martí
db2aaeaf22 Bump checkstyle to 6.17
No changes were necessary to keep it happy.
2016-03-29 17:46:37 +01:00
Hans-Christoph Steiner
88b5e284b5 use commons-io via a gradle dependency
This makes it so gradle provides all dependencies, rather than a mix of
classes that are copied in versus imported via gradle.  This library is
already used by the tests, so its not really a new dependency, and proguard
should remove all the unused stuff.
2016-03-29 14:06:52 +02:00
Hans-Christoph Steiner
3fcdfe85bb move main project files into standard gradle/Android Studio layout
This makes it a lot easier to setup all the testing stuff.  Mostly,
I'm tired of fighting Android Studio's fragility, so I want to remove
as much non-standardness as possible in the hopes of improving that
situation.

closes #534 https://gitlab.com/fdroid/fdroidclient/issues/534
2016-03-28 12:12:37 +02:00