Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira server plugin obfuscation

Aleksandr Zuevich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2020

Hi,

Could anybody share maven plugin configuration to integrate any obfuscator to Jira server plugin build?

Thanks in advance.

1 answer

0 votes
Deniz Oğuz - The Starware
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2020

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>;
}

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

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 now
AUG Leaders

Atlassian Community Events