0

I have a class that looks like this:

package com.hi

class A {
    void doSomething(java.util.List<SomeClass> list) {
    }
}

Then in my proguard.cfg I tried this:

-keep class com.hi.A {
    void doSomething(java.util.List<com.hi.SomeClass>);
}

But that fails proguard with:

[proguard] Note: the configuration refers to the unknown class 'java.util.List<com.hi.SomeClass>'

I couldn't find anywhere in the proguard docs about using template arguments. Has anyone been able to keep this kind of method?

JonnyBoy
  • 1,555
  • 14
  • 24
  • 1
    Consider looking for "generics" instead of "templates" -- [This related question](http://stackoverflow.com/questions/12924425/how-do-you-stop-proguard-from-removing-type-parameters) or [this one](http://stackoverflow.com/questions/8794220/proguard-obfuscation-java-google-gson-and-generic-collections-how-to-keep-me) might help. – jedwards Sep 27 '13 at 01:23
  • The second link you provided gave me the solution, thanks! – JonnyBoy Sep 27 '13 at 18:09

1 Answers1

2

I solved it this way:

-keep class com.hi.A {
    void doSomething(java.util.List);
}
JonnyBoy
  • 1,555
  • 14
  • 24