Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obfuscating WAR file with Proguard

I want to obfuscate my web application built as WAR archive, as this sensitive application in first time deployed outside our data center. I tried to use the Proguard GUI tool to obfuscate the input war, with all the service jar required for the UI application, with other external dependencies. Though the Proguard runs successfully with some warnings, ex., duplicate definition of library class [javax.servlet.UnavailableException], the output war contains no classes, but has lib with the library jars and web.xml files. Any steps I mess? Any right document on this? I would appreciate if anyone can provide the right document or steps to successfully obfuscate a WAR file with dependent project (a .jar file) and other external jar files (that needs no obfuscation).

like image 420
Vijay Veeraraghavan Avatar asked Feb 24 '15 08:02

Vijay Veeraraghavan


People also ask

How do you obfuscate war files using ProGuard?

What you can do here is setup your project so the project that makes up the war - configuration xml, WEB-INF content, resources and the web content and servlet definitions and put your java in a library project. Obfuscate the library project and use those obfuscated jars in your web project.

Does ProGuard obfuscate package name?

By default, ProGuard obfuscates the code: it assigns new short random names to classes and class members. It removes internal attributes that are only useful for debugging, such as source files names, variable names, and line numbers.


1 Answers

Protector4j is the best solution to obfuscate the war file, due to graphic user interface its too easy to use and their eclipse plugin is also available. You will download it from this link https://doc.protector4j.com/protect-tomcat-web-app

like image 156
Ghulam Murtaza Avatar answered Oct 13 '22 07:10

Ghulam Murtaza