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.
- Obfuscate your jar with ProGuard with
-printmapping mapping.txt
argument; - Copy resulting mapping.txt to the needed directory;
- 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.
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