Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are 3 basic ways you do it:</p> <ol> <li>Create a normal proguard.cfg file, and reference it from ant</li> <li>Put your proguard settings directly inside ant using XML notation</li> <li>Put your proguard settings directly inside ant using the proguard.cfg format</li> </ol> <p>Here's a basic example of using Proguard with Ant with the 3rd approach: <a href="http://www.reviewmylife.co.uk/blog/2007/10/20/proguard-eclipse-ant-buildxml/" rel="noreferrer">http://www.reviewmylife.co.uk/blog/2007/10/20/proguard-eclipse-ant-buildxml/</a></p> <p>The important thing to remember about Proguard is that everything you want to obfuscate has to be inside a JAR file, and you'll need to explicitly tell it not to obfuscate certain things (like your program entry point, things you access via reflection, etc).</p> <p>JavaFX creates a file used as an entry point you want to prevent obfuscating:</p> <pre><code>-keepclasseswithmembers public class com.javafx.main.Main { public *; public static *; } </code></pre> <p>Make sure to include Java/JavaFX libs</p> <pre><code>-libraryjars "${java.home}/lib/rt.jar" -libraryjars "${java.home}/lib/ant-javafx.jar" -libraryjars "${java.home}/lib/jfxrt.jar" </code></pre> <p>If you're using FXML files, you'll want to make sure your FXML files are renamed similarly to their respective controller file:</p> <pre><code>-adaptresourcefilecontents **.fxml </code></pre> <p>Anything annotated with @FXML is accessed through reflection, so don't obfuscate them:</p> <pre><code>-keepclassmembernames class * { @javafx.fxml.FXML *; } </code></pre> <p>The Proguard website has a lot of information, but it can be difficult to grok.</p> <p>Honestly, there are plenty of examples on the web that show you how to do this. Just google javafx proguard, and you'll probably find some good complete examples.</p> <p>Edit: as far as how IntelliJ passes information to Ant.. I don't know. There are probably some variables it passes in that you reference like a normal Ant propertly. I'm sure JetBrains website has info on that on their website if you can't find it on the net. </p> <p>If it was me, I'd just create an ant script to compile my application without obfuscation, then add in proguard once you've got that squared away.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload