我有应付的ProGuard和Android的问题。
我在网上搜索了几个小时,发现多种方式obsfuscate一个Android应用程序。 现在我想一个看起来是最简单的,所以:
- 我创建了一个
config.cfg
在我的项目的根目录下的文件- 我加
proguard.config=config.cfg
在我project.properties
- 在我使用Eclipse的导出向导导出和签署.apk文件
我得到一个消息,说Proguard returned with error code 1. See console
并在控制台:
Proguard returned with error code 1. See console
Note: there were 3847 duplicate class definitions.
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
You should check if you need to specify additional program jars.
Warning: there were 4 unresolved references to classes or interfaces.
You may need to specify additional library jars (using '-libraryjars').
Error: Please correct the above warnings first.
即使我使用由官方Proguard的网站所提供的配置,或默认我有错误。
这里是我的自定义配置(myProject的/的config.cfg):
-injars bin/classes
-injars libs
-libraryjars "C:\Program Files\Android\android-sdk\platforms\android-13\android.jar"
-dontskipnonpubliclibraryclasses
-optimizationpasses 5
-printmapping map.txt
-flattenpackagehierarchy
-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*
-keep public class * extends android.app.Application
-keep public class * extends android.app.Activity
-keep public class * extends android.app.PreferenceActivity
-keep public class * extends android.view.View
-keep public class * extends android.widget.BaseAdapter
-keep public class * implements android.view.View.OnTouchListener
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}
-keepclassmembers class * implements android.os.Parcelable {
static android.os.Parcelable$Creator CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
我无法得到它的工作...任何想法将不胜感激!
注:我使用存储在杰克逊JSON librairies libs
我的项目文件夹