{"record":{"id":"5fb1868ec35f41b5","repo":"skylot/jadx","slug":"fallback-parser-failed-to-open-file","errorCode":null,"errorMessage":"Fallback parser failed to open file: {}","messagePattern":"Fallback parser failed to open file: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/JadxZipParser.java","lineNumber":379,"sourceCode":"\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 {\n\t\t\t\tfallbackZipContent = new FallbackZipParser(zipFile, options).open();\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(\"Fallback parser failed to open file: \" + zipFile, e);\n\t\t\t}\n\t\t}\n\t\treturn fallbackZipContent;\n\t}\n\n\tprivate boolean isEncrypted(JadxZipEntry entry) {\n\t\tint flags = readFlags(entry);\n\t\treturn (flags & 1) != 0;\n\t}\n\n\tprivate int readFlags(JadxZipEntry entry) {\n\t\tByteBuffer buf = getBuffer();\n\t\tbuf.position(entry.getEntryStart() + 6);\n\t\treturn readU2(buf);\n\t}\n\n\tstatic byte[] bufferToBytes(ByteBuffer buf, int start, int size) {\n\t\tbyte[] data = new byte[size];","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/JadxZipParser.java#L361-L397","documentation":"Thrown inside initFallbackParser() when constructing/opening the FallbackZipParser itself fails. Because the fallback parser is jadx's last resort (used when the custom parser cannot open the file), this error means neither parser could process the archive. The FallbackZipParser constructor throws FallbackException on open failure and open() throws FallbackException/IOException; both are caught and wrapped with the zip file path, chaining the cause.","triggerScenarios":"Any earlier code path that decides to use the fallback parser (initial open with FALLBACK_AS_DEFAULT, or recovery from a custom-parser failure) reaches initFallbackParser(), and new FallbackZipParser(zipFile, options).open() throws.","commonSituations":"A file that is not a valid zip at all (wrong magic bytes, truncated, zero-byte); a zip that triggers a bug in Java's built-in ZipFile; a file locked/exclusively held by another process; an archive whose central directory is so damaged that even Java's tolerant parser gives up.","solutions":["Verify the file is a real zip/APK (check magic bytes 'PK\\x03\\x04' or 'PK\\x05\\x06') before invoking jadx.","Check getCause() (FallbackException) for the underlying reason.","Ensure the file is not locked by another process and is fully written.","If the file is legitimately a non-zip input, pass it via custom code loaders instead of as an input file."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate the file is a real, openable zip before invoking jadx.\nif (!file.isFile()) throw new IOException(\"Not a file: \" + file);\ntry (java.util.zip.ZipFile zf = new java.util.zip.ZipFile(file)) {\n    // opens successfully -> fallback parser should also open it\n} catch (IOException e) {\n    throw new IOException(\"Unreadable zip, will fail fallback too: \" + file, e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fallback = new FallbackZipParser(file, options).open();\n} catch (RuntimeException e) { // wraps FallbackException\n    LOG.error(\"Neither parser can open {}: {}\", file, e.getCause());\n    throw e;\n}","preventionTips":["Confirm the file is a genuine, complete zip before processing.","Check getCause() (FallbackException) for the true open failure.","Ensure the file is not locked by another process."],"tags":["zip","fallback-parser","io","corrupted-archive"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}