简体   繁体   English

Proguard混淆和通用方法

[英]Proguard obfuscation and generic methods

I'm trying to obfuscate an Android App with ProGuard. 我正在尝试使用ProGuard混淆Android应用程序。

Here I have a class 我在这里上课

public class Book implements DBbinded

And a generic method 和一般的方法

private void storeDBObjects(ArrayList<? extends DBbinded> dbObjects)

The call of this method throws an java.lang.ClassCastException: java.util.LinkedHashMap after obfuscation. 在混淆之后,此方法的调用将抛出java.lang.ClassCastException:java.util.LinkedHashMap。 What should I write into proguard.properties to fix this? 我应该写什么来proguard.properties来解决这个问题?

I have just come across this problem and resolved it by specifying the 'Signature' attribute under the -keepattributes ProGuard argument. 我刚刚遇到这个问题并通过在-keepattributes ProGuard参数下指定'Signature'属性来解决它。

-keepattributes SourceFile,LineNumberTable,Signature,*Annotation*

I do not believe it is a ProGuard bug. 我不相信它是ProGuard的错误。 Hope that helps. 希望有所帮助。

This could be a bug in ProGuard. 这可能是ProGuard中的一个错误。 You should check if installing the latest version helps (ProGuard 4.9 beta1 at this time: copy proguard4.9beta1/lib/proguard.jar in android-sdk/tools/proguard/lib). 您应该检查安装最新版本是否有帮助(此时ProGuard 4.9 beta1:在android-sdk / tools / proguard / lib中复制proguard4.9beta1 / lib / proguard.jar)。 Otherwise, you can report the problem on ProGuard's bug tracker . 否则,您可以在ProGuard的错误跟踪器上报告问题。

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

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