Jim Layhey
Jim Layhey

Reputation: 363

Is -keep class android.support.** { *; } Impacting Proguard optimization?

In order to run my application with Proguard, I need to add the following line to my Proguard.cfg:

-keep class android.support.** { *; }

Is this common practice to keep such classes? If not, how much is this line impacting Proguard optimization?

Upvotes: 0

Views: 1226

Answers (2)

user8912774
user8912774

Reputation:

Add with this progard :

-ignorewarnings -keep class * { public private *; }

here this prograd use to ignore warnings

Upvotes: 0

Reaz Murshed
Reaz Murshed

Reputation: 24211

Yes, this is somewhat common while setting up proguard rules for your project. The libraries are SDK materials that you do not need to obfuscate actually. However, you need not to obfuscate any third-party library unless its highly needed to obfuscate it. Because, in some cases, you do not know the interdependency of the classes inside the third-party library you are using. If you really have to obfuscate the third-party library code, then please go through the proguard-rules specification for that library as well. In case of obfuscating third-party libraries you might face RuntimeException in your application.

Keeping classes do not really have any impact in proguard optimization. You are just telling proguard that you want to keep the classes inside the com.android... package as they are without being obfuscated.

Upvotes: 1

Related Questions