Package org.jf.dexlib2.dexbacked.raw
Class HeaderItem
java.lang.Object
org.jf.dexlib2.dexbacked.raw.HeaderItem
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate DexBackedDexFilestatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate static final byte[]static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintstatic intgetEndian(byte[] buf, int offset) private static StringgetEndianText(int endianTag) intintintstatic byte[]getMagicForApi(int api) Get the highest magic number supported by Android for this api level.static byte[]getMagicForDexVersion(int dexVersion) intintintintintbyte[]intintintintstatic intgetVersion(byte[] buf, int offset) Gets the dex version from a dex headerprivate static intgetVersionUnchecked(byte[] buf, int offset) static 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 Details
-
ITEM_SIZE
public static final int ITEM_SIZE- See Also:
-
MAGIC_VALUE
private static final byte[] MAGIC_VALUE -
LITTLE_ENDIAN_TAG
public static final int LITTLE_ENDIAN_TAG- See Also:
-
BIG_ENDIAN_TAG
public static final int BIG_ENDIAN_TAG- See Also:
-
CHECKSUM_OFFSET
public static final int CHECKSUM_OFFSET- See Also:
-
CHECKSUM_DATA_START_OFFSET
public static final int CHECKSUM_DATA_START_OFFSET- See Also:
-
SIGNATURE_OFFSET
public static final int SIGNATURE_OFFSET- See Also:
-
SIGNATURE_SIZE
public static final int SIGNATURE_SIZE- See Also:
-
SIGNATURE_DATA_START_OFFSET
public static final int SIGNATURE_DATA_START_OFFSET- See Also:
-
FILE_SIZE_OFFSET
public static final int FILE_SIZE_OFFSET- See Also:
-
HEADER_SIZE_OFFSET
public static final int HEADER_SIZE_OFFSET- See Also:
-
ENDIAN_TAG_OFFSET
public static final int ENDIAN_TAG_OFFSET- See Also:
-
MAP_OFFSET
public static final int MAP_OFFSET- See Also:
-
STRING_COUNT_OFFSET
public static final int STRING_COUNT_OFFSET- See Also:
-
STRING_START_OFFSET
public static final int STRING_START_OFFSET- See Also:
-
TYPE_COUNT_OFFSET
public static final int TYPE_COUNT_OFFSET- See Also:
-
TYPE_START_OFFSET
public static final int TYPE_START_OFFSET- See Also:
-
PROTO_COUNT_OFFSET
public static final int PROTO_COUNT_OFFSET- See Also:
-
PROTO_START_OFFSET
public static final int PROTO_START_OFFSET- See Also:
-
FIELD_COUNT_OFFSET
public static final int FIELD_COUNT_OFFSET- See Also:
-
FIELD_START_OFFSET
public static final int FIELD_START_OFFSET- See Also:
-
METHOD_COUNT_OFFSET
public static final int METHOD_COUNT_OFFSET- See Also:
-
METHOD_START_OFFSET
public static final int METHOD_START_OFFSET- See Also:
-
CLASS_COUNT_OFFSET
public static final int CLASS_COUNT_OFFSET- See Also:
-
CLASS_START_OFFSET
public static final int CLASS_START_OFFSET- See Also:
-
DATA_SIZE_OFFSET
public static final int DATA_SIZE_OFFSET- See Also:
-
DATA_START_OFFSET
public static final int DATA_START_OFFSET- See Also:
-
dexFile
-
-
Constructor Details
-
HeaderItem
-
-
Method Details
-
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) -
getEndianText
-
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
-
getVersionUnchecked
private static int getVersionUnchecked(byte[] buf, int offset) -
isSupportedDexVersion
public static boolean isSupportedDexVersion(int version) -
getEndian
public static int getEndian(byte[] buf, int offset)
-