【问题标题】:* vs ** vs *** in Proguard?Proguard中的* vs ** vs ***?
【发布时间】:2013-11-12 07:10:28
【问题描述】:

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

-keep class com.mypackage.*

-keep class com.mypackage.**

-keep class com.mypackage.***

【问题讨论】:

    标签: android proguard


    【解决方案1】:
    *   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()",也不匹配"java.lang.Object[] getObjects()"

    【讨论】:

    【解决方案2】:
    *   matches any part of a filename not containing the directory separator.
    **  matches any part of a filename, possibly containing any number of directory separators.
    

    【讨论】:

      【解决方案3】:

      来自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).
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-01-31
        • 2019-09-06
        • 2017-08-25
        • 2014-08-17
        • 2011-09-18
        • 1970-01-01
        相关资源
        最近更新 更多