Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken .tar file after unpacking #49

Open
clhunsen opened this Issue Mar 28, 2017 · 16 comments

Comments

Projects
None yet
7 participants
@clhunsen
Copy link

clhunsen commented Mar 28, 2017

I have run the following commands to backup my Android N device (7.1.1, N4F26T) and to check the files in the backup using ABE (a checkmark ✔ after any command indicates exit code 0):

[ /media/data/backups/files ] ✔
$ adb backup '-all -apk -shared -nosystem'
[ /media/data/backups/files ] ✔
$ head -n4 backup.ab
ANDROID BACKUP
4
1
AES-256
[ /media/data/backups/files ] ✔
$ java -jar ../android-backup-extractor/build/libs/abe-all.jar unpack backup.ab backup.tar
This backup is encrypted, please provide the password
Password: 
Calculated MK checksum (use UTF-8: true): [hash]
2381763584 bytes written to backup.tar.
[ /media/data/backups/files ] ✔
$ 

So far, so good. Now, the following command should give me a list of all files in the backup (.tar) file, but unfortunately, after a long list files, it gives me an error:

$ tar -tf backup.tar
apps/cc.dict.dictcc/_manifest
apps/cc.dict.dictcc/a/base.apk
[...]
shared/0/WhatsApp/Media/WhatsApp Video/VID-20161224-WA0001.mp4
shared/0/WhatsApp/Media/WhatsApp Video/VID-20161209-WA0001.mp4
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

Am I doing anything the wrong way? Or is this a bug in ABE when unpacking the .ab file?

@SquallATF

This comment has been minimized.

Copy link

SquallATF commented Apr 17, 2017

new android version backup struct changed, try backup with -nocompress

@clhunsen

This comment has been minimized.

Copy link
Author

clhunsen commented Apr 18, 2017

try backup with -nocompress

Thank you, that solved my problem. At least, for the moment.

As ABE should be able to handle compressed backup files of newer formats, I leave this issue open.

@nelenkov

This comment has been minimized.

Copy link
Owner

nelenkov commented Apr 20, 2017

Any idea what the exact change is? This seems to only happen when -shared is specified.

@superbonaci

This comment has been minimized.

Copy link

superbonaci commented May 1, 2017

I've found similar problem, is the same problem or is not?

Sony Xperia Z5 Compact fails to adb backup shared storage

@nelenkov

This comment has been minimized.

Copy link
Owner

nelenkov commented May 1, 2017

Does -nocompress help? If so, might be related.

@egalanos

This comment has been minimized.

Copy link

egalanos commented Jul 6, 2017

I've also got this exact problem. Both star and tar are getting the same error.

My phone is now dead so can't generate a new .ab. Any ideas on how I can get abe to work?

@egalanos

This comment has been minimized.

Copy link

egalanos commented Jul 9, 2017

My phone worked again for a few hours today. I created a new encrypted (is forced on) backup using -nocompress.

The abe unpack command completed without error. The tarball is still broken.

@superbonaci

This comment has been minimized.

Copy link

superbonaci commented Jul 10, 2017

@egalanos what is the error of the tar?

@egalanos

This comment has been minimized.

Copy link

egalanos commented Jul 10, 2017

% ls -l adb-nocompress-unpacked.tar 
-rw-rw-r--. 1 user user 4440329216 Jul  9 14:33 adb-nocompress-unpacked.tar

tar:

% tar tf adb-nocompress-unpacked.tar
<file list>
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

star:

star tvf adb-nocompress-unpacked.tar -debug
<file list>
star: Tar file too small (amount: 0 bytes).
star: Unexpected EOF on input.
star: Cannot recover from error - exiting.
star: 433625 blocks + 9216 bytes (total of 4440329216 bytes = 4336259.00k).

@nelenkov

This comment has been minimized.

Copy link
Owner

nelenkov commented Jul 10, 2017

Make a backup without excluding external storage (-sdcard), it seems the error happens during unpacking the SD card data.

@gsgrippal

This comment has been minimized.

Copy link

gsgrippal commented Apr 8, 2018

@clhunsen Probably it's an issue with your phone. Try running adb logcat while backup and watch for letter capital E.

  • adb logcat -s BackupManagerService

Open another console and backup

  • adb backup -apk -shared -all -system
@M0rtale

This comment has been minimized.

Copy link

M0rtale commented Jun 10, 2018

same error here... The unpacked .tar file is damaged.

@gsgrippal

This comment has been minimized.

Copy link

gsgrippal commented Jun 16, 2018

@M0rtale android has unfixed bugs

@clhunsen

This comment has been minimized.

Copy link
Author

clhunsen commented Aug 12, 2018

@clhunsen Probably it's an issue with your phone. Try running adb logcat while backup and watch for letter capital E.

  • adb logcat -s BackupManagerService

Thanks for that hint, @gsgrippal! I found that the Amazon Prime Video app threw some errors. After resetting it (and removing all stored local data for it), the backup ran flawlessly.

@gsgrippal

This comment has been minimized.

Copy link

gsgrippal commented Aug 13, 2018

@clhunsen glad that you found the culprit. Thanks also for the heads up, as you can see adb backup still need a lot of improvement to be user friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.