2

In my app I have library project dependency with lots of unused methods fields and classes. Since this is a third-party library I don't want to remove all unused classes and methods by myself due it's future updates. I'm trying to use proguard for this but

-dontobfuscate

will only exclude whole project from any optimisations shrinking and obfuscation. Is it possible to skip obfuscation step?

oneday
  • 63
  • 1
  • 6

1 Answers1

2

You should generally apply ProGuard to the combination of your app and its libraries. This provides the best results in terms of shrinking, optimization, and obfuscation. The libraries will be obfuscated, but if you get a new version, you need to rebuild the entire app anyway.

If you want to shrink, optimize, and obfuscate a single library, you can have a look at the ProGuard manual > Examples > A typical library.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • 10
    The problem is that I really don't want to obfuscate anything - all I need is just to strip unused methods and fields inside this library cause I'm facing 65k methods limit inside my app because of this huge library and multidex is not an option so I'm trying to use proguard to remove the garbage. – oneday Dec 16 '14 at 14:37
  • 2
    `-dontobfuscate` disables the obfuscation step, but not the shrinking step or the optimization step, so the option should work fine for you. – Eric Lafortune Dec 19 '14 at 23:44
  • So I guess my solution is just `-dontobfuscate` with `-keep` of every class that is used by public api of my library – oneday Dec 24 '14 at 09:12