-adaptresourcefilenames not working

  • Masoud

    Masoud - 2010-07-01

    I have added the -adaptresourcefilenames  line to my .pro file, using ProGuard version 4.5

    The output jar file has de1/*.class files with obfuscated names, but de1/resources/*.properties files have the original class names in the filenames.

    Any ideas what I'm doing wrong?

    Here's my .pro file:
    # obfuscator settings file, (using ProGuard obfuscator)
    -injars       dist/De1.jar
    -outjars      dist/De1_out.jar
    -libraryjars  <java.home>/lib/rt.jar;dist/lib

    -keepattributes SourceFile,LineNumberTable
    # map file for decoding call stacks
    -printmapping De1.map

    # to rename i18n resources for each form (the <className>.properties file)
    -repackageclasses ''  # i added this just in case the -adaptresourcefilenames only works in this case; this doesn't seem to do anything different
    -adaptresourcefilenames **.properties,**.gif,**.jpg

    #-adaptresourcefilenames    **.properties,**.gif,**.jpg
    #-adaptresourcefilecontents **.properties,META-INF/MANIFEST.MF

    -keep public class de1.De1App {
        public static void main(java.lang.String);

    -keepclasseswithmembernames class * {
        native <methods>;
    -keepnames class de1.LibXlsEntryInfo

    -keepclassmembernames class * {
        void close();
        public void close();
        void Xfer1(de1.utXferContext);

    I do get 1394 duplicate class name errors, but the output jar file is created anyway
    Errors like:  Note: duplicate definition of library class

  • Eric Lafortune

    Eric Lafortune - 2010-07-02

    ProGuard only renames resource files with exactly the same paths as the corresponding file names. It doesn't know about infixes like resources/. You'll have to keep the class names or rename the resource files in some other way.



Log in to post a comment.