ProGuard configuration for Guava with obfuscation and optimization

前端 未结 10 1435
臣服心动
臣服心动 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:45

    One of the engineers who built R8 (Stephan Herhut) listed the following rules for the latest Guava (25.0-android) in this session from Google I/O 2018:

    -dontwarn afu.org.checkerframework.**
    -dontwarn org.checkerframework.**
    -dontwarn com.google.errorprone.**
    -dontwarn sun.misc.Unsafe
    -dontwarn java.lang.ClassValue
    

    The video also includes a short explanation of the rules (first 3 are static analysis annotation frameworks, last 2 are unavailable classes on Android which are protected by runtime checks in Guava).

    I spoke with Stephan after the session and he said these will hopefully be included in the Guava documentation in the future or better yet in the consumerProguardFiles of future Guava releases. Here's hoping!

提交回复
热议问题