{"record":{"id":"f6ab3d60b552e458","repo":"skylot/jadx","slug":"entry-is-encrypted-failed-to-decompress","errorCode":null,"errorMessage":"Entry is encrypted, failed to decompress: {}","messagePattern":"Entry is encrypted, failed to decompress: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/JadxZipParser.java","lineNumber":355,"sourceCode":"\t\t// treat any other compression methods values as UNCOMPRESSED\n\t\treturn bufferToBytes(getBuffer(), entry.getDataStart(), (int) entry.getUncompressedSize());\n\t}\n\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\")","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/JadxZipParser.java#L337-L373","documentation":"Thrown when decompression of a single entry fails AND the entry's general-purpose bit flag has bit 0 set (the standard zip encryption flag). jadx cannot decrypt password-protected or encrypted entries, so rather than silently producing garbage it aborts with a RuntimeException naming the entry and chaining the original DataFormatException/IOException. The encryption check (flags & 1) is done inside entryParseFailed, so this fires only after a real decompression attempt has already failed.","triggerScenarios":"Calling the entry-decompression path in JadxZipParser for an entry whose bit-0 encryption flag is set, where Inflater (or the raw copy) then fails. The flag is read from the entry's general purpose bit flag field.","commonSituations":"Decompiling a password-protected APK/JAR; an APK signed/packed with a tool that sets encryption flags; an AAB or split APK whose vendor applied entry-level encryption; an obfuscator that flips the encryption bit.","solutions":["Supply an unencrypted copy of the archive; jadx has no facility to decrypt entries.","If you know the password, decrypt the archive externally (e.g., unzip with the password) before feeding it to jadx.","Skip encrypted entries programmatically by reading the entry's flags before decompression.","Verify the archive is not corrupted, since corruption can also cause the underlying decompression failure that reaches this branch."],"exampleFix":"// before\nbyte[] data = (byte[]) jadxZipEntry.getData();\n\n// after\nif ((entryFlags & 1) != 0) {\n    LOG.warn(\"Entry {} is encrypted and will be skipped\", entry.getName());\n    continue;\n}\nbyte[] data = (byte[]) jadxZipEntry.getData();","handlingStrategy":"validation","validationCode":"// Read the entry's general-purpose bit flag; bit 0 = encrypted.\nint gpFlags = entry.getGeneralPurposeBitFlag(); // or read from header\nif ((gpFlags & 0x1) != 0) {\n    LOG.warn(\"Entry {} is encrypted and cannot be decompressed, skipping\", entry.getName());\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    data = decompress(entry);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"encrypted\")) {\n        LOG.warn(\"Encrypted entry {} skipped\", entry.getName());\n        continue;\n    }\n    throw e;\n}","preventionTips":["jadx cannot decrypt entries; always supply unencrypted archives.","Check the encryption bit on entry flags before attempting decompression.","If you have the password, decrypt the archive externally first."],"tags":["zip","encryption","security","decompression"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}