skylot/jadx · error · JadxArgsValidateException

Config file extension should be '.json'

Error message

Config file extension should be '.json'

What it means

Thrown by JadxConfigAdapter.resolveConfigRef() when the supplied config reference contains a path separator ('/' or '\') but does not end in '.json'. A path-like reference must be an explicit JSON file; short names without separators get '.json' appended automatically.

Source

Thrown at jadx-cli/src/main/java/jadx/cli/config/JadxConfigAdapter.java:102

		}
	}

	public String objectToJsonString(T configObject) {
		return gson.toJson(configObject, configCls);
	}

	public T jsonStringToObject(String jsonStr) {
		return gson.fromJson(jsonStr, configCls);
	}

	private Path resolveConfigRef(String configRef) {
		if (configRef == null || configRef.isEmpty()) {
			// use default config file
			return JadxCommonFiles.getConfigDir().resolve(defaultConfigFileName);
		}
		if (configRef.contains("/") || configRef.contains("\\")) {
			if (!configRef.toLowerCase().endsWith(".json")) {
				throw new JadxArgsValidateException("Config file extension should be '.json'");
			}
			return Path.of(configRef);
		}
		// treat as a short name
		return JadxCommonFiles.getConfigDir().resolve(configRef + ".json");
	}
}

View on GitHub (pinned to e738a26571)

Solutions

  1. Give the config file a '.json' extension.
  2. If using a short name without a path separator, the '.json' suffix is added automatically — just pass the name.
  3. Rename or copy the existing config file to a .json extension.

Example fix

// before
jadx --config myconfig.yaml ...
// after
jadx --config myconfig.json ...
Defensive patterns

Strategy: validation

Validate before calling

public static void checkConfigRef(String ref) {
    if (ref == null || ref.isEmpty()) return;
    if (ref.contains("/") || ref.contains("\\")) {
        if (!ref.toLowerCase(Locale.ROOT).endsWith(".json")) {
            throw new IllegalArgumentException("Path-like config ref must end with .json: " + ref);
        }
    }
}

Type guard

public static boolean isConfigRefValid(String ref) {
    if (ref == null || ref.isEmpty()) return true;
    if (ref.contains("/") || ref.contains("\\")) return ref.toLowerCase(Locale.ROOT).endsWith(".json");
    return true;
}

Try / catch

try {
    adapter.resolveConfigRef(ref);
} catch (JadxArgsValidateException e) {
    System.err.println(e.getMessage() + " Appending .json or using a short name.");
}

Prevention

When it happens

Trigger: Passing a config reference that looks like a path (contains '/' or '\') but has a different extension, e.g. '--config myconfig.txt' or a --save-config value ending in '.yaml'.

Common situations: User thinks jadx supports YAML/TOML config; typo in the extension; passing a full path with no extension.

Related errors


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/65095396b5a18d51. Report an issue: GitHub.