android-backup-extractor icon indicating copy to clipboard operation
android-backup-extractor copied to clipboard

ZipException: invalid stored block lengths

Open 478a opened this issue 6 years ago • 7 comments

Exception during unpack with PW from 5GB backup create with oreo 8.0.0, adb 1.0.40 via adb backup -apk -shared -all adb restore fails, too Thanks for your work!

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% Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: invalid stored block lengths 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 stored block lengths at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:165) at java.base/java.io.FilterInputStream.read(FilterInputStream.java:107) at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:205) ... 1 more

478a avatar Feb 27 '19 12:02 478a

Still having the issue?

superbonaci avatar May 21 '22 01:05 superbonaci

I experienced the same error. However I think it is caused by adb backup creating a broken backup-file. When I try to adb restore the file, it crashes as well (seemingly at a similar progress).

Maybe it is possible to use android-backup-extractor to skip "faulty blocks" (at this point I have no idea what I am talking about anymore) and therefore just lose partial data but at least not make it crash?

java -jar abe.jar unpack ./bak.ab ./bak.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% 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%
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: invalid stored block lengths
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:232)
        at org.nick.abe.Main.main(Main.java:40)
Caused by: java.util.zip.ZipException: invalid stored block lengths
        at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:165)
        at java.base/java.io.FilterInputStream.read(FilterInputStream.java:105)
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:206)
        ... 1 more

zlyfer avatar Jun 14 '24 08:06 zlyfer

check abarms https://github.com/Own-Data-Privateer/abarms

superbonaci avatar Jun 14 '24 09:06 superbonaci

Thank you! I will check it out.

zlyfer avatar Jun 14 '24 09:06 zlyfer

Pull requests always welcome, but at the very least, consider sharing a sample file that reproduces the issue. Nearly impossible to fix otherwise.

nelenkov avatar Jun 14 '24 10:06 nelenkov

@zlyfer did you check it, any error or message?

superbonaci avatar Jun 18 '24 12:06 superbonaci

@zlyfer did you check it, any error or message?

Sorry for the late reply. Yes I checked it and it has the same issue. It unwraps for a bit and then just crashes. It did recover some data though.

I can not share this backup file as this is a personal backup including sensitive data. However on the weekend I may tinker around a bit and see if I can reproduce this issue with another backup file.

Here is an error log if anyone is interested. I may create an issue at Own-Data-Privateer/abarms in the next days.

~\TEMP > abarms unwrap bak.ab bak2.tar
Writing output to `bak2.tar`... 86%Traceback (most recent call last):
  File "/home/zlyfer/.local/bin/abarms", line 8, in <module>
    sys.exit(main())
  File "/home/zlyfer/.local/lib/python3.9/site-packages/abarms/__main__.py", line 866, in main
    cfg.func(cfg)
  File "/home/zlyfer/.local/lib/python3.9/site-packages/abarms/__main__.py", line 619, in ab_unwrap
    copy_input_to_output(cfg)
  File "/home/zlyfer/.local/lib/python3.9/site-packages/abarms/__main__.py", line 418, in copy_input_to_output
    data = cfg.input.read(BUFFER_SIZE)
  File "/home/zlyfer/.local/lib/python3.9/site-packages/abarms/__main__.py", line 63, in read
    self._buffer += self._handle_data(data)
  File "/home/zlyfer/.local/lib/python3.9/site-packages/abarms/__main__.py", line 121, in _handle_data
    return self._decompressor.decompress(data)
zlib.error: Error -3 while decompressing data: invalid stored block lengths

zlyfer avatar Jun 18 '24 13:06 zlyfer

Thy this too, report the bug the the developers also. https://sourceforge.net/projects/android-backup-processor/

superbonaci avatar Jun 18 '24 14:06 superbonaci