sourcenouveau
sourcenouveau

Reputation: 30534

Using ProGuard to obfuscate resource filenames

I have an application JAR file I would like to obfuscate using ProGuard. It contains a number of PNG files that are referenced using path strings in the application, such as /my/path/image.png.

I tried using the -adaptresourcefilenames **.png resource obfuscation option but it didn't seem to have any effect.

Can ProGuard rename my PNG files somehow? I need it to rename the files and change the strings in class files that reference it.

Upvotes: 1

Views: 2422

Answers (1)

Eric Lafortune
Eric Lafortune

Reputation: 45676

The option -adaptresourcefilenames only works for resource files like mypackage/MyClass.properties that have a corresponding class file mypackage/MyClass.class. If the class name is obfuscated the resource file name is obfuscated along.

ProGuard doesn't obfuscate other file names, since the names are often not specified as a single literal string in the code, making it difficult or impossible to replace them.

Upvotes: 1

Related Questions