57 Commits

Author SHA1 Message Date
Daniel Martí
d8a624b397 End AS formatting madness in build.gradle
This was changed to obey Android Studio's formatting of gradle files. Some of
what it did was fine, but removing all line spacing is bonkers.
2015-10-08 17:26:27 +02:00
Daniel Martí
999fa6eb21 Add checkstyle with a small config
It doesn't include all of the Android style checks as found in Android Studio,
but it's a start.

Bump Gradle to 2.7 because the checkstyle plugin in earlier versions is just
not good enough.
2015-10-08 17:26:27 +02:00
Daniel Martí
d40781584b Update jmdns to 3.4.2 from 3.4.1+ trunk 2015-10-06 14:11:30 +02:00
Daniel Martí
6d579368af Start using gradle-witness
Fixes #429.
2015-09-25 22:00:24 -07:00
Daniel Martí
f05d0e12a0 Merge branch 'my-first-new-swap-fixes' into 'master'
My first new-swap fixes

I've been working on getting new-swap stable, these are my fixes so far.  The big one is fixing swap when proxy settings are enabled.  Comments in the commits.

See merge request !136
2015-09-11 00:50:48 +00:00
Daniel Martí
30ed545981 Bump accesspoint lib 2015-09-10 10:49:45 -07:00
Hans-Christoph Steiner
a69488b32f HttpDownloader bypasses proxy when accessing a swap repo
Proxying are basically always for internet access, and swap repos are by
definition only on the local network.  This adds a pretty strict check for
whether a given download URL is for a swap repo, and if so, the proxy
settings are ignored.

fixes https://dev.guardianproject.info/issues/3421
2015-09-10 18:42:36 +02:00
Hans-Christoph Steiner
8d20135779 swap: close resources reported by StrictMode
This required rebuilding the zipsigner.jar, since there was once issue to
be fixed in kellingwood.security.zipsigner.ZipSigner.

Here are the stacktraces:

            StrictMode  E  A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                        E  java.lang.Throwable: Explicit termination method 'close' not called
                        E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                        E      at java.io.FileOutputStream.<init>(FileOutputStream.java:90)
                        E      at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
                        E      at java.io.FileWriter.<init>(FileWriter.java:42)
                        E      at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:488)
                        E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
                        E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
                        E      at android.os.AsyncTask$2.call(AsyncTask.java:288)
                        E      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                        E      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                        E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                        E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                        E      at java.lang.Thread.run(Thread.java:841)
                        E  A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                        E  java.lang.Throwable: Explicit termination method 'close' not called
                        E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                        E      at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128)
                        E      at kellinwood.zipio.ZipInput.<init>(ZipInput.java:57)
                        E      at kellinwood.zipio.ZipInput.read(ZipInput.java:75)
                        E      at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:646)
                        E      at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
                        E      at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
                        E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
                        E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
                        E      at android.os.AsyncTask$2.call(AsyncTask.java:288)
                        E      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                        E      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                        E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                        E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                        E      at java.lang.Thread.run(Thread.java:841)
                        E  A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                        E  java.lang.Throwable: Explicit termination method 'end' not called
                        E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                        E      at java.util.zip.Inflater.<init>(Inflater.java:82)
                        E      at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:475)
                        E      at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:445)
                        E      at kellinwood.security.zipsigner.ZipSigner.addDigestsToManifest(ZipSigner.java:418)
                        E      at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:713)
                        E      at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:647)
                        E      at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
                        E      at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
                        E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
                        E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
                        E      at android.os.AsyncTask$2.call(AsyncTask.java:288)
                        E      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                        E      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                        E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                        E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                        E      at java.lang.Thread.run(Thread.java:841)

StrictMode  E  A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
            E  java.lang.Throwable: Explicit termination method 'close' not called
            E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
            E      at java.io.FileOutputStream.<init>(FileOutputStream.java:90)
            E      at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
            E      at java.io.FileWriter.<init>(FileWriter.java:42)
            E      at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:488)
            E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
            E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
            E      at android.os.AsyncTask$2.call(AsyncTask.java:288)
            E      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            E      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            E      at java.lang.Thread.run(Thread.java:841)
            E  A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
            E  java.lang.Throwable: Explicit termination method 'close' not called
            E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
            E      at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128)
            E      at kellinwood.zipio.ZipInput.<init>(ZipInput.java:57)
            E      at kellinwood.zipio.ZipInput.read(ZipInput.java:75)
            E      at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:646)
            E      at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
            E      at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
            E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
            E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
            E      at android.os.AsyncTask$2.call(AsyncTask.java:288)
            E      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            E      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            E      at java.lang.Thread.run(Thread.java:841)
            E  A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
            E  java.lang.Throwable: Explicit termination method 'end' not called
            E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
            E      at java.util.zip.Inflater.<init>(Inflater.java:82)
            E      at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:475)
            E      at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:445)
            E      at kellinwood.security.zipsigner.ZipSigner.addDigestsToManifest(ZipSigner.java:418)
            E      at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:713)
            E      at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:647)
            E      at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
            E      at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
            E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
            E      at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
            E      at android.os.AsyncTask$2.call(AsyncTask.java:288)
            E      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            E      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            E      at java.lang.Thread.run(Thread.java:841)
2015-09-10 18:42:35 +02:00
Daniel Martí
ed5de47197 Merge branch 'enhanced-priv-install' of https://gitlab.com/dschuermann/fdroidclient 2015-09-09 21:21:06 -07:00
Daniel Martí
af5836cb09 Bump accesspoint library to try to fix #407 2015-09-09 15:39:21 -07:00
Daniel Martí
3d749120a7 Remove support for building entirely from source
* Hard to keep both regular and source builds working and bug-free
* Keep -PsourceDeps to package jars for libs which are not yet in jcenter
* Use the libs packaged in jcenter the same way in both builds
* Remove cleanBinaryDeps, can be done via the shell easily
2015-09-08 15:40:44 -07:00
Hans-Christoph Steiner
2c88703588 use NetCipher to get improved TLS and cipher support on HTTPS connections
The NetCipher library creates instances of HttpURLConnection that are
configured to have solid TLS protocol and cipher settings, especially on
older versions of Android.

fixes #370 https://gitlab.com/fdroid/fdroidclient/issues/370
2015-09-08 19:19:30 +02:00
Hans-Christoph Steiner
853e281710 code formatting fixes for build.gradle from Android Studio 2015-09-08 19:19:29 +02:00
Dominik Schürmann
85c8e7035d Move shared AIDL files into lib, restructure, start of install/delete code 2015-09-07 01:38:48 +02:00
Daniel Martí
232ed2229b Bump build-tools 2015-09-05 23:00:47 -04:00
Daniel Martí
45782355db Update zxing-core to 3.2.1 2015-09-05 22:14:18 -04:00
Peter Serwylo
f635df8502 Merge branch 'master' into new-swap 2015-09-02 17:01:58 +10:00
Daniel Martí
f07497a39c Revert appcompat-v7 to 22.1.1. Closes #356.
22.2.* have an issue where all the text in the app becomes gray, both in the
light and dark themes. We'll see if appcompat 23.* fixes this issue.
2015-08-24 11:37:11 -07:00
Daniel Martí
4c75f6078d Disable lint warnings in command-line builds
There are just too many now, and they hide actual compilation errors.

They can still be viewed in the HTML report.
2015-08-20 18:05:34 -07:00
Daniel Martí
f0481ffa14 Support libs will never be built from source
We can't rely on their plugin versions to be compatible with ours. Besides,
they require tons of Android SDK targets to be installed to build.

They are already bundled with the SDK, so you can build them as part of the
SDK from source if you want to.
2015-08-20 10:35:18 -07:00
Peter Serwylo
133cabeed8 Let user select wifi network. Prevent "Send F-Droid" if no bluetooth.
Include support for libaccesspoint to control the WiFiAP of a device.

Selecting wifi networks i snow possible by touching the name of the
wifi network in the "Start Swap" screen (sometimes it will say
"No network yet"). This exhibits the same behaviour as the "Join Wifi"
screen used to (and still does) do.

On emulators (is there other devices too?), Bluetooth is unavailable,
but the "Send F-Droid" is still there. I could remove it, but then
people may get confused as to why it is not there. Instead, there is
now a dialog which explains why it can't be sent (no Bluetooth).
2015-08-20 21:46:07 +10:00
Daniel Martí
968b35f324 Update notes about discontinued libraries 2015-08-18 19:42:01 -07:00
Daniel Martí
33e09cc344 Don't use multi-arg compiles in gradle
Easier to keep line changes simpler this way.
2015-08-18 19:32:38 -07:00
Daniel Martí
fa929a4cf4 Bump buildToolsVersion 2015-08-18 10:24:52 -07:00
Daniel Martí
7bff114602 Re-enable proguard for release builds
It can be disabled for stables if it's not reliable.

Also enabled for debugging so that bugs don't slip into release builds.
2015-08-15 13:56:28 -07:00
Daniel Martí
e43355ce56 Limit lint output to HTML 2015-08-09 21:33:36 -07:00
Daniel Martí
939e3004b6 Reorganize buildTypes gradle config
* disable minify (proguard) on all build types
* explicitly disable resource shrinking on all build types
2015-08-09 19:10:27 -07:00
Daniel Martí
8bd6e56065 Bump support libraries to 22.2.1 2015-08-08 23:40:52 -07:00
Daniel Martí
853d7ed047 Bump compileSdkVersion 2015-08-08 23:40:52 -07:00
Daniel Martí
7f3acb215e Bundling support-v4 as a binary dep is no longer necessary 2015-07-30 20:24:25 -07:00
Daniel Martí
b152c682fa Move lint config to build.gradle
* Removed UnusedResources from default_repo.xml, since there are none of those
  warnings anymore
* Same for TrulyRandom in the whole project
2015-07-28 21:39:33 -07:00
Luca Favatella
a965ab755a Add debuggable option in build.gradle...
... as recommended at https://developer.android.com/tools/device.html
2015-06-21 19:13:53 +01:00
Peter Serwylo
a50efda113 Updated support libraries to 22.1.0 2015-06-15 21:19:14 +02:00
Nico Alt
03c5a224de fix #91: Material Design
- use 'com.android.support:appcompat-v7:22.0.0' instead of version 20.0.0
- ActionBar color: "F-Droid Blue" (also option for "F-Droid Green")
- fix invisible swap button with Material Design
- remove "Light + dark action bar" theme (as of Action Bar is always blue/green)
2015-06-15 21:19:14 +02:00
Daniel Martí
35f9900101 Update UIL to 1.9.4 2015-05-29 12:34:02 +02:00
Daniel Martí
3eab46d7f9 Group compileOptions together 2015-05-20 18:37:05 +02:00
Daniel Martí
0f36372d38 Fix to 26894fcb01d4: also bump the gradle dependency 2015-05-03 23:49:17 +02:00
Daniel Martí
3ed414cf96 Don't use + in gradle deps to make the build reproducible
20.0.+ equals 20.0.0 since there wasn't a 20.0.1
2015-04-17 11:45:49 +02:00
Daniel Martí
2ce62aac65 Adapt our gradle setup to the new v4-preferencefragment location 2015-04-01 11:28:36 +02:00
Daniel Martí
2f2a3a7755 Clarify that we're using a slightly different spongycastle 2015-04-01 11:22:09 +02:00
Daniel Martí
893e68b3da Don't use older jmdns when not building from source 2015-04-01 10:57:39 +02:00
Daniel Martí
ee287220b8 Forgot to bump zxing maven dep after bumping the source dep 2015-04-01 10:49:46 +02:00
Peter Serwylo
9dfa18aead Make F-Droid tests runnable from Gradle.
This also makes AndroidStudio integration work better, which makes
running and debugging tests much nicer than the CLI.

Also cleaned up imports in one test, and made the symlink tests not
fail on older devices below API 19.
2015-04-01 15:33:51 +11:00
Daniel Martí
246d1c5f32 Remove MemorizingTrustManager, not used right now 2015-03-31 20:47:19 +02:00
Daniel Martí
76396f224f Bump gradle plugin to 1.1.3
We also no longer depend on the undocumented internal variable sdkFolder
2015-03-30 16:49:56 +02:00
Daniel Martí
ebacde9631 Bump build-tools to 22.0.1 2015-03-30 16:38:11 +02:00
Daniel Martí
6eff521459 Bump build-tools to 22.0.0 2015-03-11 23:09:42 +01:00
Daniel Martí
00195be469 lint text output is no longer useful 2015-03-08 20:37:36 +01:00
Peter Serwylo
ccdb161de4 Final fixup before merge. Rebuild binary deps, minor fixes.
Binary deps were not getting build and cleaned from the binaryDeps
subdirectory of "libs". Also, reverted the android support appcompat
library target to android-19, as there was no need to change it.
2015-03-03 18:44:36 +11:00
Peter Serwylo
aa38418c91 Bump support libraries to v20. Gradle doesn't build them by source for now.
The support libraries expect to be using the gradle plugin version 0.10.0.
We are currently on version 1.0.0. They use APIs in their build script which
have moved or been removed, and so the build just breaks when we run it with
the 1.0.0 plugin. I tried some magic to make it work in various ways, but
kept failing. As such, I've reverted the `gradle -PsourceDeps` build to not
build the support libraries from source. In the future, we should be able to
change this if they change the plugin version to a more recent one.

Note that the ant build script still hasn't been modified, and so will be
using the binary support-v4 library, but should build appcompat-v7 from source.

Was going to bump to Support v21, however there is some behaviour change which
causes a crash. They have removed the progress view from the toolbar/actionbar.
This breaks the AppDetails activity. As such, I'll leave that for the future.

For now, there will be a slight difference between building with
ant (which uses support v-almost-21) and gradle (which uses v20).
This will stay the case until we get around to completely porting
the app to v21, and fixing any bugs or UI sadness that arises.
2015-03-03 00:46:43 +11:00