5,599,337 Members 38,281 Now Online
XDA Developers Android and Mobile Development Forum

[UNROOT] Unroot any android device

Tip us?
 
siidheesh
Old
(Last edited by siidheesh; 7th January 2011 at 07:39 AM.)
#1  
siidheesh's Avatar
Member - OP
Thanks Meter 29
Posts: 38
Join Date: Dec 2010
Location: Singapore

 
DONATE TO ME
Default [UNROOT] Unroot any android device

HOW TO UNROOT (ALMOST) ALL ANDROID DEVICES (SIMPLIFIED)

Firstly, in order to unroot your android device, you need:

1) An update available for your phone or an old nandroid backup that has a previous version of your phone android version

2) A nandroid backup done before you attempt the following steps below

Once the above conditions are met, you are ready to UNROOT your phone!

Before you read the procedure, read how it works
below and get a better picture:

HOW

Firstly, one known method of unrooting is to install an available system update. However, stock updates are signed with official keys and custom recoveries only accept updates signed with their custom keys.
So, to unroot, you need to have stock recovery installed. One way to get your phone`s stock recovery back is contained in the update zip.

The update zip is the key, literally. Look through it and you will find (usually in the system folder) a file called recovery.img, which will be used as your new stock recovery.

By flashing in the image into recovery, you can now install updates, keep your previous applications, enjoy being unrooted and updated.

There are other unroot options that tailor to specific android phones and versions, but this solution should work on all android phones.

Why unroot? Because sending in a rooted phone for repair will void your warranty. Also, by having a rooted phone, you run the risk of a rogue rooted application that does unwanted stuff to your phone.

PROCEDURE

Step 1) If you still have your original stock recovery that came with your phone, continue. Else search for my previous thread: "[RECOVERY] Reverting to original(STOCK) recovery" and follow the steps there. You can use the update file you used to revert to stock recovery here as well or vice versa

Step 2) Reboot you phone

Step 3) Check for system updates and download them

Step 4) Wait until phone reboots. All your applications and user settings will be retained.

Step 5a) Open up a terminal emulator on your phone and enter "su" (Check if unroot)

Step 5b) If you cant turn your phone on to check if unrooted, boot into recovery mode, open up adb enter:
Code:
adb shell
su
Step 6) If you get "permission denied" or something like that from step 5a/5b,
CONGRATULATIONS! YOUR PHONE HAS BEEN SUCCESSFULLY UNROOTED!

Step 7) If you don`t want to void your warranty, you should unistall applications that require root, especially Superuser

To date, I have rooted and unrooted my phone (Backflip) 3 times without any problems. In case your phone can`t be booted up, only to the bootloader or recovery, DO NOT WORRY! You can use the adb (android debug bridge) to flash in the stock recovery, push/pull the updates and reboot the phone into recovery mode or normal mode!!!

Useful ADB commands

Reboot Phone
Code:
adb shell
reboot
Reboot Phone into recovery mode
Code:
adb shell
reboot recovery
Flash a new recovery image temporarily (resets when rebooting)
Code:
adb shell
flash_image recovery /sdcard/recovery.img
Flash a new recovery image that does not reset when rebooting
Code:
adb shell
flash_image recovery /sdcard/recovery.img
exit
adb shell
cd system
su
mount -o rw,remount /dev/block/mtdblock1 /system
rm recovery.img
mount -o ro,remount /dev/block/mtdblock1 /system
exit
exit
Push file to sdcard
Code:
adb push file.blah /sdcard/file.blah
Push file to sdcard
Code:
adb pull /sdcard/file.blah file.blah
Here`s wishing you good luck and a belated happy new year!

Phone: Motorola Backflip running Cupcake
PC: Dell Studio XPS 1645

The test results just came in... Im diagnosed with ord...

PLEASE CLICK THE 'THANKS' BUTTON ON MY POST IF I HAVE SINCERELY HELPED YOU. THANK YOU!!!
The Following 20 Users Say Thank You to siidheesh For This Useful Post: [ Click to Expand ]
 
aliwaqas
Old
#2  
Member
Thanks Meter 17
Posts: 77
Join Date: May 2010
Location: Islamabad
Err.. Pretty cool info there but what if you don't meet above three requirements? I mean there are noobs like me who'd rather jump onto flashing while forgetting about nandroids etc. I guess there should be a one click unroot utility for all android devices like we have for rooting.
 
Fiddlestix
Old
#3  
Member
Thanks Meter 0
Posts: 61
Join Date: Aug 2010
im really confused.

if the phone has been rooted (using fastboot oemunlock - yes) then how can we "unroot" this device? till today there has not been a way to do so.

but if what ur suggesting relocks the bootloader (removes the cross at bootup) then woohoo!
 
siidheesh
Old
#4  
siidheesh's Avatar
Member - OP
Thanks Meter 29
Posts: 38
Join Date: Dec 2010
Location: Singapore

 
DONATE TO ME
Lightbulb The main point

ok, i think you guys dont understand what my point on unrooting is...

What im trying to say is:

Updating your phone software with an original OTA update on the original rom the came with your phone will automatically reset root. However, custom roms and recoveries dont accept OTA updates, so you need to flash back your original recovery first, nevermind if you have a custom rom.

If you don`t meet the requirements, then i`m sorry, you`ll just have to wait for an available system update like me. However if you get one, be sure to come back here if you want to unroot.
 
siidheesh
Old
#5  
siidheesh's Avatar
Member - OP
Thanks Meter 29
Posts: 38
Join Date: Dec 2010
Location: Singapore

 
DONATE TO ME
Default Creating a one/two click-unroot application

Actually, you may be right. The unroot procedures can also be carried out by adb alone , not by user interaction. So a desktop application can be created that automates the process

1) Open adb shell
2) Enter su
3) Pull the update zip from the phone
4) Recursive/y search the zip for the file recovery.img
5) Run 'flash_image recovery recovery.img'
6) Run 'adb reboot' to reboot phone
7) Phone will install update on stock update when rebooting complete
8) When update installed, root will be removed and your phone will be updated as well!

We can send keystrokes to the adb for the adb shell.
 
Jonathon Grigg
Old
#6  
Senior Member
Thanks Meter 254
Posts: 1,223
Join Date: Dec 2010
Location: Perth, WA

 
DONATE TO ME
Quote:
Originally Posted by siidheesh View Post
Actually, you may be right. The unroot procedures can also be carried out by adb alone , not by user interaction. So a desktop application can be created that automates the process

1) Open adb shell
2) Enter su
3) Pull the update zip from the phone
4) Recursive/y search the zip for the file recovery.img
5) Run 'flash_image recovery recovery.img'
6) Run 'adb reboot' to reboot phone
7) Phone will install update on stock update when rebooting complete
8) When update installed, root will be removed and your phone will be updated as well!

We can send keystrokes to the adb for the adb shell.
Shouldn't be too hard, probably only a simple script would suffice I'll see what I can come up with (if I can do anything ). Supply the script with your required update zip to make it work in a different way (maybe, I'm not great with details)
 
Jonathon Grigg
Old
(Last edited by Jonathon Grigg; 6th January 2011 at 10:19 AM.)
#7  
Senior Member
Thanks Meter 254
Posts: 1,223
Join Date: Dec 2010
Location: Perth, WA

 
DONATE TO ME
Default Automated Script

Can someone please clarify that this would work (as an unroot script):

1. Opens ADB shell
2. Enters su
3. (User) Supply script with stock update.zip - in case it's not on phone (correct if this is unnecessary)
4. recovery.img extracted from update.zip
5. recovery.img flashed to phone via 'flash_image recovery recovery.img'
6. Reboots phone via 'adb reboot'

That installs stock recovery, but what if there was no OTA update to install for that particular device? That's the only problem I can see with such a script, so I'm hesitant to make it right now (besides, I don't have my Nexus with me at the moment, so I couldn't test it).

Dumb question but would flashing a stock update.zip from the stock recovery remove root? Or does it have to be OTA? Never having done it before I'm not sure.

Edit: If it did have to be OTA, maybe you could find the original update.zip (ie. no updates before it) and flash that, so there would be a higher chance of an OTA update?
 
siidheesh
Old
#8  
siidheesh's Avatar
Member - OP
Thanks Meter 29
Posts: 38
Join Date: Dec 2010
Location: Singapore

 
DONATE TO ME
Default Different definitions

Sorry people, when i mean ota update, i dont just over-the-air updates, i am referring to original updates for your original android system that came with your phone.
 
Jonathon Grigg
Old
#9  
Senior Member
Thanks Meter 254
Posts: 1,223
Join Date: Dec 2010
Location: Perth, WA

 
DONATE TO ME
Quote:
Originally Posted by siidheesh View Post
Sorry people, when i mean ota update, i dont just over-the-air updates, i am referring to original updates for your original android system that came with your phone.
So just to clarify, you could install any stock ROM for your device and it would remove root? Specifically if it was installed through stock recovery.

Thanks, hopefully I might be able to make some progress after this
 
siidheesh
Old
#10  
siidheesh's Avatar
Member - OP
Thanks Meter 29
Posts: 38
Join Date: Dec 2010
Location: Singapore

 
DONATE TO ME
Default not as easy as it seems

Quote:
Originally Posted by jonathongrigg View Post
Can someone please clarify that this would work (as an unroot script):

1. Opens ADB shell
2. Enters su
3. (User) Supply script with stock update.zip - in case it's not on phone (correct if this is unnecessary)
4. recovery.img extracted from update.zip
5. recovery.img flashed to phone via 'flash_image recovery recovery.img'
6. Reboots phone via 'adb reboot'

That installs stock recovery, but what if there was no OTA update to install for that particular device? That's the only problem I can see with such a script, so I'm hesitant to make it right now (besides, I don't have my Nexus with me at the moment, so I couldn't test it).

Dumb question but would flashing a stock update.zip from the stock recovery remove root? Or does it have to be OTA? Never having done it before I'm not sure.

Edit: If it did have to be OTA, maybe you could find the original update.zip (ie. no updates before it) and flash that, so there would be a higher chance of an OTA update?
You cant make an unroot script that easily. Im halfway working on a .net application that does it on desktop.

Also, almost all great things come with a *catch*. In this case, you need to wait for an ota update to be available. Or if you took a nandroid backup some time back and updated your version, you can revert back to the old verison and update again.

Tags
backflip, root, unroot, unroot android, unroot phone
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...