pxb1988/dex2jar · error · RuntimeException
not support access flags " + name
Error message
not support access flags " + name
What it means
The Jasmin grammar's access-flag lookup maps textual flags (public, final, enum, super, annotation, ...) to ASM Opcodes bits. An unrecognized flag name throws RuntimeException('not support access flags <name>').
Solutions
- Remove or replace the unsupported flag with a mapped one (public/private/protected/static/final/super/interface/abstract/annotation/enum/synthetic, etc.)
- Check spelling/case of the flag in the .j file
- Add a mapping branch in getAccessFlag if you need the flag and control the grammar
Example fix
// before .class public strictfp Foo // after .class public Foo
Defensive patterns
Strategy: validation
Validate before calling
static final Set<String> VALID = Set.of("public","private","protected","static","final","super","interface","abstract","synthetic","annotation","enum");
if (!VALID.contains(flag)) throw new IllegalArgumentException("unsupported flag: " + flag); Prevention
- Whitelist access flags when generating .j files
- Strip flags not supported by this grammar before writing the file
- Test generated files against the jasmin parser
When it happens
Trigger: A .j file contains an access-flag token the parser does not know, e.g. '.class public strictfp' or misspelled/legacy flags like 'synchronized' on class or 'transient' where unsupported.
Common situations: Jasmin files generated for older/newer jasmin dialects using flags this grammar doesn't recognize; typos ('pubic', 'Privat'); flags valid in Java but not mapped in this grammar.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Fail to assemble
- can't pase string
- can't get owner and type from '"+str+"'
- RecognitionException on invalid annotation element keyword…
- RecognitionException on invalid annotation element keyword…
AI-assisted analysis of pxb1988/dex2jar@b5bda4fb49 (2026-09-08).
Data as JSON: /api/errors/13a28da8f70339e3.
Report an issue: GitHub.
Appendix: source
Thrown at d2j-jasmin/src/main/antlr3/com/googlecode/d2j/jasmin/Jasmin.g:271
return ACC_NATIVE;
} else if (name.equals("interface")) {
return ACC_INTERFACE;
} else if (name.equals("abstract")) {
return ACC_ABSTRACT;
} else if (name.equals("strict")) {
return ACC_STRICT;
} else if (name.equals("strictfp")) {
return ACC_STRICT;
} else if (name.equals("synthetic")) {
return ACC_SYNTHETIC;
} else if (name.equals("annotation")) {
return ACC_ANNOTATION;
} else if (name.equals("enum")) {
return ACC_ENUM;
} else if (name.equals("super")) {
return ACC_SUPER;
}
throw new RuntimeException("not support access flags " + name);
}
private static int getOp(String str) {
switch (str) {
case "nop":
return Opcodes.NOP;
case "aconst_null":
return Opcodes.ACONST_NULL;
case "iconst_m1":
return Opcodes.ICONST_M1;
case "iconst_0":
return Opcodes.ICONST_0;
case "iconst_1":
return Opcodes.ICONST_1;
case "iconst_2":
return Opcodes.ICONST_2;
case "iconst_3":
return Opcodes.ICONST_3;
case "iconst_4":
View on GitHub (pinned to b5bda4fb49)