Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Enable R8 fullMode (#13)
Browse files Browse the repository at this point in the history
* Enable R8 fullMode

* Add keep rule

* Remove proguard rules of arouter

* Keep rxjava3

* Keep BaseBindingActivity

* Add rules for retrofit

* allowobfuscation & allowshrinking
  • Loading branch information
Goooler authored Feb 17, 2022
1 parent a3640a9 commit 9459ac8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ org.gradle.parallel=true
android.experimental.enableNewResourceShrinker.preciseShrinking=true
android.enablePartialRIncrementalBuilds=true
android.enableParallelJsonGen=true
android.enableR8.fullMode=true
android.nonTransitiveRClass=true
org.gradle.unsafe.configuration-cache=true
17 changes: 10 additions & 7 deletions gradle/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@
# ZoneRulesProvider _does_ exist!
-dontwarn java.time.zone.ZoneRulesProvider

# Arouter
-keep public class com.alibaba.android.arouter.routes.**{*;}
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider

# DataBinding
-keep public class * extends androidx.databinding.ViewDataBinding {
* inflate(android.view.LayoutInflater);
}

# Extra rules for R8 fullMode
-keep,allowobfuscation,allowshrinking class io.goooler.demoapp.common.base.binding.BaseBindingActivity
-keep,allowobfuscation,allowshrinking class * extends io.goooler.demoapp.common.base.binding.BaseBindingActivity
-keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Single
-keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Observable
# TODO: Waiting for new retrofit release to remove these rules
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

0 comments on commit 9459ac8

Please sign in to comment.