Package org.jf.dexlib2.dexbacked.raw
Class HeaderItem
- java.lang.Object
-
- org.jf.dexlib2.dexbacked.raw.HeaderItem
-
public class HeaderItem extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
BIG_ENDIAN_TAG
static int
CHECKSUM_DATA_START_OFFSET
static int
CHECKSUM_OFFSET
static int
CLASS_COUNT_OFFSET
static int
CLASS_START_OFFSET
static int
DATA_SIZE_OFFSET
static int
DATA_START_OFFSET
static int
ENDIAN_TAG_OFFSET
static int
FIELD_COUNT_OFFSET
static int
FIELD_START_OFFSET
static int
FILE_SIZE_OFFSET
static int
HEADER_SIZE_OFFSET
static int
ITEM_SIZE
static int
LITTLE_ENDIAN_TAG
static int
MAP_OFFSET
static int
METHOD_COUNT_OFFSET
static int
METHOD_START_OFFSET
static int
PROTO_COUNT_OFFSET
static int
PROTO_START_OFFSET
static int
SIGNATURE_DATA_START_OFFSET
static int
SIGNATURE_OFFSET
static int
SIGNATURE_SIZE
static int
STRING_COUNT_OFFSET
static int
STRING_START_OFFSET
static int
TYPE_COUNT_OFFSET
static int
TYPE_START_OFFSET
-
Constructor Summary
Constructors Constructor Description HeaderItem(DexBackedDexFile dexFile)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getChecksum()
int
getClassCount()
int
getClassOffset()
static int
getEndian(byte[] buf, int offset)
int
getFieldCount()
int
getFieldOffset()
int
getHeaderSize()
static byte[]
getMagicForApi(int api)
Get the highest magic number supported by Android for this api level.static byte[]
getMagicForDexVersion(int dexVersion)
int
getMapOffset()
int
getMethodCount()
int
getMethodOffset()
int
getProtoCount()
int
getProtoOffset()
byte[]
getSignature()
int
getStringCount()
int
getStringOffset()
int
getTypeCount()
int
getTypeOffset()
static int
getVersion(byte[] buf, int offset)
Gets the dex version from a dex headerstatic boolean
isSupportedDexVersion(int version)
static SectionAnnotator
makeAnnotator(DexAnnotator annotator, MapItem mapItem)
static boolean
verifyMagic(byte[] buf, int offset)
Verifies the magic value at the beginning of a dex file
-
-
-
Field Detail
-
ITEM_SIZE
public static final int ITEM_SIZE
- See Also:
- Constant Field Values
-
LITTLE_ENDIAN_TAG
public static final int LITTLE_ENDIAN_TAG
- See Also:
- Constant Field Values
-
BIG_ENDIAN_TAG
public static final int BIG_ENDIAN_TAG
- See Also:
- Constant Field Values
-
CHECKSUM_OFFSET
public static final int CHECKSUM_OFFSET
- See Also:
- Constant Field Values
-
CHECKSUM_DATA_START_OFFSET
public static final int CHECKSUM_DATA_START_OFFSET
- See Also:
- Constant Field Values
-
SIGNATURE_OFFSET
public static final int SIGNATURE_OFFSET
- See Also:
- Constant Field Values
-
SIGNATURE_SIZE
public static final int SIGNATURE_SIZE
- See Also:
- Constant Field Values
-
SIGNATURE_DATA_START_OFFSET
public static final int SIGNATURE_DATA_START_OFFSET
- See Also:
- Constant Field Values
-
FILE_SIZE_OFFSET
public static final int FILE_SIZE_OFFSET
- See Also:
- Constant Field Values
-
HEADER_SIZE_OFFSET
public static final int HEADER_SIZE_OFFSET
- See Also:
- Constant Field Values
-
ENDIAN_TAG_OFFSET
public static final int ENDIAN_TAG_OFFSET
- See Also:
- Constant Field Values
-
MAP_OFFSET
public static final int MAP_OFFSET
- See Also:
- Constant Field Values
-
STRING_COUNT_OFFSET
public static final int STRING_COUNT_OFFSET
- See Also:
- Constant Field Values
-
STRING_START_OFFSET
public static final int STRING_START_OFFSET
- See Also:
- Constant Field Values
-
TYPE_COUNT_OFFSET
public static final int TYPE_COUNT_OFFSET
- See Also:
- Constant Field Values
-
TYPE_START_OFFSET
public static final int TYPE_START_OFFSET
- See Also:
- Constant Field Values
-
PROTO_COUNT_OFFSET
public static final int PROTO_COUNT_OFFSET
- See Also:
- Constant Field Values
-
PROTO_START_OFFSET
public static final int PROTO_START_OFFSET
- See Also:
- Constant Field Values
-
FIELD_COUNT_OFFSET
public static final int FIELD_COUNT_OFFSET
- See Also:
- Constant Field Values
-
FIELD_START_OFFSET
public static final int FIELD_START_OFFSET
- See Also:
- Constant Field Values
-
METHOD_COUNT_OFFSET
public static final int METHOD_COUNT_OFFSET
- See Also:
- Constant Field Values
-
METHOD_START_OFFSET
public static final int METHOD_START_OFFSET
- See Also:
- Constant Field Values
-
CLASS_COUNT_OFFSET
public static final int CLASS_COUNT_OFFSET
- See Also:
- Constant Field Values
-
CLASS_START_OFFSET
public static final int CLASS_START_OFFSET
- See Also:
- Constant Field Values
-
DATA_SIZE_OFFSET
public static final int DATA_SIZE_OFFSET
- See Also:
- Constant Field Values
-
DATA_START_OFFSET
public static final int DATA_START_OFFSET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HeaderItem
public HeaderItem(@Nonnull DexBackedDexFile dexFile)
-
-
Method Detail
-
getChecksum
public int getChecksum()
-
getSignature
@Nonnull public byte[] getSignature()
-
getMapOffset
public int getMapOffset()
-
getHeaderSize
public int getHeaderSize()
-
getStringCount
public int getStringCount()
-
getStringOffset
public int getStringOffset()
-
getTypeCount
public int getTypeCount()
-
getTypeOffset
public int getTypeOffset()
-
getProtoCount
public int getProtoCount()
-
getProtoOffset
public int getProtoOffset()
-
getFieldCount
public int getFieldCount()
-
getFieldOffset
public int getFieldOffset()
-
getMethodCount
public int getMethodCount()
-
getMethodOffset
public int getMethodOffset()
-
getClassCount
public int getClassCount()
-
getClassOffset
public int getClassOffset()
-
makeAnnotator
@Nonnull public static SectionAnnotator makeAnnotator(@Nonnull DexAnnotator annotator, @Nonnull MapItem mapItem)
-
getMagicForApi
public static byte[] getMagicForApi(int api)
Get the highest magic number supported by Android for this api level.- Returns:
- The dex file magic number
-
getMagicForDexVersion
public static byte[] getMagicForDexVersion(int dexVersion)
-
verifyMagic
public static boolean verifyMagic(byte[] buf, int offset)
Verifies the magic value at the beginning of a dex file- Parameters:
buf
- A byte array containing at least the first 8 bytes of a dex fileoffset
- The offset within the buffer to the beginning of the dex header- Returns:
- True if the magic value is valid
-
getVersion
public static int getVersion(byte[] buf, int offset)
Gets the dex version from a dex header- Parameters:
buf
- A byte array containing at least the first 7 bytes of a dex fileoffset
- The offset within the buffer to the beginning of the dex header- Returns:
- The dex version if the header is valid or -1 if the header is invalid
-
isSupportedDexVersion
public static boolean isSupportedDexVersion(int version)
-
getEndian
public static int getEndian(byte[] buf, int offset)
-
-