
나는 adb backup
많은 게시물에서 지적했듯이 Android 스마트폰을 백업하는 데 사용합니다.https://stackoverflow.com/questions/18533567/how-to-extract-or-unpack-an-ab-file-android-backup-file- 예를 들어 .gz로 변환해 보았습니다.
$ adb backup -apk -shared -all -f mybackup.ab
Now unlock your device and confirm the backup operation...
$ (printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -n +5 mybackup.ab) > mybackup.gz
$ tar tzvf mybackup.gz
...
gzip: stdin: unexpected end of file
drwxrwx--- 0/9997 0 2020-02-22 10:23 shared/0/Notifications
drwxrwx--- 0/9997 0 2020-02-22 10:23 shared/0/Ringtones
drwxrwx--- 0/9997 0 2020-02-22 10:23 shared/0/Podcasts
tar: Child returned status 1
tar: Error is not recoverable: exiting now
연결된 SO 게시물의 의견에는 다음이 언급되어 있습니다.
backup.ab에 CRC-32 체크섬 및 길이가 포함된 올바른 gzip 파일 바닥글이 없기 때문에 불만이 발생할 수 있습니다.
따라서 내 질문은 다음과 같습니다. 위와 같은 mybackup.gz에 올바른 .gz 파일 헤더가 있지만 파일 바닥글이 잘못되었습니다. 바닥글을 생성하고 추가하거나 바꾸는 방법은 무엇입니까(정상적인 쉘/Bash에서 작동하길 바랍니다) 가능하지만 다른 언어 솔루션을 사용해도 상관 없습니다. 사용 가능한 모든 데이터가 포함되지만 mybackup.gz
?로 확인하면 mybackup_fixed.gz
결과가 나오지 않습니다 .unexpected end of file
tar tzvf