FORUMS
Remove All Ads from XDA
Top Tech YouTubers Review the OnePlus 6!

[Recovery]TWRP 3.1.1-0 LG G5 H840

181 posts
Thanks Meter: 113
 
By synescu, Senior Member on 10th May 2017, 08:47 PM
Post Reply Email Thread
DO NOT FORMAT YOUR MICRO SDCARD INSIDE TWRP RECOWERY
WARNING: If you want tho use /data and internal sdcard first have to format data in stock recovery This will wipe your internal storage, and factory reset your phone!
encryption is not supported yet
To flash this img to your phone use fastboot
Code:
fastboot flash recovery twrp-x.x.x-x-h840.img
+new test build with encryption support

source code https://github.com/synescu/twrp_lg_h840

1.Unlocking the bootloader.
1.1Get the latest drivers: ( http://tool.lime.gdms.lge.com/dn/dow...=UW00120120425 )

1.2Get ADB fastboot. If you hate installing huge files for just a few commands, you have 3 options:
-MINIMAL ADB and fastboot: (https://forum.xda-developers.com/sho....php?t=2317790 )
-15 seconds ADB Installer v1.4.3: (https://forum.xda-developers.com/sho....php?t=2588979 )
-SDK Platform-Tools coming directly from google: (https://developer.android.com/studio...orm-tools.html )
I personally went with the “15 seconds ADB Installer v1.4.3”, because it installs also a Google driver, which might, or might have not helped out in the process to follow.
1.3Follow the instructions at the official LG unlocking page ( https://developer.lge.com/resource/m...Bootloader.dev ), just keep in mind that after step 1.2 you have adb ready to go @ your main drive C:\adb. You go to that folder shift + right click and open a command prompt at that location, the rest is trivial.
2.Updating to the latest official stock android.
2.1Get the latest kdz from: (https://lg-firmwares.com/lg-h840-firmwares/ ). As far as I know you can go for any of those firmwares, but it is advisable to use one from your region (Europe, South America, Middle East). As mentioned above my LG G5 H840 is the newest European model, totally unbranded. So I took the 20c for Spain. This is as high as you can get at present moment.
2.2 Flash with LGUP 1.14 and UPPERCUT 1.0.0, both available at: (http://downloads.codefi.re/autoprime/LG/LG_G5 )
2.3 Reboot and do a quick setup. I recommend to have your sim card, SD card out at this moment, do not connect to wireless networks, all of this you will have plenty of time to do later, besides whatever you set at this point will be lost in the next step.
3.Get TWRP and root
3.1TWRP. As a courtesy of synescu, we have 2 versions: a regular one and such with encryption support. It took me long to realize that only the one with encryption would work on a latest H840 installed with v20c. So I guess if you have an old phone and possibly firmware 10a/b/c/d, than you can try “twrp3.1.1-0-h840.img”, otherwise go straight to “twrp_encryption-h840.img”. If you use the one without encryption support you will find no way to root the phone, because it can not see the SD card, or any USB flash attached and also if you connect the phone to a PC with MTP mode, or any other mode you won’t be able to browse both (internal and external) memories on that phone.
3.1.1Put on a SD card following files: 1) latest stable SuperSU 2.79 2) no-verity-opt-encrypt.zip from here (https://build.nethunter.com/android-...ncrypt-5.1.zip ) and just in case although not mandatory “twrp_encryption-h840.img”.
3.1.2Put in the C:\adb folder the “twrp_encryption-h840.img” and the stock recovery from here (https://forum.xda-developers.com/att...9&d=1494791791 ). The stock recovery is necessary in case you make a mistake and have to do a factory reset.
3.1.3Turn off the phone.
3.1.4Boot into stock recovery (holding volume down + power, at LG logo releasing power shortly and than pushing power again).
As a side note here, after I unlocked the bootloader I’ve got that annoying message on start-up that the phone is untrusted. With G4 H815 it was a small message in the upper corner, this time around it is a huge message in the middle of the screen. LG, for the love of god! After all the playing, I have now also a message screen, which I call “Options Menu”, it shows right after the nagging untrusted message. Although esthetically ugly, I have an easy way to go to recovery and fastboot in each and every regular power on, or restart. As said the Options Menu is showing up for 5 sec after the untrusted nagger. If you click the volume up, or down you get to the options (Power off, Restart, Recovery, Fastboot ), otherwise after 5 sec the phone would boot normally. I don’t know if this is the expected behavior of the phone, or did I trigger it somehow, but now I don’t have to use the combo buttons for anything.
Back from the side note. The new stock recovery is a white screen with 2 options for No and Yes. Go for YES and than YES again, after both YES the phone will be factory reset and will reboot. Do not allow it to boot though, because the userdata will be encrypted at this point and you will have to repeat the reset again. Use the combo buttons for recovery, which will bring you to the “Options Menu”, or Volume up and plug in the phone into the PC. Yet again there is hardly any time so maybe plugin in won’t be fast enough, so just keep pressed the combo buttons, also change with volume up and power, or remove the battery and start again. In any event do not let it boot until it brings you to the “Options Menu”
3.1.5In the Options Menu pick fastboot and plug the phone to the PC
3.1.6Open command prompt in adb and flash TWRP ( fastboot flash recovery twrp_encryption-h840.img ) you might be ok also to do factory reset from adb with this command (fastboot –w ), but unfortunately I forgot already if I did it, when it finally worked for me
3.1.7Disconnect from the PC and pull the battery out, or just keep the buttons combo pressed. It is possible that you see the old stock recovery (white screen YES/NO), which might have stayed somehow in memory. Do not perform further resets, just keep pressing the button combo and it will reboot eventually to the Options Menu.
3.1.8There you go 3 times volume down and power to pick recovery. Follows a reboot of the bootloader, nagging screens, but eventually it loads TWRP.
3.2Root.
3.2.1For some reason even after the factory reset, the data partition keeps an encrypted flag. So you can not write to it. Stock recovery should have reset it to non-encrypted, but it does not do it correctly, I guess. Therefore you go to Wipe, pick only the Data check box and go to change format in the bottom. Change the format to FAT and than back to EXT4
3.2.2Go to the SD card and flash no-verity-opt-encrypt.zip and SuperSu. Yes I know, that SuperSu is supposed to install also no-verity, but I like to flash both just in case.
3.2.3Do NOT wipe anything in TWRP at this point. Reboot only!!!!! Once the phone has booted in v20c you can go back to TWRP, Wipe and make all the backups you like
Thanks to @svetloslav for this complex post
The Following 12 Users Say Thank You to synescu For This Useful Post: [ View ] Gift synescu Ad-Free
 
 
10th May 2017, 11:01 PM |#2  
Junior Member
Thanks Meter: 2
 
More
Thanks a lot.
Can't wait to flash!!
The Following User Says Thank You to anigooner For This Useful Post: [ View ] Gift anigooner Ad-Free
11th May 2017, 06:00 AM |#3  
Bert98's Avatar
Senior Member
Flag Sant'Urbano (PD)
Thanks Meter: 394
 
More
YESS finally we have root on the SE thank you very much man
11th May 2017, 09:10 AM |#4  
Junior Member
Thanks Meter: 1
 
More
Hi all. When I try to flash recovery, fastboot give me that message:

target reported max download size of 536870912 bytes
sending 'recovery' (15089 KB)...
OKAY [ 0.490s]
writing 'recovery'...
FAILED (remote: image is not a boot image)

Any suggestion? Thanks

Solved: I had not extracted the .img from the .tar archive
The Following User Says Thank You to rem977 For This Useful Post: [ View ] Gift rem977 Ad-Free
11th May 2017, 11:06 AM |#5  
bob8x's Avatar
Senior Member
Flag Lodi
Thanks Meter: 40
 
More
Quote:
Originally Posted by synescu

For now external sd card is mounted as internal. De only way you can flash something for now When I would have more time I will try to fix this and upload the source to github. I rooted the phone and installed the supersu and no verity zip
source code https://github.com/synescu/twrp_lg_h840

Thanks a lot!
just a few information...
Is this build on android 6, 7 or 7.1 three?
Is encryption supported?
11th May 2017, 11:17 AM |#6  
synescu's Avatar
OP Senior Member
Thanks Meter: 113
 
More
Quote:
Originally Posted by bob8x

Thanks a lot!
just a few information...
Is this build on android 6, 7 or 7.1 three?
Is encryption supported?

I'm booting this vith android 7.0
6.0 must boot just fine. didn't tried encryption but I'm pretty sure that doesn't work
Build compiled from Omni 6.0 sources

Sent from my LG-H840 using Tapatalk
12th May 2017, 04:52 AM |#7  
Junior Member
Thanks Meter: 3
 
More
Thank you very much for your precious time my friend. Good work
The Following 2 Users Say Thank You to yosora For This Useful Post: [ View ] Gift yosora Ad-Free
13th May 2017, 12:04 PM |#8  
Wire1122's Avatar
Senior Member
Thanks Meter: 28
 
More
Can't flash magisk through twrp.
Can't mount data through twrp. It is greyed out. Can't select
Have you fix the ptoblem with external sd?
13th May 2017, 11:59 PM |#9  
synescu's Avatar
OP Senior Member
Thanks Meter: 113
 
More
Quote:
Originally Posted by Wire1122

Can't flash magisk through twrp.
Can't mount data through twrp. It is greyed out. Can't select
Have you fix the ptoblem with external sd?

Yes internal storage it's properly mounted now

Sent from my LG-H840 using Tapatalk
14th May 2017, 12:18 PM |#10  
synescu's Avatar
OP Senior Member
Thanks Meter: 113
 
More
Anyone can confirm if encryption works?

Sent from my LG-H840 using Tapatalk
14th May 2017, 03:50 PM |#11  
Wire1122's Avatar
Senior Member
Thanks Meter: 28
 
More
Quote:
Originally Posted by synescu

Anyone can confirm if encryption works?

I have flash it succesffully. But how can I yest if it works?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes