From defebcf8e5eb8012d7f41a8028e6637d2c03a4cb Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 14 May 2018 20:22:23 -0700 Subject: [PATCH] Update proguard rules to differentiate between reflect or codegen --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 81542f2..876507d 100644 --- a/README.md +++ b/README.md @@ -588,10 +588,15 @@ If you are using ProGuard you might need to add the following options: -keep @com.squareup.moshi.JsonQualifier interface * ``` Additional rules are needed if you are using Kotlin: + +*...If you are using the reflect API (i.e. `KotlinJsonAdapter`):* ``` -keepclassmembers class kotlin.Metadata { public ; } +``` +*...If you are using the codegen API (i.e. `JsonClass(generateAdapter = true)`):* +``` -keepnames class **JsonAdapter -keepnames @com.squareup.moshi.JsonClass class * ``` @@ -620,4 +625,4 @@ License [okhttp]: https://github.com/square/okhttp/ [gson]: https://github.com/google/gson/ [javadoc]: https://square.github.io/moshi/1.x/moshi/ - [kapt]: https://kotlinlang.org/docs/reference/kapt.html \ No newline at end of file + [kapt]: https://kotlinlang.org/docs/reference/kapt.html