Proguard中的*
,**
和***
通配符有什么区别?例如:
-keep class com.mypackage.*
VS
-keep class com.mypackage.**
VS
-keep class com.mypackage.***
答案 0 :(得分:16)
* 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).
注意,*
和**
通配符永远不会匹配基本类型。此外,只有 *通配符将匹配任何维度的数组类型。例如,“获取*()”匹配"java.lang.Object getObject()"
,但不匹配"float getFloat()"
,也不匹配"java.lang.Object[] getObjects()"
。
答案 1 :(得分: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.
答案 2 :(得分:0)
从此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).