Excluding File Paths

I want to exclude some file paths from ProGuard. Does anyone have any best practices for doing this? Providing examples would be great.

Excluding file paths is simple with ProGuard! (or DexGuard)

Here are some examples:

The following rule keeps the names of all public classes in just the one specified package:

-keep public class com.myapp.ExampleClass.*

The following configuration (recursively) keeps the names of all public classes in the specified package and all of its its subpackages:

-keep public class com.myapp.ExampleClass.**

The following configuration keeps the names of all public/protected classes/fields/methods in the specified package and its subpackages:

-keep public class com.myapp.ExampleClass.** {
  public protected *;
}
1 Like