Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

* vs ** vs *** in Proguard?

Tags:

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.*** 
like image 605
J2K Avatar asked Nov 01 '13 04:11

J2K


People also ask

What is Dontwarn in ProGuard?

If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options. ( http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) Warning: there were 2 unresolved references to program class members. Your input classes appear to be inconsistent.

What is ProGuard rule?

What is ProGuard? ProGuard is a free java tool in Android, which helps us to do the following, Shrink(Minify) the code: Remove unused code in the project. Obfuscate the code: Rename the names of class, fields, etc. Optimize the code: Do things like inlining the functions.

Should I use R8 or ProGuard?

R8 is having a faster processing time than Proguard which reduces build time. R8 gives better output results than Proguard. R8 reduces the app size by 10 % whereas Proguard reduces app size by 8.5 %. The android app having a Gradle plugin above 3.4.


1 Answers

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

like image 79
GrIsHu Avatar answered Sep 21 '22 18:09

GrIsHu