23

Proguard 中的*,**​​ 和通配符有什么区别?***例如:

-keep class com.mypackage.*

对比

-keep class com.mypackage.**

对比

-keep class com.mypackage.***
4

3 回答 3

25
*   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()"

于 2013-11-01T04:39:00.573 回答
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.
于 2013-11-01T04:27:55.797 回答
0

从这个文件

*   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).
于 2021-06-29T14:46:31.483 回答