ProGuard configuration for Guava with obfuscation and optimization

前端 未结 10 1434
臣服心动
臣服心动 2020-12-07 12:04

Looking for a ProGuard configuration for Guava that will obfuscate and optimize, as the default one that is provided on the website does not.

Not only that I cannot

相关标签:
10条回答
  • 2020-12-07 12:54

    These proguard-rules worked for me: guava 23.3-android

    -dontwarn sun.misc.Unsafe
    -dontwarn com.google.common.collect.MinMaxPriorityQueue
    -dontwarn com.google.common.util.concurrent.FuturesGetChecked**
    -dontwarn javax.lang.model.element.Modifier
    
    0 讨论(0)
  • 2020-12-07 12:56

    Total proguard rule for guava 20.0. For now the latest guava 21 does not support android.

    -dontwarn com.google.common.base.**
    -keep class com.google.common.base.** {*;}
    -dontwarn com.google.errorprone.annotations.**
    -keep class com.google.errorprone.annotations.** {*;}
    -dontwarn   com.google.j2objc.annotations.**
    -keep class com.google.j2objc.annotations.** { *; }
    -dontwarn   java.lang.ClassValue
    -keep class java.lang.ClassValue { *; }
    -dontwarn   org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
    -keep class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement { *; }
    
    0 讨论(0)
  • 2020-12-07 12:59

    Now that Guava 19.0 is released, I found that I had to add these rules.

    -keep class com.google.j2objc.annotations.** { *; }
    -dontwarn   com.google.j2objc.annotations.**
    -keep class java.lang.ClassValue { *; }
    -dontwarn   java.lang.ClassValue
    -keep class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement { *; }
    -dontwarn   org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
    
    0 讨论(0)
  • 2020-12-07 13:07

    This message suggests the following workaround:

    -dontwarn com.google.common.collect.MinMaxPriorityQueue 
    

    I'd like to think that Proguard could be changed to make this unnecessary, but we haven't checked with its owners.

    0 讨论(0)
提交回复
热议问题