Do not verify apks when processing profiles
It's a waste of time and it causes problems when taking snapshots for the
boot image profile.
Bug: 73313191
Test: profile_assistant_test
Change-Id: I8e838af9515b41402eda455c23741a855c48ff98
diff --git a/profman/profman.cc b/profman/profman.cc
index f2cec47..b9f0209 100644
--- a/profman/profman.cc
+++ b/profman/profman.cc
@@ -187,7 +187,6 @@
dump_only_(false),
dump_classes_and_methods_(false),
generate_boot_image_profile_(false),
- skip_apk_verification_(false),
dump_output_to_fd_(kInvalidFd),
test_profile_num_dex_(kDefaultTestProfileNumDex),
test_profile_method_percerntage_(kDefaultTestProfileMethodPercentage),
@@ -231,8 +230,6 @@
ParseUintOption(option, "--dump-output-to-fd", &dump_output_to_fd_, Usage);
} else if (option == "--generate-boot-image-profile") {
generate_boot_image_profile_ = true;
- } else if (option == "--skip-apk-verification") {
- skip_apk_verification_ = true;
} else if (option.starts_with("--boot-image-class-threshold=")) {
ParseUintOption(option,
"--boot-image-class-threshold",
@@ -369,10 +366,6 @@
return result;
}
- bool ShouldSkipApkVerification() const {
- return skip_apk_verification_;
- }
-
bool GetProfileFilterKeyFromApks(std::set<ProfileFilterKey>* profile_filter_keys) {
auto process_fn = [profile_filter_keys](std::unique_ptr<const DexFile>&& dex_file) {
// Store the profile key of the location instead of the location itself.
@@ -424,10 +417,11 @@
std::string error_msg;
const ArtDexFileLoader dex_file_loader;
std::vector<std::unique_ptr<const DexFile>> dex_files_for_location;
+ // We do not need to verify the apk for processing profiles.
if (use_apk_fd_list) {
if (dex_file_loader.OpenZip(apks_fd_[i],
dex_locations_[i],
- /* verify */ !ShouldSkipApkVerification(),
+ /* verify */ false,
kVerifyChecksum,
&error_msg,
&dex_files_for_location)) {
@@ -438,7 +432,7 @@
} else {
if (dex_file_loader.Open(apk_files_[i].c_str(),
dex_locations_[i],
- /* verify */ !ShouldSkipApkVerification(),
+ /* verify */ false,
kVerifyChecksum,
&error_msg,
&dex_files_for_location)) {
@@ -1260,7 +1254,6 @@
bool dump_only_;
bool dump_classes_and_methods_;
bool generate_boot_image_profile_;
- bool skip_apk_verification_;
int dump_output_to_fd_;
BootImageOptions boot_image_options_;
std::string test_profile_;