tbruyelle / RxPermissions

Android runtime permissions powered by RxJava2
Apache License 2.0
10.48k stars 1.31k forks source link

Is there some Proguard rules to follow ? #45

Closed afaucogney closed 7 years ago

afaucogney commented 8 years ago

If yes, that would be good to put in the Readme.

tbruyelle commented 8 years ago

Good question, I presume no but I didn't test with proguard. Could you check that ?

afaucogney commented 8 years ago

Especially with obfuscation, this will not work. I used it with RxBinding, but from them nothing is necessary.

I had to insert the RxJava rules found on the web to make it running. But no idea if this is optimal or not !

# rxjava
-keep class rx.schedulers.Schedulers {
    public static <methods>;
}
-keep class rx.schedulers.ImmediateScheduler {
    public <methods>;
}
-keep class rx.schedulers.TestScheduler {
    public <methods>;
}
-keep class rx.schedulers.Schedulers {
    public static ** test();
}
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
    long producerIndex;
    long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
    long producerNode;
    long consumerNode;
}
tbruyelle commented 8 years ago

It seems the rules are not specific to rx-permissions but more to rx-java, in that case I don't think I should document them. Users simply refer to the rx-java documentation for that purpose.

afaucogney commented 8 years ago

Yes and No. As I'm not using directly use RxJava, I had to search and check a while until I found a solution. I think refer to RxJava is a minimun ᐧ

2016-04-23 11:01 GMT+02:00 Thomas Bruyelle notifications@github.com:

It seems the rules are not specific to rx-permissions but more to rx-java, in that case I don't think I should document them. Users simply refer to the rx-java documentation for that purpose.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/tbruyelle/RxPermissions/issues/45#issuecomment-213697653

tbruyelle commented 8 years ago

You're probably right, but I didn't find official documentation about proguard rules in the rx-java project. Did you ?

ysnows commented 7 years ago

for rxpermissions,just add -dontwarn com.tbruyelle.rxpermissions.** to your app progurard-rules.pro file。