Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aaa1d4e9 authored by David Brazdil's avatar David Brazdil
Browse files

installd: Run dex2oat with relative path to the APK

Previous CL (I6aaddffe79c55b9a6560c2d6542cf87abbd4fb11) started
passing the absolute path of an APK to dex2oat. This renders APKs
dexopted while in a temporary folder during install out-of-date when
moved to the final location.

Bug: 26409579
Change-Id: Icccf2d1bb34e2d5f4d98efae3c8f5609784abafd
parent 3a5ecd84
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1194,7 +1194,14 @@ int dexopt(const char* apk_path, uid_t uid, const char* pkgname, const char* ins
            || dexopt_needed == DEXOPT_SELF_PATCHOAT_NEEDED) {
            run_patchoat(input_fd, out_fd, input_file, out_path, pkgname, instruction_set);
        } else if (dexopt_needed == DEXOPT_DEX2OAT_NEEDED) {
            run_dex2oat(input_fd, out_fd, image_fd, input_file, out_path, swap_fd,
            // Pass dex2oat the relative path to the input file.
            const char *input_file_name = strrchr(input_file, '/');
            if (input_file_name == NULL) {
                input_file_name = input_file;
            } else {
                input_file_name++;
            }
            run_dex2oat(input_fd, out_fd, image_fd, input_file_name, out_path, swap_fd,
                        instruction_set, vm_safe_mode, debuggable, boot_complete, extract_only,
                        profile_files_fd, reference_profile_files_fd);
        } else {