Lines Matching refs:dex_path
883 static bool validate_dex_path_size(const std::string& dex_path) { in validate_dex_path_size() argument
884 if (dex_path.size() >= (PKG_PATH_MAX - 8)) { in validate_dex_path_size()
885 LOG(ERROR) << "dex_path too long: " << dex_path; in validate_dex_path_size()
985 const std::string& dex_path, const char* profile_name, bool profile_guided, in maybe_open_reference_profile() argument
1008 location = dex_path; in maybe_open_reference_profile()
1261 static bool prepare_secondary_dex_oat_dir(const std::string& dex_path, int uid, in prepare_secondary_dex_oat_dir() argument
1263 unsigned long dirIndex = dex_path.rfind('/'); in prepare_secondary_dex_oat_dir()
1265 LOG(ERROR ) << "Unexpected dir structure for secondary dex " << dex_path; in prepare_secondary_dex_oat_dir()
1268 std::string dex_dir = dex_path.substr(0, dirIndex); in prepare_secondary_dex_oat_dir()
1273 LOG(ERROR) << "Could not prepare oat dir for secondary dex: " << dex_path; in prepare_secondary_dex_oat_dir()
1281 LOG(ERROR) << "Could not prepare oat/isa dir for secondary dex: " << dex_path; in prepare_secondary_dex_oat_dir()
1309 static bool process_secondary_dexoptanalyzer_result(const std::string& dex_path, int result, in process_secondary_dexoptanalyzer_result() argument
1326 dex_path.c_str(), in process_secondary_dexoptanalyzer_result()
1356 dex_path.c_str(), in process_secondary_dexoptanalyzer_result()
1368 static SecondaryDexAccess check_secondary_dex_access(const std::string& dex_path) { in check_secondary_dex_access() argument
1370 if (access(dex_path.c_str(), R_OK) == 0) { in check_secondary_dex_access()
1375 "Secondary dex does not exist: %s", dex_path.c_str()); in check_secondary_dex_access()
1379 "Could not access secondary dex: %s (%d)", dex_path.c_str(), errno); in check_secondary_dex_access()
1397 static bool create_secondary_dex_oat_layout(const std::string& dex_path, const std::string& isa, in create_secondary_dex_oat_layout() argument
1399 size_t dirIndex = dex_path.rfind('/'); in create_secondary_dex_oat_layout()
1401 *error_msg = std::string("Unexpected dir structure for dex file ").append(dex_path); in create_secondary_dex_oat_layout()
1407 std::string apk_dir = dex_path.substr(0, dirIndex); in create_secondary_dex_oat_layout()
1411 if (!create_oat_out_path(dex_path.c_str(), isa.c_str(), out_oat_dir, in create_secondary_dex_oat_layout()
1413 *error_msg = std::string("Could not create oat path for secondary dex ").append(dex_path); in create_secondary_dex_oat_layout()
1499 for (const std::string& dex_path : dex_paths) { in open_dex_paths() local
1500 zip_fds->emplace_back(open(dex_path.c_str(), O_RDONLY)); in open_dex_paths()
1503 "installd cannot open '%s' for input during dexopt", dex_path.c_str()); in open_dex_paths()
1535 static bool process_secondary_dex_dexopt(const std::string& dex_path, const char* pkgname, in process_secondary_dex_dexopt() argument
1540 LOG(DEBUG) << "Processing secondary dex path " << dex_path; in process_secondary_dex_dexopt()
1551 dex_path, instruction_set, oat_dir, oat_isa_dir, oat_path, error_msg)) { in process_secondary_dex_dexopt()
1563 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid, uid, storage_flag)) { in process_secondary_dex_dexopt()
1565 "Could not validate secondary dex path %s", dex_path.c_str()); in process_secondary_dex_dexopt()
1571 zip_fd.reset(open(dex_path.c_str(), O_RDONLY)); in process_secondary_dex_dexopt()
1588 if (!prepare_secondary_dex_oat_dir(dex_path, uid, instruction_set)) { in process_secondary_dex_dexopt()
1595 if (!maybe_open_oat_and_vdex_file(dex_path, in process_secondary_dex_dexopt()
1605 int profile_analysis_result = analyze_profiles(uid, pkgname, dex_path, in process_secondary_dex_dexopt()
1611 RunDexoptAnalyzer run_dexopt_analyzer(dex_path, in process_secondary_dex_dexopt()
1628 dex_path.c_str(), in process_secondary_dex_dexopt()
1635 bool success = process_secondary_dexoptanalyzer_result(dex_path, in process_secondary_dex_dexopt()
1643 LOG(DEBUG) << "Processed secondary dex file " << dex_path << " result=" << result; in process_secondary_dex_dexopt()
1657 *is_public_out = ((dexopt_flags & DEXOPT_PUBLIC) != 0) && is_file_public(dex_path); in process_secondary_dex_dexopt()
1662 static std::string format_dexopt_error(int status, const char* dex_path) { in format_dexopt_error() argument
1667 return StringPrintf("Dex2oat invocation for %s failed: %s", dex_path, code_name); in format_dexopt_error()
1670 return StringPrintf("Dex2oat invocation for %s failed with 0x%04x", dex_path, status); in format_dexopt_error()
1673 int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* instruction_set, in dexopt() argument
1684 if (!validate_dex_path_size(dex_path)) { in dexopt()
1685 *error_msg = StringPrintf("Failed to validate %s", dex_path); in dexopt()
1716 if (process_secondary_dex_dexopt(dex_path, pkgname, dexopt_flags, volume_uuid, uid, in dexopt()
1737 UniqueFile in_dex(open(dex_path, O_RDONLY, 0), dex_path); in dexopt()
1739 *error_msg = StringPrintf("installd cannot open '%s' for input during dexopt", dex_path); in dexopt()
1752 UniqueFile out_oat = open_oat_out_file(dex_path, oat_dir, is_public, uid, in dexopt()
1762 if (!open_vdex_files_for_dex2oat(dex_path, out_oat.path().c_str(), dexopt_needed, in dexopt()
1788 pkgname, dex_path, profile_name, profile_guided, is_public, uid, is_secondary_dex); in dexopt()
1828 LOG(VERBOSE) << "DexInv: --- BEGIN '" << dex_path << "' ---"; in dexopt()
1871 LOG(VERBOSE) << "DexInv: --- END '" << dex_path << "' (success) ---"; in dexopt()
1873 LOG(VERBOSE) << "DexInv: --- END '" << dex_path << "' --- status=0x" in dexopt()
1875 *error_msg = format_dexopt_error(res, dex_path); in dexopt()
1932 bool reconcile_secondary_dex_file(const std::string& dex_path, in reconcile_secondary_dex_file() argument
1956 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid_cstr, in reconcile_secondary_dex_file()
1959 "Could not validate secondary dex path %s", dex_path.c_str()); in reconcile_secondary_dex_file()
1963 SecondaryDexAccess access_check = check_secondary_dex_access(dex_path); in reconcile_secondary_dex_file()
1985 dex_path,isas[i], oat_dir, oat_isa_dir, oat_path, &error_msg)) { in reconcile_secondary_dex_file()
1997 multiuser_get_user_id(uid), pkgname, dex_path, /*is_secondary*/true); in reconcile_secondary_dex_file()
1999 pkgname, dex_path, /*is_secondary*/true); in reconcile_secondary_dex_file()
2005 std::string old_current_profile = dex_path + ".prof"; in reconcile_secondary_dex_file()
2014 "Could not validate secondary dex path %s", dex_path.c_str()); in reconcile_secondary_dex_file()
2021 LOG(WARNING) << "reconcile dex failed for location " << dex_path << ": " << return_code; in reconcile_secondary_dex_file()
2026 LOG(DEBUG) << "Reconcile secondary dex path " << dex_path << " result=" << return_code; in reconcile_secondary_dex_file()
2058 bool hash_secondary_dex_file(const std::string& dex_path, const std::string& pkgname, int uid, in hash_secondary_dex_file() argument
2086 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid_cstr, uid, storage_flag)) { in hash_secondary_dex_file()
2088 "Could not validate secondary dex path %s", dex_path.c_str()); in hash_secondary_dex_file()
2092 unique_fd fd(TEMP_FAILURE_RETRY(open(dex_path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW))); in hash_secondary_dex_file()
2098 PLOG(ERROR) << "Failed to open secondary dex " << dex_path; in hash_secondary_dex_file()
2100 "Failed to open secondary dex %s: %d", dex_path.c_str(), errno); in hash_secondary_dex_file()
2114 "Failed to read secondary dex %s: %d", dex_path.c_str(), errno); in hash_secondary_dex_file()