Dees Troy | 3be70a8 | 2013-10-22 14:25:12 +0000 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2012 bigbiff/Dees_Troy TeamWin |
| 3 | This file is part of TWRP/TeamWin Recovery Project. |
| 4 | |
| 5 | TWRP is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by |
| 7 | the Free Software Foundation, either version 3 of the License, or |
| 8 | (at your option) any later version. |
| 9 | |
| 10 | TWRP is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with TWRP. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 18 | |
| 19 | #include <ctype.h> |
| 20 | #include <errno.h> |
| 21 | #include <fcntl.h> |
| 22 | #include <limits.h> |
| 23 | #include <sys/stat.h> |
| 24 | #include <sys/wait.h> |
| 25 | #include <unistd.h> |
| 26 | |
| 27 | #include <string.h> |
| 28 | #include <stdio.h> |
| 29 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 30 | #include "twcommon.h" |
Dees_Troy | b9d88ac | 2012-09-14 14:34:19 -0400 | [diff] [blame] | 31 | #include "mincrypt/rsa.h" |
| 32 | #include "mincrypt/sha.h" |
Ethan Yonker | 75bf041 | 2014-11-21 13:54:27 -0600 | [diff] [blame] | 33 | #include "mtdutils/mounts.h" |
| 34 | #include "mtdutils/mtdutils.h" |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 35 | #include "minzip/SysUtil.h" |
| 36 | #include "minzip/Zip.h" |
Ethan Yonker | 75bf041 | 2014-11-21 13:54:27 -0600 | [diff] [blame] | 37 | #include "verifier.h" |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 38 | #include "variables.h" |
| 39 | #include "data.hpp" |
| 40 | #include "partitions.hpp" |
bigbiff bigbiff | cdcfee4 | 2013-02-27 21:11:26 -0500 | [diff] [blame] | 41 | #include "twrpDigest.hpp" |
Dees_Troy | 38bd760 | 2012-09-14 13:33:53 -0400 | [diff] [blame] | 42 | #include "twrp-functions.hpp" |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 43 | extern "C" { |
| 44 | #include "gui/gui.h" |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 45 | #include "legacy_property_service.h" |
| 46 | } |
| 47 | |
| 48 | static const char* properties_path = "/dev/__properties__"; |
| 49 | static const char* properties_path_renamed = "/dev/__properties_kk__"; |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 50 | static bool legacy_props_env_initd = false; |
| 51 | static bool legacy_props_path_modified = false; |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 52 | |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 53 | static int switch_to_legacy_properties() |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 54 | { |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 55 | if (!legacy_props_env_initd) { |
| 56 | if (legacy_properties_init() != 0) |
| 57 | return -1; |
| 58 | |
| 59 | char tmp[32]; |
| 60 | int propfd, propsz; |
| 61 | legacy_get_property_workspace(&propfd, &propsz); |
| 62 | sprintf(tmp, "%d,%d", dup(propfd), propsz); |
| 63 | setenv("ANDROID_PROPERTY_WORKSPACE", tmp, 1); |
| 64 | legacy_props_env_initd = true; |
| 65 | } |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 66 | |
| 67 | if (TWFunc::Path_Exists(properties_path)) { |
| 68 | // hide real properties so that the updater uses the envvar to find the legacy format properties |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 69 | if (rename(properties_path, properties_path_renamed) != 0) { |
| 70 | LOGERR("Renaming %s failed: %s\n", properties_path, strerror(errno)); |
| 71 | return -1; |
| 72 | } else { |
| 73 | legacy_props_path_modified = true; |
| 74 | } |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 75 | } |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 76 | |
| 77 | return 0; |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 78 | } |
| 79 | |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 80 | static int switch_to_new_properties() |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 81 | { |
| 82 | if (TWFunc::Path_Exists(properties_path_renamed)) { |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 83 | if (rename(properties_path_renamed, properties_path) != 0) { |
| 84 | LOGERR("Renaming %s failed: %s\n", properties_path_renamed, strerror(errno)); |
| 85 | return -1; |
| 86 | } else { |
| 87 | legacy_props_path_modified = false; |
| 88 | } |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 89 | } |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 90 | |
| 91 | return 0; |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 92 | } |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 93 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 94 | static int Run_Update_Binary(const char *path, ZipArchive *Zip, int* wipe_cache) { |
| 95 | const ZipEntry* binary_location = mzFindZipEntry(Zip, ASSUMED_UPDATE_BINARY_NAME); |
| 96 | string Temp_Binary = "/tmp/updater"; |
| 97 | int binary_fd, ret_val, pipe_fd[2], status, zip_verify; |
| 98 | char buffer[1024]; |
| 99 | const char** args = (const char**)malloc(sizeof(char*) * 5); |
| 100 | FILE* child_data; |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 101 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 102 | if (binary_location == NULL) { |
| 103 | mzCloseZipArchive(Zip); |
| 104 | return INSTALL_CORRUPT; |
| 105 | } |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 106 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 107 | // Delete any existing updater |
| 108 | if (TWFunc::Path_Exists(Temp_Binary) && unlink(Temp_Binary.c_str()) != 0) { |
| 109 | LOGINFO("Unable to unlink '%s'\n", Temp_Binary.c_str()); |
| 110 | } |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 111 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 112 | binary_fd = creat(Temp_Binary.c_str(), 0755); |
| 113 | if (binary_fd < 0) { |
| 114 | mzCloseZipArchive(Zip); |
| 115 | LOGERR("Could not create file for updater extract in '%s'\n", Temp_Binary.c_str()); |
| 116 | return INSTALL_ERROR; |
| 117 | } |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 118 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 119 | ret_val = mzExtractZipEntryToFile(Zip, binary_location, binary_fd); |
| 120 | close(binary_fd); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 121 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 122 | if (!ret_val) { |
Dees_Troy | 512376c | 2013-09-03 19:39:41 +0000 | [diff] [blame] | 123 | mzCloseZipArchive(Zip); |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 124 | LOGERR("Could not extract '%s'\n", ASSUMED_UPDATE_BINARY_NAME); |
| 125 | return INSTALL_ERROR; |
| 126 | } |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 127 | |
Dees_Troy | 512376c | 2013-09-03 19:39:41 +0000 | [diff] [blame] | 128 | // If exists, extract file_contexts from the zip file |
| 129 | const ZipEntry* selinx_contexts = mzFindZipEntry(Zip, "file_contexts"); |
| 130 | if (selinx_contexts == NULL) { |
| 131 | mzCloseZipArchive(Zip); |
| 132 | LOGINFO("Zip does not contain SELinux file_contexts file in its root.\n"); |
| 133 | } else { |
| 134 | string output_filename = "/file_contexts"; |
| 135 | LOGINFO("Zip contains SELinux file_contexts file in its root. Extracting to %s\n", output_filename.c_str()); |
| 136 | // Delete any file_contexts |
| 137 | if (TWFunc::Path_Exists(output_filename) && unlink(output_filename.c_str()) != 0) { |
| 138 | LOGINFO("Unable to unlink '%s'\n", output_filename.c_str()); |
| 139 | } |
| 140 | |
| 141 | int file_contexts_fd = creat(output_filename.c_str(), 0644); |
| 142 | if (file_contexts_fd < 0) { |
| 143 | mzCloseZipArchive(Zip); |
| 144 | LOGERR("Could not extract file_contexts to '%s'\n", output_filename.c_str()); |
| 145 | return INSTALL_ERROR; |
| 146 | } |
| 147 | |
| 148 | ret_val = mzExtractZipEntryToFile(Zip, selinx_contexts, file_contexts_fd); |
| 149 | close(file_contexts_fd); |
| 150 | |
| 151 | if (!ret_val) { |
| 152 | mzCloseZipArchive(Zip); |
| 153 | LOGERR("Could not extract '%s'\n", ASSUMED_UPDATE_BINARY_NAME); |
| 154 | return INSTALL_ERROR; |
| 155 | } |
| 156 | } |
| 157 | mzCloseZipArchive(Zip); |
| 158 | |
Matt Mower | 6883d73 | 2014-03-20 17:28:13 -0500 | [diff] [blame] | 159 | #ifndef TW_NO_LEGACY_PROPS |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 160 | /* Set legacy properties */ |
| 161 | if (switch_to_legacy_properties() != 0) { |
| 162 | LOGERR("Legacy property environment did not initialize successfully. Properties may not be detected.\n"); |
| 163 | } else { |
| 164 | LOGINFO("Legacy property environment initialized.\n"); |
| 165 | } |
Matt Mower | 6883d73 | 2014-03-20 17:28:13 -0500 | [diff] [blame] | 166 | #endif |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 167 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 168 | pipe(pipe_fd); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 169 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 170 | args[0] = Temp_Binary.c_str(); |
| 171 | args[1] = EXPAND(RECOVERY_API_VERSION); |
| 172 | char* temp = (char*)malloc(10); |
| 173 | sprintf(temp, "%d", pipe_fd[1]); |
| 174 | args[2] = temp; |
| 175 | args[3] = (char*)path; |
| 176 | args[4] = NULL; |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 177 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 178 | pid_t pid = fork(); |
| 179 | if (pid == 0) { |
| 180 | close(pipe_fd[0]); |
that | 7e303cf | 2014-03-06 07:57:43 +0100 | [diff] [blame] | 181 | execve(Temp_Binary.c_str(), (char* const*)args, environ); |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 182 | printf("E:Can't execute '%s'\n", Temp_Binary.c_str()); |
| 183 | _exit(-1); |
| 184 | } |
| 185 | close(pipe_fd[1]); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 186 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 187 | *wipe_cache = 0; |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 188 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 189 | DataManager::GetValue(TW_SIGNED_ZIP_VERIFY_VAR, zip_verify); |
| 190 | child_data = fdopen(pipe_fd[0], "r"); |
| 191 | while (fgets(buffer, sizeof(buffer), child_data) != NULL) { |
| 192 | char* command = strtok(buffer, " \n"); |
Vojtech Bocek | fafb0c5 | 2013-07-25 22:53:02 +0200 | [diff] [blame] | 193 | if (command == NULL) { |
| 194 | continue; |
| 195 | } else if (strcmp(command, "progress") == 0) { |
| 196 | char* fraction_char = strtok(NULL, " \n"); |
| 197 | char* seconds_char = strtok(NULL, " \n"); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 198 | |
Vojtech Bocek | fafb0c5 | 2013-07-25 22:53:02 +0200 | [diff] [blame] | 199 | float fraction_float = strtof(fraction_char, NULL); |
| 200 | int seconds_float = strtol(seconds_char, NULL, 10); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 201 | |
Vojtech Bocek | fafb0c5 | 2013-07-25 22:53:02 +0200 | [diff] [blame] | 202 | if (zip_verify) |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 203 | DataManager::ShowProgress(fraction_float * (1 - VERIFICATION_PROGRESS_FRACTION), seconds_float); |
| 204 | else |
| 205 | DataManager::ShowProgress(fraction_float, seconds_float); |
Vojtech Bocek | fafb0c5 | 2013-07-25 22:53:02 +0200 | [diff] [blame] | 206 | } else if (strcmp(command, "set_progress") == 0) { |
| 207 | char* fraction_char = strtok(NULL, " \n"); |
| 208 | float fraction_float = strtof(fraction_char, NULL); |
| 209 | DataManager::SetProgress(fraction_float); |
| 210 | } else if (strcmp(command, "ui_print") == 0) { |
| 211 | char* display_value = strtok(NULL, "\n"); |
| 212 | if (display_value) { |
| 213 | gui_print("%s", display_value); |
| 214 | } else { |
| 215 | gui_print("\n"); |
| 216 | } |
| 217 | } else if (strcmp(command, "wipe_cache") == 0) { |
| 218 | *wipe_cache = 1; |
| 219 | } else if (strcmp(command, "clear_display") == 0) { |
| 220 | // Do nothing, not supported by TWRP |
| 221 | } else { |
| 222 | LOGERR("unknown command [%s]\n", command); |
| 223 | } |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 224 | } |
| 225 | fclose(child_data); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 226 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 227 | waitpid(pid, &status, 0); |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 228 | |
Matt Mower | 6883d73 | 2014-03-20 17:28:13 -0500 | [diff] [blame] | 229 | #ifndef TW_NO_LEGACY_PROPS |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 230 | /* Unset legacy properties */ |
| 231 | if (legacy_props_path_modified) { |
| 232 | if (switch_to_new_properties() != 0) { |
| 233 | LOGERR("Legacy property environment did not disable successfully. Legacy properties may still be in use.\n"); |
| 234 | } else { |
| 235 | LOGINFO("Legacy property environment disabled.\n"); |
| 236 | } |
| 237 | } |
Matt Mower | 6883d73 | 2014-03-20 17:28:13 -0500 | [diff] [blame] | 238 | #endif |
Matt Mower | cdd3b33 | 2014-03-27 14:38:48 -0500 | [diff] [blame] | 239 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 240 | if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { |
| 241 | LOGERR("Error executing updater binary in zip '%s'\n", path); |
| 242 | return INSTALL_ERROR; |
| 243 | } |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 244 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 245 | return INSTALL_SUCCESS; |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 246 | } |
| 247 | |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 248 | extern "C" int TWinstall_zip(const char* path, int* wipe_cache) { |
Ethan Yonker | d5801c5 | 2014-04-14 08:59:35 -0500 | [diff] [blame] | 249 | int ret_val, zip_verify = 1, md5_return, key_count; |
bigbiff bigbiff | cdcfee4 | 2013-02-27 21:11:26 -0500 | [diff] [blame] | 250 | twrpDigest md5sum; |
| 251 | string strpath = path; |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 252 | ZipArchive Zip; |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 253 | |
Ethan Yonker | 2481342 | 2014-11-07 17:19:07 -0600 | [diff] [blame] | 254 | if (strcmp(path, "error") == 0) { |
| 255 | LOGERR("Failed to get adb sideload file: '%s'\n", path); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 256 | return INSTALL_CORRUPT; |
Matt Mower | d5c1a92 | 2014-04-15 12:50:58 -0500 | [diff] [blame] | 257 | } |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 258 | |
Ethan Yonker | 2481342 | 2014-11-07 17:19:07 -0600 | [diff] [blame] | 259 | gui_print("Installing '%s'...\n", path); |
| 260 | if (strlen(path) < 9 || strncmp(path, "/sideload", 9) != 0) { |
| 261 | gui_print("Checking for MD5 file...\n"); |
| 262 | md5sum.setfn(strpath); |
| 263 | md5_return = md5sum.verify_md5digest(); |
| 264 | if (md5_return == -2) { // md5 did not match |
| 265 | LOGERR("Aborting zip install\n"); |
| 266 | return INSTALL_CORRUPT; |
| 267 | } |
| 268 | } |
| 269 | |
Ethan Yonker | d5801c5 | 2014-04-14 08:59:35 -0500 | [diff] [blame] | 270 | #ifndef TW_OEM_BUILD |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 271 | DataManager::GetValue(TW_SIGNED_ZIP_VERIFY_VAR, zip_verify); |
Ethan Yonker | d5801c5 | 2014-04-14 08:59:35 -0500 | [diff] [blame] | 272 | #endif |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 273 | DataManager::SetProgress(0); |
Ethan Yonker | f96087e | 2014-11-07 10:38:51 -0600 | [diff] [blame] | 274 | |
| 275 | MemMapping map; |
| 276 | if (sysMapFile(path, &map) != 0) { |
| 277 | LOGERR("Failed to sysMapFile '%s'\n", path); |
| 278 | return -1; |
| 279 | } |
| 280 | |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 281 | if (zip_verify) { |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 282 | gui_print("Verifying zip signature...\n"); |
Ethan Yonker | f96087e | 2014-11-07 10:38:51 -0600 | [diff] [blame] | 283 | ret_val = verify_file(map.addr, map.length); |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 284 | if (ret_val != VERIFY_SUCCESS) { |
| 285 | LOGERR("Zip signature verification failed: %i\n", ret_val); |
Ethan Yonker | f9796a4 | 2014-11-08 07:28:03 -0600 | [diff] [blame] | 286 | sysReleaseMap(&map); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 287 | return -1; |
Ethan Yonker | 738be7a | 2014-12-10 11:40:43 -0600 | [diff] [blame] | 288 | } else { |
| 289 | gui_print("Zip signature verified successfully.\n"); |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 290 | } |
| 291 | } |
Ethan Yonker | f96087e | 2014-11-07 10:38:51 -0600 | [diff] [blame] | 292 | ret_val = mzOpenZipArchive(map.addr, map.length, &Zip); |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 293 | if (ret_val != 0) { |
| 294 | LOGERR("Zip file is corrupt!\n", path); |
Ethan Yonker | f9796a4 | 2014-11-08 07:28:03 -0600 | [diff] [blame] | 295 | sysReleaseMap(&map); |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 296 | return INSTALL_CORRUPT; |
| 297 | } |
Ethan Yonker | f9796a4 | 2014-11-08 07:28:03 -0600 | [diff] [blame] | 298 | ret_val = Run_Update_Binary(path, &Zip, wipe_cache); |
| 299 | sysReleaseMap(&map); |
| 300 | return ret_val; |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 301 | } |