Android full phone backup without an unlocked boot loader or root

When it comes to computers, smartphones or just anything electronics in general it’s always a good idea to have a backup. The Apple iTunes ecosystems allows a user to easily create a backup from your phone that includes your data, settings, literally everything with just a touch of a button. So even if you lose or break your device you can simply buy a new one and restore your backup. It’s as if it never happened. 

However things on Android have never been that easy. Users with a rooted device could always use Titanium Backup to backup all applications and settings but I haven’t heard of an application that allows this on non-rooted devices. I reckon that technically it’s not possible without root access as applications don’t have the permissions to access the /system/app/ folder where all the installed applications reside. 


Luckily, there seems to be a way now to backup your Android phone with the help of ADB – the android debug bridge from the android SDK. Keep in mind that your phone needs to have at least Android 4.0 running. As this hasn’t been publicised explicitly as a new feature of ICS I would still treat is experimental. From my personal experience I can tell that it works rather well, otherwise I wouldn’t be writing about it.


Before we start, I am going to assume that you’ve already installed the Android SDK and updated the SDK Platform Tools to the latest version using the SDK Manager.

To Backup your phone: 

  1. Connect your phone via usb and make sure that you have enabled usb debugging in the developer options. Open up a command / terminal prompt
    1. Optionally you can type the command “adb devices”
      1:  chriss-mbp:~ chris$ adb devices  
      2: List of devices attached
      3: 047c58661c9162b9 device
      4:
      5: chriss-mbp:~ chris$

  2. The command ‘adb backup’ allows you to create a full backup of your android device

The command syntax:     [ command ] : optional argument

 adb backup [ -f ] [ -apk | -noapk ] [ -shared | -noshared ] [ -all ] [ -system | -nosystem ] [  ]  


The following basic command will use the defaults to backup only application and device data without the APKs itself to the file ‘backup.ab’ in your current working directory

You might need to specify the backup file in case the following error occurs:
“adb: cannot open file ./backup.ab”

 adb backup -all -f C:\backup.ab  

Explanation of parameters:

 -f   

specifies where the backup file will be saved.

 -apk | -noapk  

flag sets whether or not the APK’s of an application should be included in the backup or simply the application’s respective data. The default is -noapk. I highly recommend -apk just in case the apk is not available anymore from the market. Saves hunting down the apk on some dubious 3rd party file hoster.

 -shared | -noshared  

flag sets whether the device’s shared storage (included memory of the device), usually mounted at /sdcard/ is backed up. The default is -noshared. I highly recommend this for nexus devices as they have no external micro-sd card slot and all the pictures/music are saved on the internal storage. Still use a PC to backup your pictures/music manually or use something like Dropbox or G+ Auto-Upload. Better safe than sorry.

 -all 

flag set whether to backup all the applications or just backup the app specified by the argument

 -system|-nosystem

flag sets whether or not the -all flag will also include system applications or not. When I backup my phone I always use -system just in case. I guess when restoring your backup to a new phone with a higher Android version it would be advisable / safer to use -nosystem.

Once you’ve have made your decision on what to backup, simply type the command into the terminal. I usually use:

 adb backup -apk -shared -all -system -f ~/backups/nexus4_20130901.db   

A screen like this will appear on our Android device:

Backup dialog

You can enter a password to encrypt the backup. You will need this password to restore the backup. Thus make sure not to forget or don’t set one.

This process can take several minutes up to a couple of hours, depending on the settings you have chosen, especially when you included the shared storage. As soon as the backup completes, a toast message will appear saying “Backup Complete”

To Restore your phone:

With your device connected enter the following command into command prompt / terminal

 adb restore ~/backups/nexus4_20130901.db   

replacing ~/backups/nexus4_20130901.db with the location of your backup file.

A screen like this will appear on your Android device:

Restore dialog

Type in your current encryption password in case you set one and press ‘Restore my data’ to begin the restore. Again it can take several minutes up to a couple of hours. After the restore your should system should be back just like when you created the backup short of some widgets and wallpaper on the homescreen.  My alarms remained and for most applications it even kept my login. It kept everything.

NOTE: This will not backup your SMS. I suggest using something like SMS Backup & Restore

Android / WebOS Dualboot on HP Touchpad

A “friend” of mine asked me if I could fix his HP Touchpad. It was stuck in an endless bootloop after he had tried to flash an Android r,om. He didn’t provide me any detalis regarding what he had done and what tools he used to flash android , moboot (bootloader for dual booting webos and android) and various other things. Moboot presented me 5 different options at the first boot-up:

  • Boot Web-OS
  • Boot Android
  • Boot WebOS Recovery
  • Boot TWRP-Recovery

WebOS and TWRP-Recovery were the only working options. Everything else resulted in a bootloop.

In situations where the previously applied procedures are unknown it’s always the best to start from scratch. That meant:

  1. restore the touchpad to its original state (WebOS only)
  2. install twrp-recovery and moboot
  3. flash android

First road-block: restoring the touchpad

Trying to restore the Touchpad with WebOSDoctor always falied at 8%. It turns out that the usb-storage somehow got completely corrupted. Source

In order to restore the usb storage completely (in case the sdcard cannot be mounted as the underlying lvm has been destroyed) the physical volume needs to be recreated

Preqrequisites
  • Novacom
  • Novaterm
  • Recovery image
  • WebOS Doctor v.3.0.0
  • WebOS Doctor v.3.0.5 (optional)
Initial Setup
  1. Install Novacom driver and extract novaterm to novacom’s install folder
  2. Open a command prompt and navigate to your Palm, Inc folder (usually \Program Flies\Palm, Inc)
  3. Move the recovery uImage to the Palm, Inc folder.
  4. Boot your Touchpad into recovery (Power + Volume Up from power off)
  5. In that command prompt, run
    novacom boot mem:// < nova-installer-image-topaz.uImage
  6. Once running, the HP logo will appear on the touchpad. Now you should be able to connect to the touchpad with novaterm
    Touchpad in recovery mode
  7. A prompt starting with:

    root@webOS device

    should appear

  8. Run the following commands in ORDER
    (!Important!: they are case sensitive)
     #completely erase the lvm and recreate the physical volumes

    dd if=/dev/zero of=/dev/mmcblk0p14 bs=1024 count=1000
    lvm.static pvcreate /dev/mmcblk0p14

    #For 32GB Touchpads only

    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgremove store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgcreate -s 8M store /dev/mmcblk0p14
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static lvcreate -l 71 -i 1 -M y --major 254 --minor 0 -n root store
    lvm.static lvcreate -l 8 -i 1 -M y --major 254 --minor 1 -n var store
    lvm.static lvcreate -l 2 -i 1 -M y --major 254 --minor 2 -n update store
    lvm.static lvcreate -l 3 -i 1 -M y --major 254 --minor 3 -n log store
    lvm.static lvcreate -l 32 -i 1 -M y --major 254 --minor 4 -n mojodb store
    lvm.static lvcreate -l 17 -i 1 -M y --major 254 --minor 5 -n filecache store
    lvm.static lvcreate -l 3523 -i 1 -M y --major 254 --minor 6 -n media store
    lvm.static lvcreate -l 64 -i 1 -M y --major 254 --minor 7 -n swap store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    mkdosfs -f 1 -s 64 /dev/store/media

    #For 16GB Touchpads only

    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgremove store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static vgcreate -s 8M store /dev/mmcblk0p14
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    lvm.static lvcreate -l 71 -i 1 -M y --major 254 --minor 0 -n root store
    lvm.static lvcreate -l 8 -i 1 -M y --major 254 --minor 1 -n var store
    lvm.static lvcreate -l 2 -i 1 -M y --major 254 --minor 2 -n update store
    lvm.static lvcreate -l 3 -i 1 -M y --major 254 --minor 3 -n log store
    lvm.static lvcreate -l 32 -i 1 -M y --major 254 --minor 4 -n mojodb store
    lvm.static lvcreate -l 17 -i 1 -M y --major 254 --minor 5 -n filecache store
    lvm.static lvcreate -l 1618 -i 1 -M y --major 254 --minor 6 -n media store
    lvm.static lvcreate -l 64 -i 1 -M y --major 254 --minor 7 -n swap store
    lvm.static vgscan --ignorelockingfailure
    lvm.static vgchange -ay --ignorelockingfailure
    mkdosfs -f 1 -s 64 /dev/store/media

  9. When done, reboot the Touchpad into recovery (Power + Center/Home until the screen is off, then Power + Volume UP)
  10. Run WebOS Doctor 3.0.0 (this is to ensure a repartioning and no other version will work at this point)
  11. Optional steps to upgrade to WebOS 3.0.5

  12. When WebOS Doctor is complete, hold down Power + Center, and when the screen turns off, immediately hold power and Volume up to reboot into recovery again
  13. As soon as the USB icon appears again, run WebOS Doctor 3.0.5
  14. WebOS Doctor will automatically reboot your Device and after a while the following screen should appear (remark: the first boot-up can take quite a while)

Flashing Multi-Boot Loader & Android

Preparing the files
  1. Download the following CM-10 Package: Cyanogenmod 10 Jelly Bean (CM10-2013/04/18) cminstall package and extract it
  2. Attach the HP Touchpad with your PC with the usb cable and place it into MTP – Mode
  3. Transfer the extracted “cminstall” folder into the internal storage (e.g. /sdcard/cminstall) of your HP Touchpad
    Make sure that the folder is called cminstall
Installation
  1. As soon as the files are on the HP Touchpad, reboot the Touchpad into WebOS Recovery (USB – Mode)
    First disconnect the usb cable from PC (windows: green icon to eject the external drive)
    In WebOS reboot the device:
    –> Settings –> Device Info –> Reset Options –> Restart
  2. As soon as the screen goes dark: Hold down the volume up button until you enter the WebOS Recovery mode (in case you miss it, reboot and try again)
  3. On your PC:
  4. Open a command prompt and change to the “Palm Inc.” directory in “Program Files”
    cd "c:\Program Files\Palm. Inc\"
  5. Start the acmeinstaller to install cm10:
    novacom.exe boot mem:// 
  6. While Cyanogenmod is istalling you will see lines of text scrolling on the HP Touchpad informing you about the current operation the installer is performing.
    Once this is completed the Touchpad will automatically reboot and you will be greeted by the moboot bootloader menu and Cyanogenmod will automatically boot for the first time.

    Remark: to switch between WebOS and Android, reboot the device and press volume up button as soon as the moboot screen appears (to interrupt the automatic timeout) and select the OS you would like to boot.

Samsung Galaxy S3 Optimization via build.prop

One major point speaking for Samsung devices in general is the usual unlocked boot-loader that allows you to modify the system partition. The build.prop file is your device’s “ID Card”. It contains the device’s specifications that allows an application to customise the program according to your device’s specification.

Editing the build.prop file is most commonly used for changing LCD density, build number, the device’s model and manufacturer information. Changing the “fingerprint” of your device can trick some applications in the market into becoming compatible with your device 😉

What you will need

Simple work-around: remove all settings from parental controls

  • a rooted Galaxy S3
  • a file explorer that allows you to remount and explore /system partition (e.g. ES File Explorer)
  • Preferably a nandroid backup of your device (just in case)

Proceed with caution: Attempting to modify and/or overwrite core system files may be detrimental to the function of your device, which could result in lost and unrecoverable data. Make sure to back up your device before continuing with this guide.

Step 1. Open the build.prop file

Start ES File Explorer and navigate to /system. Press the menu button and choose the category: root explorer. Select Mount R/W and remount /system partition as writeable. Open the build.prop file with the included ES Note Editor.

Step 2. Choose the settings to add

#Fast Reboot
persist.sys.purgeable_assets=1

#Increasing the Video Recording Quality
ro.media.enc.hprof.vid.bps=8000000

#Screen Rotate to 270 Degrees
windowsmgr.supportrotation_270=true;

#Increase VM Heap Size (Resolve Some FC's)
dalvik.vm.heapsize=64m

#Render UI with GPU
debug.sf.hw=1

#Increasing It Will Make Mobile Smoother
windowsmgr.maxevents_per_sec=150

#Video Acceleration Enabled
video.accelerate.hw=1

#Increase Performance
debug.performance.tuning=1

#Disable Sending Usage Data
ro.config.nocheckin=1

#Deeper Sleep / Better Battery Life
ro.ril.disable.power.collapse=1

pm.sleep_mode=1

#Ringing Will Start Immediately
ro.telephony.callring.delay=0

#Disable Error Checking
ro.kernel.android.checkjni=0

#Increase Quality of Media Streaming
media.stagefright.enable-meta=true

media.stagefright.enable-scan=true

media.stagefright.enable-http=true

media.stagefright.enable-record=false

#Disable BootAnimation
debug.sf.nobootanimation=1

#Force Launcher to Remain in Memory
ro.HOME_APP_ADJ=1

#Disable Waking Up of Phone by Volume Buttons
ro.config.hwfeature_wakeupkey=0

#Off the Proximity Quickly After Call
mot.proximity.delay=25
ro.lge.proximity.delay=25

#Signal Tweaks
ro.ril.hsxpa=2

ro.ril.gprsclass=10

ro.ril.hep=1

ro.ril.enable.dtm=1

ro.ril.hsdpa.category=10

ro.ril.enable.a53=1

ro.ril.enable.3g.prefix=1

ro.ril.htcmaskw1.bitmask=4294967295

ro.ril.htcmaskw1=14449

ro.ril.hsupa.category=5

#NetSpeed Tweaks
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960

net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960

net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960

net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960

net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960

#Google DNS Tweak
net.rmnet0.dns1=8.8.8.8

net.rmnet0.dns2=8.8.4.4

net.dns1=8.8.8.8

net.dns2=8.8.4.4

#Increase Photo and Video Quality
ro.media.dec.jpeg.memcap=8000000

ro.media.enc.hprof.vid.bps=8000000

ro.media.enc.jpeg.quality=100

#Touch Responsiveness
debug.performance.tuning=1

video.accelerate.hw=1

#Scrolling Responsiveness
windowsmgr.maxevents_per_sec=500

#Power Save Tweaks
ro.ril.disable.power.collapse=1

pm.sleep_mode=1

#Disables Debug Icon on Status Bar
persist.adb.notify=0
Faster Scrolling
ro.max.flingvelocity=12000

ro.min.fling_velocity=8000

#Wi-Fi to Scan Less Frequently
wifi.supplicantscan_interval=180

#Improve Battery When No Signal
ro.mot.eri.losalert.delay=1000

#Frees RAM to Allow Applications to Load Faster (edit existing line)
dalvik.vm.dexopt-flags=m=v,o=y

Step 3. Add chosen settings to the build.prop file

From the list above choose the options to add to your build.prop file. Scroll down to the bottom of the file and press the overflow button in the actionbar. Choose Edit and append the settings to the file.

Back-out of the editor to save the file

Step 4. Reboot the device + clean up

To apply those changes:

  1. reboot into recovery – mode by restarting the phone and holding down Volume Up + Home + Power Buttons
  2. in recovery mode choose: Wipe Cache and Wipe Dalvik Cache
  3. still in recovery mode choose: reboot now

Depending on the settings you added the changes might not be noticeable immediately.