Giter Club home page Giter Club logo

recaf-launcher's Introduction

recaf-launcher's People

Contributors

1fexd avatar col-e avatar sureshg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

recaf-launcher's Issues

Allow the user to specify a default action in the config

This would allow the user via the GUI or CLI to choose what happens when they provide no arguments to the launcher. The main options would be run and update-and-run. This would allow the launcher to seamlessly open Recaf without any intermediate steps or required user input.

Using bundled JavaFX - NOT possible

In your readme, you're saying:

  • Bundling JavaFX can work, but its your responsibility to ensure the bundled version is compatible with Recaf
  • Ideally use a JDK that does not bundle JavaFX and let the launcher pull in JavaFX

This is, in fact, not true. When I try to run Recaf using java -jar launcher.jar run, I get the error:

No local cached version of JavaFX found.
- Try running with 'update-jfx'

Based on the code from src/main/java/software/coley/recaf/launch/commands/Run.java, it indeed checks only for the locally cached version of JavaFX and ignores any bundled version (line 61: JavaFxVersion javaFxVersion = JavaFxVersion.getLocalVersion();).
I don't want to force downloading JavaFX separately. The whole reason for using JDK with bundled JFX is to not occupy additional disk space for a copy of JavaFX for every Java app that might use it.

My proposal for a fix is:

  • Do not make the check for local JavaFX mandatory
  • Wrap the lines 73-80 in an if (javaFxVersion != null) and don't do classpathItems.addAll(javafxDependencies); if it's not true.

This will assume JavaFX is bundled with JDK and try to run Recaf with it. Of course, bundled JavaFX could probably be checked in some way (like how the Java runtime itself does when running a JAR with javafx Application subclass as the main class).

Hangs on fetching artifact

When trying to install Recaf 4.x with launcher 0.4.1 it hangs on fetching the artifact. No network usage listed in Task Manager above 32kbps which is baseline

I can't use Recaf 2 because I need to change an annotation

C:\Users\username\Downloads>java -jar recaf-launcher-0.4.1.jar update-ci -b dev4
Attempting to resolve installed Recaf version...
Recaf jar file not found: 'C:\Users\username\AppData\Roaming\Recaf\recaf.jar'
Attempting to resolve JFX version...
No JavaFX version class found in the current classpath
Java Properties:
 - java.home = C:\Program Files\Java\graalvm-jdk-17.0.11+7.1
 - java.version = 17.0.11
 - java.vm.vendor = Oracle Corporation
 - java.vm.version = 17.0.11+7-LTS-jvmci-23.0-b34
 - javafx.platform = win
 - javafx.version = -1
 - os.arch = amd64
 - os.bitness = 64
 - os.name = Windows 11
 - os.processors = 20
 - os.version = 10.0
 - recaf.version = ?

Attempting to resolve installed Recaf version...
Recaf jar file not found: 'C:\Users\username\AppData\Roaming\Recaf\recaf.jar'
Checked for update recently on 2024/06/05 16:30:08, will check again later in 6m 52s
Recaf CI has 30 artifacts listed, fetching first matching one...

Same issue on Java 22

Unable to run Recaf through launcher: java.lang.UnsatisfiedLinkError

Here's the stdout generated when using Azul Zulu 21: stdout_zulu21.txt

Same thing with Eclipse Adoptium 17: stdout_adoptium17.txt

The exception java.lang.UnsatisfiedLinkError: 'java.lang.String com.sun.javafx.font.PrismFontFactory.regReadFontLink(java.lang.String)' is probably generated by some JavaFX incompatibility. I'm unsure if either of these runtimes have JavaFX bundled, but a quick find for jfx/javafx in the install directory yields nothing. Thanks in advance.

Javafx validation failed after updating recaf.

Attempting to resolve installed Recaf version...
Found Recaf's build config, checking contents...
 - MAVEN_GROUP = software.coley
 - MAVEN_NAME = recaf-core
 - VERSION = 4.0.0-SNAPSHOT
 - GIT_REVISION = 1
 - GIT_SHA = ebfd9b9bb3e856eb06985493e65efe92de7b2c94
 - GIT_DATE = 2024 04/15 19:52
 - GIT_BRANCH = dev4
 - BUILD_DATE = 2024 04/15 19:53
 - BUILD_UNIX_TIME = 1713210800811
 - DIRTY = 0
Attempting to resolve JFX version...
No JavaFX version class found in the current classpath
Java Properties:
 - java.home = D:\Program Files\Zulu\zulu-22
 - java.version = 22.0.1
 - java.vm.vendor = Azul Systems, Inc.
 - java.vm.version = 22.0.1+8
 - javafx.platform = win
 - javafx.version = -1
 - os.arch = amd64
 - os.bitness = 64
 - os.name = Windows 11
 - os.processors = 8
 - os.version = 10.0
 - recaf.version = 4.0.0-SNAPSHOT

Looking in 'C:\Users\Liticane\AppData\Roaming\Recaf' for Recaf/dependencies...
Running Recaf '4.0.0-SNAPSHOT' with JavaFX '23-ea+3:win'
23:52:30.171 [JFXValidation/main] ERROR: JFX validation failed, could not find 'VersionInfo' class
java.lang.ClassNotFoundException: com.sun.javafx.runtime.VersionInfo
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:413)
        at java.base/java.lang.Class.forName(Class.java:404)
        at software.coley.recaf.util.JFXValidation.validateJFX(JFXValidation.java:33)
        at software.coley.recaf.Main.main(Main.java:70)

Dependencies folder needs to exist

First time installing the launcher. When running java -jar recaf-launcher-0.1.3.jar update-jfx, it attempts to download dependencies into AppData\Roaming\Recaf\dependencies. In my case, the dependencies directory did not exist and the launcher did not make an attempt to create the directory automatically. This caused the dependency download to fail.

unable to update jfx

dependencies folder in appdata\recaf isnt created automatically :(((

Failed downloading FX artifact: ' https://repo1.maven.org/maven2/org/openjfx/javafx-media/22-ea+16/javafx-media-22-ea+16-win.jar'
java.nio.file.NoSuchFileException: C:\Users\yeah\AppData\Roaming\Recaf\dependencies\javafx-media-22-ea+16-win.jar
        at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
        at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(Unknown Source)
        at java.base/java.nio.file.Files.newOutputStream(Unknown Source)
        at java.base/java.nio.file.Files.copy(Unknown Source)
        at software.coley.recaf.launch.commands.UpdateJavaFX.updateTo(UpdateJavaFX.java:200)
        at software.coley.recaf.launch.commands.UpdateJavaFX.update(UpdateJavaFX.java:159)
        at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:44)
        at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:24)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at software.coley.recaf.launch.Launcher.main(Launcher.java:51)
        ```

Pass .jar to open in Recaf using the launcher

To be able to double click jars and to swifty open projects. It is common to make the argument of the runnable being a path to the destination to open.

As such, please add an argument to the 4.x launcher to open Recaf with he desired workspace (jar, directory, ...).

How to use launcher from cli?

Hi. I want to make simple cli command to decompile jar file. With programs like text editors I can just specify filename after program name (notepad myfile.txt). But it doesn't work with this launcher. Where can I specify file to open? Or workspace to open or stuff like that.
Also headless mode doesn't seem to work for me, recaf still opens a window even when I use java (not javaw) and specify -x option. And there's no --help or anything

Show critical errors via MessageBox, not just recaf-launcher.log

For example, when I open the launcher.jar it doesn't open, I don't see MessageBox with error, to understand what happened, I have to open recaf-launcher.log to find the line with an error.
In that case log is:

Attempting to resolve installed Recaf version...
Recaf jar file not found: 'C:\Users\u\AppData\Roaming\Recaf\recaf.jar'

It would be nice to see a MessageBox with error:

Recaf jar file not found:
``C:\Users\u\AppData\Roaming\Recaf\recaf.jar''.

I think it won't be a problem to make MessageBox display via jfx

JavaFX Class Not Found

Downloaded launcher 0.4.0, downloaded Java 22 x64 and installed that ahead of time. When I try to run recaf via the launcher, it downloads recaf and JavaFX, however there seems to be a class required that is not available.

 - java.version = 22.0.1
 - java.vm.vendor = Oracle Corporation
 - java.vm.version = 22.0.1+8-16
...
Running Recaf '4.0.0-SNAPSHOT' with JavaFX '23-ea+3:win'
08:34:52.540 [JFXValidation/main] ERROR: JFX validation failed, could not find 'VersionInfo' class
java.lang.ClassNotFoundException: com.sun.javafx.runtime.VersionInfo
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:413)
        at java.base/java.lang.Class.forName(Class.java:404)
        at software.coley.recaf.util.JFXValidation.validateJFX(JFXValidation.java:33)
        at software.coley.recaf.Main.main(Main.java:70)```

failed to fetch dependencies

runed java -jar update-jfx
and the following error appeared
java.nio.file.NoSuchFileException: C:\Users\neilhuang007\AppData\Roaming\Recaf\dependencies at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) at java.base/sun.nio.fs.WindowsDirectoryStream.<init>(WindowsDirectoryStream.java:86) at java.base/sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(WindowsFileSystemProvider.java:541) at java.base/java.nio.file.Files.newDirectoryStream(Files.java:481) at java.base/java.nio.file.Files.list(Files.java:3767) at software.coley.recaf.launch.info.JavaFxVersion.getLocalVersion(JavaFxVersion.java:66) at software.coley.recaf.launch.commands.UpdateJavaFX.update(UpdateJavaFX.java:153) at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:44) at software.coley.recaf.launch.commands.UpdateJavaFX.call(UpdateJavaFX.java:24) at picocli.CommandLine.executeUserObject(CommandLine.java:2041) at picocli.CommandLine.access$1500(CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461) at picocli.CommandLine$RunLast.handle(CommandLine.java:2453) at picocli.CommandLine$RunLast.handle(CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273) at picocli.CommandLine$RunLast.execute(CommandLine.java:2417) at picocli.CommandLine.execute(CommandLine.java:2170) at software.coley.recaf.launch.Launcher.main(Launcher.java:51)

Allow passing arguments into Recaf

Currently the Recaf process is started with no arguments, but we'll want to allow specifying content like:

  • Files to open as workspaces
  • Scripts to run

Usage:

  • For the GUI
    • A single jar path as an argument should pass that path as an input/workspace to Recaf when launched
    • A single java source file path as an argument should pass that path as a script to Recaf when launched
  • For the CLI
    • The run and auto commands should have new --input and --script arguments for passing along to Recaf when launched

See: LaunchCommand

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.