aspose file tools*
The moose likes Security and the fly likes Problem in Obfuscate war file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Problem in Obfuscate war file " Watch "Problem in Obfuscate war file " New topic
Author

Problem in Obfuscate war file

mdraj group
Greenhorn

Joined: Aug 05, 2013
Posts: 4
Hi All,

Can anyone please let me know how to Obfuscate the war file using progaurd. I have tried but not succeed, added the below code in build.xml



below one is the .pro config file that basically tells that in and out jars.




I am able to produce the out_war file but when i open this output file there is no class files in classes directory.

Can any one give a hand to fix this or any suggestions.


Thanks in advance.

Thanks
MDRaj
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
A .war file is not a .jar file. Apply ProGuard to classes and jar files only, and the create the .war file with the results.


Ping & DNS - my free Android networking tools app
mdraj group
Greenhorn

Joined: Aug 05, 2013
Posts: 4
Ulf Dittmer wrote:A .war file is not a .jar file. Apply ProGuard to classes and jar files only, and the create the .war file with the results.



Thanks for the reply.

You mean, cant we apply obfuscation directly to .war file. first i have make jar for classes in classes folder and then appy obfuscation and then unzip jar to classes folder and then prepare war. am i right?
instead It would be better to apply obfuscation directly to classes folder.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
Yes, you can't apply obfuscation to .war files.

No, you're wrong, it's perfectly possibly to apply obfuscation to .jar files, as I said in my previous post. There is no benefit in applying obfuscation to the classes folder instead of applying it to .jar files.
mdraj group
Greenhorn

Joined: Aug 05, 2013
Posts: 4
Ulf Dittmer wrote:Yes, you can't apply obfuscation to .war files.

No, you're wrong, it's perfectly possibly to apply obfuscation to .jar files, as I said in my previous post. There is no benefit in applying obfuscation to the classes folder instead of applying it to .jar files.


I have tried to prepare jar and then obfuscate but still out put jar is not obfuscated means .class file names s are not changed.

Here is my build.xml file. default task is "war" (default="war")




Here is my .pro config file



Can you please let me know where i did done mistake.


Thanks
MDRaj

mdraj group
Greenhorn

Joined: Aug 05, 2013
Posts: 4
Can anybody look into this issue Please

Thanks
MDRaj

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
Not sure what's going on. This is about the most minimal configuration that works fine in creating an obfuscated jar file from an unobfuscated one (after fixing the two paths I have omitted):
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Obfuscate war file