Coder Social home page Coder Social logo

JavaFX fxml support about yguard HOT 7 CLOSED

yworks avatar yworks commented on June 11, 2024
JavaFX fxml support

from yguard.

Comments (7)

thomasbehr avatar thomasbehr commented on June 11, 2024

Obfuscating FXML files is not explicitly supported. However, if you only need to adjust class names, you can try adding

<adjust replacecontent="true">
  <include name="**/*.fxml"/>
</adjust>

to the rename element of your yguard task. yGuard is not able to adjust method names that are specified as event handlers in FXML, though.

The other, more reliable option is to exclude class and method names that are used in FXML from obfuscation.

from yguard.

Fohlen avatar Fohlen commented on June 11, 2024

@yanchikdev did this fix your issue? Can it be closed?
@thomasbehr should we add a fxml example to the examples folder?

from yguard.

meetinger avatar meetinger commented on June 11, 2024

@Fohlen Yeah, I excluded the controller from obfuscation and it worked.
But I still wanted yGuard to be able to rename methods in FXML

from yguard.

thomasbehr avatar thomasbehr commented on June 11, 2024

@Fohlen As long as yGuard does not support obfuscating method names in FXML files, I do not think an example is the proper place for providing this kind of information. I would prefer to have this piece of information as part of the yGuard documentation.

from yguard.

Fohlen avatar Fohlen commented on June 11, 2024

Since yFiles is also offered for JavaFX applications it probably makes sense to add this functionality to yGuard to cover the use case. Moving up on our priority list.

from yguard.

Fohlen avatar Fohlen commented on June 11, 2024

@meetinger I've set up an example with FXML support. However there are two issues that currently need to be handled by hand:

  • if you reference a method name from your FXML you need to exclude it from obfuscation
  • if you use anonymous functions that actually have semantics (e.g ActionEvent.handle) you will need to exclude those from obfuscation as well

I think this is a well enough tradeoff for obfuscation. Most of our use cases do not require "reflecting" the method names from a config. In contrary this is probably not desired, as during deployment / obfuscation you want to be very explicit what gets mapped. Is this as you imagined it and could this issue be closed with it?

from yguard.

Fohlen avatar Fohlen commented on June 11, 2024

Closing this because of inactivity and because we see the current tradeoff as sufficient for most use cases.

from yguard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.