19

I need to prevent Proguard from obfuscating any classes from the package com.foo.*.

I have tried:

-keep com.foo.** {
    <fields>;
    <methods>;
    <constructors>;
}

But proguard says :

Error: Unexpected keyword 'com.sun.foo.**' in line 32 of file 'obfuscationConfig.pro', included from argument number 1

I get a similar error if I try keep name com.foo** or keep * com.foo.**.

David
  • 15,652
  • 26
  • 115
  • 156
  • Did you ever find out why this was giving you "Unexpected keyword"? I was using something similar and it used to work but I've been getting the same error recently. – speedynomads Nov 03 '16 at 09:42

1 Answers1

36

Try to use the following:

-keep class com.foo.** {
  public protected private *;
}
Volo
  • 28,673
  • 12
  • 97
  • 125