• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in Obfuscate war file

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
mdraj group
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody look into this issue Please

Thanks
MDRaj

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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):
 
reply
    Bookmark Topic Watch Topic
  • New Topic