summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-10-16 17:43:20 +0200
committerDees_Troy <dees_troy@teamw.in>2012-10-16 17:43:20 +0200
commit06b4fe97eff1f03540919c2900ccaf217a75fa2e (patch)
tree1aab3027899ad286258eb859cc801e99dcd91412 /gui
parentFix weird keyboard problem (diff)
downloadandroid_bootable_recovery-06b4fe97eff1f03540919c2900ccaf217a75fa2e.tar
android_bootable_recovery-06b4fe97eff1f03540919c2900ccaf217a75fa2e.tar.gz
android_bootable_recovery-06b4fe97eff1f03540919c2900ccaf217a75fa2e.tar.bz2
android_bootable_recovery-06b4fe97eff1f03540919c2900ccaf217a75fa2e.tar.lz
android_bootable_recovery-06b4fe97eff1f03540919c2900ccaf217a75fa2e.tar.xz
android_bootable_recovery-06b4fe97eff1f03540919c2900ccaf217a75fa2e.tar.zst
android_bootable_recovery-06b4fe97eff1f03540919c2900ccaf217a75fa2e.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/action.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 4d9c9df59..dd38b3175 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -670,7 +670,13 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
if (simulate) {
simulate_progress_bar();
} else {
- system("injecttwrp --dump /tmp/backup_recovery_ramdisk.img /tmp/injected_boot.img --flash");
+ TWPartition* Boot = PartitionManager.Find_Partition_By_Path("/boot");
+ if (Boot == NULL || Boot->Current_File_System != "emmc")
+ system("injecttwrp --dump /tmp/backup_recovery_ramdisk.img /tmp/injected_boot.img --flash");
+ else {
+ string injectcmd = "injecttwrp --dump /tmp/backup_recovery_ramdisk.img /tmp/injected_boot.img --flash bd=" + Boot->Actual_Block_Device;
+ system(injectcmd.c_str());
+ }
ui_print("TWRP injection complete.\n");
}
}
@@ -1042,6 +1048,22 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
ret = 1; // failure
else if (wipe_cache)
PartitionManager.Wipe_By_Path("/cache");
+ if (DataManager::GetIntValue(TW_HAS_INJECTTWRP) == 1 && DataManager::GetIntValue(TW_INJECT_AFTER_ZIP) == 1) {
+ operation_start("ReinjectTWRP");
+ ui_print("Injecting TWRP into boot image...\n");
+ if (simulate) {
+ simulate_progress_bar();
+ } else {
+ TWPartition* Boot = PartitionManager.Find_Partition_By_Path("/boot");
+ if (Boot == NULL || Boot->Current_File_System != "emmc")
+ system("injecttwrp --dump /tmp/backup_recovery_ramdisk.img /tmp/injected_boot.img --flash");
+ else {
+ string injectcmd = "injecttwrp --dump /tmp/backup_recovery_ramdisk.img /tmp/injected_boot.img --flash bd=" + Boot->Actual_Block_Device;
+ system(injectcmd.c_str());
+ }
+ ui_print("TWRP injection complete.\n");
+ }
+ }
}
operation_end(ret, simulate);
return 0;