dalvik.system
public
final
class
dalvik.system.DexFile
Manipulate DEX files. Similar in principle to java.util.zip.ZipFile.
Used primarily by class loaders.
We don't directly open and read the DEX file here. They're mapped read-only
by the VM.
Summary
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
DexFile(File file)
Open a DEX file from a File object.
public
DexFile(String fileName)
Open a DEX file from a filename (preferrably a full path).
This will usually be a Zip/Jar with a "classes.dex" inside. Do not
specify the "dalvik-cache" version directly.
Public Methods
public
void
close()
Close a DEX file.
This may not be able to release any resources. If classes have
been loaded, the underlying storage can't be discarded.
Enumerate the names of the classes in this DEX file.
public
String
getName()
Get the name of the open file.
Load a class. Returns the class on success, or a null reference
on failure.
If you are not calling this from a class loader, this is most likely
not going to do what you want. Use Class.forName() instead.
"name" should look like "java/lang/String".
I'm not throwing an exception if the class isn't found because I
don't want to be throwing exceptions wildly every time we load a
class that isn't in the first DEX file we look at. This method
*will* throw exceptions for anything that isn't ClassNotFoundException.
Protected Methods
protected
void
finalize()