diff options
author | Jesse Wilson <jessewilson@google.com> | 2011-07-06 14:21:39 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-07-06 14:21:39 -0700 |
commit | ba4500230de2ac9d293c006cc2223b0794614b62 (patch) | |
tree | 8042d4b541ae7935a8e38764182ac6c05ce42eb3 /dalvik | |
parent | c1fb498a2fdffedb7b09a7192f136ca8c26d6186 (diff) | |
parent | 489ce787516ec9027c1d49ab89b6738d78dc317a (diff) | |
download | libcore-ba4500230de2ac9d293c006cc2223b0794614b62.zip libcore-ba4500230de2ac9d293c006cc2223b0794614b62.tar.gz libcore-ba4500230de2ac9d293c006cc2223b0794614b62.tar.bz2 |
am 489ce787: am 09bb615c: Use a clear warning in the DexClassLoader docs.
* commit '489ce787516ec9027c1d49ab89b6738d78dc317a':
Use a clear warning in the DexClassLoader docs.
Diffstat (limited to 'dalvik')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/DexClassLoader.java | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/dalvik/src/main/java/dalvik/system/DexClassLoader.java b/dalvik/src/main/java/dalvik/system/DexClassLoader.java index fea65dd..775a38a 100644 --- a/dalvik/src/main/java/dalvik/system/DexClassLoader.java +++ b/dalvik/src/main/java/dalvik/system/DexClassLoader.java @@ -23,15 +23,19 @@ import java.net.URL; import java.util.zip.ZipFile; /** - * Provides a simple {@link ClassLoader} implementation that operates on a - * list of jar/apk files with classes.dex entries. The directory that - * holds the optimized form of the files is specified explicitly. This - * can be used to execute code not installed as part of an application. + * A class loader that loads classes from {@code .jar} and {@code .apk} files + * containing a {@code classes.dex} entry. This can be used to execute code not + * installed as part of an application. * - * The best place to put the optimized DEX files is in app-specific - * storage, so that removal of the app will automatically remove the - * optimized DEX files. If other storage is used (e.g. /sdcard), the - * app may not have an opportunity to remove them. + * <p>This class loader requires an application-private, writable directory to + * cache optimized classes. Use {@code Context.getDir(String, int)} to create + * such a directory: <pre> {@code + * File dexOutputDir = context.getDir("dex", 0); + * }</pre> + * + * <p><strong>Do not cache optimized classes on external storage.</strong> + * External storage does not provide access controls necessary to protect your + * application from code injection attacks. */ public class DexClassLoader extends ClassLoader { // TODO: Factor out commonality between this class and PathClassLoader. @@ -63,17 +67,15 @@ public class DexClassLoader extends ClassLoader { * 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.separator" system property, which defaults to ":". + * <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 - * @param dexOutputDir - * directory where optimized DEX files should be written - * @param libPath - * the list of directories containing native libraries; may be null - * @param parent - * the parent class loader + * @param dexPath the list of jar/apk files containing classes and resources + * @param dexOutputDir directory where optimized DEX files should be + * written. This should be an application-private, writable directory. + * @param libPath the list of directories containing native libraries; may + * be null + * @param parent the parent class loader */ public DexClassLoader(String dexPath, String dexOutputDir, String libPath, ClassLoader parent) { |