Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proguard obfuscation and generic methods

I'm trying to obfuscate an Android App with ProGuard.

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. What should I write into proguard.properties to fix this?

like image 680
nemo Avatar asked Aug 15 '12 18:08

nemo


1 Answers

I have just come across this problem and resolved it by specifying the 'Signature' attribute under the -keepattributes ProGuard argument.

-keepattributes SourceFile,LineNumberTable,Signature,*Annotation*

I do not believe it is a ProGuard bug. Hope that helps.

like image 166
BrantApps Avatar answered Oct 11 '22 20:10

BrantApps