{"record":{"id":"421a3e6ccee98b6a","repo":"pxb1988/dex2jar","slug":"no-odex-421a3e","errorCode":null,"errorMessage":"No odex","messagePattern":"No odex","errorType":"exception","errorClass":"HelpException","httpStatus":null,"severity":"error","filePath":"dex-tools/src/main/java/com/googlecode/dex2jar/tools/GenerateCompileStubFromOdex.java","lineNumber":35,"sourceCode":"@BaseCmd.Syntax(cmd = \"d2j-generate-stub-from-odex\", syntax = \"[options] <odex0> [odex1 ... odexN]\", desc =\n        \"Generate no-code jar from odex\")\npublic class GenerateCompileStubFromOdex extends BaseCmd {\n    private static final int MAGIC_ODEX = 0x0A796564 & 0x00FFFFFF;// hex for 'dey ', ignore the 0A\n    private static final int MAGIC_DEX = 0x0A786564 & 0x00FFFFFF;// hex for 'dex ', ignore the 0A\n\n    public static void main(String... args) {\n        new GenerateCompileStubFromOdex().doMain(args);\n    }\n\n    @Opt(opt = \"o\", longOpt = \"output\", description = \"output .jar file, default is stub.jar\", argName = \"out-jar-file\")\n    private Path output;\n    @Opt(opt = \"npri\", longOpt = \"no-private\", description = \"\", hasArg = false)\n    private boolean noPrivate;\n\n    @Override\n    protected void doCommandLine() throws Exception {\n        if (remainingArgs.length == 0) {\n            throw new HelpException(\"No odex\");\n        }\n        if (output == null) {\n            output = new File(\"stub.jar\").toPath();\n        }\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);","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-tools/src/main/java/com/googlecode/dex2jar/tools/GenerateCompileStubFromOdex.java#L17-L53","documentation":"Usage guard in GenerateCompileStubFromOdex.doCommandLine: no positional odex file was provided. The command's syntax is '[options] <odex0> [odex1 ... odexN]', so with an empty remainingArgs list it aborts with this HelpException and prints help.","triggerScenarios":"Thrown at dex-tools/src/main/java/com/googlecode/dex2jar/tools/GenerateCompileStubFromOdex.java:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run d2j-generate-stub-from-odex with at least one .odex file path as a positional argument","Use -h to review the accepted options (e.g. -o for the output jar) and the expected file format"],"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"}