kr1s
kr1s

Reputation: 63

Proguard obfuscates class despite -keepclasseswithmembernames

I try to prevent obfuscation for the classes which contains attribute @com.evernote.android.state.State on any members

For this i add to my rule:

-keepclasseswithmembernames class * { @com.evernote.android.state.State *;}

And it doesn't work. Classes are obfuscated

But if specify more concrete condition:

-keepclasseswithmembernames class * { @com.evernote.android.state.State <fields>;}

It works fine!

Can somebody clarify why first variant doesn't work?

Build-gradle version is 3.1.2

Upvotes: 2

Views: 966

Answers (1)

T. Neidhart
T. Neidhart

Reputation: 6200

The rule -keepclasseswithmembernames will match only if all specified members match. If you use a wildcard like *, then all fields and methods must be annotated, which is probably not the case.

If you match only fields then it will work.

Upvotes: 2

Related Questions