ADB Backup: fix adb restore issues
Set Backup_FileName on adb backup to fix restore.
Set read_from_adb after EOF to return properly
from newer adb client prompt.
Create setter and getter for Backup_FileName
for openrecoveryscript.cpp which is not a
friend class.
Fix condition for twrpTar::Get_Size() and adb backup.
Change-Id: I7eb8168fa3416366b996e220cecbc0e1bcec5e8e
diff --git a/adbbu/twadbstream.h b/adbbu/twadbstream.h
index 4e76be1..23d4a1f 100644
--- a/adbbu/twadbstream.h
+++ b/adbbu/twadbstream.h
@@ -21,7 +21,7 @@
#define TW_ADB_BU_CONTROL "/tmp/twadbbucontrol" //FIFO for sending control from TWRP to ADB Backup
#define TW_ADB_TWRP_CONTROL "/tmp/twadbtwrpcontrol" //FIFO for sending control from ADB Backup to TWRP
#define TWRP "TWRP" //Magic Value
-#define ADB_BU_MAX_ERROR 10 //Max amount of errors for while loops
+#define ADB_BU_MAX_ERROR 20 //Max amount of errors for while loops
//ADB Backup Control Commands
#define TWSTREAMHDR "twstreamheader" //TWRP Parititon Count Control
diff --git a/adbbu/twrpback.cpp b/adbbu/twrpback.cpp
index 2a227ec..c59fd1c 100644
--- a/adbbu/twrpback.cpp
+++ b/adbbu/twrpback.cpp
@@ -514,7 +514,6 @@
return -1;
}
}
-
//If we should read from the adb stream, write commands and data to TWRP
if (read_from_adb) {
std::string cmdstr;
@@ -547,6 +546,7 @@
close_restore_fds();
return -1;
}
+ read_from_adb = false;
}
else {
adblogwrite("ADB TWENDADB crc header doesn't match\n");