{"record":{"id":"629886afebff5bd9","repo":"pxb1988/dex2jar","slug":"file","errorCode":null,"errorMessage":"File ","messagePattern":"File ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dex-tools/src/main/java/com/googlecode/dex2jar/tools/GenerateCompileStubFromOdex.java","lineNumber":57,"sourceCode":"        }\n\n        try (FileSystem fs = createZip(output)) {\n            Path out = fs.getPath(\"/\");\n            for (String x : remainingArgs) {\n                System.err.println(\"Processing \" + x + \" ...\");\n                ByteBuffer bs = ByteBuffer.wrap(Files.readAllBytes(new File(x).toPath()))\n                        .order(ByteOrder.LITTLE_ENDIAN);\n                int magic = bs.getInt(0) & 0x00FFFFFF;\n                if (magic == MAGIC_ODEX) {\n                    int offset = bs.getInt(8);\n                    int length = bs.getInt(12);\n                    bs.position(offset);\n                    ByteBuffer n = (ByteBuffer) bs.slice().limit(length);\n                    doDex(n, out);\n                } else if (magic == MAGIC_DEX) {\n                    doDex(bs, out);\n                } else {\n                    throw new RuntimeException(\"File \" + x + \" is not an dex or odex\");\n                }\n\n            }\n        }\n    }\n\n    private void doDex(ByteBuffer bs, final Path out) {\n        DexFileReader reader = new DexFileReader(bs);\n        DexFileNode fileNode = new DexFileNode();\n        reader.accept(fileNode, DexFileReader.SKIP_CODE);\n        Dex2Asm dex2Asm = new Dex2Asm();\n        dex2Asm.convertDex(fileNode, new ClassVisitorFactory() {\n            @Override\n            public ClassVisitor create(final String classInternalName) {\n                final Path target = out.resolve(classInternalName + \".class\");\n                if (Files.exists(target)) {\n                    System.err.println(\"Class \" + classInternalName + \" already exists, skipping.\");\n                    return null;","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-tools/src/main/java/com/googlecode/dex2jar/tools/GenerateCompileStubFromOdex.java#L39-L75","documentation":"Input validation in GenerateCompileStubFromOdex.doCommandLine: one of the positional argument files exists but could not be read (or does not exist) when Files.readAllBytes was called on it — the exception message is prefixed with 'File ' followed by the offending path. It fires before the odex magic-number check, so the file was never even parsed.","triggerScenarios":"Thrown at dex-tools/src/main/java/com/googlecode/dex2jar/tools/GenerateCompileStubFromOdex.java:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the printed file path for typos and confirm the file exists at that location","Verify read permissions on the file and that it is not a directory","Ensure the argument is a local filesystem path, not a pattern or URL"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b5bda4fb4935ae8b3869b422454ae3b3896c7bc1","analyzedAt":"2026-09-08T00:44:01.258Z","contentChangedAt":"2026-09-08T00:44:01.258Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}