Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top