Friday 12 June 2015

How To Flash Custom Recovery To Your Android Phone

How To Flash Custom Recovery To Your Android Phone





We will be using two methods
1. Via Fastboot mode
2. Using dd command


1. Via Fastboot

Things required.

Install java jdk in your computer

Make sure you have downloaded and installed the device drivers provided by your phones manufacturer's website.

Download this zip file and extract in a folder and place it anywhere in C drive.
link:http://www.mediafire.com/download/hdeg7cpexblodjt/fastboot_adb(1.0.32).rar

Recovery image file for your device. CWM or TWRP



          CWM                                                                TWRP

When you download recovery file, place it in the folder extracted and placed in C drive.
Now go inside the folder and press 'Shift key' and right click and select option "Open command window here" from context menu.

Now boot your phone in fastboot mode.Every different manufacturer's device has its own way to boot in fastboot.
So Google it and find out how to boot your device in fastboot mode.

For example in Htc device press = Hold volume down + home buttons together.

When you boot successfully in fastboot mode.Connect your phone to your pc/laptop via usb.

And check if your device is recognised by adb.For that type command
adb devices



It will shows your device serial number.

Now to flash recovery type this command
fastboot flash recovery <name of recovery>

For example; 
fastboot flash recovery twrp-2.8.6.0-xt1032.img



This will flash recovery image in your device.And then you can boot into recovery by giving this command.
adb reboot recovery
You will be successfully boot into recovery mode.

2. Using dd command

We can also flash recovery image manually using this dd command.The good thing about this method is we can also directly flash recovery from our phone
using app "Terminal Emulator".
We will discuss both methods here 
1.With Pc 
2.Without Pc

Download recovery image file for your device.

1.Without Pc

Go to the Google PlayStore,find app "Terminal emulator" and download it.
link: https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en

After that download the recovery image for your device and place it in your sdcard.
Now you need to find recovery partition of your device, so open terminal emulator and type in these commands.
su
cat /proc/mtd

i.e;
dev:    size   erasesize  name
mtd0: 000a0000 00020000 "misc"
mtd1: 00500000 00020000 "recovery"
mtd2: 00400000 00020000 "boot"
mtd3: 0ec60000 00020000 "system"
mtd4: 03b00000 00020000 "cache"
mtd5: 09e00000 00020000 "userdata"
mtd6: 00a00000 00020000 "devlog"


It will show the name of the recovery partition.Note it down somewhere. 
Now after that type the dd command. In the place of [recoveryimg] add path of your recovery image, and in the place of [recovery partition] write the your name of 
recovery partition which you noted down previously.
su
dd if=[recoveryimg] of=/dev/block/[recovery partition]

i.e;
su
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p18



Done !! You can boot in the recovery mode using right combination of buttons.

2. With Pc

Download this zip file and extract in a folder and place it anywhere in C drive.
link:http://www.mediafire.com/download/hdeg7cpexblodjt/fastboot_adb(1.0.32).rar

Download recovery image file for your device.

When you download recovery file, place it in the folder extracted and placed in C drive.
Now go inside the folder and press 'Shift key' and right click and select option "Open command window here" from context menu.

Now boot your device in fastboot mode and connect your device to your Pc/laptop.

Now type in this command to konw if adb is recognising your device or not.
adb devices


It will show your serial number.
Now type in this command.
adb shell

It will show you the '$' sign. That means you are in the bash shell



Now you need to find recovery partition of your device, so in these commands.
su
cat /proc/mtd

i.e;
dev:    size   erasesize  name

mtd0: 000a0000 00020000 "misc"
mtd1: 00500000 00020000 "recovery"
mtd2: 00400000 00020000 "boot"
mtd3: 0ec60000 00020000 "system"
mtd4: 03b00000 00020000 "cache"
mtd5: 09e00000 00020000 "userdata"
mtd6: 00a00000 00020000 "devlog"


It will show the name of the recovery partition.Note it down somewhere. 
Now after that type the dd command. In the place of [recoveryimg] add path of your recovery image, and in the place of [recovery partition] write the your name of 
recovery partition which you noted down previously.
su
dd if=[recoveryimg] of=/dev/block/[recovery partition]

i.e;
su
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p18

Done !! You can boot in the recovery mode using this command.
adb reboot bootloader

No comments:

Post a Comment