Hi,
Could anybody share maven plugin configuration to integrate any obfuscator to Jira server plugin build?
Thanks in advance.
Hi Aleksandr,
I don't think obfuscation adds much protection and it occasionally caused problems in production because I forgot to update configuration or add necessary annotation. I don't think my configuration file is ideal but it may be a good starting point if you want to integrate Proguard anyway.
There are some classes you don't want to be obfuscated. For example, Active Object data classes, Rest API data classes, interfaces which are meant to be used by other plugins (your API). You can create a tagging annotation and add it to classes you don't want to be obfuscated, but you will sooner or later forget to do it.
-dontshrink
-dontoptimize
-dontnote
-keepattributes *Annotation*
-keepdirectories
-keepattributes Signature
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-ignorewarnings
-keep @javax.xml.bind.annotation.XmlRootElement public class * {
<fields>;
<methods>;
}
-keep @javax.xml.bind.annotation.XmlRootElement class * {
<fields>;
<methods>;
}
-keep @javax.xml.bind.annotation.XmlAccessorType public class * {
<fields>;
<methods>;
}
-keep class !com.deniz.** {
*;
}
-keep public class * extends com.atlassian.jira.web.action.JiraWebActionSupport {
<fields>;
<methods>;
}
-keep public class * extends net.java.ao.Entity {
<fields>;
<methods>;
}
-keepclassmembers class * {
public <init>(...);
}
# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum * {
<fields>;
<methods>;
}
# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,allowshrinking class * {
native <methods>;
}
-keep class * implements com.deniz.jira.utils.DoNotObfuscate {
<fields>;
<methods>;
}
-keep @com.deniz.jira.worklog.utils.DontObfuscateMethods class * {
<methods>;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.