public class DexArchive extends Archive
| Modifier and Type | Method and Description |
|---|---|
protected void |
downloadArchive(java.io.InputStream is,
java.net.URL source)
Create an Archive based on contents of an InputStream, the archive is saved
as local copy in the specified directory.
|
boolean |
exists(java.lang.String path,
boolean onlyDirs)
Get a BundleResourceStream to named entry inside an Archive.
|
byte[] |
getClassBytes(java.lang.String name)
Return null to indicate that we can not get class bytes from DEX files
|
java.lang.Class<?> |
loadClassBytes(java.lang.String name,
java.lang.ClassLoader cl)
Load a class using the Dalvik DexFile API.
|
protected void |
restoreArchive()
Create an Archive based on contents of a saved archive in the specified
directory.
|
protected Archive |
subArchive(java.lang.String path,
int id)
Create a Sub-Archive based on a path to in an already existing Archive.
|
checkNativeLibrary, findResourcesPath, getBundleGeneration, getBundleResourceStream, getFile, getNativeLibrary, getSubId, isJar, listDir, toStringprotected void downloadArchive(java.io.InputStream is,
java.net.URL source)
throws java.io.IOException
ArchivedownloadArchive in class Archiveis - Jar file data in an InputStream.java.io.IOExceptionprotected void restoreArchive()
throws java.io.IOException
ArchiverestoreArchive in class Archivejava.io.IOExceptionprotected Archive subArchive(java.lang.String path, int id) throws java.io.IOException
ArchivesubArchive in class Archivepath - Path of new Archive inside old Archive.id - Sub-id of Archive.java.io.FileNotFoundException - if no such Jar file in archive.java.io.IOException - if failed to read Jar file.public boolean exists(java.lang.String path,
boolean onlyDirs)
Archiveexists in interface FileArchiveexists in class Archivepublic byte[] getClassBytes(java.lang.String name)
getClassBytes in interface FileArchivegetClassBytes in class Archivename - File to get.public java.lang.Class<?> loadClassBytes(java.lang.String name,
java.lang.ClassLoader cl)
This relies in the bundle having a "classes.dex" in its root
TODO: We should create a specific bundle storage module for DEX files.
To create such a bundle, do
dx --dex --output=classes.dex bundle.jar
aapt add bundle.jar classes.dex
loadClassBytes in interface FileArchiveloadClassBytes in class Archivecl - Class loader to use for component.