我试图用proguard混淆一个android项目,但是失败并出现以下错误:
Proguard returned with error code 1. See console
[2015-05-19 18:24:31 - Volume] You should check if you need to specify additional program jars.
[2015-05-19 18:24:31 - Volume] Exception in thread "main" java.lang.StackOverflowError
[2015-05-19 18:24:31 - Volume] at proguard.obfuscate.ClassObfuscator.visitAnyAttribute(ClassObfuscator.java:169)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.util.SimplifiedVisitor.visitSourceFileAttribute(SimplifiedVisitor.java:251)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.attribute.SourceFileAttribute.accept(SourceFileAttribute.java:60)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.ProgramClass.attributesAccept(ProgramClass.java:535)
[2015-05-19 18:24:31 - Volume] at proguard.obfuscate.ClassObfuscator.visitProgramClass(ClassObfuscator.java:148)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.attribute.EnclosingMethodAttribute.referencedClassAccept(EnclosingMethodAttribute.java:108)
[2015-05-19 18:24:31 - Volume] at proguard.obfuscate.ClassObfuscator.visitEnclosingMethodAttribute(ClassObfuscator.java:182)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.attribute.EnclosingMethodAttribute.accept(EnclosingMethodAttribute.java:130)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.ProgramClass.attributesAccept(ProgramClass.java:535)
[2015-05-19 18:24:31 - Volume] at proguard.obfuscate.ClassObfuscator.visitProgramClass(ClassObfuscator.java:148)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.attribute.EnclosingMethodAttribute.referencedClassAccept(EnclosingMethodAttribute.java:108)
[2015-05-19 18:24:31 - Volume] at proguard.obfuscate.ClassObfuscator.visitEnclosingMethodAttribute(ClassObfuscator.java:182)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.attribute.EnclosingMethodAttribute.accept(EnclosingMethodAttribute.java:130)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.ProgramClass.attributesAccept(ProgramClass.java:535)
[2015-05-19 18:24:31 - Volume] at proguard.obfuscate.ClassObfuscator.visitProgramClass(ClassObfuscator.java:148)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.attribute.EnclosingMethodAttribute.referencedClassAccept(EnclosingMethodAttribute.java:108)
[2015-05-19 18:24:31 - Volume] at proguard.obfuscate.ClassObfuscator.visitEnclosingMethodAttribute(ClassObfuscator.java:182)
[2015-05-19 18:24:31 - Volume] at proguard.classfile.attribute.EnclosingMethodAttribute.accept(EnclosingMethodAttribute.java:130)
对于具有相同错误的1000行,它会继续这样做
[更新] Proguard.cfg
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
-dontwarn sun.misc.Unsafe
-keepattributes *Annotation*, EnclosingMethod, Signature, InnerClasses
-keepattributes SourceFile,LineNumberTable
-keep class org.acra.ACRA {
*;
}
-keep class org.acra.ReportingInteractionMode {
*;
}
-keepnames class org.acra.sender.HttpSender$** {
*;
}
-keepnames class org.acra.ReportField {
*;
}
-keep public class org.acra.ErrorReporter
{
public void addCustomData(java.lang.String,java.lang.String);
public void putCustomData(java.lang.String,java.lang.String);
public void removeCustomData(java.lang.String);
}
-keep public class org.acra.ErrorReporter
{
public void handleSilentException(java.lang.Throwable);
}
-keepclassmembers class ** {
public void onEvent*(**);
}
-keep class com.android.internal.telephony.* {
*;
}
-keep class com.example.com.IncomingCallReceiver {
*;
}
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewInjector { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
-keep class com.daimajia.easing.** { *; }
-keep interface com.daimajia.easing.** { *; }
-keepnames class de.devland.** { *; }
-keep class **$$Impl { public *;}
-keep class preferences.**Prefs { public *;}
# Dagger
-dontwarn dagger.internal.codegen.**
-keepclassmembers,allowobfuscation class * {
@javax.inject.* *;
@dagger.* *;
<init>();
}
-keep class dagger.* { *; }
-keep class javax.inject.* { *; }
-keep class * extends dagger.internal.Binding
-keep class * extends dagger.internal.ModuleAdapter
-keep class * extends dagger.internal.StaticInjection
我尝试了什么:
确保我已引用所有库
确保proguard.cfg
有人可以告诉我下一步的任何想法或我如何调试proguard吗? 谢谢!