Hello,
is there any plan to support backups from Android 8.0? Currently it is not supported because version in these backup is 5.
I can unpack it when I change number 5 in .ab file to 4, but it is not ideal.
And do you know what was changed?
Thank you,
CdTC
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I have no idea if there are real differences in the source code besides just the version number. I will try to take a look when I have some free time...
Last edit: dragomerlin 2017-08-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the meantime you can edit the backup.ab with wxHexEditor and replace the 5 with a 4, it works with a couple of backups I've tested so presumably there are no important source code changes.
Note that adb backup is partially broken on all android versions, even on newest android 8.0 Oreo, so don't completely trust them. Convert the ab file to tar and then extract it to verify there's no error, that is the only way to confirm the adb backup is valid. You can confirm that adb backup is broken installing the game Asphalt 8. Then perform a backup this way and you will see it never finishes:
Cancel it with Control+C, then convert the adb backup to tar and you will see the following error:
PS C:\temp> java -jar .\abe.jar -debug unpack .\backup.ab out.tar
Strong AES encryption allowed
Magic: ANDROID BACKUP
Version: 4
Compressed: 1
Algorithm: none
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.RuntimeException: java.io.EOFException: Unexpected end of ZLIB input stream
at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:420)
at org.nick.abe.Main.main(Main.java:128)
... 5 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:397)
... 6 more
Google is trying to shift Android backups and restores to the cloud, so would not surprise me if the mentioned issue never gets fixed. Other bugs are present also.
Use iOS if you want a real backup (with the exception of the apps themselves), all the data for all the apps is backed up properly.
Android backup system is not trustworthy (never was).
Last edit: dragomerlin 2017-08-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also, remember that not all applications' data will be backed up. Those that are disallowed by AndroidManifest.xml will not be saved:
android:allowBackup="false"
Even if the backup is allowed, individual files can be excluded with the attribute "android:fullBackupContent". Users should be notified of that at the moment of performing a backup that some data will be lost forever. You think just everything will be saved but that's not the case. It's an obscure move from Google. Use iPhone and iOS to truly preserve your data.
Thank you very much for your help!
Yes, I have Asphalt 8 on my phone and I have encountered an error where there are 30 bytes missing in the tar file (so it is not aligned to blocks of size 512). I thought there was a problem on my side.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm still getting an error while trying to extract a backup from a device with Android Oreo:
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.lang.IllegalArgumentException: Don't
know how to process version 5
at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:444)
at org.nick.abe.Main.main(Main.java:128)
... 5 more
Caused by: java.lang.IllegalArgumentException: Don't know how to process version
5
at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:284)
... 6 more
I'm using the latest version (v20170828)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
is there any plan to support backups from Android 8.0? Currently it is not supported because version in these backup is 5.
I can unpack it when I change number 5 in .ab file to 4, but it is not ideal.
And do you know what was changed?
Thank you,
CdTC
Hi, I have no idea if there are real differences in the source code besides just the version number. I will try to take a look when I have some free time...
Last edit: dragomerlin 2017-08-26
In the meantime you can edit the backup.ab with wxHexEditor and replace the 5 with a 4, it works with a couple of backups I've tested so presumably there are no important source code changes.
Note that adb backup is partially broken on all android versions, even on newest android 8.0 Oreo, so don't completely trust them. Convert the ab file to tar and then extract it to verify there's no error, that is the only way to confirm the adb backup is valid. You can confirm that adb backup is broken installing the game Asphalt 8. Then perform a backup this way and you will see it never finishes:
adb backup -apk -all -nosystem -shared -obb -f backup.ab
On another console run adb logcat, you will see something like that confirming the problem:
Cancel it with Control+C, then convert the adb backup to tar and you will see the following error:
Google is trying to shift Android backups and restores to the cloud, so would not surprise me if the mentioned issue never gets fixed. Other bugs are present also.
Use iOS if you want a real backup (with the exception of the apps themselves), all the data for all the apps is backed up properly.
Android backup system is not trustworthy (never was).
Last edit: dragomerlin 2017-08-26
Nougat and latest PackageManagerService.java files:
https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/pm/PackageManagerService.java
https://android.googlesource.com/platform/frameworks/base/+/nougat-release/services/core/java/com/android/server/pm/PackageManagerService.java
Also, remember that not all applications' data will be backed up. Those that are disallowed by AndroidManifest.xml will not be saved:
Even if the backup is allowed, individual files can be excluded with the attribute "android:fullBackupContent". Users should be notified of that at the moment of performing a backup that some data will be lost forever. You think just everything will be saved but that's not the case. It's an obscure move from Google. Use iPhone and iOS to truly preserve your data.
Read more here:
Auto Backup for Apps
If the jar is ever updated I will include a warning about this.
Last edit: dragomerlin 2017-08-27
Android backup extractor 20170828 doesn't check anymore the version of the backup, so feel free too experiment with newer versions out of the box.
Thank you very much for your help!
Yes, I have Asphalt 8 on my phone and I have encountered an error where there are 30 bytes missing in the tar file (so it is not aligned to blocks of size 512). I thought there was a problem on my side.
Use the -obb and -noshared options. Backup the sdcard copying the files to the computer directly.
Hi, I'm still getting an error while trying to extract a backup from a device with Android Oreo:
I'm using the latest version (v20170828)
New version 20170922 is out. Now it's fixed.