summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdexfile/dex/dex_file.h12
-rw-r--r--libdexfile/dex/dex_file_loader.h11
2 files changed, 22 insertions, 1 deletions
diff --git a/libdexfile/dex/dex_file.h b/libdexfile/dex/dex_file.h
index 8bcf1d803a..6bc6e4f4ca 100644
--- a/libdexfile/dex/dex_file.h
+++ b/libdexfile/dex/dex_file.h
@@ -935,7 +935,17 @@ class DexFile {
// This is different to the "data section" in the standard dex header.
ArrayRef<const uint8_t> const data_;
- // Typically the dex file name when available, alternatively some identifying string.
+ // The full absolute path to the dex file, if it was loaded from disk.
+ //
+ // Can also be a path to a multidex container (typically apk), followed by
+ // DexFileLoader.kMultiDexSeparator (i.e. '!') and the file inside the
+ // container.
+ //
+ // On host this may not be an absolute path.
+ //
+ // On device libnativeloader uses this to determine the location of the java
+ // package or shared library, which decides where to load native libraries
+ // from.
//
// The ClassLinker will use this to match DexFiles the boot class
// path to DexCache::GetLocation when loading from an image.
diff --git a/libdexfile/dex/dex_file_loader.h b/libdexfile/dex/dex_file_loader.h
index 6530303542..ec7f8ba977 100644
--- a/libdexfile/dex/dex_file_loader.h
+++ b/libdexfile/dex/dex_file_loader.h
@@ -327,6 +327,17 @@ class DexFileLoader {
const File* file_ = &kInvalidFile;
std::optional<File> owned_file_; // May be used as backing storage for 'file_'.
std::shared_ptr<DexFileContainer> root_container_;
+
+ // The full absolute path to the dex file, if it was loaded from disk.
+ //
+ // Can also be a path to a multidex container (typically apk), followed by
+ // kMultiDexSeparator and the file inside the container.
+ //
+ // On host this may not be an absolute path.
+ //
+ // On device libnativeloader uses this to determine the location of the java
+ // package or shared library, which decides where to load native libraries
+ // from.
const std::string location_;
};