{"record":{"id":"1978cd8449735cad","repo":"skylot/jadx","slug":"failed-to-decompress-zip-entry-error","errorCode":null,"errorMessage":"Failed to decompress zip entry: {}, error: {}","messagePattern":"Failed to decompress zip entry: (.+?), error: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/JadxZipParser.java","lineNumber":358,"sourceCode":"\n\tprivate static void verifyEntry(JadxZipEntry entry) {\n\t\tint compressMethod = entry.getCompressMethod();\n\t\tif (compressMethod == 0) {\n\t\t\tif (entry.getCompressedSize() != entry.getUncompressedSize()) {\n\t\t\t\tLOG.warn(\"Not equal sizes for STORE method: compressed: {}, uncompressed: {}, entry: {}\",\n\t\t\t\t\t\tentry.getCompressedSize(), entry.getUncompressedSize(), entry);\n\t\t\t}\n\t\t} else if (compressMethod != 8) {\n\t\t\tLOG.warn(\"Unknown compress method: {} in entry: {}\", compressMethod, entry);\n\t\t}\n\t}\n\n\tprivate void entryParseFailed(JadxZipEntry entry, Exception e) {\n\t\tif (isEncrypted(entry)) {\n\t\t\tthrow new RuntimeException(\"Entry is encrypted, failed to decompress: \" + entry, e);\n\t\t}\n\t\tif (flags.contains(ZipReaderFlags.DONT_USE_FALLBACK)) {\n\t\t\tthrow new RuntimeException(\"Failed to decompress zip entry: \" + entry + \", error: \" + e.getMessage(), e);\n\t\t}\n\t\tLOG.warn(\"Entry '{}' parse failed, switching to fallback parser\", entry, e);\n\t}\n\n\t@SuppressWarnings(\"resource\")\n\tprivate IZipEntry useFallbackParser(JadxZipEntry entry) {\n\t\tLOG.debug(\"useFallbackParser used for {}\", entry);\n\t\tIZipEntry zipEntry = initFallbackParser().searchEntry(entry.getName());\n\t\tif (zipEntry == null) {\n\t\t\tthrow new RuntimeException(\"Fallback parser can't find entry: \" + entry);\n\t\t}\n\t\treturn zipEntry;\n\t}\n\n\t@SuppressWarnings(\"resource\")\n\tprivate synchronized ZipContent initFallbackParser() {\n\t\tif (fallbackZipContent == null) {\n\t\t\ttry {","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/JadxZipParser.java#L340-L376","documentation":"Thrown in entryParseFailed() when decompression fails, the entry is NOT encrypted, and the caller has set ZipReaderFlags.DONT_USE_FALLBACK. In the default configuration jadx would instead log a warning and transparently retry the entry with the fallback parser; the DONT_USE_FALLBACK flag converts that soft recovery into a hard RuntimeException that chains the underlying cause (typically DataFormatException).","triggerScenarios":"Decompressing an entry whose data does not inflate correctly (corrupt compressed payload, mismatched compression method, partial write) while DONT_USE_FALLBACK is in the ZipReaderOptions flags.","commonSituations":"Strict CI pipelines or library integrations that disable the fallback to get deterministic behavior, run against a partially corrupt archive; an obfuscator that emits entries the custom parser misreads; a zip produced by a non-standard packer.","solutions":["Remove ZipReaderFlags.DONT_USE_FALLBACK to let jadx retry the entry with the fallback parser.","Inspect getCause() (usually DataFormatException) to determine if the compressed payload is truncated or corrupt.","Re-acquire the archive from a trusted source and retry.","If the archive is intentionally malformed for testing, expect this error and handle it."],"exampleFix":"// before\nZipReaderOptions opts = new ZipReaderOptions(security, EnumSet.of(ZipReaderFlags.DONT_USE_FALLBACK));\n\n// after\nZipReaderOptions opts = new ZipReaderOptions(security, ZipReaderFlags.none());","handlingStrategy":"fallback","validationCode":"// The error only occurs when DONT_USE_FALLBACK is set. Prefer the default:\nSet<ZipReaderFlags> flags = ZipReaderFlags.none(); // do NOT add DONT_USE_FALLBACK","typeGuard":null,"tryCatchPattern":"try {\n    content = new JadxZipParser(file, strictOpts).open();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Failed to decompress zip entry\")) {\n        // retry with fallback enabled\n        strictOpts = new ZipReaderOptions(security, ZipReaderFlags.none());\n        content = new JadxZipParser(file, strictOpts).open();\n    } else throw e;\n}","preventionTips":["Only set DONT_USE_FALLBACK when you deliberately want strict behavior.","For untrusted or third-party archives, leave the fallback enabled.","Inspect getCause() (DataFormatException) to tell corruption from a parser edge case."],"tags":["zip","decompression","fallback-parser","configuration"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}