skylot/jadx · error · JadxRuntimeException

Consume wrong char: '{}' != '{}', sign: {}

Error message

Consume wrong char: '{}' != '{}', sign: {}

What it means

SignatureParser.consume(char) reads the next character and compares it to an expected delimiter. If they differ it throws with both the actual and expected char plus a debug string of the full signature. This signals a structurally invalid generic signature that does not match the expected JVM signature grammar (e.g. wrong placement of '<', '>', ':', ';').

Source

Thrown at jadx-core/src/main/java/jadx/core/dex/nodes/parser/SignatureParser.java:114

	private boolean skipUntil(char untilChar) {
		int startPos = pos;
		while (true) {
			if (lookAhead(untilChar)) {
				return true;
			}
			char ch = next();
			if (ch == STOP_CHAR) {
				pos = startPos;
				return false;
			}
		}
	}

	private void consume(char exp) {
		char c = next();
		if (exp != c) {
			throw new JadxRuntimeException("Consume wrong char: '" + c + "' != '" + exp
					+ "', sign: " + debugString());
		}
	}

	private boolean tryConsume(char exp) {
		if (lookAhead(exp)) {
			next();
			return true;
		}
		return false;
	}

	@Nullable
	public String consumeUntil(char lastChar) {
		mark();
		return skipUntil(lastChar) ? inclusiveSlice() : null;
	}

View on GitHub (pinned to e738a26571)

Solutions

  1. Upgrade JADX.
  2. Examine the full signature string in the error message (debugString) to locate the malformed segment.
  3. Use --no-debug-info or skip signature parsing if a CLI option exists, to get partial output.
  4. Report the signature and the class/member it belongs to upstream.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-validate a generic signature against a minimal grammar before handing to JADX.
static boolean looksLikeValidSignature(String sig) {
    if (sig == null || sig.isEmpty()) return false;
    int depth = 0;
    for (char c : sig.toCharArray()) {
        if (c == '<') depth++;
        else if (c == '>') { if (depth-- == 0) return false; }
    }
    return depth == 0;
}

Try / catch

try {
    jadx.load();
} catch (JadxRuntimeException e) {
    if (e.getMessage().contains("Consume wrong char")) {
        log.warn("Malformed generic signature attribute; input may be obfuscated", e);
    } else throw e;
}

Prevention

When it happens

Trigger: Parsing a Signature attribute that violates the JVM generic signature grammar — e.g. expecting ';' after a class type but finding '>', or expecting '<' at the start of a type parameter list but finding something else.

Common situations: Obfuscators that mangle generic signature strings, hand-crafted/invalid Signature attributes, or a DEX produced by a faulty toolchain. The debugString in the message shows the exact position and surrounding signature.

Related errors


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