在Proguard混淆时,一个罐子搞砸了,我该怎么办?

时间:2016-04-26 20:31:36

标签: java android proguard java-bytecode-asm android-proguard

“asm-4.0.jar”,“org.objectweb.asm”,如果包含此.jar,我会在构建时遇到此错误:

AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"4 errors; aborting","sources":[{}]}

部分来自Proguard配置:

#-libraryjars libs/asm-4.0.jar
-keep class !org.objectweb.asm.** { *; }
-dontwarn org.objectweb.asm.**

完整的proguard配置:http://pastebin.com/mxXK4WvY

  

-dontobfuscate

这条线使proguard工作,但我需要混淆。

我该怎么办? Kryonet需要这个罐子,我的整个游戏都建立在它上面。

1 个答案:

答案 0 :(得分:0)

我想我通过这样做来修复它:

-keep class org.objectweb.asm.** { *; }
-keepclassmembers class org.objectweb.asm.** { *; }
-keepclassmembernames class org.objectweb.asm.** { *; }
-dontwarn org.objectweb.asm.**