{"record":{"id":"da9f4257e02eed26","repo":"skylot/jadx","slug":"jdwp-handshake-bad-reply","errorCode":null,"errorMessage":"jdwp handshake bad reply","messagePattern":"jdwp handshake bad reply","errorType":"exception","errorClass":"SmaliDebuggerException","httpStatus":null,"severity":"error","filePath":"jadx-gui/src/main/java/jadx/gui/device/debugger/SmaliDebugger.java","lineNumber":647,"sourceCode":"\t\t\t\t\treturn new JDWP(sizes);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tthrow new SmaliDebuggerException(e);\n\t\t}\n\t\tthrow new SmaliDebuggerException(\"Failed to init JDWP.\");\n\t}\n\n\tprivate static void handShake(OutputStream outputStream, InputStream inputStream) throws SmaliDebuggerException {\n\t\tbyte[] buf;\n\t\ttry {\n\t\t\toutputStream.write(JDWP.encodeHandShakePacket());\n\t\t\tbuf = IOUtils.readNBytes(inputStream, 14);\n\t\t} catch (Exception e) {\n\t\t\tthrow new SmaliDebuggerException(\"jdwp handshake failed\", e);\n\t\t}\n\t\tif (buf == null || !JDWP.decodeHandShakePacket(buf)) {\n\t\t\tthrow new SmaliDebuggerException(\"jdwp handshake bad reply\");\n\t\t}\n\t}\n\n\tprivate MethodsWithGenericData getMethodBySig(long classID, String sig) {\n\t\tList<MethodsWithGenericData> methods = clsMethodMap.get(classID);\n\t\tif (methods != null) {\n\t\t\tfor (MethodsWithGenericData method : methods) {\n\t\t\t\tif (sig.startsWith(method.name + \"(\") && sig.endsWith(method.signature)) {\n\t\t\t\t\treturn method;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate int genID() {\n\t\treturn idGenerator.getAndAdd(1);\n\t}","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-gui/src/main/java/jadx/gui/device/debugger/SmaliDebugger.java#L629-L665","documentation":"Error \"jdwp handshake bad reply\" thrown in skylot/jadx.","triggerScenarios":"Thrown at jadx-gui/src/main/java/jadx/gui/device/debugger/SmaliDebugger.java:647 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Compare the reply bytes against the expected handshake string and include the received bytes (hex) in the error message for diagnosis.","If the reply is bad, close the socket and advise reconnecting the debugger, since the transport state is unrecoverable."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}