Dex Access Flags
Constants and helpers for raw DEX access_flags values.
Use these with the accessFlags result property or matcher condition for exact DEX semantics. The separate modifiers property and condition follow Android Java reflection, including hidden Java bits such as BRIDGE, VARARGS, and SYNTHETIC. Use java.lang.reflect.Modifier for reflection conditions.
CONSTRUCTOR and DECLARED_SYNCHRONIZED are DEX-only bits: inspect them through accessFlags. The helpers only test bits and never normalize them. In raw DEX, SYNCHRONIZED is only valid for native methods; reflection maps DECLARED_SYNCHRONIZED to SYNCHRONIZED instead.
Several bit positions depend on the target: SYNCHRONIZED and SUPER are both 0x20, VOLATILE and BRIDGE are both 0x40, and TRANSIENT and VARARGS are both 0x80. SUPER mirrors slicer's complete kAcc set but is not used by a DEX class_def_item. See DEX access_flags.
Java can access constants and helpers directly, for example:
DexAccessFlags.isConstructor(methodData.getAccessFlags())
DexAccessFlags.isBridge(methodData.getAccessFlags())原始 DEX access_flags 常量及辅助方法。
精确 DEX 语义请使用结果属性或匹配条件 accessFlags;独立的 modifiers 属性和条件遵循 Android Java 反射语义,保留 BRIDGE、VARARGS、SYNTHETIC 等隐藏 Java 标志位。 反射条件使用 java.lang.reflect.Modifier。
CONSTRUCTOR、DECLARED_SYNCHRONIZED 是 DEX 专有标志,应通过 accessFlags 读取。 本工具类只判断位值,不做归一化。原始 DEX 的 SYNCHRONIZED 仅适用于 native 方法; 反射语义则把 DECLARED_SYNCHRONIZED 转换为 SYNCHRONIZED。
部分位值按目标类型复用:SYNCHRONIZED 与 SUPER 均为 0x20,VOLATILE 与 BRIDGE 均为 0x40,TRANSIENT 与 VARARGS 均为 0x80。请选择适用于类、字段或方法的常量。 SUPER 仅用于对齐 slicer 的完整 kAcc 集合,不用于 DEX class_def_item。
Properties
ACC_ANNOTATION: annotation class or InnerClass.
ACC_CONSTRUCTOR: DEX-only class or instance initializer method.
ACC_DECLARED_SYNCHRONIZED: DEX-only declared synchronized method.
ACC_SYNCHRONIZED: synchronized native method.
Functions
Returns whether accessFlags contains ABSTRACT.
Returns whether accessFlags contains ANNOTATION.
Returns whether accessFlags contains CONSTRUCTOR.
Returns whether accessFlags contains DECLARED_SYNCHRONIZED.
Returns whether accessFlags contains INTERFACE.
Returns whether accessFlags contains PROTECTED.
Returns whether accessFlags contains SYNCHRONIZED.
Returns whether accessFlags contains SYNTHETIC.
Returns whether accessFlags contains TRANSIENT.
Returns whether accessFlags contains VOLATILE.
Returns a context-aware string for class access flags.
Returns a context-aware string for field access flags.
Returns a context-aware string for method access flags.