diff --git a/data.cpp b/data.cpp index 3d81bf6f..f7cd7a2a 100755 --- a/data.cpp +++ b/data.cpp @@ -763,6 +763,8 @@ void DataManager::SetDefaultValues() mPersist.SetValue(TW_TIME_ZONE_GUISEL, "CST6;CDT,M3.2.0,M11.1.0"); mPersist.SetValue(TW_TIME_ZONE_GUIOFFSET, "0"); mPersist.SetValue(TW_TIME_ZONE_GUIDST, "1"); + mPersist.SetValue(TW_AUTO_REFLASHTWRP_VAR, "0"); + mData.SetValue(TW_ACTION_BUSY, "0"); mData.SetValue("tw_wipe_cache", "0"); mData.SetValue("tw_wipe_dalvik", "0"); @@ -1169,4 +1171,4 @@ void DataManager::LoadTWRPFolderInfo(void) string mainPath = GetCurrentStoragePath(); SetValue(TW_RECOVERY_FOLDER_VAR, TWFunc::Check_For_TwrpFolder()); mBackingFile = mainPath + GetStrValue(TW_RECOVERY_FOLDER_VAR) + '/' + TW_SETTINGS_FILE; -} \ No newline at end of file +} diff --git a/gui/action.cpp b/gui/action.cpp index a623ccd5..c63337c7 100755 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -239,6 +239,7 @@ GUIAction::GUIAction(xml_node<>* node) ADD_ACTION(installapp); ADD_ACTION(uninstalltwrpsystemapp); ADD_ACTION(repackimage); + ADD_ACTION(reflashtwrp); ADD_ACTION(fixabrecoverybootloop); ADD_ACTION(applycustomtwrpfolder); #ifndef TW_EXCLUDE_NANO @@ -2159,6 +2160,23 @@ exit: return 0; } +int GUIAction::reflashtwrp(std::string arg __unused) +{ + int op_status = 1; + twrpRepacker repacker; + + operation_start("Repack Image"); + if (!simulate) + { + if (!repacker.Flash_Current_Twrp()) + goto exit; + } else + simulate_progress_bar(); + op_status = 0; +exit: + operation_end(op_status); + return 0; +} int GUIAction::fixabrecoverybootloop(std::string arg __unused) { int op_status = 1; diff --git a/gui/objects.hpp b/gui/objects.hpp index ec550bb3..098c4805 100755 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -372,6 +372,7 @@ protected: int installapp(std::string arg); int uninstalltwrpsystemapp(std::string arg); int repackimage(std::string arg); + int reflashtwrp(std::string arg); int fixabrecoverybootloop(std::string arg); int enableadb(std::string arg); int enablefastboot(std::string arg); diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index bf8912a3..369c4d86 100755 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -460,6 +460,13 @@ + + + + + + + @@ -3234,6 +3241,13 @@ + + + + + + + @@ -3719,6 +3733,22 @@ repackselect + + + + + + + tw_repack_kernel=0 + tw_back=advanced + tw_action=reflashtwrp + tw_text1={@reflash_twrp_confirm=Flash Current TWRP?} + tw_action_text1={@reflashing_twrp=Flashing TWRP...} + tw_complete_text1={@reflash_twrp_complete=Done flashing TWRP} + tw_slider_text={@swipe_to_confirm=Swipe to Confirm} + confirm_action + + diff --git a/gui/theme/common/languages/en.xml b/gui/theme/common/languages/en.xml index 1dca4f61..2ff27b2a 100755 --- a/gui/theme/common/languages/en.xml +++ b/gui/theme/common/languages/en.xml @@ -317,6 +317,7 @@ General General Use rm -rf instead of formatting + Automatically Reflash TWRP after flashing a ROM Use 24-hour clock Reversed navbar layout Simulate actions for theme testing @@ -506,9 +507,15 @@ Install Complete Error unpacking image. Error repacking image. + ramdisk files have been modified, unable to create ramdisk to flash, fastboot boot twrp and try this option again or use the Install Recovery Ramdisk option. + failed to create ramdisk to flash. Unpacking {1}... Repacking {1}... Select Image + Flash current TWRP + Flash current TWRP? + Flashing TWRP... + Done flashing TWRP Fix Recovery Bootloop Fix Recovery Bootloop? Fixing Recovery Bootloop... diff --git a/gui/theme/common/portrait.xml b/gui/theme/common/portrait.xml index 9e0fec88..3d6bce7c 100755 --- a/gui/theme/common/portrait.xml +++ b/gui/theme/common/portrait.xml @@ -412,6 +412,13 @@ + + + + + + + @@ -3408,6 +3415,13 @@ + + + + + + +