krschultz / android-proguard-snippets

Proguard configurations for common Android libraries
http://www.kevinrschultz.com/blog/2014/02/15/proguard-with-gradle/
Apache License 2.0
4.59k stars 598 forks source link

Update Jackson 2 #132

Open paour opened 8 years ago

paour commented 8 years ago

Annotations need to be preserved (the rule may be a bit too broad; I left another setting that also works commented out).

Caerbannog commented 7 years ago

This didn't quite work for me. I ended with the following solution:

# Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)

-keep class com.fasterxml.jackson.databind.ObjectMapper {
    public <methods>;
    protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
    public ** writeValueAsString(**);
}

-keep class com.fasterxml.jackson.annotation.** { *; }
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry
-dontwarn com.fasterxml.jackson.databind.**