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 intBIG_ENDIAN_TAGstatic intCHECKSUM_DATA_START_OFFSETstatic intCHECKSUM_OFFSETstatic intCLASS_COUNT_OFFSETstatic intCLASS_START_OFFSETstatic intDATA_SIZE_OFFSETstatic intDATA_START_OFFSETstatic intENDIAN_TAG_OFFSETstatic intFIELD_COUNT_OFFSETstatic intFIELD_START_OFFSETstatic intFILE_SIZE_OFFSETstatic intHEADER_SIZE_OFFSETstatic intITEM_SIZEstatic intLITTLE_ENDIAN_TAGstatic intMAP_OFFSETstatic intMETHOD_COUNT_OFFSETstatic intMETHOD_START_OFFSETstatic intPROTO_COUNT_OFFSETstatic intPROTO_START_OFFSETstatic intSIGNATURE_DATA_START_OFFSETstatic intSIGNATURE_OFFSETstatic intSIGNATURE_SIZEstatic intSTRING_COUNT_OFFSETstatic intSTRING_START_OFFSETstatic intTYPE_COUNT_OFFSETstatic intTYPE_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 intgetChecksum()intgetClassCount()intgetClassOffset()static intgetEndian(byte[] buf, int offset)intgetFieldCount()intgetFieldOffset()intgetHeaderSize()static byte[]getMagicForApi(int api)Get the highest magic number supported by Android for this api level.static byte[]getMagicForDexVersion(int dexVersion)intgetMapOffset()intgetMethodCount()intgetMethodOffset()intgetProtoCount()intgetProtoOffset()byte[]getSignature()intgetStringCount()intgetStringOffset()intgetTypeCount()intgetTypeOffset()static intgetVersion(byte[] buf, int offset)Gets the dex version from a dex headerstatic booleanisSupportedDexVersion(int version)static SectionAnnotatormakeAnnotator(DexAnnotator annotator, MapItem mapItem)static booleanverifyMagic(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)
-
-