summaryrefslogtreecommitdiffstats
path: root/dalvik
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-07-10 11:35:38 +0100
committerNarayan Kamath <narayan@google.com>2014-07-25 14:53:51 +0100
commitdf641c08eb53f4a1cee031ff7ba490535af3ed5d (patch)
treeff8ad52a45c3dcedff9d6501fba5c6f21a089c9b /dalvik
parentf12adcfbc07ac899d2ed5219bb3c451f147a6fef (diff)
downloadlibcore-df641c08eb53f4a1cee031ff7ba490535af3ed5d.zip
libcore-df641c08eb53f4a1cee031ff7ba490535af3ed5d.tar.gz
libcore-df641c08eb53f4a1cee031ff7ba490535af3ed5d.tar.bz2
Use the provided path when opening dex files.
Previously we would use the canonical path. If the path contains symlinks it may generate the wrong file name when searching for the containing oat file. This is because we don't apply any canonicalization when dex files are generated so we think we're looking for somthing else. Bug: 15563230 (cherry picked from commit 71202f8ed84edc6ab57e7b6c26f0a1ec97d5adc6) Change-Id: If261e2d80e9cbdc6e7750c73b8e6f298e46b009b
Diffstat (limited to 'dalvik')
-rw-r--r--dalvik/src/main/java/dalvik/system/DexFile.java16
1 files changed, 5 insertions, 11 deletions
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java
index 5a9c01a..8c78312 100644
--- a/dalvik/src/main/java/dalvik/system/DexFile.java
+++ b/dalvik/src/main/java/dalvik/system/DexFile.java
@@ -281,21 +281,15 @@ public final class DexFile {
}
}
- /*
- * Open a DEX file. The value returned is a magic VM cookie. On
- * failure, an IOException is thrown.
- */
- private static long openDexFile(String sourceName, String outputName, int flags) throws IOException {
- return openDexFileNative(new File(sourceName).getCanonicalPath(),
- (outputName == null) ? null : new File(outputName).getCanonicalPath(),
- flags);
- }
-
private static native void closeDexFile(long cookie);
private static native Class defineClassNative(String name, ClassLoader loader, long cookie)
throws ClassNotFoundException, NoClassDefFoundError;
private static native String[] getClassNameList(long cookie);
- private static native long openDexFileNative(String sourceName, String outputName, int flags);
+ /*
+ * Open a DEX file. The value returned is a magic VM cookie. On
+ * failure, an IOException is thrown.
+ */
+ private static native long openDexFile(String sourceName, String outputName, int flags);
/**
* Returns true if the VM believes that the apk/jar file is out of date