• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaFX application obfuscation

 
Naveen Bharadwaj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another solution is to set the controller instances programmatically using "FXMLLoader.setController(new your.unobfuscated.controller())" instead of doing it declaratively in the FXML.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic