nelenkov/android-backup-extractor

invalid block type

davispuh opened this issue · 7 comments

I created a non-encrypted backup with $ adb backup -apk -shared -all -system on LG V20 (Android 7.0)

but it fails to convert it to tar

$ abe unpack backup.ab backup.tar
0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: invalid block type
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:233)
        at org.nick.abe.Main.main(Main.java:40)
Caused by: java.util.zip.ZipException: invalid block type
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
        at java.io.FilterInputStream.read(FilterInputStream.java:107)
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:205)
        ... 1 more

Does it work if leave out -shared? Is the header the same format?
It is possible that LG customized the backup logic, you may need to do some digging.

Different error then

0% 1% 2% 3% 4% 5% 6% Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: invalid bit length repeat
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:233)
        at org.nick.abe.Main.main(Main.java:40)
Caused by: java.util.zip.ZipException: invalid bit length repeat
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
        at java.io.FilterInputStream.read(FilterInputStream.java:107)
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:205)
        ... 1 more

Maybe it's because for some reason it gets interrupted/corrupted while adb is creating it... but still weird.

With debug build

Magic: ANDROID BACKUP
Version: 4
Compressed: 1
Algorithm: none

Tried with tar

gzip: stdin: invalid compressed data--format violated
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

and

tar: Skipping to next header
tar: Exiting with failure status due to previous errors

I think it stops making backup when screen goes off

With another try

0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99% 100%
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: incorrect data check
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:233)
        at org.nick.abe.Main.main(Main.java:40)
Caused by: java.util.zip.ZipException: incorrect data check
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
        at java.io.FilterInputStream.read(FilterInputStream.java:107)
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:205)
        ... 1 more

No sure, either it's an error, or they use a different compression algorithm.

@davispuh 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

Having the same issue here... ran the logcat command as suggested (thanks) and found this:

04-27 22:15:39.673 5039 16381 V BackupManagerService: Requesting backup: apks=true obb=true shared=false all=true system=true includekeyvalue=true pkgs=[Ljava.lang.String;@183e824

Is that Ljava.lang.String;@ supposed to be there? sorry, java noob here.

I.e. i did not specified any specific packages to backup, only ran adb backup -apk -obb -keyvalue -all