Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proguard issues with code obfuscation #97

Open
ouyangzn opened this issue Mar 22, 2017 · 2 comments
Open

Proguard issues with code obfuscation #97

ouyangzn opened this issue Mar 22, 2017 · 2 comments

Comments

@ouyangzn
Copy link

Hi guys,
there is a problem, if i add this line, all class name will not be obfuscated, it seems not so well. How can i resolve it?

-keepnames class * { @icepick.State *;}
@pamalyshev
Copy link

pamalyshev commented Mar 29, 2017

This rule seems to be unnecessary and wrong.
If I understand ProGuard docs correctly this rule means "Keep names of all classes that were not removed AND ALSO keep names of members that are annotated with @State.

I removed this rule, so now I have:

-dontwarn icepick.**
-keep class icepick.** { *; }
-keep class **$$Icepick { *; }

-keepclasseswithmembernames class * {
    @icepick.* <fields>;
}

State restoration works, this seems to be the right set of rules.
Unobvious thing here is that rule

-keepclasseswithmembernames class * {
    @icepick.* <fields>;
}

Won't work without -keep class icepick.** { *; } because @icepick.* annotations are removed.

@phcannesson
Copy link

I spent a few hours today investigating this issue before I found this topic.
So I created a pull request to remove the line from README and avoid the pain to others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants