skylot/jadx · error · RuntimeException

Expect format: {}, got: {}

Error message

Expect format: {}, got: {}

What it means

Thrown by VerifyRequiredVersion.parse when the requiredJadxVersion string does not match the regex (\d+\.\d+\.\d+),\s+(r\d+) - i.e. it must be a three-part numeric semver, a comma, and an 'rNNN' unstable revision. This is the inner exception that 192 wraps; it is a plain RuntimeException.

Source

Thrown at jadx-core/src/main/java/jadx/core/plugins/versions/VerifyRequiredVersion.java:63

			// keep version str parsing for verification
			return true;
		}
		if (unstable) {
			return VersionComparator.checkAndCompare(jadxVersion, reqVer.getUnstableRev()) >= 0;
		}
		return VersionComparator.checkAndCompare(jadxVersion, reqVer.getReleaseVer()) >= 0;
	}

	public String getJadxVersion() {
		return jadxVersion;
	}

	private static final Pattern REQ_VER_FORMAT = Pattern.compile("(\\d+\\.\\d+\\.\\d+),\\s+(r\\d+)");

	private static RequiredVersionData parse(String reqVersionStr) {
		Matcher matcher = REQ_VER_FORMAT.matcher(reqVersionStr);
		if (!matcher.matches()) {
			throw new RuntimeException("Expect format: " + REQ_VER_FORMAT + ", got: " + reqVersionStr);
		}
		return new RequiredVersionData(matcher.group(1), matcher.group(2));
	}

	private static final class RequiredVersionData {
		private final String releaseVer;
		private final String unstableRev;

		private RequiredVersionData(String releaseVer, String unstableRev) {
			this.releaseVer = releaseVer;
			this.unstableRev = unstableRev;
		}

		public String getReleaseVer() {
			return releaseVer;
		}

		public String getUnstableRev() {

View on GitHub (pinned to e738a26571)

Solutions

  1. Reformat the version to match the regex exactly, e.g. '1.5.0, r1234'.
  2. If you only need a yes/no compatibility answer, pass null or empty (isCompatible returns true) instead of a malformed string.
  3. When building a plugin, copy the required version string from jadx's own release label to avoid format drift.
  4. Catch IllegalArgumentException around plugin loading so one bad descriptor does not kill the whole plugin scan.

Example fix

// before
String v = "1.5";            // rejected
String v = "1.5.0-r1234";   // rejected (missing ', ')
// after
String v = "1.5.0, r1234";  // accepted
Defensive patterns

Strategy: validation

Validate before calling

private static final Pattern REQ_VER_FORMAT =
    Pattern.compile("(\\d+\\.\\d+\\.\\d+),\\s+(r\\d+)");
boolean ok(String v) { return v != null && REQ_VER_FORMAT.matcher(v).matches(); }

Try / catch

try {
    VerifyRequiredVersion.verify(v);
} catch (RuntimeException e) {
    LOG.warn("ignoring malformed requiredJadxVersion '{}': {}", v, e.getMessage());
}

Prevention

When it happens

Trigger: parse() is called with anything other than the exact '<digits>.<digits>.<digits>, r<digits>' shape: missing comma, missing 'r', two-part version, or extra text. The matcher.matches() call returns false and the method throws, reporting the expected pattern and the offending string.

Common situations: Same as 192: malformed plugin descriptor metadata. Also reachable directly if user code calls VerifyRequiredVersion.isCompatible with a bad string (it calls parse internally), though isJadxCompatible tolerates null/empty.

Related errors


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