diff options
author | Dees_Troy <dees_troy@teamw.in> | 2012-10-16 17:43:20 +0200 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2012-10-16 17:43:20 +0200 |
commit | 06b4fe97eff1f03540919c2900ccaf217a75fa2e (patch) | |
tree | 1aab3027899ad286258eb859cc801e99dcd91412 /gui/action.cpp | |
parent | Fix weird keyboard problem (diff) | |
download | android_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/action.cpp')
-rw-r--r-- | gui/action.cpp | 24 |
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; |