To my knowledge, this is the first and currently (but not for long), the only confirmed working rooting method for Nexus 4 posted here at XDA. Though my knowledge is limited, so please correct me if I am wrong.
I originally posted this method at AddictiveTips. The method I posted there is targeted at everyone including the absolute beginners and I have also included instructions there for setting up the required tools, and for reverting back to the original recovery and boot image in case anything goes wrong. All external credits should be given to that guide (it does link back to this thread). Here is the link:
How To Root Nexus 4.
Getting straight to the point for now. Will edit this post to add cosmetic changes later.
UPDATE: There is a working CWM now available that lets you flash zip files from sd card, so this should all be easy as pie now. I am adding the CWM method too. BIG thanks to
Stryder5 for this method and to
fkrone for working CWM. Please don't flash the recovery yet; just simply boot with it as per the instructions provided below, for rooting the device.
ADB and Insecure Boot Image Method:
- Grab the insecure boot image by Harry GT-S5830 from this thread.
- Also download these root files. This package includes the latest SuperSU 0.98 (all credits to Chainfire), latest su binary that comes with it, and working busybox (not sure if latest).
- Extract the contents of the downloaded zip file to your computer.
- Enable Android Debugging from Settings > Developer Options. (If you can't find developer options, go to 'About' and tap 'Build number' seven times.)
- Connect the device to your computer via USB, and install the required drivers (Thanks Stryder5).
- Reboot into fastboot/bootloader:
Kod:
adb reboot bootloader
You can also power off the phone and then use power + volume-down key combination to get into bootloader.
- Unlock the bootloader if you haven't done so already. WARNING: This command will wipe all data on your device.
- Get back into bootloader mode and boot into the downloaded insecure boot image:
Kod:
fastboot boot boot.img
Don't worry, this will not replace your existing boot image and will only boot from the insecure one once.
- Once booted into Android successfully using the insecure boot image, simply enter these commands one by one in command prompt (making sure you are in the directory where you downloaded the files):
Kod:
adb shell mount -o remount,rw /system
adb push su /system/bin/
adb push Superuser.apk /system/app/
adb push busybox /system/xbin/
adb shell
chmod 06755 /system/bin/su
chmod 0644 /system/app/Superuser.apk
chmod 04755 /system/xbin/busybox
cd /system/xbin
busybox --install /system/xbin/
exit
exit
- Reboot your device.
ClockworkMod Recovery Method:
- Download working ClockworkMod recovery by fkrone from this thread.
- Enable Android Debugging from Settings > Developer Options. (If you can't find developer options, go to 'About' and tap 'Build number' seven times.)
- Connect the device to your computer via USB, and install the required drivers (Thanks Stryder5).
- Download the recovery flashable SuperSU package with Busybox and transfer it to your phone's internal SD card.
- Reboot into fastboot/bootloader:
Kod:
adb reboot bootloader
You can also power off the phone and then use power + volume-down key combination to get into bootloader.
- Unlock the bootloader if you haven't done so already. WARNING: This command will wipe all data on your device.
- Enter this command in a command prompt (making sure you are in the directory where you downloaded the recovery file):
Kod:
fastboot boot cwm-recovery-mako.img
- Now boot into recovery by pressing volume-up or volume-down twice to select the recovery option, and then the power button to enter it.
- Once in recovery, take a backup to be on the safe side.
- Flash the downloaded SuperSU and busybox package zip file from recovery.
- Clear cache and dalvik cache just in case (not required but won't hurt).
- Reboot the device.
Update: Kudos to
Kstarz for
posting this same recovery method with his own working CWM in this thread earlier on as well. I just noticed it. You guys can use his recovery too, and it should work the same. Again, please don't flash any of these recoveries yet; just boot with them as per the instructions provided, for rooting purposes and wait till a fully functional one is out there before you flash one.
You will now have root access. Tested and
confirmed working by Stryder5 and many others.
I have tried my best to give everyone the due credit but if I have missed out on anyone, please do remind me.
Click to expand...