Obfuscate project

42 views
Skip to first unread message

Marek Gvora

unread,
Jan 10, 2020, 4:43:03 AM1/10/20
to MvvmFX
Hi everyone,

Do you have experiences with obfuscate of an aplication based on the mvvm framework ?
Is necessary some rules or something ? I just need obfuscate my jar file in which is principal logic.

Thank you in advance

Manuel Mauky

unread,
Jan 10, 2020, 4:55:30 AM1/10/20
to MvvmFX
Hi,
I don't have experience with obfuscation but I can give you some hints on what shouldn't be obfuscated:
- The class-names of the View has to match the filename of the FXML file so the name shouln'd be changed. If this is a problem you can use the @FxmlPath annotation to define the filename. In this case the naming of the View class is not relevant anymore.
- if a ViewModel has a method with signature "public void initialize()" then it will be invoked by the framework after initialization is done. The same is true for normal Views, expect that it's JavaFX itself that is doing the invocaiton. Your obfuscator shouldn't rename these methods. If this doesn't work you can use the annotation “@Initialize" from JavaFX on the initialize method and then the naming isn't relevant anymore
- there is also some naming-conventions coming from JavaFX that are not dependant on mvvmFX: The injection of JavaFX controls from the FXML file into the View class is done based on the naming of the fields in the View class (it has to match the fx:id attribute in FXML file). So your obfuscator shouldn't rename these fields. There is no alternative here as far as I know.

I'm not sure if there is anything left because as I've said I haven't done this before but maybe this stil helps you.

best regards, manuel
Reply all
Reply to author
Forward
0 new messages