Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the double asterisk mean in proguard rules?

Tags:

What does this rule mean in proguard for example:

-keep class myjava.** {*;} 

I understand {*;} part would mean all members and methods in the class. But what does the 2 asterisk mean in the package name?.

Thanks in advance.

like image 546
Notbad Avatar asked Feb 12 '14 11:02

Notbad


People also ask

What is keep in ProGuard?

To fix errors and force R8 to keep certain code, add a -keep line in the ProGuard rules file. For example: -keep public class MyClass. Alternatively, you can add the @Keep annotation to the code you want to keep. Adding @Keep on a class keeps the entire class as-is.

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.

Does ProGuard remove unused classes?

ProGuard Facts:Helps to remove unused classes, members & fields. It removes unused codes from your libraries as well. (Which means, any method or field that is not referenced anywhere will be removed by ProGuard Shrinker). Helps to reduce the build size by obfuscating the classes, methods, & fields with short names.

What is ProGuard configuration?

ProGuard is a tool to help minify, obfuscate, and optimize your code. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications.


1 Answers

From the manual:

 Types in classname, annotationtype, returntype, and argumenttype can contain wildcards: '?' for a single character, '*' for any number of characters (but not the package separator), '**' for any number of (any) characters, '%' for any primitive type, '***' for any type, and '...' for any number of arguments. 
like image 96
Sean Bright Avatar answered Sep 24 '22 20:09

Sean Bright