1

I have a bunch of Retrofit Request/Response classes that get (de)serialized with GSON.

I currently use @Keep to make sure that R8 doesn't make them abstract, or obfuscate the property names (which are needed for GSON).

Is there any way I can obfuscate the class name while not obfuscating the property names, etc...

Eliezer
  • 7,209
  • 12
  • 56
  • 103

1 Answers1

0

I think you can try -keepclassmembernames

As per proguard manual here

-keepclassmembernames class_specification

Short for-keepclassmembers,allowshrinkingclass_specification Specifies class members whose names are to be preserved, if they aren't removed in the shrinking phase. For example, you may want to preserve the name of the synthetic class$methods when processing a library compiled by JDK 1.2 or older, so obfuscators can detect it again when processing an application that uses the processed library (although ProGuard itself doesn't need this). Only applicable when obfuscating.

Shailesh Chandra
  • 2,164
  • 2
  • 17
  • 25