From 9597b840bcc7e51de01a2ea93df133cdc05c635d Mon Sep 17 00:00:00 2001 From: epicX Date: Sat, 20 Mar 2021 21:58:17 +0530 Subject: [PATCH] Normalized digest check before installing zip Change-Id: I5a3e82f103e7a80800be7790f1c8dc33c76413da (cherry picked from commit 646f4f0c66a918f12e12784b22e7dc9a89837c37) --- data.cpp | 1 + gui/action.cpp | 2 +- gui/theme/common/landscape.xml | 47 +++++++++++++++++++------------ gui/theme/common/languages/en.xml | 1 + gui/theme/common/portrait.xml | 47 +++++++++++++++++++------------ gui/theme/common/watch.xml | 47 +++++++++++++++++++------------ gui/theme/landscape_hdpi/ui.xml | 1 + gui/theme/landscape_mdpi/ui.xml | 1 + gui/theme/portrait_hdpi/ui.xml | 1 + gui/theme/portrait_mdpi/ui.xml | 1 + gui/theme/watch_mdpi/ui.xml | 1 + twrpDigestDriver.cpp | 4 +-- variables.h | 1 + 13 files changed, 98 insertions(+), 57 deletions(-) diff --git a/data.cpp b/data.cpp index d7c77ab8..ffb9b420 100755 --- a/data.cpp +++ b/data.cpp @@ -755,6 +755,7 @@ void DataManager::SetDefaultValues() mPersist.SetValue(TW_GUI_SORT_ORDER, "1"); mPersist.SetValue(TW_RM_RF_VAR, "0"); mPersist.SetValue(TW_SKIP_DIGEST_CHECK_VAR, "0"); + mPersist.SetValue(TW_SKIP_DIGEST_CHECK_ZIP_VAR, "1"); mPersist.SetValue(TW_SKIP_DIGEST_GENERATE_VAR, "0"); mPersist.SetValue(TW_SDEXT_SIZE, "0"); mPersist.SetValue(TW_SWAP_SIZE, "0"); diff --git a/gui/action.cpp b/gui/action.cpp index 58211d35..145a55b8 100755 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -400,7 +400,7 @@ int GUIAction::flash_zip(std::string filename, int* wipe_cache) if (simulate) { simulate_progress_bar(); } else { - ret_val = TWinstall_zip(filename.c_str(), wipe_cache, (bool) DataManager::GetIntValue(TW_SKIP_DIGEST_CHECK_VAR)); + ret_val = TWinstall_zip(filename.c_str(), wipe_cache, (bool) !DataManager::GetIntValue(TW_SKIP_DIGEST_CHECK_ZIP_VAR)); PartitionManager.Unlock_Block_Partitions(); // Now, check if we need to ensure TWRP remains installed... struct stat st; diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index 3af7da6c..3ac0d285 100755 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -175,6 +175,15 @@ + + + + + +