diff options
-rw-r--r-- | libdexfile/dex/art_dex_file_loader.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libdexfile/dex/art_dex_file_loader.cc b/libdexfile/dex/art_dex_file_loader.cc index 0854b76bb5..bfae66724a 100644 --- a/libdexfile/dex/art_dex_file_loader.cc +++ b/libdexfile/dex/art_dex_file_loader.cc @@ -544,9 +544,14 @@ std::unique_ptr<DexFile> ArtDexFileLoader::OpenCommon(const uint8_t* base, // Location can contain multidex suffix, so fetch its canonical version. Note // that this will call `realpath`. std::string path = DexFileLoader::GetDexCanonicalLocation(location.c_str()); - if (LocationIsOnRuntimeModule(path.c_str()) || LocationIsOnConscryptModule(path.c_str())) { + // We check /system/framework before the runtime module location, because the + // runtime module location in a testing environment could be /system. + if (LocationIsOnSystemFramework(path.c_str())) { + dex_file->SetHiddenapiDomain(hiddenapi::Domain::kPlatform); + } else if (LocationIsOnRuntimeModule(path.c_str()) || + LocationIsOnConscryptModule(path.c_str())) { dex_file->SetHiddenapiDomain(hiddenapi::Domain::kCorePlatform); - } else if (LocationIsOnApex(path.c_str()) || LocationIsOnSystemFramework(path.c_str())) { + } else if (LocationIsOnApex(path.c_str())) { dex_file->SetHiddenapiDomain(hiddenapi::Domain::kPlatform); } else { dex_file->SetHiddenapiDomain(hiddenapi::Domain::kApplication); |