Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira server plugin obfuscation

Hi,

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

Thanks in advance.

1 answer

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

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you