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>;
}
Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.
Register nowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.