public class DexUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DexUtil.InvalidFile |
static class |
DexUtil.UnsupportedFile |
| Constructor and Description |
|---|
DexUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
verifyCdexHeader(byte[] buf,
int offset)
Verifies that the cdex header is valid and a supported version
|
static int |
verifyDexHeader(byte[] buf,
int offset)
Verifies that the dex header is valid and a supported version
|
static int |
verifyDexHeader(java.io.InputStream inputStream)
Reads in the dex header from the given input stream and verifies that it is valid and a supported version
The inputStream must support mark(), and will be reset to initial position upon exiting the method
|
static void |
verifyOdexHeader(byte[] buf,
int offset)
Verifies that the odex header is valid and a supported version
|
static void |
verifyOdexHeader(java.io.InputStream inputStream)
Reads in the odex header from the given input stream and verifies that it is valid and a supported version
The inputStream must support mark(), and will be reset to initial position upon exiting the method
|
public static int verifyDexHeader(@Nonnull
java.io.InputStream inputStream)
throws java.io.IOException
inputStream - An input stream that is positioned at a dex headerDexBackedDexFile.NotADexFile - If the file is not a dex fileDexUtil.InvalidFile - If the header appears to be a dex file, but is not valid for some reasonDexUtil.UnsupportedFile - If the dex header is valid, but uses unsupported functionalityjava.io.IOExceptionpublic static int verifyDexHeader(@Nonnull
byte[] buf,
int offset)
buf - A byte array containing at least the first 44 bytes of a dex fileoffset - The offset within the array to the dex headerDexBackedDexFile.NotADexFile - If the file is not a dex fileDexUtil.InvalidFile - If the header appears to be a dex file, but is not valid for some reasonDexUtil.UnsupportedFile - If the dex header is valid, but uses unsupported functionalitypublic static int verifyCdexHeader(@Nonnull
byte[] buf,
int offset)
buf - A byte array containing at least the first 44 bytes of a cdex fileoffset - The offset within the array to the dex headerDexBackedDexFile.NotADexFile - If the file is not a cdex fileDexUtil.InvalidFile - If the header appears to be a cdex file, but is not valid for some reasonDexUtil.UnsupportedFile - If the cdex header is valid, but uses unsupported functionalitypublic static void verifyOdexHeader(@Nonnull
java.io.InputStream inputStream)
throws java.io.IOException
inputStream - An input stream that is positioned at an odex headerDexBackedOdexFile.NotAnOdexFile - If the file is not an odex fileDexUtil.UnsupportedFile - If the odex header is valid, but is an unsupported versionjava.io.IOExceptionpublic static void verifyOdexHeader(@Nonnull
byte[] buf,
int offset)
buf - A byte array containing at least the first 8 bytes of an odex fileoffset - The offset within the array to the odex headerDexBackedOdexFile.NotAnOdexFile - If the file is not an odex fileDexUtil.UnsupportedFile - If the odex header is valid, but uses unsupported functionality