Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obfuscating Play 2 web app on dist with Proguard?

How to automatically obfuscate a Play Framework web app when the play state|dist command is executed?

The idea is to use Proguard to perform Java code obfuscation.

There are plugins for SBT, such as sbt-proguard and xsbt-proguard-plugin, but I'm not sure if I can integrate them with Play 2 straightforward.

Please advise.

like image 974
David Campos Avatar asked Mar 25 '14 22:03

David Campos


1 Answers

I don't know whether this is possible for Play Framework 2.0.x, but it can be done from 2.2.0 onwards.

You can follow the steps given here. All of the steps are pretty straight-forward. However, you'll need to know where the required files are:

  • plugins.sbt - You can find it in PLAY_HOME/framework/project/plugins.sbt
  • build.sbt - You will find this in your application root folder. This file is available only from Play 2.2.0 onwards.

These steps should be sufficient to integrate the plugin with Play

Hope that helps you.

like image 91
Rahul Bobhate Avatar answered Oct 08 '22 15:10

Rahul Bobhate