Package dalvik.system
Class DexClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- dalvik.system.BaseDexClassLoader
-
- dalvik.system.DexClassLoader
-
public class DexClassLoader extends BaseDexClassLoader
A class loader that loads classes from.jarand.apkfiles containing aclasses.dexentry. This can be used to execute code not installed as part of an application.This class loader requires an application-private, writable directory to cache optimized classes. Use
Context.getCodeCacheDir()to create such a directory:File dexOutputDir = context.getCodeCacheDir();Do not cache optimized classes on external storage. External storage does not provide access controls necessary to protect your application from code injection attacks.
-
-
Field Summary
-
Fields inherited from class java.lang.ClassLoader
proxyCache
-
-
Constructor Summary
Constructors Constructor Description DexClassLoader(String dexPath, String optimizedDirectory, String libraryPath, ClassLoader parent)Creates aDexClassLoaderthat finds interpreted and native code.
-
Method Summary
-
Methods inherited from class dalvik.system.BaseDexClassLoader
findClass, findLibrary, findResource, findResources, getLdLibraryPath, getPackage, toString
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findSystemClass, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
DexClassLoader
public DexClassLoader(String dexPath, String optimizedDirectory, String libraryPath, ClassLoader parent)
Creates aDexClassLoaderthat finds interpreted and native code. Interpreted classes are found in a set of DEX files contained in Jar or APK files.The path lists are separated using the character specified by the
path.separatorsystem property, which defaults to:.- Parameters:
dexPath- the list of jar/apk files containing classes and resources, delimited byFile.pathSeparator, which defaults to":"on AndroidoptimizedDirectory- directory where optimized dex files should be written; must not benulllibraryPath- the list of directories containing native libraries, delimited byFile.pathSeparator; may benullparent- the parent class loader
-
-