[Android Software/Hacking General [Developers Only]] chris@xda:
https://github.com/omegavesko/HoloBackup

Better do it yourself

Enable Android ADB Backup

The Android backup feature using adb backup is only available from Android 4.0+. To use this feature, USB debugging (under Settings -> Developer options) must be enabled on the device.

Also, this feature does not work on all apps. To enable ADB backup for an app, that app must have set the android:allowbackup attribute to true in the Android Manifest (AndroidManifest.xml) XML file.

Android Manifest XML File

<application>

...

android:allowBackup="true"

...

</application>

1

2

3

4

5

<application>

...

android:allowBackup="true"

...

</application>

Apps like the Google Authenticator have disabled the ADB backup feature to prevent sensitive information from being extracted from the device. ADB backup will not work on such apps. An attempt to perform an ADB backup on such apps will only generate a dummy file with no valid content inside.

Perform Android ADB Backup

To perform an ADB backup, you will first need to know the package name of the app in question. For example, if you want to perform a backup of the WhatsApp application, the package name would be “com.whatsapp“.

You can get a list of the installed packages by running the pm list packages command from the ADB shell.

$ adb shell pm list packages

Another easier way is to extract the package name from the app’s Google Play Store web URL. For WhatsApp, the URL is https://play.google.com/store/apps/details?id=com.whatsapp and the package name can be found after the “id=” field.

To perform a backup, connect the phone to the computer via USB and run the ADB backup command. If you want to backup WhatsApp, run adb like this:

$ adb backup -f com.whatsapp.ab -noapk com.whatsapp

This will trigger a confirmation dialog prompting you to authorise the backup on your phone as shown below. Click on the “Back up my data” button without providing a password. The backup will start only after you click on the button.

Wait for the ADB backup command to complete. It may take a while, depending on the size of the data to be backed up. The backup will be written to the file specified in the “-f” option, in our case, it’s “com.whatsapp.ab“. The “.ab” extension indicates Android Backup. The “-noapk” option means that a backup of the .apk file is disabled and only the contents are backed up.

Restore / Repack Android ADB Backup

To restore the original Android Backup archive, run adb like this:

$ adb restore com.whatsapp.ab

A nice little helper for preparing ADB backups has landed in from switzerland:

https://play.google.com/store/apps/details?id=ch.masshardt.adbbackuphelper&hl=en_US

1. To backup app data along with apk

Type in this command:

adb backup -f “D:\myfolder\myapp.ab” -apk <package name>

-f parameter specifies the file location, -apk specifies to backup apk (and not only app data)

Once you enter this command on PC you will be prompted to unlock phone screen. Unlock screen and select ‘Back Up Data’ and also enter password if you have set up any previously. This command will store the backup to myapp.ab file on your PC. To restore this back to your phone simply type in:

adb restore “D:\myfolder\myapp.ab”

This command will restore entire app back to your phone.

2. To backup only app data

To backup only data don’t pass -apk parameter. This will only backup the app data in myapp.ab file. Remember that before you restore this backup the app should already be installed on the phone (From play store or from apk file which you are supposed to have).

3. To backup multiple apps

If you need to backup more than one app put in all package names in <package name> parameter with single space between each name. Alternatively if you want to backup all apps on phone you can use:

adb backup -f “D:\myfolder\myapp.ab” -all -apk -nosystem

-nosystem parameter is used to exclude system apps from backup, as restoring system apps sometimes causes stability issues.

4. To backup your personal data only

adb backup -shared -f “D:\myfolder\mydata.ab”

-shared does a backup of personal data from the internal SDcard. It used to exclude apps, but should save settings