public class DexFileReader
extends java.lang.Object
DexFileVisitor visitor = new xxxFileVisitor(); DexFileReader reader = new DexFileReader(dexFile); reader.accept(visitor);
Modifier and Type | Field and Description |
---|---|
static int |
IGNORE_READ_EXCEPTION
ingore read exception
|
static int |
KEEP_ALL_METHODS
read all methods, even if they are glitch
|
static int |
KEEP_CLINIT
keep clinit method when
SKIP_DEBUG |
static int |
SKIP_ANNOTATION
skip annotation info in dex file.
|
static int |
SKIP_CODE
skip code info in dex file, this indicate
SKIP_DEBUG |
static int |
SKIP_DEBUG
skip debug infos in dex file.
|
static int |
SKIP_EXCEPTION
keep clinit method when
SKIP_DEBUG |
static int |
SKIP_FIELD_CONSTANT
skip field constant in dex file.
|
Constructor and Description |
---|
DexFileReader(byte[] data) |
DexFileReader(java.nio.ByteBuffer in)
read dex from a
ByteBuffer . |
DexFileReader(java.io.File file) |
DexFileReader(java.io.InputStream is) |
DexFileReader(java.nio.file.Path file) |
Modifier and Type | Method and Description |
---|---|
void |
accept(java.util.function.Consumer<java.lang.String> stringConsumer)
Provides the given consumer with all strings in the dex file.
|
void |
accept(DexFileVisitor dv)
equals to
accept(DexFileVisitor, int) with 0 as config |
void |
accept(DexFileVisitor dv,
int config)
Makes the given visitor visit the dex file.
|
void |
accept(DexFileVisitor dv,
int classIdx,
int config)
Makes the given visitor visit the dex file.
|
java.util.List<java.lang.String> |
getClassNames() |
int |
getClassSize()
the size of class in dex file
|
int |
getDexVersion() |
java.lang.Boolean |
ignoreClass(java.lang.String className) |
static void |
niceExceptionMessage(java.lang.Throwable t,
int deep) |
static int |
readLeb128i(java.nio.ByteBuffer in) |
static int |
readULeb128i(java.nio.ByteBuffer in) |
public static final int SKIP_DEBUG
public static final int SKIP_CODE
SKIP_DEBUG
public static final int SKIP_ANNOTATION
public static final int SKIP_FIELD_CONSTANT
public static final int IGNORE_READ_EXCEPTION
public static final int KEEP_ALL_METHODS
public static final int KEEP_CLINIT
SKIP_DEBUG
public static final int SKIP_EXCEPTION
SKIP_DEBUG
public DexFileReader(java.nio.ByteBuffer in)
ByteBuffer
.in
- public DexFileReader(byte[] data)
data
- the byte array of dexpublic DexFileReader(java.io.File file) throws java.io.IOException
file
- the dex filejava.io.IOException
public DexFileReader(java.nio.file.Path file) throws java.io.IOException
java.io.IOException
public DexFileReader(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void niceExceptionMessage(java.lang.Throwable t, int deep)
public static int readULeb128i(java.nio.ByteBuffer in)
public static int readLeb128i(java.nio.ByteBuffer in)
public int getDexVersion()
public void accept(DexFileVisitor dv)
accept(DexFileVisitor, int)
with 0 as configdv
- public java.util.List<java.lang.String> getClassNames()
public void accept(DexFileVisitor dv, int config)
dv
- visitorconfig
- config flags, SKIP_CODE
, SKIP_DEBUG
, SKIP_ANNOTATION
,
SKIP_FIELD_CONSTANT
public void accept(DexFileVisitor dv, int classIdx, int config)
DexFileVisitor.visitEnd()
is not calleddv
- visitorclassIdx
- index of class_defconfig
- config flags, SKIP_CODE
, SKIP_DEBUG
, SKIP_ANNOTATION
,
SKIP_FIELD_CONSTANT
public void accept(java.util.function.Consumer<java.lang.String> stringConsumer)
public java.lang.Boolean ignoreClass(java.lang.String className)
public final int getClassSize()