Recaf Documentation

repository·master·Indexed 27 days ago

https://github.com/col-e/recaf

A modern Java bytecode editor for standard Java and Android applications. Recaf abstracts complexities like constant pools and stack frame calculations, providing features for decompilation, bytecode assembly, deobfuscation, and runtime instrumentation. It supports extensibility via scripts and plugins, a headless mode for server-side use, and a command line interface.

Tokens
543
Snippets
1
Records
7
Agent score
43%

What's inside Recaf

  1. Use Kotlin Metadata library

    master
    Recaf includes a minified dependency specifically for reading Kotlin Metadata. This is a subset of a much larger dependency, provided to minimize footprint while maintaining the ability to parse Kotlin metadata.
  2. Use provided libraries for non-standard Maven hosts

    master
    In scenarios where required libraries are not hosted on standard Maven repositories, Recaf provides specific libraries directly within the project structure to ensure availability.
  3. Set up Recaf development environment

    master

    To develop on Recaf, clone the repository and use either an IDE or Gradle.

    Using an IDE

    1. Import the project using the build.gradle file.
    2. Create a run configuration using the main class software.coley.recaf.Main.

    Using Gradle (No IDE)

    Run the build command to generate the executable JAR.

    Output location: recaf-ui/build/libs/recaf-ui-{VERSION}-all.jar

  4. Extend Recaf with Scripts and Plugins

    master

    Recaf's functionality is exposed through modular APIs. You can automate behaviors or add new features using two methods:

    • Scripts: For automating specific behaviors.
    • Plugins: For more complex scenarios and registering hooks into the APIs.

    For implementation details, refer to the developer documentation under the "plugins & scripts" section.

  5. Launch Recaf in Headless Mode

    master
    To run Recaf without a graphical user interface (e.g., for scripting or server-side use), use the headless mode flag provided by the LaunchCommand parser. In headless mode, Recaf performs a restricted classpath discovery (Bootstrap.enableCoreOnlyDiscovery()) to avoid loading UI-related services, making it suitable for platform-independent distributions that lack JavaFX bundles.
  6. Run Recaf via Command Line

    master
    Recaf supports running as a command line application. This is particularly useful when providing scripts at startup. To view all available launch arguments, run the application with the --help flag.
    --help