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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With