[Android] Proguard: Add Retrofit rules

Geoffrey Métais git at videolan.org
Fri Feb 15 09:18:28 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 15 09:14:59 2019 +0100| [b0f33a91f8c8cdbd8c0b0205bec5a4b0f3e12462] | committer: Geoffrey Métais

Proguard: Add Retrofit rules

> https://code.videolan.org/videolan/vlc-android/commit/b0f33a91f8c8cdbd8c0b0205bec5a4b0f3e12462
---

 vlc-android/proguard.cfg | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/vlc-android/proguard.cfg b/vlc-android/proguard.cfg
index e44a81f8f..f387888ea 100644
--- a/vlc-android/proguard.cfg
+++ b/vlc-android/proguard.cfg
@@ -73,3 +73,28 @@
 -keep class kotlinx.coroutines.android.AndroidExceptionPreHandler { *; }
 -keep class kotlinx.coroutines.android.AndroidDispatcherFactory { *; }
 
+# Retrofit
+# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
+# EnclosingMethod is required to use InnerClasses.
+-keepattributes Signature, InnerClasses, EnclosingMethod
+
+# Retrofit does reflection on method and parameter annotations.
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
+
+# Retain service method parameters when optimizing.
+-keepclassmembers,allowshrinking,allowobfuscation interface * {
+    @retrofit2.http.* <methods>;
+}
+
+# Ignore annotation used for build tooling.
+-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
+
+# Ignore JSR 305 annotations for embedding nullability information.
+-dontwarn javax.annotation.**
+
+# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
+-dontwarn kotlin.Unit
+
+# Top-level functions that can only be used by Kotlin.
+-dontwarn retrofit2.-KotlinExtensions
+



More information about the Android mailing list