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

ZipException: invalid stored block lengths #72

Open
478a opened this issue Feb 27, 2019 · 7 comments
Open

ZipException: invalid stored block lengths #72

478a opened this issue Feb 27, 2019 · 7 comments

Comments

@478a
Copy link

478a commented Feb 27, 2019

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

@zlyfer
Copy link

zlyfer commented Jun 14, 2024

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

@superbonaci
Copy link

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

@zlyfer
Copy link

zlyfer commented Jun 14, 2024

Thank you! I will check it out.

@nelenkov
Copy link
Owner

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

@superbonaci
Copy link

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

@zlyfer
Copy link

zlyfer commented Jun 18, 2024

@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

@superbonaci
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants