/reObfuscateFXML

Fixes obfuscation of onAction calls in FXML missed by ProGuard

Primary LanguageJavaApache License 2.0Apache-2.0

reObfuscateFXML

Fixes obfuscation of onAction calls in FXML missed by ProGuard.

If your action handlers for GUI elements are declared in FXML file with onAction="#foo" tag ProGuard will miss it even with the -adaptresourcefilecontents.

This tiny tool takes your obfuscated jar, unpacks it to the specified directory, renames all such calls with their obfuscated counterparts using provided mapping, and then packs it all back again.

Usage

  1. Obfuscate your jar with ProGuard with -printmapping mapping.txt argument;
  2. Copy resulting mapping.txt to the needed directory;
  3. Use the command java -jar reObfuscateFXML.jar obfs.jar out.jar mapping.txt dest, where obfs.jar is the original obfuscated jar, out.jar is the desirable name for resulting jar, mapping.txt is the file produced by ProGuard and dest is the name of temporary directory that will be created to unpack the jar.

Changelog

23.05.2019: reobfuscate fx:id and source when using fx:include. Note that you have to keep xController naming pattern in ProGuard configuration when using fx:include