skylot/jadx · error · SmaliDebuggerException

jdwp handshake failed

Error message

jdwp handshake failed

What it means

Error "jdwp handshake failed" thrown in skylot/jadx.

Source

Thrown at jadx-gui/src/main/java/jadx/gui/device/debugger/SmaliDebugger.java:644

				tryThrowError(res);
				if (res.isReplyPacket() && res.getID() == 1) {
					JDWP.IDSizes.IDSizesReplyData sizes = JDWP.IDSizes.decode(res.getBuf(), JDWP.PACKET_HEADER_SIZE);
					return new JDWP(sizes);
				}
			}
		} catch (IOException e) {
			throw new SmaliDebuggerException(e);
		}
		throw new SmaliDebuggerException("Failed to init JDWP.");
	}

	private static void handShake(OutputStream outputStream, InputStream inputStream) throws SmaliDebuggerException {
		byte[] buf;
		try {
			outputStream.write(JDWP.encodeHandShakePacket());
			buf = IOUtils.readNBytes(inputStream, 14);
		} catch (Exception e) {
			throw new SmaliDebuggerException("jdwp handshake failed", e);
		}
		if (buf == null || !JDWP.decodeHandShakePacket(buf)) {
			throw new SmaliDebuggerException("jdwp handshake bad reply");
		}
	}

	private MethodsWithGenericData getMethodBySig(long classID, String sig) {
		List<MethodsWithGenericData> methods = clsMethodMap.get(classID);
		if (methods != null) {
			for (MethodsWithGenericData method : methods) {
				if (sig.startsWith(method.name + "(") && sig.endsWith(method.signature)) {
					return method;
				}
			}
		}
		return null;
	}

View on GitHub (pinned to e738a26571)

Solutions

  1. Confirm the bytes sent match the 'JDWP-Handshake' string and that the socket is connected before writing; log the actual reply length when it differs.
  2. Add a timeout on the handshake read so a hung target fails fast with a clear timeout error instead of a generic handshake failure.

When it happens

Trigger: Thrown at jadx-gui/src/main/java/jadx/gui/device/debugger/SmaliDebugger.java:644 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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