How to get marshmallow on the LG G4 AND encrypt the device AND root it WITHOUT a factory reset

LG G4

So, since a few days I’ve a new toy….a LG G4!

And, of course, I wanted to get the newest marshmallow android on it, as soon as possible. And - also of course - I wanted to encrypt the /data-partition (called device encryption) and wanted still to become root (I’ve been used to fully control a device - and I wouldn’t change this in android 6.0).

So, here is the story I’ve got root on a encrypted LG G4 with marshmallow and WITHOUT a factory reset needed:

But first the necessary disclaimer:

You follow this tutorial on your own risk! I’m only a silly blogger and I’m not responsible, If you loose your data or damage your hardware or whatever. (And so on..)

Prerequisites:

  1. A LG G4 H815 with an unlocked bootloder: http://www.naldotech.com/how-to-unlock-bootloader-on-lg-g4-h815-official-method/

  2. The newest Android SDK including adb and fastboot.

  3. LG G4 Bridge: http://www.lg.com/us/support/software-firmware

  4. The latest TWRP image on your PC https://dl.twrp.me/h815/

  5. The system-less SuperSu Zip-File on the external-SD-card of your phone: http://forum.xda-developers.com/apps/supersu/wip-android-6-0-marshmellow-t3219344/post64161125#post64161125

  6. Backup of your important data (just to be safe).

ok, let’s start…

TL;DR:

(Explanations below)

Sadly I unlocked the bootloader before I get the update with OTA. And if your bootloader is unlocked, it seems you would not get updates over-the-air.

  1. Connect your Phone to your PC and start the update process inside LG Bridge. The update removes root and twrp, but that’s ok, wee need a stock rom to install systemless-su (see xda). If you have updated your phone and rooted it, you must unroot it! (See explanations).

  2. Decrypt the LG G4 over the Settings-Dialog. If your phone wasn’t encrypted so far, skip this. (Short Explanation: It seems that TWRP with the current version can’t be installed, when the phone is encrypted)

  3. Flash TWRP:

    $ adb reboot bootloader
    $ fastboot flash recovery twrp-2.8.7.0-h815.img
    $ fastboot reboot
    $ adb reboot recovery #for testing, TWRP should run
    --> reboot system
    

    Yes, this seems very awkward. But the simple fastboot boot twrp-2.8.7.0-h815.img didn’t work for me, because the twrp wasn’t installed permanently.

  4. Now, encrypt your phone again (with the settings-menu).

  5. Be sure you have the Super-Su Zip (for me it was Version 2.66) on your external SD card (because twrp sometimes still fails to decrypt the /data partition). Then:

    $ adb reboot recovery 
    #because reboot using the hardware-buttons didn't worked for me
    

    TWRP will ask you for your password to decrypt the data-partition. If this fails “cancel” the encryption. Then go to “Install” select the SuperSu-Zip on the external sd card (OTG Adapter didn’t work, I don’t know why) and install it. But remember the instructions from chainfire:

If TWRP offers you to keep /system read-only, indeed keep it read-only. If TWRP tells you SuperSU is not installed, and asks you to install it, do not do it, you will break things!

It will modify the boot.img and need to reboot several times. You’ve to enter your encryption password several times (be patient).

  1. Done!

Explanations:

So, why I’ve to go the very awkward and senseless way to first decrypt the phone and then encrypt?? Is this really necessary??

Sadly, yes! Due to a combination of various problems:

  1. TWRP seems to have problems to decrypt phones with Lollipop or Marshmallow. See http://forum.xda-developers.com/g4/help/twrp-2-8-7-0-2-8-6-1-decrypt-lg-g4-h815-t3171040 . It seems to have something to do with a missing length information. Also install TWRP on encrypted phones seems to be problematic. Ironically TWRP 2.8.7.0. worked for me as my LG G4 runs on android 5.1. So I didn’t expect any problems after the update. But…mhh..you see the process above. To get there comes with some pain for me… ;)

  2. The LG G4 Stock Rom would not encrypt a phone if it’s rooted…it hangs after reboot. See http://forum.xda-developers.com/g4/general/howto-encrypt-decrypt-phone-rooted-t3200256 But the proposed solution in this thrad doesn’t work for the systemless root variant, because the boot img is still modified. And, to be honest, I don’t understand why the proposed solution to temporally unroot works (but I did with android 5.1, also for me). Very strange…

  3. We need a working TWRP to flash the SuperSu Zip.

So, If we summarize this three points we have two options - on the first sight: To have a rooted marshmallow or to have a decrypted marshmallow.

But, I want to have a encrypted phone and still the complete controll with a superuser. Also, in order to achive this, I’ve had to be a little bit creative to find a way around this chicken and egg problem…

And, because I’ve youse the phone for several weeks before the marshmallow update, I really want to avoid a factory reset - as it is proposed in other tutorials. You know, we are all a little bit lazy… ;)

You have another opinion?
Great! Then let's reduce the fallacy together!


Why are there no comments?