publicclassDexClassLoaderextendsBaseDexClassLoader { /** * Creates a {@code DexClassLoader} that finds interpreted and native * code. Interpreted classes are found in a set of DEX files contained * in Jar or APK files. * * <p>The path lists are separated using the character specified by the * {@code path.separator} system property, which defaults to {@code :}. * * @param dexPath the list of jar/apk files containing classes and * resources, delimited by {@code File.pathSeparator}, which * defaults to {@code ":"} on Android * @param optimizedDirectory directory where optimized dex files * should be written; must not be {@code null} * @param librarySearchPath the list of directories containing native * libraries, delimited by {@code File.pathSeparator}; may be * {@code null} * @param parent the parent class loader */ publicDexClassLoader(String dexPath, String optimizedDirectory, String librarySearchPath, ClassLoader parent) { super(dexPath, newFile(optimizedDirectory), librarySearchPath, parent); } }
publicclassPathClassLoaderextendsBaseDexClassLoader { /** * Creates a {@code PathClassLoader} that operates on a given list of files * and directories. This method is equivalent to calling * {@link #PathClassLoader(String, String, ClassLoader)} with a * {@code null} value for the second argument (see description there). * * @param dexPath the list of jar/apk files containing classes and * resources, delimited by {@code File.pathSeparator}, which * defaults to {@code ":"} on Android * @param parent the parent class loader */ publicPathClassLoader(String dexPath, ClassLoader parent) { super(dexPath, null, null, parent); }
/** * Creates a {@code PathClassLoader} that operates on two given * lists of files and directories. The entries of the first list * should be one of the following: * * <ul> * <li>JAR/ZIP/APK files, possibly containing a "classes.dex" file as * well as arbitrary resources. * <li>Raw ".dex" files (not inside a zip file). * </ul> * * The entries of the second list should be directories containing * native library files. * * @param dexPath the list of jar/apk files containing classes and * resources, delimited by {@code File.pathSeparator}, which * defaults to {@code ":"} on Android * @param librarySearchPath the list of directories containing native * libraries, delimited by {@code File.pathSeparator}; may be * {@code null} * @param parent the parent class loader */ publicPathClassLoader(String dexPath, String librarySearchPath, ClassLoader parent) { super(dexPath, null, librarySearchPath, parent); } }
publicfinalclassInMemoryDexClassLoaderextendsBaseDexClassLoader { /** * Create an in-memory DEX class loader with the given dex buffers. * * @param dexBuffers array of buffers containing DEX files between * <tt>buffer.position()</tt> and <tt>buffer.limit()</tt>. * @param parent the parent class loader for delegation. * @hide */ publicInMemoryDexClassLoader(ByteBuffer[] dexBuffers, ClassLoader parent) { super(dexBuffers, parent); }
/** * Creates a new in-memory DEX class loader. * * @param dexBuffer buffer containing DEX file contents between * <tt>buffer.position()</tt> and <tt>buffer.limit()</tt>. * @param parent the parent class loader for delegation. */ publicInMemoryDexClassLoader(ByteBuffer dexBuffer, ClassLoader parent) { this(newByteBuffer[] { dexBuffer }, parent); } }