Search code examples
javaandroidproguardandroid-proguard

What does the exclamation mark before class path do in ProGuard?


I studying the Proguard now but im confused with the exclamation mark ! before the classpath in the settings, such as:

-keep class !android.support.v7.view.menu.{*;}**

what does this "!" do? does it mean that proguard will not keep this class? but if thats so why do we need it since proguard will obfuscate all the classes?


Solution

  • It means the same thing that ! means in many other programming languages. It negates the selection that follows. So in your example, the keep directive will apply to everything that is not in the following package/class selection.