[G4 General] htr5:
I recently went through all of this and it took me quite a while to dig through dozens of threads so I decided to make a new one bringing all of these great things together specifically for the H815. Brace yourselves for the Android right of passage...

LG G4 H815 Marshmallow 6.0 Guide.

1. Unlock the Bootloader

2. Install the custom recovery: TWRP

3. Root

4. Install Xposed

5. Install Viper4Android

6. Unbrick Guide

7. Debloat

8. Battery Optimisations

- Quicklinks:

Drivers: http://oceanhost.eu/e4h2px4e0hkd/LGMobileDriver_WHQL_Ver_4.0.4.exe.htm

Minimal ADB: https://www.androidfilehost.com/?fid=24521665358595410

LG Bootloader Unlock: https://developer.lge.com/resource/mobile/RetrieveBootloader.dev?categoryTypeCode=ANRS

TWRP: https://xdaforums.com/attachment.php?attachmentid=4387389&d=1515789045

SuperSU: https://www.androidfilehost.com/?fid=24369303960690845

System Image Complete: http://xdaforums.com/g4/development/stock-h815-20g-images-kdz-flashable-t3450503

Xposed Framework: http://xdaforums.com/attachment.php?attachmentid=3848457&d=1471691646

Xposed Installer App: http://xdaforums.com/showthread.php?t=3034811

Viper4Android: https://www.dropbox.com/s/lvcxffdqimbi78b/V4A_Poweramp_Lollipop_v3.zip?dl=0

SELinux Mode Changer App: http://xdaforums.com/devdb/project/dl/?id=12506

LG Bridge Unbrick Tool: http://www.lg.com/us/support/product-help/CT10000025-1438110404543-preinstall-apps

IMPORTANT | IMPORTANT | IMPORTANT | IMPORTANT | IMPORTANT

Backup any personal files because

everything will be deleted!

Make sure you have at least 50%

battery remaining

.

1. Unlocking the bootloader officially

This is the first step in voiding your warranty so is the point of no return. I've read in some places that you may be able to do this without voiding your warranty but I did not look into this.

WARNING

- This will delete everything on the phone so make sure to backup important personal files.

i) Visit the official LG website to obtain a bootloader unlock file. First click the 'How to Unlock the Bootloader' tab and then the button 'Starting Unlocking the Bootloader' at the bottom of the page: https://developer.lge.com/resource/mobile/RetrieveBootloader.dev

ii) Sign up to a free developer account using a real email address (it's needed)

iii) Enter your IMEI number which you can find on your box, under the battery or by dialing *#06# on the phone. Keep this tab open

iv) On your phone, go to settings -> About phone -> Software info and then tap on Build number 7 times. Go back to Developer options under general settings and enable 'USB debugging' and 'Enable OEM unlock'.

v) Install the LG G4 drivers from here: http://oceanhost.eu/e4h2px4e0hkd/LGMobileDriver_WHQL_Ver_4.0.4.exe.htm

vi) Download and install minimal adb 1.4 from here: https://www.androidfilehost.com/?fid=24521665358595410

vii) Browse to where you installed this and then right click and select 'Open command window here'. By default, this is in C:\Program Files (x86)\Minimal ADB and Fastboot

viii) Plug in your phone to your computer using a reliable USB port and cable (USB 3.0 doesn't seem to work). Enter "adb reboot bootloader" into the command window without quotations. Wait for it to reboot and then type "fastboot oem device-id"

ix) This fastboot command will return a character string. This is the Device ID which is needed to generate your unique unlock key. It will look like this:

Example Device ID (PC User)$ fastboot oem device-id
(bootloader)-----------------------------------------------------------------
(bootloader) Device-ID
(bootloader) CD58B679A38D6B613ED518F37A05E013
(bootloader) F93190BD558261DBBC5584E8EF8789B1
(bootloader)-----------------------------------------------------------------

To generate your unlock key, you will need to paste together the 2 lines of output into one continuous string without "(bootloader)" or white spaces. In the example above, the Device ID would be:

CD58B679A38D6B613ED518F37A05E013F93190BD558261DBBC5584E8EF8789B1

Paste this into the LG website form and confirm. It will email you an unlock.bin file which you need to put in the same folder as your adb.exe file.

x) Now enter "fastboot flash unlock unlock.bin" into the command window. This should take seconds.

xi) Now check it is unlocked. By entering “fastboot reboot” and waiting for it to reboot. Then enter "adb reboot bootloader" again and then "fastboot getvar unlocked" and verifying that the response is "unlocked: yes".

Your bootloader should now be unlocked.Keep this command window open for the next step.

Thanks to shimp208 for minimal adb http://xdaforums.com/showthread.php?t=2317790

2. Installing TWRP Custom Recovery

This will install a custom recovery allowing you to make backups and flash zip files.

i) With your bootloader freshly unlocked, you can boot up the device and set it up. Go through the startup guide thoroughly without skipping as these settings are going to stay.

ii) Download the latest TWRP img file from https://xdaforums.com/attachment.php?attachmentid=4387389&d=1515789045 and place it in the same folder as your adb.exe file and unlock.bin. Now rename it to lgg4-twrp.img without changing the file extension!

iii) Now also copy the lgg4-twrp.img file to your phone's SD card using a USB cable.

iv) Enable USB debugging again

v) Open up a command window again by Shift+Right clicking in the folder with adb.exe.

vii) In the command window, type "adb reboot bootloader". Wait to enter the bootloader and then type "fastboot boot lgg4-twrp.img" and hit enter. The device should now restart in TWRP but it is not installed yet.

vii) Once TWRP starts, select 'install' and then tick 'images' at the bottom.

viii) Find the lgg4-twrp.img file and select it. Then in the next menu select 'recovery' and swipe the bar at the bottom to confirm flash.

ix) You should then see 'Image Flash Complete' so can select back then reboot and system.

(If installing from an external SD card, go to 'mount' from the main screen and then tick to mount your ext SD card. Go back and continue as normal)

Thanks to TeamWin for TWRP https://twrp.me/

Thanks to Adam Myczkowski for TWRP install corrections.

3. Root

By now, you should have an unlocked bootloader and a custom recovery installed.

If you use snapchat, you won't be able to log in with a rooted phone. So it would be a good idea to install it now and log in. You remain logged in rooting and installing Xposed. Quicklink: https://play.google.com/store/apps/details?id=com.snapchat.android​

i) Download SuperSU from https://www.androidfilehost.com/?fid=24369303960690845 and place it on your phones internal storage.

(this works fine but you can get the latest from here: http://xdaforums.com/showpost.php?p=64161125&postcount=3

ii) Make sure you have USB debugging enabled again.

iii) Now with your phone on and plugged in, enter recovery by opening adb as before and entering "adb reboot recovery".

If you have problems, see the end of this section​

iv) Once in the recovery, hit install and browse to the SuperSU file we just downloaded.

vii) Swipe flash and then reboot into the system.

The phone should now boot and be rooted. If not, see the notes at the end of this section.

You can use https://play.google.com/store/apps/details?id=com.joeykrim.rootcheck to verify if you have root.

• If your phone does not turn on then pull out the battery and USB cable and then put just the battery back in. Now Press and hold the volume down and power buttons together. Then first LG logo should appear. Now continue holding the down button but release the power button for one second and then press it again and hold.

You should now see a screen asking you to wipe everything. Navigate with the down arrow and press the power button for both screens. This should now take you to TWRP recovery and NOT actually wipe the phone.

• If you had a bootloop then follow the above steps to get into the recovery and then you will need to download the following onto the phone: http://xdaforums.com/g4/development/stock-h815-20g-images-kdz-flashable-t3450503 [1.5GB]

Once in the recovery, you are able to connect the phone to the computer for regular data transfer in order to transfer the file. (I had problems with the microSD card so I would avoid it).

This system image seems to be missing the FM Radio, LG Remote and SmartSettings, Voice Recorder and Quickmemo apps. To get these back, go to general settings -> About phone -> Update centre -> App updates and download/install as necessary.​

• If you still could not get into the recovery at all then follow the unbrick steps below in section 6.​

Thanks to autoprime for the system images [url[http://xdaforums.com/g4/development/stock-h815-20g-images-kdz-flashable-t3450503[/url]

Thanks to Chainfire for SuperSU http://xdaforums.com/showpost.php?p=64161125

4. Installing Xposed

i) Download Xposed from here: https://xdaforums.com/attachment.php?attachmentid=3848457&d=1471691646 and place it on your phone or SD card

ii) Enter recovery using the methods shown before. (You can also now enter recovery using this root app: https://play.google.com/store/apps/details?id=com.antaresone.quickreboot)

iii) Use the recovery menus to flash the zip file. Reboot.

iv) Download and install the Xposed installer app, XposedInstaller_3.0_alpha4.apk, from the post attachment here: http://xdaforums.com/showthread.php?t=3034811

Thanks to rovo89 for Xposed and Follow_and_Feel for sharing the G4 Xposed link http://xdaforums.com/showthread.php?t=3034811

5. Installing Viper4Android (this breaks FM radio!)

WARNING

- The FM radio app will not work after installing this.

i) Download Viper4Android from here: https://www.dropbox.com/s/lvcxffdqimbi78b/V4A_Poweramp_Lollipop_v3.zip?dl=0

ii) Place the zip file on your phone or SD card and flash it in recovery. Reboot.

iii) Open the ViperFX app. From the menu and install the driver.

iv) You need to get Viper4Android to run in enforcing mode so flash this zip in recovery: https://www.dropbox.com/s/k9cnruw2e1t1d4t/ViPER4Android-supolicy.zip?dl=0

Install it. Open the app and set selinux to permissive. Reboot.

v) Install BusyBox from here: https://play.google.com/store/apps/details?id=stericson.busybox

Thanks to the ViperFX developers and zhuhang for Viper4Android http://xdaforums.com/showthread.php?t=2191223

Thanks to Choristav for the Viper4Android file http://xdaforums.com/lg-g2/general/guide-poweramp-viper4android-lollipop-t3133935

Thanks to maximumentropy for the SElinux enforcing zip http://xdaforums.com/showthread.php?p=61242973#post61242973

Once all this is done and you're happy. It would be a good idea to

enter recovery and make a full backup

so that you can restore to the clean rooted state.

6. Unbrick Guide

If something messed up while flashing something and can't boot. Open up the recovery and restore your backup. If you don't have one, flash the v20d system image from an external SD card [1.5GB]. Download here: http://xdaforums.com/g4/development/stock-h815-20g-images-kdz-flashable-t3450503

If you cannot get to the recovery then follow these steps:

i) Make sure you have the LG Drivers installed from here: http://oceanhost.eu/e4h2px4e0hkd/LGMobileDriver_WHQL_Ver_4.0.4.exe.htm

ii) Download the LG Bridge software from here: http://www.lg.com/us/support/product-help/CT10000025-1438110404543-preinstall-apps

iii) Remove the battery and reinsert it so the device it is fully off.

iv) While holding the up volume button, insert your USB cable.

v) You should enter download mode. Go to the Software Update tab of the LG Bridge. It will say connecting and then should say your device is up to date. Click on the recovery text on the bottom right and then follow the instructions. The software will download the system image for you and this is roughly 1.6GB so make sure your firewall doesn't block this connection.

This shouldn't delete your data (no guarantees) but you will have to grant app permissions again and reapply any changes to system files e.g. root, viper4android, xposed ect.

If you have problems try this method instead:

http://xdaforums.com/g4/general/guide-lg-g4-stock-firmware-to-stock-kdz-t3107848

7. Debloat

Here is a list of apps and services an XDA user has suggested removing: https://xdaforums.com/g4/general/bloatware-tool-t3141890/post61509537#post61509537

Removing these won't break the phone but of course be smart about it; removing Weather will mean you don't have the weather app. I only removed Google apps I don't use and redunadant apps from LG.

You can remove bloat apps using the Titanium Backup app from here: https://play.google.com/store/apps/details?id=com.keramidas.TitaniumBackup

I would advice you to make a backup of them first in case you want them back. It's the easiest way to get the apps back.

If you do need a guide for using Titanium Backup, head over to this excellent guide: http://xdaforums.com/showthread.php?t=2717159

8. Battery Optimisations

The aim is to get maximum battery life without compromising speed, user experience, features or notifications.

(I'm just going to use the following space as a log of things I've done. I will tidy this up when complete. Please do suggest if any of these things are ineffective or detrimental.)

Read through this guide: http://xdaforums.com/g4/general/guide-g4-lag-free-marshmallow-t3327878

1. Disable Activity Logs: General Settings -> About phone -> Activity Logs at the bottom.

Also try following the steps on here; users report better battery life: https://www.reddit.com/r/lgg4/comments/4fb4uf/psa_free_up_some_ram_up_to_300mb_and_maybe_gain_a/

2. Disable Smart Settings under General Settings

3. Disable Bluetooth and Wi-Fi scanning location service: General Settings -> Location -> Menu -> Scanning -> Untick both. (I honestly can't believe these exist. I wondered why I have bluetooth wakelocks)

4. Disable Open Wi-Fi scanning: Network Settings -> Wi-Fi -> Menu -> Advanced -> Untick Wifi notification. Toggle this on and off as it should also fix random white LED blinking.

5. Greenify 2.9 beta to enable aggressive doze.

6. Follow this guide for processor tweaks http://xdaforums.com/nexus-5x/general/guide-advanced-interactive-governor-t3269557

Please note that this is my first thread and I'm not a developer. I hope the instructions are as complete and accurate as possible and they are what I followed for my H815 602. If there are any things I forgot or updates, please do let me know.