24

What is the difference between the *, ** and *** wildcards in Proguard? For example:

-keep class com.mypackage.*

vs

-keep class com.mypackage.**

vs

-keep class com.mypackage.***
J2K
  • 1,593
  • 13
  • 26

3 Answers3

26
*   matches any part of a method name. OR matches any part of a class name not containing the package separator.
**  matches any part of a class name, possibly containing any number of package separators.
*** matches any type (primitive or non-primitive, array or non-array).

Note that the *, and ** wildcards will never match primitive types. Furthermore, only the * wildcards will match array types of any dimension. For example, " get*()" matches "java.lang.Object getObject()", but not "float getFloat()", nor "java.lang.Object[] getObjects()".

Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
  • 6
    The documentation corresponding to this answer is at https://www.guardsquare.com/en/products/proguard/manual/usage#classspecification – Michael Osofsky Sep 07 '18 at 20:15
1
*   matches any part of a filename not containing the directory separator.
**  matches any part of a filename, possibly containing any number of directory separators.
shankar
  • 632
  • 4
  • 14
0

from this the document :

*   matches any part of a class name not containing the package separator. For example, "com.example.*Test*" matches "com.example.Test" and "com.example.YourTestApplication", but not "com.example.mysubpackage.MyTest". Or, more generally, "com.example.*" matches all classes in "com.example", but not in its subpackages.
**   matches any part of a class name, possibly containing any number of package separators. For example, "**.Test" matches all Test classes in all packages except the root package. Or, "com.example.**" matches all classes in "com.example" and in its subpackages.
***   matches any type (primitive or non-primitive, array or non-array).
Armin
  • 599
  • 2
  • 8
  • 19