Merge up to android-8.1.0_r1 and fix conflicts
Change-Id: I2dc060134d15ec9f015a606cb24ef8276f6af1fc
This commit is contained in:
+17
-2
@@ -363,7 +363,11 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
|
||||
DataManager::SetProgress(0);
|
||||
|
||||
MemMapping map;
|
||||
#ifdef USE_MINZIP
|
||||
if (sysMapFile(path, &map) != 0) {
|
||||
#else
|
||||
if (!map.MapFile(path)) {
|
||||
#endif
|
||||
gui_msg(Msg(msg::kError, "fail_sysmap=Failed to map file '{1}'")(path));
|
||||
return -1;
|
||||
}
|
||||
@@ -377,6 +381,9 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
|
||||
if (!load_keys("/res/keys", loadedKeys)) {
|
||||
LOGINFO("Failed to load keys");
|
||||
gui_err("verify_zip_fail=Zip signature verification failed!");
|
||||
#ifdef USE_MINZIP
|
||||
sysReleaseMap(&map);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
ret_val = verify_file(map.addr, map.length, loadedKeys, std::bind(&DataManager::SetProgress, std::placeholders::_1));
|
||||
@@ -384,7 +391,9 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
|
||||
if (ret_val != VERIFY_SUCCESS) {
|
||||
LOGINFO("Zip signature verification failed: %i\n", ret_val);
|
||||
gui_err("verify_zip_fail=Zip signature verification failed!");
|
||||
#ifdef USE_MINZIP
|
||||
sysReleaseMap(&map);
|
||||
#endif
|
||||
return -1;
|
||||
} else {
|
||||
gui_msg("verify_zip_done=Zip signature verified successfully.");
|
||||
@@ -393,7 +402,9 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
|
||||
ZipWrap Zip;
|
||||
if (!Zip.Open(path, &map)) {
|
||||
gui_err("zip_corrupt=Zip file is corrupt!");
|
||||
sysReleaseMap(&map);
|
||||
#ifdef USE_MINZIP
|
||||
sysReleaseMap(&map);
|
||||
#endif
|
||||
return INSTALL_CORRUPT;
|
||||
}
|
||||
|
||||
@@ -404,8 +415,10 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
|
||||
// Additionally verify the compatibility of the package.
|
||||
if (!verify_package_compatibility(&Zip)) {
|
||||
gui_err("zip_compatible_err=Zip Treble compatibility error!");
|
||||
sysReleaseMap(&map);
|
||||
Zip.Close();
|
||||
#ifdef USE_MINZIP
|
||||
sysReleaseMap(&map);
|
||||
#endif
|
||||
ret_val = INSTALL_CORRUPT;
|
||||
} else {
|
||||
ret_val = Prepare_Update_Binary(path, &Zip, wipe_cache);
|
||||
@@ -433,6 +446,8 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
|
||||
} else {
|
||||
LOGINFO("Install took %i second(s).\n", total_time);
|
||||
}
|
||||
#ifdef USE_MINZIP
|
||||
sysReleaseMap(&map);
|
||||
#endif
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user