This is going to be used to make the managing of async tasks in
F-Droid easier to reason about. It does this by using a more
functional style to performing multiple different asynchronous tasks
as compared to the Android `AsyncTask` or `Service` or some other approach.
Its use was removed long ago, and the dependency was left behind for
some reason. This commit can be reverted if it's needed in the future
again.
This of course slightly simplifies the build thus speeding it a little,
but what's more interesting is that the output apk is also ~100KB
smaller. So something is going on.
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.
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
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
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)
* 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
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#370https://gitlab.com/fdroid/fdroidclient/issues/370
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.
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).