Package org.jf.dexlib2.dexbacked.raw
Class OdexHeaderItem
- java.lang.Object
-
- org.jf.dexlib2.dexbacked.raw.OdexHeaderItem
-
public class OdexHeaderItem extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
AUX_LENGTH_OFFSET
static int
AUX_OFFSET
static int
DEPENDENCIES_LENGTH_OFFSET
static int
DEPENDENCIES_OFFSET
static int
DEX_LENGTH_OFFSET
static int
DEX_OFFSET
static int
FLAGS_OFFSET
static int
ITEM_SIZE
static int
MAGIC_LENGTH
static int
MAGIC_OFFSET
-
Constructor Summary
Constructors Constructor Description OdexHeaderItem()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getDependenciesOffset(byte[] buf)
static int
getDexOffset(byte[] buf)
static int
getVersion(byte[] buf, int offset)
Gets the dex version from an odex headerstatic boolean
isSupportedOdexVersion(int version)
static boolean
verifyMagic(byte[] buf, int offset)
Verifies the magic value at the beginning of an odex file
-
-
-
Field Detail
-
ITEM_SIZE
public static final int ITEM_SIZE
- See Also:
- Constant Field Values
-
MAGIC_OFFSET
public static final int MAGIC_OFFSET
- See Also:
- Constant Field Values
-
MAGIC_LENGTH
public static final int MAGIC_LENGTH
- See Also:
- Constant Field Values
-
DEX_OFFSET
public static final int DEX_OFFSET
- See Also:
- Constant Field Values
-
DEX_LENGTH_OFFSET
public static final int DEX_LENGTH_OFFSET
- See Also:
- Constant Field Values
-
DEPENDENCIES_OFFSET
public static final int DEPENDENCIES_OFFSET
- See Also:
- Constant Field Values
-
DEPENDENCIES_LENGTH_OFFSET
public static final int DEPENDENCIES_LENGTH_OFFSET
- See Also:
- Constant Field Values
-
AUX_OFFSET
public static final int AUX_OFFSET
- See Also:
- Constant Field Values
-
AUX_LENGTH_OFFSET
public static final int AUX_LENGTH_OFFSET
- See Also:
- Constant Field Values
-
FLAGS_OFFSET
public static final int FLAGS_OFFSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
verifyMagic
public static boolean verifyMagic(byte[] buf, int offset)
Verifies the magic value at the beginning of an odex file- Parameters:
buf
- A byte array containing at least the first 8 bytes of an odex fileoffset
- The offset within the buffer to the beginning of the odex header- Returns:
- True if the magic value is valid
-
getVersion
public static int getVersion(byte[] buf, int offset)
Gets the dex version from an odex header- Parameters:
buf
- A byte array containing at least the first 7 bytes of an odex fileoffset
- The offset within the buffer to the beginning of the odex header- Returns:
- The odex version if the header is valid or -1 if the header is invalid
-
isSupportedOdexVersion
public static boolean isSupportedOdexVersion(int version)
-
getDexOffset
public static int getDexOffset(byte[] buf)
-
getDependenciesOffset
public static int getDependenciesOffset(byte[] buf)
-
-