{"record":{"id":"d18b35b7d336d34d","repo":"skylot/jadx","slug":"unknown-instruction-d18b35","errorCode":null,"errorMessage":"Unknown instruction: '{}'","messagePattern":"Unknown instruction: '(.+?)'","errorType":"exception","errorClass":"DecodeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/instructions/InsnDecoder.java","lineNumber":514,"sourceCode":"\t\t\tcase SPARSE_SWITCH:\n\t\t\t\treturn makeSwitch(insn, false);\n\n\t\t\tcase PACKED_SWITCH_PAYLOAD:\n\t\t\tcase SPARSE_SWITCH_PAYLOAD:\n\t\t\t\treturn new SwitchData((ISwitchPayload) insn.getPayload());\n\n\t\t\tcase MONITOR_ENTER:\n\t\t\t\treturn insn(InsnType.MONITOR_ENTER,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tInsnArg.reg(insn, 0, ArgType.UNKNOWN_OBJECT));\n\n\t\t\tcase MONITOR_EXIT:\n\t\t\t\treturn insn(InsnType.MONITOR_EXIT,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tInsnArg.reg(insn, 0, ArgType.UNKNOWN_OBJECT));\n\n\t\t\tdefault:\n\t\t\t\tthrow new DecodeException(\"Unknown instruction: '\" + insn + '\\'');\n\t\t}\n\t}\n\n\tprivate SwitchInsn makeSwitch(InsnData insn, boolean packed) {\n\t\tSwitchInsn swInsn = new SwitchInsn(InsnArg.reg(insn, 0, ArgType.NARROW_INTEGRAL), insn.getTarget(), packed);\n\t\tICustomPayload payload = insn.getPayload();\n\t\tif (payload != null) {\n\t\t\tswInsn.attachSwitchData(new SwitchData((ISwitchPayload) payload), insn.getTarget());\n\t\t}\n\t\tmethod.add(AFlag.COMPUTE_POST_DOM);\n\t\tCodeFeaturesAttr.add(method, CodeFeature.SWITCH);\n\t\treturn swInsn;\n\t}\n\n\tprivate InsnNode makeNewArray(InsnData insn) {\n\t\tArgType indexType = ArgType.parse(insn.getIndexAsType());\n\t\t// NEW_ARRAY literal = dimensions to wrap the operand by: 0 if it is already the full array type\n\t\t// (dalvik new-array, java multianewarray), 1 for newarray/anewarray (operand is the element type)","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/instructions/InsnDecoder.java#L496-L532","documentation":"The default branch of the main opcode switch in InsnDecoder.decode(). It fires when a DEX instruction opcode is encountered that is not in any handled case (everything up through MONITOR_EXIT). Represents an opcode JADX does not know how to translate.","triggerScenarios":"A DEX bytecode opcode value not covered by the switch — e.g. a reserved/unassigned opcode, an opcode from a future DEX format, or a value produced by a corrupt or deliberately mangled code section.","commonSituations":"Decompiling an APK built for an Android version newer than what JADX supports, DEX files generated by non-standard toolchains, or obfuscators that corrupt opcode bytes.","solutions":["Upgrade JADX to a version that supports the target DEX format / Android API level.","Verify the DEX file with dexdump or baksmali to confirm the opcode is genuinely unknown vs. corrupt.","Use --no-replace-consts or other fallback flags and skip the offending class with -j 1 per-class runs.","File an issue with the raw opcode value and the instruction offset."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before a batch run, confirm the DEX format version is one JADX supports.\nbyte[] magic = Files.readAllBytes(Path.of(\"classes.dex\")).length >= 8\n    ? Files.readAllBytes(Path.of(\"classes.dex\")) : new byte[0];\nboolean admissible = magic.length >= 8 && (magic[0] == 0x64 && magic[1] == 0x65 && magic[2] == 0x78);\nif (!admissible) throw new IllegalArgumentException(\"Not a valid DEX file\");","typeGuard":null,"tryCatchPattern":"try {\n    jadx.load();\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().contains(\"Unknown instruction\")) {\n        log.warn(\"Unsupported opcode encountered; upgrade JADX\", e);\n    } else throw e;\n}","preventionTips":["Match the JADX version to the DEX format / Android API level of your input.","Validate DEX files with dexdump before decompiling.","Run per-class so unknown opcodes in one class do not abort the whole APK."],"tags":["dex-decode","opcode","malformed-input","version-mismatch"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}