JADX Plugins Guide

Jadx Plugins Guide

Prerequisites

Dependency Setup

Add jadx-core as compileOnly to reduce plugin JAR size — at runtime jadx provides it from its own classpath:

1compileOnly("io.github.skylot:jadx-core:1.5.3")

Plugin Entry Point

The plugin main class must implement jadx.api.plugins.JadxPlugin:

 1import jadx.api.plugins.JadxPlugin;
 2import jadx.api.plugins.JadxPluginContext;
 3import jadx.api.plugins.JadxPluginInfo;
 4
 5public class JadxExamplePlugin implements JadxPlugin {
 6    public static final String PLUGIN_ID = "example-plugin";
 7
 8    @Override
 9    public JadxPluginInfo getPluginInfo() {
10        return JadxPluginInfoBuilder.pluginId(PLUGIN_ID)
11                .name("Jadx example plugin")
12                .description("Add jadx watermark comment to every class")
13                .homepage("https://github.com/jadx-decompiler/jadx-example-plugin")
14                .requiredJadxVersion("1.5.3, r2504")
15                .build();
16    }
17
18    @Override
19    public void init(JadxPluginContext context) {
20        // plugin init code
21    }
22}

Plugin Discovery (ServiceLoader)

Create the file resources/META-INF/services/jadx.api.plugins.JadxPlugin containing the fully qualified class name of your plugin class. This enables auto-discovery via Java’s ServiceLoader mechanism.

Version Compatibility

Use requiredJadxVersion to prevent runtime errors when the plugin uses APIs added in newer jadx versions.

Format: "<release-version>, r<revision-number>"

Stable release mapping:

jadx-core versionrequiredJadxVersion string
1.5.3"1.5.3, r2504"
1.5.2"1.5.2, r2472"
1.5.1"1.5.1, r2333"

For snapshot builds: set release version to snapshot + 0.0.1, and revision to the latest unstable build number.

Example: jadx-core 1.5.2-SNAPSHOT → use "1.5.3, r2475"

Get revision number from git: git rev-list --count HEAD

Note: jadx searches the 10 most recent plugin releases to find a compatible version when installing a plugin for an unstable jadx build.

Plugin API

Root API object: JadxPluginContext — available in the init(context) method.

Key methods on JadxPluginContext:

MethodPurpose
addPassInsert custom logic into the decompilation pipeline
registerOptionsDeclare custom options accessible from jadx-cli and jadx-gui
getGuiContextReturns JadxGuiContext for UI customization when running in jadx-gui

Warning: getGuiContext() returns null in jadx-cli and during jadx-gui option collection for preferences. Always null-check before use:

1JadxGuiContext guiCtx = context.getGuiContext();
2if (guiCtx != null) {
3    // UI customization code
4}

Use cases enabled by the plugin system:

Installation

After packaging the plugin as a JAR:

GitHub Release Distribution

JAR artifact naming convention: <repo-name>-<version>.jar

Example: jadx-example-plugin-0.1.1.jar

The <version> segment is displayed in the UI. Semantic versioning (major.minor.patch) is recommended.

Install by location ID:

Discovering Installed / Available Plugins

Plugins listed in the community registry at https://github.com/jadx-decompiler/jadx-plugins-list appear in these views automatically.

Reference