Skip to content

Commit

Permalink
ADB Backup: fix md5 check on restore.
Browse files Browse the repository at this point in the history
Add debug capability.
Fix backup of images after tarred partitions with too much padding
Add more md5 logging.
Skip digest check if selected.
Change ADB Backup version to 3 for new fixes to image padding.
Change-Id: I0f76c0733c523717e4797d1a14c3ae47d046fc8c
  • Loading branch information
bigbiff authored and Dees-Troy committed May 25, 2018
1 parent a82a754 commit 38b83c1
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 138 deletions.
2 changes: 1 addition & 1 deletion adbbu/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libtwadbbu
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS = -fno-strict-aliasing -D_LARGFILE_SOURCE
LOCAL_CFLAGS = -fno-strict-aliasing -D_LARGFILE_SOURCE #-D_DEBUG_ADB_BACKUP
LOCAL_C_INCLUDES += bionic external/zlib
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
LOCAL_C_INCLUDES += external/stlport/stlport
Expand Down
2 changes: 1 addition & 1 deletion adbbu/libtwadbbu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ std::vector<std::string> twadbbu::Get_ADB_Backup_Files(std::string fname) {
return std::vector<std::string>();
}

while (1) {
while (true) {
std::string cmdstr;
int readbytes;
if ((readbytes = read(fd, &buf, sizeof(buf))) > 0) {
Expand Down
2 changes: 1 addition & 1 deletion adbbu/twadbstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define TWMD5 "twverifymd5" //This command is compared to the md5trailer by ORS to verify transfer
#define TWENDADB "twendadb" //End Protocol
#define TWERROR "twerror" //Send error
#define ADB_BACKUP_VERSION 2 //Backup Version
#define ADB_BACKUP_VERSION 3 //Backup Version
#define DATA_MAX_CHUNK_SIZE 1048576 //Maximum size between each data header
#define MAX_ADB_READ 512 //align with default tar size for amount to read fom adb stream

Expand Down
Loading

0 comments on commit 38b83c1

Please sign in to comment.