summaryrefslogtreecommitdiffstats
path: root/runtime/oat_file.h
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2017-04-05 17:05:46 -0700
committerJeff Hao <jeffhao@google.com>2017-04-18 17:03:11 -0700
commit16d4843433e024100b4ecd183f827ad5bd8772a6 (patch)
tree30b6f526051faaf8cc5ebbc15a7dfeef051a153f /runtime/oat_file.h
parent2203253254e18ebde386740d3c841c04c432a42e (diff)
downloadart-16d4843433e024100b4ecd183f827ad5bd8772a6.tar.gz
art-16d4843433e024100b4ecd183f827ad5bd8772a6.tar.bz2
art-16d4843433e024100b4ecd183f827ad5bd8772a6.zip
Allow dex2oat to handle relative paths.
During installation at compile time, the PackageManager is passing shared libraries to dex2oat with -classpath. For split apps, we want the splits to have the proper dependencies, and are now passing previous parts of the split apk as shared libraries as we compile them all. These apks are staged in a temp dir during compilation, so we pass a relative path for them instead. Since PackageManager can now pass relative paths to dex2oat as shared libraries, dex2oat has an added --classpath-dir switch to specify the directory to use for relative class paths. At runtime when checking shared libraries, we use oat file functionality to resolve relative paths to determine if the paths match. Bug: 34169257 Test: cts-tradefed run singleCommand cts -d --module CtsAppSecurityHostTestCases -t android.appsecurity.cts.SplitTests Merged-In: I9667f0069c8d12e94598f8a78888d3855d870824 (cherry-picked from commit f79ac83a8c18b0bd81aafc9c8823f6bed35d8847) Change-Id: I8e4703fdd4bfeb94f982e93abb7eb0cd71060fce
Diffstat (limited to 'runtime/oat_file.h')
-rw-r--r--runtime/oat_file.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index d24283afee..06c76b5464 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -288,7 +288,9 @@ class OatFile {
const char* abs_dex_location, const std::string& rel_dex_location);
// Create a dependency list (dex locations and checksums) for the given dex files.
- static std::string EncodeDexFileDependencies(const std::vector<const DexFile*>& dex_files);
+ // Removes dex file paths prefixed with base_dir to convert them back to relative paths.
+ static std::string EncodeDexFileDependencies(const std::vector<const DexFile*>& dex_files,
+ std::string& base_dir);
// Finds the associated oat class for a dex_file and descriptor. Returns an invalid OatClass on
// error and sets found to false.