简体   繁体   English

使用Proguard保护Android Apk

[英]Android Apk protecting using proguard

我生成了一个带有proguard的apk文件,但是当我尝试与azure连接时,它给出了一些例外

Try to add an exception of the classes in your jar files. 尝试在jar文件中添加类的例外。 For instance I was using roboguice so I added this: 例如,我使用的是roboguice,因此添加了以下内容:

# Keep the classes in the external jars
-keep class com.google.inject.** { *; } 
-keep class javax.inject.** { *; } 
-keep class javax.annotation.** { *; } 
-keep class roboguice.** { *; } 

I was also using XStream so in my proguard-project.txt i did added the following: 我也在使用XStream,因此在我的proguard-project.txt中确实添加了以下内容:

#Keep the classes for XStream jar
-keep class com.thoughtworks.xstream.converters.extended.SubjectConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.ThrowableConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.StackTraceElementConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.CurrencyConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.RegexPatternConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.CharsetConverter { *; }
-keep class com.thoughtworks.xstream.annotations.** { *; }

So what I would try is to add the classes that the jar files provide you 所以我想尝试的是添加jar文件为您提供的类

我在我的proguard中添加了-keepattributes Signature,*Annotation*,EnclosingMethod

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM