MichaelRocks / paranoid

String obfuscator for Android applications.
Apache License 2.0
670 stars 79 forks source link

Dex format not supported #33

Closed alexs60 closed 2 years ago

alexs60 commented 4 years ago

I obtained this error using annotaition @Obfuscate over an interface in android java.

name '$private$<clinit>' in class 'com.**********.utils.Constants$Storage$-CC' cannot be represented in dex format.

after removing the @Obfuscate annotaion this error disappeared.

Skaldebane commented 4 years ago

Try to put the @Obfuscate annotation on top of the whole class instead.

MichaelRocks commented 4 years ago

@alexs60 Seems that's a bug and the plugin tries to change the interface which causes problems with its bytecode. But obfuscating an interface with the current approach doesn't make much sense since an interface may contain only static final strings that are already inlined into places of usage. In other words when your code is compiled constants from the interface are never referenced. So you should apply the annotation to classes which reference constants from the interface but not to the interface itself.