summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-02-11 23:49:19 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-02-11 23:49:44 +0100
commitaee144c32207a27e2c6f54639101b5828da713d8 (patch)
tree66f13972ec956bb60f15e54450c4550d947dba80
parentFix handling of GGLContext in res_scale_surface (diff)
downloadandroid_bootable_recovery-aee144c32207a27e2c6f54639101b5828da713d8.tar
android_bootable_recovery-aee144c32207a27e2c6f54639101b5828da713d8.tar.gz
android_bootable_recovery-aee144c32207a27e2c6f54639101b5828da713d8.tar.bz2
android_bootable_recovery-aee144c32207a27e2c6f54639101b5828da713d8.tar.lz
android_bootable_recovery-aee144c32207a27e2c6f54639101b5828da713d8.tar.xz
android_bootable_recovery-aee144c32207a27e2c6f54639101b5828da713d8.tar.zst
android_bootable_recovery-aee144c32207a27e2c6f54639101b5828da713d8.zip
-rw-r--r--openrecoveryscript.cpp57
1 files changed, 33 insertions, 24 deletions
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index d28f76202..9b71ee75c 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -437,34 +437,43 @@ int OpenRecoveryScript::Install_Command(string Zip) {
std::vector<PartitionList> Storage_List;
string Full_Path;
- PartitionManager.Mount_All_Storage();
- PartitionManager.Get_Partition_List("storage", &Storage_List);
- int listSize = Storage_List.size();
- for (int i = 0; i < listSize; i++) {
- if (PartitionManager.Is_Mounted_By_Path(Storage_List.at(i).Mount_Point)) {
- Full_Path = Storage_List.at(i).Mount_Point + "/" + Zip;
- if (TWFunc::Path_Exists(Full_Path)) {
- Zip = Full_Path;
- break;
- }
- Full_Path = Zip;
- LOGINFO("Trying to find zip '%s' on '%s'...\n", Full_Path.c_str(), Storage_List.at(i).Mount_Point.c_str());
- ret_string = Locate_Zip_File(Full_Path, Storage_List.at(i).Mount_Point);
- if (!ret_string.empty()) {
- Zip = ret_string;
- break;
+ if (Zip.substr(0, 1) == "@") {
+ // This is a special file that contains a map of blocks on the data partition
+ Full_Path = Zip.substr(1);
+ if (!PartitionManager.Mount_By_Path(Full_Path, true) || !TWFunc::Path_Exists(Full_Path)) {
+ gui_print("Unable to install via mapped zip '%s'\n", Full_Path.c_str());
+ return 1;
+ }
+ gui_print("Installing mapped zip file '%s'\n", Full_Path.c_str());
+ } else if (!TWFunc::Path_Exists(Zip)) {
+ PartitionManager.Mount_All_Storage();
+ PartitionManager.Get_Partition_List("storage", &Storage_List);
+ int listSize = Storage_List.size();
+ for (int i = 0; i < listSize; i++) {
+ if (PartitionManager.Is_Mounted_By_Path(Storage_List.at(i).Mount_Point)) {
+ Full_Path = Storage_List.at(i).Mount_Point + "/" + Zip;
+ if (TWFunc::Path_Exists(Full_Path)) {
+ Zip = Full_Path;
+ break;
+ }
+ Full_Path = Zip;
+ LOGINFO("Trying to find zip '%s' on '%s'...\n", Full_Path.c_str(), Storage_List.at(i).Mount_Point.c_str());
+ ret_string = Locate_Zip_File(Full_Path, Storage_List.at(i).Mount_Point);
+ if (!ret_string.empty()) {
+ Zip = ret_string;
+ break;
+ }
}
}
+ if (!TWFunc::Path_Exists(Zip)) {
+ // zip file doesn't exist
+ gui_print("Unable to locate zip file '%s'.\n", Zip.c_str());
+ ret_val = 1;
+ } else
+ gui_print("Installing zip file '%s'\n", Zip.c_str());
}
- if (!TWFunc::Path_Exists(Zip)) {
- // zip file doesn't exist
- gui_print("Unable to locate zip file '%s'.\n", Zip.c_str());
- ret_val = 1;
- } else {
- gui_print("Installing zip file '%s'\n", Zip.c_str());
- ret_val = TWinstall_zip(Zip.c_str(), &wipe_cache);
- }
+ ret_val = TWinstall_zip(Zip.c_str(), &wipe_cache);
if (ret_val != 0) {
LOGERR("Error installing zip file '%s'\n", Zip.c_str());
ret_val = 1;