From 5c853029288bb431de87b54bc08d4dfad9ad3a40 Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Tue, 26 Jan 2016 16:16:01 +1100 Subject: [PATCH 1/2] Add ReactiveX (rxjava + rxandroid) as dependency 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. --- F-Droid/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/F-Droid/build.gradle b/F-Droid/build.gradle index e80c2014c..9c22e8a9e 100644 --- a/F-Droid/build.gradle +++ b/F-Droid/build.gradle @@ -22,6 +22,8 @@ dependencies { compile('ch.acra:acra:4.8.0') { exclude module: 'support-v4' } + compile 'io.reactivex:rxjava:1.1.0' + compile 'io.reactivex:rxandroid:0.23.0' androidTestCompile 'commons-io:commons-io:2.2' } @@ -73,6 +75,8 @@ if (!hasProperty('sourceDeps')) { 'com.madgag.spongycastle:prov:029f26cd6b67c06ffa05702d426d472c141789001bcb15b7262ed86c868e5643', 'com.madgag.spongycastle:core:9b6b7ac856b91bcda2ede694eccd26cefb0bf0b09b89f13cda05b5da5ff68c6b', 'ch.acra:acra:d8ef3b76760e3faf7fe0ea0231fbe98e57f8f06ed3b86c877e6aa95bbc188aac', + 'io.reactivex:rxjava:2c162afd78eba217cdfee78b60e85d3bfb667db61e12bc95e3cf2ddc5beeadf6', + 'io.reactivex:rxandroid:35c1a90f8c1f499db3c1f3d608e1f191ac8afddb10c02dd91ef04c03a0a4bcda', ] } From 73d24d987e6fd39d6c4f35d7057fae2eae90516b Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Fri, 5 Feb 2016 14:00:38 +1100 Subject: [PATCH 2/2] Add exception for rxjava in Proguard. The rxjava library depends on sun.misc.Unsafe, which is unavailable on Android The rxjava team is aware of this, and mention in the docs that they only use the unsafe functionality if the platform supports it. - https://github.com/ReactiveX/RxJava/issues/1415#issuecomment-48390883 - https://github.com/ReactiveX/RxJava/blob/1.x/src/main/java/rx/internal/util/unsafe/UnsafeAccess.java#L23 --- F-Droid/proguard-rules.pro | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/F-Droid/proguard-rules.pro b/F-Droid/proguard-rules.pro index e0d139764..4784add4a 100644 --- a/F-Droid/proguard-rules.pro +++ b/F-Droid/proguard-rules.pro @@ -33,3 +33,10 @@ -keep public class * extends android.support.v4.view.ActionProvider { public (android.content.Context); } + +# The rxjava library depends on sun.misc.Unsafe, which is unavailable on Android +# The rxjava team is aware of this, and mention in the docs that they only use +# the unsafe functionality if the platform supports it. +# - https://github.com/ReactiveX/RxJava/issues/1415#issuecomment-48390883 +# - https://github.com/ReactiveX/RxJava/blob/1.x/src/main/java/rx/internal/util/unsafe/UnsafeAccess.java#L23 +-dontwarn rx.internal.util.**