public interface DexArchive
extends java.io.Closeable
Dex archives can be updated by adding new files.
When using instances of DexArchive make sure that you invoke Closeable.close() after
you are done using it.
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(java.lang.String relativePath,
byte[] bytes,
int offset,
int end)
Adds a DEX file to this dex archive from a byte[].
|
java.util.List<DexArchiveEntry> |
getFiles()
Returns collection of all entries,
DexArchiveEntry, in this dex archive. |
java.nio.file.Path |
getRootPath()
Returns the path to this DEX archive.
|
@NonNull java.nio.file.Path getRootPath()
void addFile(@NonNull
java.lang.String relativePath,
byte[] bytes,
int offset,
int end)
throws java.io.IOException
getRootPath(). In case file with the same relative path already exists, implementations of
this method should overwrite it with the new version of the file.relativePath - file to be added to this archivebytes - the buffer to get the dex file content fromoffset - the offset for the buffer window.end - the end of the buffer window.java.io.IOException - if the dex file cannot be written.@NonNull java.util.List<DexArchiveEntry> getFiles() throws java.io.IOException
DexArchiveEntry, in this dex archive. The entries
contain information about the relative path, DexArchiveEntry.getRelativePathInArchive() as well as the actual DEX file content, DexArchiveEntry.getDexFileContent().java.io.IOException