Lines Matching refs:apex_file
193 auto apex_file = ApexFile::Open(path); in PreAllocateLoopDevices() local
194 if (!apex_file.ok()) { in PreAllocateLoopDevices()
199 if (IsBootstrapApex(*apex_file)) { in PreAllocateLoopDevices()
353 Result<ApexFile> apex_file = ApexFile::Open(path); in RemovePreviouslyActiveApexFiles() local
354 if (!apex_file.ok()) { in RemovePreviouslyActiveApexFiles()
355 return apex_file.error(); in RemovePreviouslyActiveApexFiles()
358 const std::string& package_name = apex_file->GetManifest().name(); in RemovePreviouslyActiveApexFiles()
365 if (files_to_keep.find(apex_file->GetPath()) != files_to_keep.end()) { in RemovePreviouslyActiveApexFiles()
370 LOG(DEBUG) << "Deleting previously active apex " << apex_file->GetPath(); in RemovePreviouslyActiveApexFiles()
371 if (unlink(apex_file->GetPath().c_str()) != 0) { in RemovePreviouslyActiveApexFiles()
372 return ErrnoError() << "Failed to unlink " << apex_file->GetPath(); in RemovePreviouslyActiveApexFiles()
707 for (const ApexFile& apex_file : apexes) { in PrePostinstallPackages() local
708 apexd_private::UnmountTempMount(apex_file); in PrePostinstallPackages()
717 for (const ApexFile& apex_file : apexes) { in PrePostinstallPackages() local
718 if (!(apex_file.GetManifest().*fn)().empty()) { in PrePostinstallPackages()
772 Result<ApexFile> apex_file = ApexFile::Open(path); in OpenApexFiles() local
773 if (!apex_file.ok()) { in OpenApexFiles()
774 return apex_file.error(); in OpenApexFiles()
776 ret.emplace_back(std::move(*apex_file)); in OpenApexFiles()
797 Result<void> VerifyPackageBoot(const ApexFile& apex_file) { in VerifyPackageBoot() argument
800 auto public_key = instance.GetPublicKey(apex_file.GetManifest().name()); in VerifyPackageBoot()
804 Result<ApexVerityData> verity_or = apex_file.VerifyApexVerity(*public_key); in VerifyPackageBoot()
809 if (shim::IsShimApex(apex_file)) { in VerifyPackageBoot()
813 const auto& result = ValidateStagingShimApex(apex_file); in VerifyPackageBoot()
825 Result<void> VerifyPackageStagedInstall(const ApexFile& apex_file) { in VerifyPackageStagedInstall() argument
826 const auto& verify_package_boot_status = VerifyPackageBoot(apex_file); in VerifyPackageStagedInstall()
834 return RunVerifyFnInsideTempMount(apex_file, kSuccessFn, false); in VerifyPackageStagedInstall()
847 for (const ApexFile& apex_file : *apex_files) { in VerifyPackages()
848 Result<void> result = verify_apex_fn(apex_file); in VerifyPackages()
924 auto backup_path_fn = [](const ApexFile& apex_file) { in BackupActivePackages() argument
926 GetPackageId(apex_file.GetManifest()).c_str(), in BackupActivePackages()
940 Result<ApexFile> apex_file = ApexFile::Open(path); in BackupActivePackages() local
941 if (!apex_file.ok()) { in BackupActivePackages()
942 return Error() << "Backup failed : " << apex_file.error(); in BackupActivePackages()
944 const auto& dest_path = backup_path_fn(*apex_file); in BackupActivePackages()
945 if (link(apex_file->GetPath().c_str(), dest_path.c_str()) != 0) { in BackupActivePackages()
946 return ErrnoError() << "Failed to backup " << apex_file->GetPath(); in BackupActivePackages()
1236 Result<void> ActivatePackageImpl(const ApexFile& apex_file, in ActivatePackageImpl() argument
1238 const ApexManifest& manifest = apex_file.GetManifest(); in ActivatePackageImpl()
1245 if (shim::IsShimApex(apex_file) && in ActivatePackageImpl()
1246 !ApexFileRepository::GetInstance().IsPreInstalledApex(apex_file)) { in ActivatePackageImpl()
1249 Result<void> result = VerifyPackageBoot(apex_file); in ActivatePackageImpl()
1251 LOG(ERROR) << "Failed to validate shim apex: " << apex_file.GetPath(); in ActivatePackageImpl()
1296 auto mount_status = MountPackage(apex_file, mount_point, device_name); in ActivatePackageImpl()
1308 gMountedApexes.SetLatest(manifest.name(), apex_file.GetPath()); in ActivatePackageImpl()
1325 gMountedApexes.SetLatest(manifest.name(), apex_file.GetPath()); in ActivatePackageImpl()
1337 LOG(DEBUG) << "Successfully activated " << apex_file.GetPath() in ActivatePackageImpl()
1346 Result<ApexFile> apex_file = ApexFile::Open(full_path); in ActivatePackage() local
1347 if (!apex_file.ok()) { in ActivatePackage()
1348 return apex_file.error(); in ActivatePackage()
1350 return ActivatePackageImpl(*apex_file, in ActivatePackage()
1351 GetPackageId(apex_file->GetManifest())); in ActivatePackage()
1357 Result<ApexFile> apex_file = ApexFile::Open(full_path); in DeactivatePackage() local
1358 if (!apex_file.ok()) { in DeactivatePackage()
1359 return apex_file.error(); in DeactivatePackage()
1362 return UnmountPackage(*apex_file, /* allow_latest= */ true, in DeactivatePackage()
1374 Result<ApexFile> apex_file = ApexFile::Open(data.full_path); in GetActivePackages() local
1375 if (!apex_file.ok()) { in GetActivePackages()
1378 ret.emplace_back(std::move(*apex_file)); in GetActivePackages()
1484 Result<ApexFile> apex_file = ApexFile::Open(path); in GetFactoryPackages() local
1485 if (!apex_file.ok()) { in GetFactoryPackages()
1486 LOG(ERROR) << apex_file.error(); in GetFactoryPackages()
1490 if (apex_file->IsCompressed() && in GetFactoryPackages()
1493 apex_file->GetManifest().name()) != in GetFactoryPackages()
1498 ret.emplace_back(std::move(*apex_file)); in GetFactoryPackages()
1558 Result<ApexFile> apex_file = ApexFile::Open(name); in ScanApexFiles() local
1559 if (!apex_file.ok()) { in ScanApexFiles()
1560 LOG(ERROR) << "Failed to scan " << name << " : " << apex_file.error(); in ScanApexFiles()
1562 ret.emplace_back(std::move(*apex_file)); in ScanApexFiles()
1693 for (const ApexFile& apex_file : decompressed_apex) { in ActivateMissingApexes() local
1694 fallback_apexes.emplace_back(std::cref(apex_file)); in ActivateMissingApexes()
2061 Result<ApexFile> apex_file = ApexFile::Open(apex); in ScanStagedSessionsDirAndStage() local
2062 if (!apex_file.ok()) { in ScanStagedSessionsDirAndStage()
2066 session.AddApexName(apex_file->GetManifest().name()); in ScanStagedSessionsDirAndStage()
2109 std::string StageDestPath(const ApexFile& apex_file) { in StageDestPath() argument
2111 GetPackageId(apex_file.GetManifest()).c_str(), in StageDestPath()
2131 for (const ApexFile& apex_file : *apex_files) { in StagePackages()
2132 if (shim::IsShimApex(apex_file)) { in StagePackages()
2136 Result<void> result = VerifyPackageBoot(apex_file); in StagePackages()
2169 for (const ApexFile& apex_file : *apex_files) { in StagePackages()
2172 std::string new_hashtree_file = GetHashTreeFileName(apex_file, in StagePackages()
2174 std::string old_hashtree_file = GetHashTreeFileName(apex_file, in StagePackages()
2185 std::string dest_path = StageDestPath(apex_file); in StagePackages()
2193 if (link(apex_file.GetPath().c_str(), dest_path.c_str()) != 0) { in StagePackages()
2194 return ErrnoError() << "Unable to link " << apex_file.GetPath() << " to " in StagePackages()
2198 staged_packages.insert(apex_file.GetManifest().name()); in StagePackages()
2200 LOG(DEBUG) << "Success linking " << apex_file.GetPath() << " to " in StagePackages()
2819 for (const ApexFile& apex_file : decompressed_apex) { in OnStart() local
2820 activation_list.emplace_back(std::cref(apex_file)); in OnStart()
3296 for (const ApexFile& apex_file : decompressed_apex) { in OnOtaChrootBootstrap() local
3297 activation_list.emplace_back(std::cref(apex_file)); in OnOtaChrootBootstrap()
3444 Result<void> VerifyPackageNonStagedInstall(const ApexFile& apex_file) { in VerifyPackageNonStagedInstall() argument
3445 const auto& verify_package_boot_status = VerifyPackageBoot(apex_file); in VerifyPackageNonStagedInstall()
3450 auto check_fn = [&apex_file](const std::string& mount_point) -> Result<void> { in VerifyPackageNonStagedInstall()
3457 return Error() << apex_file.GetPath() << " contains app inside"; in VerifyPackageNonStagedInstall()
3461 return Error() << apex_file.GetPath() << " contains priv-app inside"; in VerifyPackageNonStagedInstall()
3465 return RunVerifyFnInsideTempMount(apex_file, check_fn, true); in VerifyPackageNonStagedInstall()