posted 9 years ago
Hi,
I have found some blogs which explains how to obfuscate the JavaFX application. I have followed the steps and obfuscated the application successfully. In all the blogs, they have mentioned that the FXML files should not be obfuscated. However FXML will contain a reference to the controller class (fully qualified name). Once the application is obfuscated, controller class name along with the package changes. So, when I run the obfuscated jar, FXML is not able to load the controller class.
I did some research around this and found that the work around was to either not obfuscate the controllers or to find the obfuscated controller class name and update the same in FXML files inside the obfuscated jar. First solution is not sensible because most of the logic and code is present in controllers. Not obfuscating controllers means entire logic is visible. I'm not comfortable with the second solution too. Every time I obfuscate, I cannot find each and every controller class and update in my FXML's, that too inside the obfuscated jar. If somebody has worked on this problem, please share some thoughts.