twrpRepacker: override slot back after flashing
and move updating partition details to the function
Change-Id: I6f27ab1191246b6a23e625b0e3459db9024691c7
(cherry picked from commit 0fc1ee2c1ab1775ac5f5115842b4aaea15ec9ad6)
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index f00e8e3..e58e8ff 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -3007,6 +3007,7 @@
LOGINFO("Overriding slot to '%s'\n", Slot.c_str());
Active_Slot_Display = Slot;
DataManager::SetValue("tw_active_slot", Slot);
+ PartitionManager.Update_System_Details();
}
void TWPartitionManager::Set_Active_Slot(const string& Slot) {
diff --git a/twrpRepacker.cpp b/twrpRepacker.cpp
index ed1bbbc..c50435c 100755
--- a/twrpRepacker.cpp
+++ b/twrpRepacker.cpp
@@ -217,7 +217,6 @@
else
PartitionManager.Override_Active_Slot("A");
DataManager::SetProgress(.25);
- PartitionManager.Update_System_Details();
if (!Backup_Image_For_Repack(part, REPACK_ORIG_DIR, Repack_Options.Backup_First, gui_lookup("repack", "Repack")))
return false;
if (TWFunc::copy_file(REPACK_NEW_DIR "ramdisk.cpio", REPACK_ORIG_DIR "ramdisk.cpio", 0644)) {
@@ -262,6 +261,11 @@
}}
TWFunc::removeDir(REPACK_NEW_DIR, false);
gui_msg(Msg(msg::kWarning, "repack_overwrite_warning=If device was previously rooted, then root has been overwritten and will need to be reinstalled."));
+ string Current_Slot = PartitionManager.Get_Active_Slot_Display();
+ if (Current_Slot == "A")
+ PartitionManager.Override_Active_Slot("B");
+ else
+ PartitionManager.Override_Active_Slot("A");
return true;
}