public final class Dex
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
Dex.Section |
| Constructor and Description |
|---|
Dex(byte[] data)
Creates a new dex that reads from
data. |
Dex(java.io.File file)
Creates a new dex buffer from the dex file
file. |
Dex(java.io.InputStream in)
Creates a new dex buffer of the dex in
in, and closes in. |
Dex(int byteCount)
Creates a new empty dex of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
Dex.Section |
appendSection(int maxByteCount,
java.lang.String name) |
java.lang.Iterable<ClassDef> |
classDefs() |
int |
computeChecksum()
Returns the checksum of all but the first 12 bytes of
dex. |
byte[] |
computeSignature()
Returns the signature of all but the first 32 bytes of this dex.
|
int |
descriptorIndexFromTypeIndex(int typeIndex)
Look up a descriptor index from a type index.
|
java.util.List<FieldId> |
fieldIds() |
byte[] |
getBytes()
Returns a copy of the the bytes of this dex.
|
int |
getLength() |
int |
getNextSectionStart() |
TableOfContents |
getTableOfContents() |
java.util.List<MethodId> |
methodIds() |
Dex.Section |
open(int position) |
java.util.List<ProtoId> |
protoIds() |
ClassData |
readClassData(ClassDef classDef) |
Code |
readCode(ClassData.Method method) |
TypeList |
readTypeList(int offset) |
java.util.List<java.lang.String> |
strings() |
java.util.List<java.lang.Integer> |
typeIds() |
java.util.List<java.lang.String> |
typeNames() |
void |
writeHashes()
Generates the signature and checksum of the dex file
out and
writes them to the file. |
void |
writeTo(java.io.File dexOut) |
void |
writeTo(java.io.OutputStream out) |
public Dex(byte[] data)
throws java.io.IOException
data. It is an error to modify
data after using it to create a dex buffer.java.io.IOExceptionpublic Dex(int byteCount)
throws java.io.IOException
java.io.IOExceptionpublic Dex(java.io.InputStream in)
throws java.io.IOException
in, and closes in.java.io.IOExceptionpublic Dex(java.io.File file)
throws java.io.IOException
file.java.io.IOExceptionpublic void writeTo(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic void writeTo(java.io.File dexOut)
throws java.io.IOException
java.io.IOExceptionpublic TableOfContents getTableOfContents()
public Dex.Section open(int position)
public Dex.Section appendSection(int maxByteCount, java.lang.String name)
public int getLength()
public int getNextSectionStart()
public byte[] getBytes()
public java.util.List<java.lang.String> strings()
public java.util.List<java.lang.Integer> typeIds()
public java.util.List<java.lang.String> typeNames()
public java.util.List<ProtoId> protoIds()
public java.util.List<FieldId> fieldIds()
public java.util.List<MethodId> methodIds()
public java.lang.Iterable<ClassDef> classDefs()
public TypeList readTypeList(int offset)
public Code readCode(ClassData.Method method)
public byte[] computeSignature()
throws java.io.IOException
java.io.IOExceptionpublic int computeChecksum()
throws java.io.IOException
dex.java.io.IOExceptionpublic void writeHashes()
throws java.io.IOException
out and
writes them to the file.java.io.IOExceptionpublic int descriptorIndexFromTypeIndex(int typeIndex)
open(tableOfContents.typeIds.off + (index * SizeOf.TYPE_ID_ITEM)).readInt();Copyright © 2020. All Rights Reserved.