Search code examples
javaproguardjna

How to tell Proguard to avoid obfuscating JNA library classes?


In other words: what -keep commands should I use to tell Proguard to avoid obfuscating my classes that represent native libraries? (since JNA requires that the names match the equivalent native function, struct, etc.)


Solution

  • This is the rule I'm using for now:

    -keepclassmembers class * extends com.sun.jna.** {
        <fields>;
        <methods>;
    }
    

    I still think there might be a better way to do it though.