{"record":{"id":"0fe247ba110122d0","repo":"skylot/jadx","slug":"error","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"jadx-commons/jadx-zip/src/main/java/jadx/zip/ZipReader.java","lineNumber":45,"sourceCode":"\t\tthis(ZipReaderOptions.getDefault());\n\t}\n\n\tpublic ZipReader(Set<ZipReaderFlags> flags) {\n\t\tthis(new ZipReaderOptions(new JadxZipSecurity(), flags));\n\t}\n\n\tpublic ZipReader(IJadxZipSecurity security) {\n\t\tthis(new ZipReaderOptions(security, ZipReaderFlags.none()));\n\t}\n\n\tpublic ZipReader(ZipReaderOptions options) {\n\t\tthis.options = options;\n\t}\n\n\t@SuppressWarnings(\"resource\")\n\tpublic ZipContent open(File zipFile) throws IOException {\n\t\tif (!zipFile.exists()) {\n\t\t\tthrow new FileNotFoundException(zipFile.getAbsolutePath());\n\t\t}\n\t\ttry {\n\t\t\tJadxZipParser jadxParser = new JadxZipParser(zipFile, options);\n\t\t\tIZipParser detectedParser = detectParser(zipFile, jadxParser);\n\t\t\treturn detectedParser.open();\n\t\t} catch (FallbackException e) {\n\t\t\tthrow e;\n\t\t} catch (Exception e) {\n\t\t\tif (options.getFlags().contains(ZipReaderFlags.DONT_USE_FALLBACK)) {\n\t\t\t\tthrow new IOException(\"Failed to open zip: \" + zipFile, e);\n\t\t\t}\n\t\t\t// switch to fallback parser\n\t\t\treturn buildFallbackParser(zipFile).open();\n\t\t}\n\t}\n\n\t/**\n\t * Visit valid entries in a zip file.","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-commons/jadx-zip/src/main/java/jadx/zip/ZipReader.java#L27-L63","documentation":"This file:line (ZipReader.open, the FileNotFoundException branch) is the source anchor, but the literal '{}' placeholder message corresponds to the FileNotFoundException thrown when zipFile.exists() is false: 'throw new FileNotFoundException(zipFile.getAbsolutePath())'. It fires before any parsing attempt when the input file does not exist on disk.","triggerScenarios":"Calling ZipReader.open(file) (or any API that opens a zip) with a File whose exists() returns false. The absolute path is included in the exception message.","commonSituations":"Wrong input path; relative path resolved against an unexpected working directory; file deleted between listing and open; case-sensitivity mismatch on case-sensitive filesystems; network/removable mount not attached.","solutions":["Verify the path exists with Files.exists before calling open.","Use an absolute path to avoid working-directory ambiguity.","Check spelling and case of the filename on case-sensitive OS.","Confirm removable/network mounts are attached."],"exampleFix":"// before\nnew ZipReader(security).open(new File(\"input.apk\"));\n// after\nFile f = new File(\"/abs/path/input.apk\");\nif (!f.exists()) throw new IllegalArgumentException(\"missing: \" + f);\nnew ZipReader(security).open(f);","handlingStrategy":"validation","validationCode":"File f = ...;\nif (!f.exists() || !f.isFile()) {\n    throw new IllegalArgumentException(\"Zip input does not exist or is not a file: \" + f.getAbsolutePath());\n}","typeGuard":"public static boolean isExistingZip(File f) {\n    return f != null && f.isFile() && f.exists();\n}","tryCatchPattern":"try {\n    zipReader.open(file);\n} catch (FileNotFoundException e) {\n    System.err.println(\"Input not found: \" + e.getMessage());\n    // prompt for correct path\n}","preventionTips":["Always use absolute input paths in scripts.","Check Files.exists right before opening to close TOCTOU windows.","Validate the path case on case-sensitive filesystems."],"tags":["zip","io","input-validation","jadx"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}