Package org.jf.dexlib2.dexbacked.raw
Class OdexHeaderItem
java.lang.Object
org.jf.dexlib2.dexbacked.raw.OdexHeaderItem
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate static final byte[]private static final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetDependenciesOffset(byte[] buf) static intgetDexOffset(byte[] buf) static intgetVersion(byte[] buf, int offset) Gets the dex version from an odex headerprivate static intgetVersionUnchecked(byte[] buf, int offset) static booleanisSupportedOdexVersion(int version) static booleanverifyMagic(byte[] buf, int offset) Verifies the magic value at the beginning of an odex file
-
Field Details
-
ITEM_SIZE
public static final int ITEM_SIZE- See Also:
-
MAGIC_VALUE
private static final byte[] MAGIC_VALUE -
SUPPORTED_ODEX_VERSIONS
private static final int[] SUPPORTED_ODEX_VERSIONS -
MAGIC_OFFSET
public static final int MAGIC_OFFSET- See Also:
-
MAGIC_LENGTH
public static final int MAGIC_LENGTH- See Also:
-
DEX_OFFSET
public static final int DEX_OFFSET- See Also:
-
DEX_LENGTH_OFFSET
public static final int DEX_LENGTH_OFFSET- See Also:
-
DEPENDENCIES_OFFSET
public static final int DEPENDENCIES_OFFSET- See Also:
-
DEPENDENCIES_LENGTH_OFFSET
public static final int DEPENDENCIES_LENGTH_OFFSET- See Also:
-
AUX_OFFSET
public static final int AUX_OFFSET- See Also:
-
AUX_LENGTH_OFFSET
public static final int AUX_LENGTH_OFFSET- See Also:
-
FLAGS_OFFSET
public static final int FLAGS_OFFSET- See Also:
-
-
Constructor Details
-
OdexHeaderItem
public OdexHeaderItem()
-
-
Method Details
-
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
-
getVersionUnchecked
private static int getVersionUnchecked(byte[] buf, int offset) -
isSupportedOdexVersion
public static boolean isSupportedOdexVersion(int version) -
getDexOffset
public static int getDexOffset(byte[] buf) -
getDependenciesOffset
public static int getDependenciesOffset(byte[] buf)
-