Menu

Wildcards in method names

Help
2015-02-26
2015-02-27
  • Calum MacLean

    Calum MacLean - 2015-02-26

    I'm trying to keep methods with a certain naming pattern - specifically, public methods starting with cc_, with any parameters and returns values. I've not succeeded so far.
    I tried:
    -keep class * extends MySuperClass {
    public cc_*;
    }
    but this wasn't accepted by the Proguard parser.
    I'd appreciate any help.
    Thanks - Calum

     
  • Eric Lafortune

    Eric Lafortune - 2015-02-26

    You need to specify a return type and method arguments, even if they are just wildcards:

    -keep class * extends MySuperClass {
        public *** cc_*(...);
    }
    

    The wildcard "***" means any class or primitive type. The wildcard "..." means any arguments.

    Eric

     
  • Calum MacLean

    Calum MacLean - 2015-02-27

    Eric - thanks for the quick and helpful answer - exactly what I needed. I was missing the *** for any return type. Much appreciated.

    Calum

     
MongoDB Logo MongoDB