0

How can I keep classes which can be obfuscated?

I played with -keep and -keepclassmembers, both will fix my class not found exceptions, but I would like to have shorted names.

As background, I need that for a instant app: That means that I need to define myself which classes should been kept in the base module for the feature modules. In the end I have now a list of 3k classes, but I'm not interested in the full class names and the member variables.

Prags
  • 2,457
  • 2
  • 21
  • 38
rekire
  • 47,260
  • 30
  • 167
  • 264

1 Answers1

2

You can use the following modifier with -keep rules:

-keep,allowobfuscation class xxx { yyy; }

This will prevent these classes/methods from being shrunk and optimized but they can be obfuscated. Take a look at the manual which describes the various modifiers.

rekire
  • 47,260
  • 30
  • 167
  • 264
T. Neidhart
  • 6,060
  • 2
  • 15
  • 38