2

I just installed ProGuard for Eclipse (http://marketplace.eclipse.org/content/proguarddt), curious about how to protect my exported .JAR program from decompilation. However, I don't have the faintest idea how to use this.

When I search around, all I see is how to use it with Android. But I am just making a desktop Java application.

They all speak of some sort of configuration file, but I don't know where to put it or how to create it or how to use it.

At How do I use ProGuard? he mentions a .pro file, but in Where do I find proguard.cfg in my project? they talk about a .txt file? I am too confused at this point.

I have an Eclipse project. It is a Java desktop application. It has a number of apache-commons libraries in its build path. It also uses JavaFX (if that makes a difference). There is only one main method in a class called "App".

Can you explain to me how to use ProGuard in Eclipse for such purposes?

Community
  • 1
  • 1
Saturn
  • 17,888
  • 49
  • 145
  • 271
  • have you had any luck with this, I have a similar usecase and all the external jars my application depends on landing me with same problem as yours – Venkat Nov 04 '16 at 19:57
  • 1
    @Venkat I don't remember the outcome, but nowadays I just use Excelsior JET to protect my applications. – Saturn Nov 07 '16 at 21:54

1 Answers1

1

Have a look at examples here suitable for your application type: http://proguard.sourceforge.net/manual/examples.html#application

This answer can give you the start: https://stackoverflow.com/a/2124256/1129313

Here is the usage of proguard: http://proguard.sourceforge.net/manual/usage.html

Another helpful link: http://www.thegeekstuff.com/2008/06/protect-your-java-code-from-reverse-engineering/

Community
  • 1
  • 1
Garry
  • 4,493
  • 3
  • 28
  • 48
  • Uh yeah but, it won't work because of my libraries. For example, I have the Shiro library JAR, and this is one of the several things ProGuard says: `Warning: org.apache.shiro.web.filter.mgt.SimpleNamedFilterList: can't find referenced class javax.servlet.Filter`. I already listed the Shiro JAR file in the `-libraryjars` part of the configuration... – Saturn Jul 13 '15 at 08:46
  • And the same happens with my other libraries (like apache-commons). – Saturn Jul 13 '15 at 08:47
  • Also, those don't talk about how to use ProGuard with Eclipse I think. I was under the impression that the plugin would make this easier. – Saturn Jul 13 '15 at 08:48
  • to add the your libraries you need to include this in your command `-libraryjars jar1.jar, jar2.jar, jar3.jar` – Garry Jul 13 '15 at 08:54
  • I haven't much idea for Eclipse plugin. – Garry Jul 13 '15 at 08:55
  • I've added the libraries separated by colons instead `:` (won't let me use commas). The troubleshooting page of you linked says that I should filter the referencing classes out like `mylibrary.jar(!somepackage/SomeUnusedReferencingClass.class)` but that doesn't seem to have effect either way. All examples I see use things like ant or gradle etc. But I don't use any of that... I just have an Eclipse project with a few apache libraries... – Saturn Jul 13 '15 at 09:16