Lines Matching refs:dex_path
990 static bool validate_dex_path_size(const std::string& dex_path) { in validate_dex_path_size() argument
991 if (dex_path.size() >= (PKG_PATH_MAX - 8)) { in validate_dex_path_size()
992 LOG(ERROR) << "dex_path too long: " << dex_path; in validate_dex_path_size()
1084 const std::string& dex_path, const char* profile_name, bool profile_guided, in maybe_open_reference_profile() argument
1107 location = dex_path; in maybe_open_reference_profile()
1342 static bool prepare_secondary_dex_oat_dir(const std::string& dex_path, int uid, in prepare_secondary_dex_oat_dir() argument
1344 unsigned long dirIndex = dex_path.rfind('/'); in prepare_secondary_dex_oat_dir()
1346 LOG(ERROR ) << "Unexpected dir structure for secondary dex " << dex_path; in prepare_secondary_dex_oat_dir()
1349 std::string dex_dir = dex_path.substr(0, dirIndex); in prepare_secondary_dex_oat_dir()
1354 LOG(ERROR) << "Could not prepare oat dir for secondary dex: " << dex_path; in prepare_secondary_dex_oat_dir()
1362 LOG(ERROR) << "Could not prepare oat/isa dir for secondary dex: " << dex_path; in prepare_secondary_dex_oat_dir()
1390 static bool process_secondary_dexoptanalyzer_result(const std::string& dex_path, int result, in process_secondary_dexoptanalyzer_result() argument
1407 dex_path.c_str(), in process_secondary_dexoptanalyzer_result()
1437 dex_path.c_str(), in process_secondary_dexoptanalyzer_result()
1449 static SecondaryDexAccess check_secondary_dex_access(const std::string& dex_path) { in check_secondary_dex_access() argument
1451 if (access(dex_path.c_str(), R_OK) == 0) { in check_secondary_dex_access()
1456 "Secondary dex does not exist: %s", dex_path.c_str()); in check_secondary_dex_access()
1460 "Could not access secondary dex: %s (%d)", dex_path.c_str(), errno); in check_secondary_dex_access()
1478 static bool create_secondary_dex_oat_layout(const std::string& dex_path, const std::string& isa, in create_secondary_dex_oat_layout() argument
1480 size_t dirIndex = dex_path.rfind('/'); in create_secondary_dex_oat_layout()
1482 *error_msg = std::string("Unexpected dir structure for dex file ").append(dex_path); in create_secondary_dex_oat_layout()
1488 std::string apk_dir = dex_path.substr(0, dirIndex); in create_secondary_dex_oat_layout()
1492 if (!create_oat_out_path(dex_path.c_str(), isa.c_str(), out_oat_dir, in create_secondary_dex_oat_layout()
1494 *error_msg = std::string("Could not create oat path for secondary dex ").append(dex_path); in create_secondary_dex_oat_layout()
1580 for (const std::string& dex_path : dex_paths) { in open_dex_paths() local
1581 zip_fds->emplace_back(open(dex_path.c_str(), O_RDONLY)); in open_dex_paths()
1584 "installd cannot open '%s' for input during dexopt", dex_path.c_str()); in open_dex_paths()
1633 static SecondaryDexOptProcessResult process_secondary_dex_dexopt(const std::string& dex_path, in process_secondary_dex_dexopt() argument
1639 LOG(DEBUG) << "Processing secondary dex path " << dex_path; in process_secondary_dex_dexopt()
1655 dex_path, instruction_set, oat_dir, oat_isa_dir, oat_path, error_msg)) { in process_secondary_dex_dexopt()
1671 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid, uid, storage_flag)) { in process_secondary_dex_dexopt()
1673 "Could not validate secondary dex path %s", dex_path.c_str()); in process_secondary_dex_dexopt()
1679 zip_fd.reset(open(dex_path.c_str(), O_RDONLY)); in process_secondary_dex_dexopt()
1696 if (!prepare_secondary_dex_oat_dir(dex_path, uid, instruction_set)) { in process_secondary_dex_dexopt()
1703 if (!maybe_open_oat_and_vdex_file(dex_path, in process_secondary_dex_dexopt()
1713 int profile_analysis_result = analyze_profiles(uid, pkgname, dex_path, in process_secondary_dex_dexopt()
1719 RunDexoptAnalyzer run_dexopt_analyzer(dex_path, in process_secondary_dex_dexopt()
1737 LOG(INFO) << "dexoptanalyzer cancelled for path:" << dex_path; in process_secondary_dex_dexopt()
1741 dex_path.c_str(), in process_secondary_dex_dexopt()
1748 bool success = process_secondary_dexoptanalyzer_result(dex_path, in process_secondary_dex_dexopt()
1756 LOG(DEBUG) << "Processed secondary dex file " << dex_path << " result=" << result; in process_secondary_dex_dexopt()
1770 *is_public_out = ((dexopt_flags & DEXOPT_PUBLIC) != 0) && is_file_public(dex_path); in process_secondary_dex_dexopt()
1775 static std::string format_dexopt_error(int status, const char* dex_path) { in format_dexopt_error() argument
1780 return StringPrintf("Dex2oat invocation for %s failed: %s", dex_path, code_name); in format_dexopt_error()
1783 return StringPrintf("Dex2oat invocation for %s failed with 0x%04x", dex_path, status); in format_dexopt_error()
1787 int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* instruction_set, in dexopt() argument
1809 if (!validate_dex_path_size(dex_path)) { in dexopt()
1810 *error_msg = StringPrintf("Failed to validate %s", dex_path); in dexopt()
1840 SecondaryDexOptProcessResult sec_dex_result = process_secondary_dex_dexopt(dex_path, in dexopt()
1868 UniqueFile in_dex(open(dex_path, O_RDONLY, 0), dex_path); in dexopt()
1870 *error_msg = StringPrintf("installd cannot open '%s' for input during dexopt", dex_path); in dexopt()
1884 open_oat_out_file(dex_path, oat_dir, is_public, uid, instruction_set, is_secondary_dex); in dexopt()
1893 if (!open_vdex_files_for_dex2oat(dex_path, out_oat.path().c_str(), dexopt_needed, in dexopt()
1919 pkgname, dex_path, profile_name, profile_guided, is_public, uid, is_secondary_dex); in dexopt()
1961 LOG(VERBOSE) << "DexInv: --- BEGIN '" << dex_path << "' ---"; in dexopt()
1997 LOG(VERBOSE) << "DexInv: --- END '" << dex_path << "' (success) ---"; in dexopt()
2000 LOG(VERBOSE) << "DexInv: --- END '" << dex_path << "' --- cancelled"; in dexopt()
2006 LOG(VERBOSE) << "DexInv: --- END '" << dex_path << "' --- status=0x" in dexopt()
2008 *error_msg = format_dexopt_error(res, dex_path); in dexopt()
2096 bool reconcile_secondary_dex_file(const std::string& dex_path, in reconcile_secondary_dex_file() argument
2120 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid_cstr, in reconcile_secondary_dex_file()
2123 "Could not validate secondary dex path %s", dex_path.c_str()); in reconcile_secondary_dex_file()
2127 SecondaryDexAccess access_check = check_secondary_dex_access(dex_path); in reconcile_secondary_dex_file()
2149 dex_path,isas[i], oat_dir, oat_isa_dir, oat_path, &error_msg)) { in reconcile_secondary_dex_file()
2161 multiuser_get_user_id(uid), pkgname, dex_path, /*is_secondary*/true); in reconcile_secondary_dex_file()
2163 pkgname, dex_path, /*is_secondary*/true); in reconcile_secondary_dex_file()
2169 std::string old_current_profile = dex_path + ".prof"; in reconcile_secondary_dex_file()
2178 "Could not validate secondary dex path %s", dex_path.c_str()); in reconcile_secondary_dex_file()
2185 LOG(WARNING) << "reconcile dex failed for location " << dex_path << ": " << return_code; in reconcile_secondary_dex_file()
2190 LOG(DEBUG) << "Reconcile secondary dex path " << dex_path << " result=" << return_code; in reconcile_secondary_dex_file()
2222 bool hash_secondary_dex_file(const std::string& dex_path, const std::string& pkgname, int uid, in hash_secondary_dex_file() argument
2250 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid_cstr, uid, storage_flag)) { in hash_secondary_dex_file()
2252 "Could not validate secondary dex path %s", dex_path.c_str()); in hash_secondary_dex_file()
2256 unique_fd fd(TEMP_FAILURE_RETRY(open(dex_path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW))); in hash_secondary_dex_file()
2262 PLOG(ERROR) << "Failed to open secondary dex " << dex_path; in hash_secondary_dex_file()
2264 "Failed to open secondary dex %s: %d", dex_path.c_str(), errno); in hash_secondary_dex_file()
2278 "Failed to read secondary dex %s: %d", dex_path.c_str(), errno); in hash_secondary_dex_file()