Proguard混淆了 - 保持公共类文件

时间:2015-06-24 06:37:03

标签: java android enums proguard obfuscation

我有一个使用亚马逊移动分析的图书馆项目。当我尝试生成工件.aar文件时,proguard给了我

:app:proguardRelease
Warning: com.amazonaws.auth.policy.conditions.S3ConditionFactory: can't find referenced class com.amazonaws.services.s3.model.CannedAccessControlList

Warning: com.amazonaws.util.json.JacksonFactory: can't find referenced class com.fasterxml.jackson.core.JsonFactory

Warning: com.amazonaws.util.json.JacksonFactory: can't find referenced class com.fasterxml.jackson.core.JsonToken

Warning: com.amazonaws.util.json.JacksonFactory$JacksonReader: can't find referenced class com.fasterxml.jackson.core.JsonParser

Warning: com.amazonaws.util.json.JacksonFactory$JacksonWriter: can't find referenced class com.fasterxml.jackson.core.JsonGenerator

Warning: there were 66 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
:app:proguardRelease FAILED

结果所有这些不可改变的类在其正文中包含 枚举 。我试图从proguard的混淆中排除包含这些类的整个包,但是这些类仍然是不可接受的,这对我来说是这样的:要么标志不影响proguard的行为,要么我还要添加一些其他标志。以下是我使用过的旗帜。

-keepattributes *Annotation*    
-keepattributes InnerClasses

#-keep class com.fasterxml.jackson.core.JsonToken { *; }
#-keep class com.fasterxml.jackson.core.JsonParser { *; }
#-keep class com.fasterxml.jackson.core.JsonGenerator { *; }

有人可以给我一个关于如何解决这个问题的报道吗?

修改

我禁止proguard混淆以下类/包,那么为什么它会在proguardRelease中生成这些警告并最终产生I / O异常。

-keep public class com.amazonaws.** { *; }
-keep public class com.fasterxml.jackson.core.** { *; }

最好的问候

0 个答案:

没有答案