• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaFX application obfuscation

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic