Merge "ADB Backup: Ignore creating backup folder for phones not decrypted. This allows you to continue without error. Also we should not set restore path for images in adb backup. Change-Id: Ia75a70377b8e1364fefc82ad41ccf74fa3b7a3c3" into android-9.0
diff --git a/twrpAdbBuFifo.cpp b/twrpAdbBuFifo.cpp
index 4f9bd2c..3143863 100755
--- a/twrpAdbBuFifo.cpp
+++ b/twrpAdbBuFifo.cpp
@@ -177,7 +177,6 @@
 	part_settings.total_restore_size = 0;
 
 	PartitionManager.Mount_All_Storage();
-	DataManager::SetValue(TW_SKIP_DIGEST_CHECK_VAR, 0);
 	LOGINFO("opening TW_ADB_BU_CONTROL\n");
 	adb_control_bu_fd = open(TW_ADB_BU_CONTROL, O_WRONLY | O_NONBLOCK);
 	LOGINFO("opening TW_ADB_TWRP_CONTROL\n");
diff --git a/twrpDigestDriver.cpp b/twrpDigestDriver.cpp
index 079d0b8..4023c81 100755
--- a/twrpDigestDriver.cpp
+++ b/twrpDigestDriver.cpp
@@ -69,10 +69,12 @@
 #endif
 
 	if (!TWFunc::Path_Exists(digestfile)) {
+		delete digest;
 		if (Filename.find(".zip") == std::string::npos) {
 			gui_msg(Msg(msg::kError, "no_digest_found=No digest file found for '{1}'. Please unselect Enable Digest verification to restore.")(Filename));
+		} else {
+			return true;
 		}
-		delete digest;
 		return false;
 	}