1

Given a simple data class

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class User(
    @field:Json(name = "name")
    val name: String,
    @field:Json(name = "age")
    val age: Int
)

I expect there should be a proguard rule which looks something like

# https://r8.googlesource.com/r8/+/refs/heads/master/compatibility-faq.md
-keepclassmembers,allowobfuscation class * {
    @com.squareup.moshi.Json <fields>;
}

But, I do not find anything similar in https://github.com/square/moshi/blob/master/moshi/src/main/resources/META-INF/proguard/moshi.pro

Am I missing something? Or, the above rule is not written correctly?

1
  • I thought exactly the same... Did you find out ? Commented Dec 18, 2024 at 0:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.