[Q] Android Backup Extractor java.lang.RuntimeException: java.util.zip.ZipException

Search This thread

mmortal03

Senior Member
Apr 15, 2014
449
98
I created a backup of my LG Motion 4G using Holo Backup on Windows 7. I would now like to view/extract the contents.

Following step 1 from this guide: http://xdaforums.com/showthread.php?t=2011811

I am using Android Backup Extractor in Windows 7 64-bit from here: http://sourceforge.net/projects/adbextractor/files/?source=navbar

When I run the following command (using either Java 32-bit or 64-bit, after replacing the two files related to encryption as per the README states):

Code:
java -jar abe.jar unpack backup.ab backup.tar MyPassword

It begins extracting, then I get:

Code:
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: invalid store
d block lengths
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:320)
        at org.nick.abe.Main.main(Main.java:58)
        ... 5 more
Caused by: java.util.zip.ZipException: invalid stored block lengths
        at java.util.zip.InflaterInputStream.read(Unknown Source)
        at java.io.FilterInputStream.read(Unknown Source)
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:299)
        ... 6 more
 

heavenlyevil

New member
May 17, 2014
1
0
I'm having the exact same problem, except I'm using Windows 8.1. I'm also using 64-bit Java and replaced the encryption files according to the instructions.

I created a backup of my LG Motion 4G using Holo Backup on Windows 7. I would now like to view/extract the contents.

Following step 1 from this guide: http://xdaforums.com/showthread.php?t=2011811

I am using Android Backup Extractor in Windows 7 64-bit from here: http://sourceforge.net/projects/adbextractor/files/?source=navbar

When I run the following command (using either Java 32-bit or 64-bit, after replacing the two files related to encryption as per the README states):

Code:
java -jar abe.jar unpack backup.ab backup.tar MyPassword

It begins extracting, then I get:

Code:
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: invalid store
d block lengths
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:320)
        at org.nick.abe.Main.main(Main.java:58)
        ... 5 more
Caused by: java.util.zip.ZipException: invalid stored block lengths
        at java.util.zip.InflaterInputStream.read(Unknown Source)
        at java.io.FilterInputStream.read(Unknown Source)
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:299)
        ... 6 more
 

mmortal03

Senior Member
Apr 15, 2014
449
98
I'm trying this again. I'm using Java 8 64-bit with the corresponding Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for JDK/JRE 8
from here: www.oracle.com/technetwork/java/javase/downloads/index.html

It starts to create the .tar file, gets about a 1GB in, then throws the following error:
Code:
Strong AES encryption enabled
Magic: ANDROID BACKUP
Version: 1
Compressed: 1
Algorithm: AES-256
IV: 0ECF671B3AE6432810E61BF5C43591D0
MK: 64BEFD995F94A4856FB5D90AED1A6B2AD144D51F3E07A880DFD8A7D3A6DB762A
MK checksum: DC98AE58FFC7855C083C7218E463C1FFF88F8C8795DBD928357B2BE05CB7F31B
key bytes: 64BEFD995F94A4856FB5D90AED1A6B2AD144D51F3E07A880DFD8A7D3A6DB762A
salt bytes: FBD35CDB1180D3A30FBD21037FF0335F8A36F601EE7C9DF378A92354DB664BB62322
F65A3054850ACB3C84A981F2ACD52202115DED983C388A648134882038A5
MK as string: [d???_???o??
?→k*?D?▼>????????v*]
Key format: RAW
Calculated MK checksum: DC98AE58FFC7855C083C7218E463C1FFF88F8C8795DBD928357B2BE0
5CB7F31B
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.RuntimeException: java.io.IOException: javax.crypto.BadPadd
ingException: Given final block not properly padded
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:320)
        at org.nick.abe.Main.main(Main.java:58)
        ... 5 more
Caused by: java.io.IOException: javax.crypto.BadPaddingException: Given final bl
ock not properly padded
        at javax.crypto.CipherInputStream.close(CipherInputStream.java:321)
        at java.util.zip.InflaterInputStream.close(Unknown Source)
        at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:311)
        ... 6 more
Caused by: javax.crypto.BadPaddingException: Given final block not properly padd
ed
        at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:966)
        at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:824)
        at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:436)
        at javax.crypto.Cipher.doFinal(Cipher.java:2048)
        at javax.crypto.CipherInputStream.close(CipherInputStream.java:314)
        ... 8 more


I see that someone else has run into the same issue in the past over on github, but there wasn't a good solution, other than restoring to another device (which I don't have): http://github.com/nelenkov/android-backup-extractor/issues/10
 
Last edited:

mmortal03

Senior Member
Apr 15, 2014
449
98
Yep, that seems to be it. Any backup which used the -shared argument with adb backup won't extract properly. There may be a procedure using a perl script (tarfix.pl) that may help.
 
Last edited:

mmortal03

Senior Member
Apr 15, 2014
449
98
On these backups, after running "perl backupdecrypt.pl --nocompress backup.ab test.tar",
I then run "perl tarfix.pl test.tar | tar xv", and I get a bunch of garbage as output (see below). I've tested this both on Windows and on Linux, with the same result, so it isn't a platform issue. I'd post over in the applicable tarfix.pl thread, but I don't have 10 posts yet to be able to do so.

Excerpt output:

Code:
Illegal binary digit '■â┐┐┐╛º' ignored at tarfix.pl line 107.
Illegal hexadecimal digit 'k' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐┐╕' ignored at tarfix.pl line 107.
Illegal hexadecimal digit 'g' ignored at tarfix.pl line 107.
Illegal binary digit ';' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐╛╜' ignored at tarfix.pl line 107.
Illegal hexadecimal digit 'i' ignored at tarfix.pl line 107.
Illegal binary digit '%' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '&' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐┐┤' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Unicode non-character 0xfffffffe is illegal for interchange at tarfix.pl line 10
7.
Illegal binary digit '■â┐┐┐┐╛' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '☼' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐┐£' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐╛╕' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐┐«' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '♂' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐┐å' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐┐₧' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐┐ú' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐┐æ' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐╛»' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐┐à' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐╛ö' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal octal digit '9' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐┐ª' ignored at tarfix.pl line 107.
Illegal binary digit '■â┐┐┐╛⌐' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal octal digit '8' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '^' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐┐Ç' ignored at tarfix.pl line 107.
Illegal hexadecimal digit '■â┐┐┐╛»' ignored at tarfix.pl line 107.