I have an LG G2-D800 running 4.4.2 KitKat and it is rooted using an app called Stump Root. I have been trying to flash a new ROM onto it and every time it boots into recovery, it boots into the android recovery, even though I have flashed it using Clockwork Mod and TWRP Manager. Can anyone help with this and suggest good ROMs to flash to it?
Its because stock roms come with their own recovery. That will always replace custom recovery. To prevent this, whenever you download a rom, open its tar or zip or whatever format is there with winrar and delete the recovery image inside it (if its zip file, then open it and go to system/etc and delete "recovery.img" and if its tar file, again open it and delete the recovery.img or any file with similar name. Keyword here is
The next step is to edit out the scripts so it doesnt give error on missing recovery image. For zip file, the android flash script is inside META-INF/com/google/android/ and you need to edit the file "updater-script". Now various rom builders use various methods to flash recovery using script, so there isnt any specific way really, but look for any line that resembles something that means "copy/flash recovery.img" and delete that line. For ex in one of the roms I downloaded, recovery was flashed using this command->
You can clearly see that its extracting recovery image to some location, so delete this line. Then save file inside zip and flash it. Your recovery wont be changed.
For roms in tar or any other format, it should normally be some batch file which carries flash instructions. Again, open it and remove line corresponding to flash recovery.
This may sound haphazard, but try it first before deciding difficulty, its relatively easy ;) All you need to do is just edit the script that controls flashing.
One more thing, if you have lost your recovery, you can flash it using
First, follow guide here to set up adb and fastboot.
Next, connect phone to pc with usb debugging enabled. Then open command prompt and enter these commands->
fastboot erase recovery fastboot flash recovery PathToRecoveryFileAndItsName.img
For ex if my recovery file lies in D:/Recovery folder, then I would use->
fastboot flash recovery D:/Recovery/TWRPblabla.img
Good luck and hope this helps.
Here's more detail on how to deal with this in case of stock roms:
HOW TO PREVENT STOCK ROM FROM OVERWRITING RECOVERY:
In stock roms, the general procedure used is to put in a recovery image file. For ex if you open a stock rom archive in winrar, you will see some image file with name and extension similar to "recovery.img". This is stock recovery, you delete this file. Now similarly, we need to edit flash scripts so it doesnt go berserk on not finding recovery image. It actually depends how stock rom is flashed (or rather what method it uses). Some need individual parts flashing (system is flashed separately and recovery is flashed separately and boot or kernel separately, like in samsungs). In this case you can simply skip step for flashing recovery and no script editing is needed. But if its using some script (like nexus stock roms have a batch file script), you will have to edit that script. Its usually batchfile. Open the file in notepad and remove the lines that lead to recovery flashing. To help you identify these lines, look for words like
recovery.img since it actually depends on how stock rom flash script is made. For ex in my nexus 4. the stock rom I downloaded flashed recovery using fastboot as->
fastboot erase recovery fastboot flash recovery recovery.img
Here, as you can see its actually first erasing my recovery, we dont want that either. So I remove these two lines. First, to prevent it from erasing my already inserted recovery, second to prevent it from flashing and over-riding my recovery with a new one. So you must also look out for such lines that may overwrite the recovery. As I said, you can simply search for keyword
recovery in script if you are having difficulty in finding such line.
There is an easy step... I used it to boot in to rec on my N910g (note4) 1 .flash the custom rec using odin (it was TWRP 184.108.40.206 for me)
- As soon as the device restarts after flashing press and hold menue button and volume up button (this should be so quick, u have to press buttons as quick as the screen get Black screen) repeat the steps it will work.(remember to flash the rec again and again when u repeat steps
Hello i just had a personal experience with my Asus zenfone selfie Z00T Stock recovery kept replacing TWRP. (Boot loader already unlocked)
This is how i got around it i downloaded the latest TWRP for my device and placed directly in minimal adb and fastboot app folder then i renamed it to recovery .
then i put my device in fastboot mode using the buttons on the phone and After i ran minimal adb and fastboot app as admin then i typed fastboot flash recovery recovery.img
once done i then i typed fastboot boot recovery.img. and my phone booted to twrp recovery then i selected reboot recovery directly on my phone and to finish reboot system (still in twrp) that's it.
(OEM commands to boot from fastboot to recovery do not work on some devices )
it only worked for me eventually because i downloaded the latest TWRP from the official TWRP website.
The idea is to flash the custom recovery and then booting from the custom recovery.img that you just used to flash (the one still on the pc) using minimal adb and fastboot app.
IT may not work on all devices as the commands may change from one device to another but the idea stays the same. (example for nexus fastboot -c "lge.kcal=0|0|0|x" boot recovery.img)
I hope this will help some people out.