Proguard 中的*
,**
和通配符有什么区别?***
例如:
-keep class com.mypackage.*
对比
-keep class com.mypackage.**
对比
-keep class com.mypackage.***
* 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).
请注意,*
和**
通配符永远不会匹配原始类型。此外,只有* 通配符将匹配任何维度的数组类型。例如,“ get*()”匹配"java.lang.Object getObject()"
, 但不匹配"float getFloat()"
, nor "java.lang.Object[] getObjects()"
。
* matches any part of a filename not containing the directory separator.
** matches any part of a filename, possibly containing any number of directory separators.
从这个文件:
* 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).