yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] escribblings:
I would just like to say a massive thank you to you guys, firstly for your guide here, and your help with my queries.

I have borrowed from this guide (and given due credit to it) to create a walkthrough for the AngryBirdsNest.

That walkthrough is now live, and can be viewed here: http://www.angrybirdsnest.com/how-to-back-up-angry-birds-progress-on-android-rooted-and-non-rooted/

My original and slightly more detailed (and possibly easier to read) guide from which the above is taken can be found on my own website: http://www.wizardgroup.net/abbu

Seeing as I have drawn heavily on your work, I thought it only fair to mention you guys and tell you about the guide I made.

Thank you once again.
[Android Software/Hacking General [Developers Only]] MichelN:
Everytime i try to unpack the ab file to a tar file i can't open it.

What am i doing wrong ?
[Android Software/Hacking General [Developers Only]] scandiun:
Show us the log
[Android Software/Hacking General [Developers Only]] escribblings:
What exactly are you doing? We can't tell you what your doing wrong if we don't know what you have done.

You need to unpack the .ab and then untar the .tar with

tar -xvf file.tar

to get your directory tree.
[Android Software/Hacking General [Developers Only]] scandiun:
Thank you so much for the guides. Hopefully next android version 4.3 will support saving the savegames on the cloud (for the games that get the update of course).
[Android Software/Hacking General [Developers Only]] eicke:
I have the same issue...converting to the tar works fine...but when I trie to unpack the tar:

tar: This does not look like a tar archive

tar: Skipping to next header

tar: Exiting with failure status due to previous errors

Can anyone help me?
[Android Software/Hacking General [Developers Only]] scandiun:
The backup is recent? Did you include sdcard in the backup?
[Android Software/Hacking General [Developers Only]] eicke:
I did it an hour ago and with a Nexus 7 Android 4.3. And no, I didn't include the sd-card.
[Android Software/Hacking General [Developers Only]] scandiun:
Please, post the exact command you used, and I'll test it tomorrow on my own Nexus 7.
[Android Software/Hacking General [Developers Only]] eicke:
I've tried 'dd' and also the java option. I did the backup without any password.

dd if=com.king.candycrushsaga.ab bs=24 skip=1 | openssl zlib -d > candy.tar

For the java option I've imported the projekt in eclipse and starteted the projekt with suitable arguments.

I've attached you one of my *.ab files (as zip).

Thanks for your help!
[Android Software/Hacking General [Developers Only]] codelover:
There is nothing wrong with the ab backup, the problem lies with the tar file itself.

Guess what? The tar file generated by your adb backup has a corrupted/incomplete header.

The files 'checksum' was incomplete thus making all tar program to 'think' it's not a valid tar even though all data was there.

The tar file can be fixed by updating all header 'checksum' with the correct value. (by recalculating header sum - with script).

But i think it's better to cure instead of fix later. But i am not sure whether adb backup use system 'tar' binary, if it does that could be the problem.

You can try creating a sample tar file on your system & try to see whether you can unpack it properly.

My Nexus 7 with Android 4.3 does not have the above problem.
[Android Software/Hacking General [Developers Only]] eicke:
First of all, thanks for your help!

I tried a tar recovery tool and it worked. I have no idea, why the genereted tars are broken.I have a normal 4.3 + rooted + latest superSU and busybox. I also tried it on my Galaxy Nexus and there everything works fine. :confused::confused:
[Android Software/Hacking General [Developers Only]] scandiun:
It looks like a corrupt tar was generated. Try rebooting the Nexus 7 and then this command:

adb backup -apk -f com.king.candycrushsaga.ab com.king.candycrushsaga

Let's see if there is any difference when you include the apk.
[Android Software/Hacking General [Developers Only]] eicke:
Hmm strange...I rebooted my device but no difference, then I reinstalled busybox and rebooted again and now it works:eek:

Thanks!
[Android Software/Hacking General [Developers Only]] scandiun:
So it appears root or busybox messed up something. Glad it works now.
[Android Software/Hacking General [Developers Only]] SadHeroXIII:
tired from trying out !!

well, I try to do it, I think I have some problems with my laptop

it said can't access the abe.jar file :(

well, anyone would help me in unpacking my .ab file ?
[Android Software/Hacking General [Developers Only]] scandiun:
Do you run the commands correctly from command prompt?
[Android Software/Hacking General [Developers Only]] SadHeroXIII:
well, yes I do. But may be i do something wrong with cygwin...

I want to extract the file cus when restorig it end b4 finish ! So, I want to restore the left :rolleyes:
[Android Software/Hacking General [Developers Only]] scandiun:
You don't need cygwin to extract an adb backup
[Android Software/Hacking General [Developers Only]] SadHeroXIII:
then how and where we should type the command ?
[Android Software/Hacking General [Developers Only]] scandiun:
Type it where abe.jar and your backup are in the same dir. If not working can't help you anymore unless you post an screenshot.
[Android Software/Hacking General [Developers Only]] SadHeroXIII:
finally, I've success in extract the .ab file !

But now, I can't extract the tar file to complete what I want to do :confused:

EDIT

I do it at last :)

thanks for the guide (y)
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Hello!

Either there is something wrong with abe.jar or with .ab and .tar files.

.ab were created using Helium and uploaded to dropbox, then downloaded locally

When I unpack it - resulting .tar files is wrong for some reason.

Then I get another backup .tar.gz using ultimate backup, unpacked gz to tar and tested that .tar to check if it is ok.

It was ok with /data/data structure and files in it.

When I pack it - resulting .ab has header and garbage after that. And Helium can't restore it.

What can be wrong?
[Android Software/Hacking General [Developers Only]] scandiun:
Either Helium is creating an invalid archive or dropbox corrupted it. Try generating the ab file yourself using the debugging bridge to see if is ok.
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Probably there is something wrong with the /data/data backup in Helium.

Coz when I try to backup APK using helium abe.jar unpacks it correctly to .tar which has apk inside.

How do i create /data/data backup using adb backup manually?
[Android Software/Hacking General [Developers Only]] scandiun:
You should report a bug to Helium then.
[Android Software/Hacking General [Developers Only]] JugglerLKR:
They made some custom and probably more convinient way to backup using adb backup with tar files. The problem is that it is really hard to convert any backup (titanium or ultimate) for it to accept. I don't think it is bug, it is just some strange usage of adb backup. This means even if Helium creates .ab backup really it is not in that format... Or it is just unencrypted or uncompressed. And I don't have openssl and cygwin to confirm it.

---------- Post added at 01:20 AM ---------- Previous post was at 01:17 AM ----------

Yes. It looks like .ab created by Helium is just tar with ANDROID BACKUP header. Not encrypted, not compressed. Is it possible to create pack/unpack for such format?
[Android Software/Hacking General [Developers Only]] scandiun:
They claim it's adb backup

http://forums.androidcentral.com/google-nexus-7-tablet-2013/327285-helium-backup-problem.html
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Well here is what it looks like:

http://i.imgur.com/Q8p3OVU.png

It is ab format but not encrypted/compressed. Please have a look
[Android Software/Hacking General [Developers Only]] scandiun:
Is that the backup of Fifa 14?

http://xdaforums.com/showthread.php?t=2265345
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Exaclty. It is "data" without apk backup using helium. To me it looks like normal tar file splitted in chunks with 01 0a or something.

With related directory structure like apps/ which maps to /data/data in helium.
[Android Software/Hacking General [Developers Only]] scandiun:
But are you using helium in root mode?
[Android Software/Hacking General [Developers Only]] JugglerLKR:
On the phone where I posted image from backup - no.
[Android Software/Hacking General [Developers Only]] scandiun:
So you use Carbon Desktop?
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Only to "init" adb backup in samsung phone. After quick "init" - it works straight to SD or to cloud from phone, until reboot. Desktop is not needed. But If I use desktop result is the same.

---------- Post added at 02:07 AM ---------- Previous post was at 01:52 AM ----------

My purpose is to use helium to restore data to 4.x android non-rooted device from old rooted 2.3 device backup (ultimate or titanium). That's what I want to achieve - convert some backups to helium backups or to adb backups. But the problem is I don't have linux to work with tar and permissions...
[Android Software/Hacking General [Developers Only]] scandiun:
You can do it entirely with cygwin under windows. Just editing a backup may not work, I recommend you to restore the backup with the same method used for backup. In what format are they?
[Android Software/Hacking General [Developers Only]] JugglerLKR:
I have either to convert with some tools or to edit backups. Coz on the old phone helium doesn't work coz it requires 4.x, and the old phone 2.3.x

So I have to use either ultimate backup or titanium backup - both use root.

New phone, on the other hand, is 4.x, but no root, so I can't use ultimate/titanium and have to use helium.

That's the problem I'm facing with.
[Android Software/Hacking General [Developers Only]] scandiun:
Which device is the one with android 2.3?
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Dell Streak 7
[Android Software/Hacking General [Developers Only]] scandiun:
I suggest you:

1) Make Titanium Backup of the desired apps (you can do also clockworkmod backup) on the Dell Streak 7.

2) Flash Unofficial CM10.1 for Dell Streak 7 and restore all desired apps from tb or cwm (there are several apps for that in play store).

3) Now that you have 4.x you can use adb backup on it and restore on the new unrooted phone. Note that not everything is stored on adb backups, so check individually all apps if is restored what you want to.
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Impossible. There are lot of apps and games for my kid. It is better for me to forget about fifa 14 than to ruin my child's tablet.:laugh:

Anyway thanks for suggestion, I'm thinking about android x86 virtual machine for that purpose, I have just to make sure that titanium backup works in it.
[Android Software/Hacking General [Developers Only]] scandiun:
If the ab file is plain tar you can remove from it the first 24 bytes and then convert with abe.jar
[Android Software/Hacking General [Developers Only]] JugglerLKR:
If you mean helium data backup - are you sure about it that there is only header and nothing else there?
[Android Software/Hacking General [Developers Only]] scandiun:
It looks like so. You can try with an hex editor and remove the first unneeded bytes.

You should check that has the proper manifest file inside like would a normal backup.
[Android Software/Hacking General [Developers Only]] JugglerLKR:
Doesn't work. At least 7zip says it is not correct tar file.
[Android Software/Hacking General [Developers Only]] scandiun:
Then probably you didn't remove the exact number of bytes. Make apps string to start at the beginning of the archive.
[Android Software/Hacking General [Developers Only]] JugglerLKR:
This is exactly how I did it! I can send you the file it is very small, so you can examine it too. If you don't mind.

Rooting android x86 in vmware is not that simple. I still can't figure out why the root script from xda doesn't work for me.
[Android Software/Hacking General [Developers Only]] scandiun:
Send me the file then privately.
[Android Software/Hacking General [Developers Only]] scandiun:
I inform you that Fifa 14 1.3.0 is not compatible with adb backup, so isn't either with Carbon (Helium). You will see that restoring the backup just resets the progress. This happens with more games.

Titanium Backup is compatible and restores your savegame (I've checked it personally), so your only option is to root both devices.

You should send an email requesting support to help@eamobile.com and ask them the exact reason why fifa 14 it's not compatible with adb backup.
[Android Software/Hacking General [Developers Only]] prakharbirla:
Good guide, I found this the most complete & informatice guide online. I had taken an ADB backup (with shared) (encrypted) on my Nexus 4 before unlocking and rooting, but I faced lot of issues while trying to restore. After lot of different tries (including buying Titanium Backup), I decided to give this a shot.. I was on windows the whole time, but the ABE utility would not work properly until I started using Linux. After another battle with the phone, I got the backup restored fully by the following strategy:

My backup of apps and shared storage was ~5.5GB, most of which is the shared storage. The Perl utility was much easier to setup and use compared to the Java one. I used that to pack and unpack (the other "quick" method failed always when I tried to restore). For packing the tar, I used pax in the end after trying star again and again. The only problem I faced, with pax, was the path length limit so some thumbnails were not included in the tar.

Note: Since I did a full backup which included some google apps causing issues when restored. I remove all such files by monitoring the restore process using `adb logcat | grep "Backup"`.

Hope this helps someone out :)

Cheers,

Prakhar
[Android Software/Hacking General [Developers Only]] wolfmaciek:
Thanks, I'm about to attempt the same, good to have reminder to stay away from system apps.

For anyone that does a lot of checking of their adb backups using dragomerlin's excellent Android Backup Extractor and are on windows may find this explorer shell extension I put together useful. It lets you quickly go from .ab file to .tar without messing with feeding paths into command line. Basically it consists of a reg file and corresponding batch file so you can just double click on the .ab file (or right click > extract) and a tar file will be produced in the same directory.

abextract.reg:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.ab]
@="adb backup"
[HKEY_CLASSES_ROOT\.ab\shell]
[HKEY_CLASSES_ROOT\.ab\shell\extract]
[HKEY_CLASSES_ROOT\.ab\shell\extract\command]
@="C:\\android\\tools\\android-backup-extractor-20130526-bin\\abextract.bat \"%1\""

abextract.bat:

@echo off
echo extracting %1...
set abfile=%1
set tarfile=%abfile:.ab=.tar%
java -jar C:\android\tools\android-backup-extractor-20130526-bin\abe.jar unpack %abfile% %tarfile%

Of course you may have to modify paths to the abe.jar and abextract.bat

And of course this doesn't take encryption into account but I think would be easy to modify for it (maybe even with user input)

First post on XDA woohoo! I thought I'd lurk until I had a grain of sand to give to the ocean of knowledge from which I've taken :)

ps I'd attach the files but I'm probably not allowed yet
[Android Software/Hacking General [Developers Only]] scandiun:
Added warning about Helium or Carbon backup
[Android Software/Hacking General [Developers Only]] klairvoiancy:
Can't seem to get .tar working...

For some reason, I can't get

tar -xvf nexus7.tar

to work. I always end up with the error "tar: Cannot connect to C: resolve failed." I'm using Cygwin on Win7, and had the perl package installed, and added Cygwin to my PATH, but I can't think of anything else to fix the problem.

I tried restarting my Nexus 7 (2013) and remaking the backup file, then converting it to tar, but I noticed that my archives are always damaged/corrupted (according to WinRAR). Any ideas?
[Android Software/Hacking General [Developers Only]] scandiun:
It looks like latest 64 bits tar for cygwin is having issues. I recommend you to rename the cygwin folder and install it again but 32 bits.

64-bit TAR fails with "Cannot connect to e: resolve failed"
[Android Software/Hacking General [Developers Only]] klairvoiancy:
Ah okay. Thanks for that. I'll re-install with the 32-bit version and report back.

EDIT: Okay, I uninstalled the 64-bit Cygwin (and completely removed it's root folder, shortcuts, etc.) and installed the 32-bit version. At first I was getting the same exact error as above when I used the following:

tar -xvf C:/Android/backup/nexus7_2.tar

So I decided instead to just make a copy of the .tar that was made in the root directory that contained "abe.jar" file. For some reason, I guess it didn't like that I tried to direct it to the where the file was located. I don't know if that made a difference, but it worked, and I was able to then make the .list out of the extracted .tar.

My follow-up question is however, is that in the example in the OP, they make an individual tar for gta3. Is there a way I can somehow batch all of the apps I want to backup in one line? Or do I have to repeat this for each app I want to backup? Sorry for all the questions, but I'm slowly getting the hang of this!
[Android Software/Hacking General [Developers Only]] geemaan:
Just a heads-up:

I have a Nexus 5, I've just updated to 4.4.3 and the adb backup version was changed to 2! The backup extractor prints the message "Don't know how to process version 2"

I made a comment on nelenkov's related blogpost.
[Android Software/Hacking General [Developers Only]] scandiun:
Thanks for the heads up. There must be some incompatibility with version between version 1 and 2, since a new version is a mayor change. If that happened from 4.4.2 to 4.4.3 we should look to the changes between the two revisions.
[Android Software/Hacking General [Developers Only]] geemaan:
I think the only "documentation" is the source code for BackupManagerService.java starting with line 2792...
[Android Software/Hacking General [Developers Only]] scandiun:
Funky Android: KOT49H (4.4.2_r1) to KTU84L (4.4.3_r1) AOSP changelog

Using diff or patch you can get all the exact lines that were changed. Git does that also.
[Android Software/Hacking General [Developers Only]] geemaan:
I searched for "backup" but didn't find anything relevant.

*edit* but I did find the commit that changed the backup version. It has this comment: "Adapt to underlying changes in the PBKDF2 implementation"
[Android Software/Hacking General [Developers Only]] scandiun:
Using git you can get the entire diff and filter for a particular file, for example BackupManagerService.java, but probably it's not the only file affected.
[Android Software/Hacking General [Developers Only]] geemaan:
well, given that the change seems to be only because of cryptographic reasons and my backup not being encrypted I hex-edited the ab file and changed '2' to '1' and the extractor works.
[Android Software/Hacking General [Developers Only]] open-mind:
how to solve this problem?

(kitkat omni 4.4.4)

Strong AES encryption allowed
Magic: ANDROID BACKUP
Version: 2
Compressed: 1
Algorithm: AES-256
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.RuntimeException: javax.crypto.BadPaddingException: Given final block not properly padded
at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:351)
at org.nick.abe.Main.main(Main.java:64)
... 5 more
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:811)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:313)
at javax.crypto.Cipher.doFinal(Cipher.java:1922)
at org.nick.abe.AndroidBackup.extractAsTar(AndroidBackup.java:268)
... 6 more
[Android Software/Hacking General [Developers Only]] scandiun:
Two ideas:

- Check that your password is correct

- Restore the backup on the same phone or another to see if everything restore properly. That may greatly depend whether the backup is of a single app or of the whole device.
[Android Software/Hacking General [Developers Only]] open-mind:
solved (password is incorrect .)
[Android Software/Hacking General [Developers Only]] toyotabedzrock:
Is there a way to fix the .tar files created when you unpack an .ab file from a Helium/carbon backup?
[Android Software/Hacking General [Developers Only]] scandiun:
The tar files from carbon backups don't need to be "fixed", it's just that they are a different format. They are created using the debug flag I think, so they can be saved directly to the device (which is not allowed by default).
[Android Software/Hacking General [Developers Only]] toyotabedzrock:
I used abe.jar on one of the backups to convert it into a tar file and I can't open it. It looks mostly normal in a HEX editor but 7z and the gnuwin tar program refuse to open it.
[Android Software/Hacking General [Developers Only]] scandiun:
I told you already that it's a custom format, you can't extract it. If you want to edit adb backups, make them using the standard procedure using adb backup and adb restore from the computer.
[Android Software/Hacking General [Developers Only]] taigawutz::::
[HELP] can you help? where are my contacts (people)?

please, tell me where my contacts are here in this backup .tar ! (see picture below)

..and how I am able to restore/extract them..!

or if there's any way to restore the google account where they're likely stored !
[Android Software/Hacking General [Developers Only]] scandiun:
these are located in

/data/data/com.android.providers.telephony/databases/mmssms.db

and

/data/data/com.android.providers.contacts/databases/contacts.db

Anyway there are dozens of apps in the play store to do that, and if you save the contacts in your google account you don't need to backup them, just put the account again in the new device and will be restored.
[Android Software/Hacking General [Developers Only]] taigawutz::::
**** worked with Nandroid. Holobackup is worthless piece of crap.

Nandroid did restore the system with CWM's help. People, do your backups with Root+Nandroid only. :good:
[Android Software/Hacking General [Developers Only]] bronyDrake:
Please Help

I did restore my Oneplus one using Holo backup for unlocking bootloader and to root.

So i used full backup excluding system apps. Backup went fine and created 9 GB "backup.ab" file. But i'm getting trouble when i restore. It is getting stuck with one app restore. Almost all apps restored.

The problem is, among 9 GB file i think it is almost restoring around 2 GB and it stucks there with "com.adobe.psmobile". So my 7 GB data is left to restore. its my shared storage.

I have only basic knowledge about adb.. Can anybody please help me to restore or extract the files. I Just wan't to get the backup of shared storage data which is most important for me.. :( :(

Thanks in advance

[MENTION=2738944]scandiun[/MENTION]

This is the out i'm getting.... Any help???
[Android Software/Hacking General [Developers Only]] scandiun:
The backup is encrypted with a password, and you don't have the unlimited policy installed. Please read first the instructions.

Strong AES encryption not allowed
Compressed: 1
Algorithm: AES-256