Lines Matching refs:dex_path
1188 static bool validate_dex_path_size(const std::string& dex_path) { in validate_dex_path_size() argument
1189 if (dex_path.size() >= (PKG_PATH_MAX - 8)) { in validate_dex_path_size()
1190 LOG(ERROR) << "dex_path too long: " << dex_path; in validate_dex_path_size()
1393 const std::string& dex_path, const char* profile_name, bool profile_guided, in maybe_open_reference_profile() argument
1416 location = dex_path; in maybe_open_reference_profile()
1680 static bool prepare_secondary_dex_oat_dir(const std::string& dex_path, int uid, in prepare_secondary_dex_oat_dir() argument
1682 unsigned long dirIndex = dex_path.rfind('/'); in prepare_secondary_dex_oat_dir()
1684 LOG(ERROR ) << "Unexpected dir structure for secondary dex " << dex_path; in prepare_secondary_dex_oat_dir()
1687 std::string dex_dir = dex_path.substr(0, dirIndex); in prepare_secondary_dex_oat_dir()
1692 LOG(ERROR) << "Could not prepare oat dir for secondary dex: " << dex_path; in prepare_secondary_dex_oat_dir()
1700 LOG(ERROR) << "Could not prepare oat/isa dir for secondary dex: " << dex_path; in prepare_secondary_dex_oat_dir()
1728 static bool process_secondary_dexoptanalyzer_result(const std::string& dex_path, int result, in process_secondary_dexoptanalyzer_result() argument
1745 dex_path.c_str(), in process_secondary_dexoptanalyzer_result()
1775 dex_path.c_str(), in process_secondary_dexoptanalyzer_result()
1787 static SecondaryDexAccess check_secondary_dex_access(const std::string& dex_path) { in check_secondary_dex_access() argument
1789 if (access(dex_path.c_str(), R_OK) == 0) { in check_secondary_dex_access()
1793 LOG(INFO) << "Secondary dex does not exist: " << dex_path; in check_secondary_dex_access()
1796 PLOG(ERROR) << "Could not access secondary dex " << dex_path; in check_secondary_dex_access()
1814 static bool create_secondary_dex_oat_layout(const std::string& dex_path, const std::string& isa, in create_secondary_dex_oat_layout() argument
1816 size_t dirIndex = dex_path.rfind('/'); in create_secondary_dex_oat_layout()
1818 *error_msg = std::string("Unexpected dir structure for dex file ").append(dex_path); in create_secondary_dex_oat_layout()
1824 std::string apk_dir = dex_path.substr(0, dirIndex); in create_secondary_dex_oat_layout()
1828 if (!create_oat_out_path(dex_path.c_str(), isa.c_str(), out_oat_dir, in create_secondary_dex_oat_layout()
1830 *error_msg = std::string("Could not create oat path for secondary dex ").append(dex_path); in create_secondary_dex_oat_layout()
1916 for (const std::string& dex_path : dex_paths) { in open_dex_paths() local
1917 zip_fds->emplace_back(open(dex_path.c_str(), O_RDONLY)); in open_dex_paths()
1920 "installd cannot open '%s' for input during dexopt", dex_path.c_str()); in open_dex_paths()
1952 static bool process_secondary_dex_dexopt(const std::string& dex_path, const char* pkgname, in process_secondary_dex_dexopt() argument
1957 LOG(DEBUG) << "Processing secondary dex path " << dex_path; in process_secondary_dex_dexopt()
1968 dex_path, instruction_set, oat_dir, oat_isa_dir, oat_path, error_msg)) { in process_secondary_dex_dexopt()
1980 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid, uid, storage_flag)) { in process_secondary_dex_dexopt()
1981 LOG(ERROR) << "Could not validate secondary dex path " << dex_path; in process_secondary_dex_dexopt()
1987 zip_fd.reset(open(dex_path.c_str(), O_RDONLY)); in process_secondary_dex_dexopt()
2004 if (!prepare_secondary_dex_oat_dir(dex_path, uid, instruction_set)) { in process_secondary_dex_dexopt()
2011 if (!maybe_open_oat_and_vdex_file(dex_path, in process_secondary_dex_dexopt()
2021 bool profile_was_updated = analyze_profiles(uid, pkgname, dex_path, in process_secondary_dex_dexopt()
2027 RunDexoptAnalyzer run_dexopt_analyzer(dex_path, in process_secondary_dex_dexopt()
2043 dex_path.c_str(), in process_secondary_dex_dexopt()
2050 bool success = process_secondary_dexoptanalyzer_result(dex_path, in process_secondary_dex_dexopt()
2058 LOG(DEBUG) << "Processed secondary dex file " << dex_path << " result=" << result; in process_secondary_dex_dexopt()
2072 *is_public_out = ((dexopt_flags & DEXOPT_PUBLIC) != 0) && is_file_public(dex_path); in process_secondary_dex_dexopt()
2077 static std::string format_dexopt_error(int status, const char* dex_path) { in format_dexopt_error() argument
2082 return StringPrintf("Dex2oat invocation for %s failed: %s", dex_path, code_name); in format_dexopt_error()
2085 return StringPrintf("Dex2oat invocation for %s failed with 0x%04x", dex_path, status); in format_dexopt_error()
2088 int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* instruction_set, in dexopt() argument
2099 if (!validate_dex_path_size(dex_path)) { in dexopt()
2100 *error_msg = StringPrintf("Failed to validate %s", dex_path); in dexopt()
2131 if (process_secondary_dex_dexopt(dex_path, pkgname, dexopt_flags, volume_uuid, uid, in dexopt()
2152 unique_fd input_fd(open(dex_path, O_RDONLY, 0)); in dexopt()
2154 *error_msg = StringPrintf("installd cannot open '%s' for input during dexopt", dex_path); in dexopt()
2168 Dex2oatFileWrapper out_oat_fd = open_oat_out_file(dex_path, oat_dir, is_public, uid, in dexopt()
2178 if (!open_vdex_files_for_dex2oat(dex_path, out_oat_path, dexopt_needed, instruction_set, in dexopt()
2203 pkgname, dex_path, profile_name, profile_guided, is_public, uid, is_secondary_dex); in dexopt()
2223 LOG(VERBOSE) << "DexInv: --- BEGIN '" << dex_path << "' ---"; in dexopt()
2230 dex_path, in dexopt()
2263 LOG(VERBOSE) << "DexInv: --- END '" << dex_path << "' (success) ---"; in dexopt()
2265 LOG(VERBOSE) << "DexInv: --- END '" << dex_path << "' --- status=0x" in dexopt()
2267 *error_msg = format_dexopt_error(res, dex_path); in dexopt()
2272 update_out_oat_access_times(dex_path, out_oat_path); in dexopt()
2326 bool reconcile_secondary_dex_file(const std::string& dex_path, in reconcile_secondary_dex_file() argument
2350 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid_cstr, in reconcile_secondary_dex_file()
2352 LOG(ERROR) << "Could not validate secondary dex path " << dex_path; in reconcile_secondary_dex_file()
2356 SecondaryDexAccess access_check = check_secondary_dex_access(dex_path); in reconcile_secondary_dex_file()
2377 dex_path,isas[i], oat_dir, oat_isa_dir, oat_path, &error_msg)) { in reconcile_secondary_dex_file()
2389 multiuser_get_user_id(uid), pkgname, dex_path, /*is_secondary*/true); in reconcile_secondary_dex_file()
2391 pkgname, dex_path, /*is_secondary*/true); in reconcile_secondary_dex_file()
2397 std::string old_current_profile = dex_path + ".prof"; in reconcile_secondary_dex_file()
2405 PLOG(ERROR) << "Failed to clean secondary dex artifacts for location " << dex_path; in reconcile_secondary_dex_file()
2412 LOG(WARNING) << "reconcile dex failed for location " << dex_path << ": " << return_code; in reconcile_secondary_dex_file()
2417 LOG(DEBUG) << "Reconcile secondary dex path " << dex_path << " result=" << return_code; in reconcile_secondary_dex_file()
2449 bool hash_secondary_dex_file(const std::string& dex_path, const std::string& pkgname, int uid, in hash_secondary_dex_file() argument
2477 if (!validate_secondary_dex_path(pkgname, dex_path, volume_uuid_cstr, uid, storage_flag)) { in hash_secondary_dex_file()
2478 LOG(ERROR) << "Could not validate secondary dex path " << dex_path; in hash_secondary_dex_file()
2482 unique_fd fd(TEMP_FAILURE_RETRY(open(dex_path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW))); in hash_secondary_dex_file()
2488 PLOG(ERROR) << "Failed to open secondary dex " << dex_path; in hash_secondary_dex_file()
2501 PLOG(ERROR) << "Failed to read secondary dex " << dex_path; in hash_secondary_dex_file()