TWRP for LG G4
Team Win strives to provide a quality product. However, it is your decision to install our software on your device. Team Win takes no responsibility for any damage that may occur from installing or using TWRP.
Support Status: Current
Maintainer: steadfasterX
Code Name: G4, F500, LS991, H810, H811, H812, H815, H819, US991, VS986
Support thread on xda-developers
NOTE: You must unlock the bootloader first before installing TWRP!
The recommended way is to use FWUL - a simple adb/fastboot ISO which has all drivers etc included and provides an easy and ready-to-use adb environment.
Consider a full backup in Download Mode with SALT first before you begin..
If you still want to use Windows you will need the platform-tools from the Android SDK on your computer. Find the Android command line tools section on the page linked and install the SDK tools package. From the SDK Manager, download only the platform-tools to get adb and fastboot binaries.
Windows users will also need proper drivers installed on their computer. You can try the Naked ADB drivers or the Universal ADB drivers if you don't already have a working driver installed
Your device needs to be either officially unlocked by LG or unofficially UsU'd before you can flash custom images!
To unlock your device officially you have to go to: http://developer.lge.com and follow all steps there to get and flash your LG unlock binary onece received. You can NOT proceed without completing this step!
Download the Official TWRP App (root required):
Install the app and open it. Agree to the Terms. Select TWRP Flash. Select your device from the device list (G4, F500, LS991, H810, H811, H812, H815, H819, US991, VS986) and choose a version. The file will download to your Downloads folder. Browse to and select the file. Tap on Flash to Recovery. Find out more about the app here.
This method works only when you have a Lollipop or Marshmallow bootloader / ROM installed! If you have flashed Nougat scroll down to the next topic!
TWRP requires an unlocked device - read the above topic and ensure you have your device unlocked and adb/fastboot ready (read above topic if not)!
Download the correct image file and copy the file into the same folder as your adb and fastboot binaries. Rename the image to twrp.img and type:
fastboot boot twrp.img
This will boot up TWRP but for the moment in memory only. To complete the installation and making it persistent:
Copy the twrp.img to your device while still in twrp (e.g. with a file explorer or by typing adb push twrp.img /sdcard)
Flash the twrp.img with the twrp GUI to the recovery(!) partition (choose the button at the bottom named 'Image' to display the copied image)
Android would overwrite TWRP on boot so: you need to boot TWRP once again NOW: Choose Reboot -> Recovery
or on your PC type: adb reboot recovery
If you see TWRP afterwards then you are safe to use the key combo described in the next topic. If NOT: RE-DO all steps! DO NOT USE THE KEY COMBO described in the next topic until the reboot into recovery worked!
This method works only when you have a Nougat bootloader / ROM installed! If you have flashed Lollipop or Marshmallow scroll up to the previous topic!
Consider a full backup with SALT first before you begin..
TWRP requires an unlocked device - read the above topic and ensure you have your device unlocked and adb/fastboot ready (read above topic if not)!
Download the correct image file and copy the file into the same folder as your adb and fastboot binaries. Rename the image to twrp.img and type:
fastboot flash recovery twrp.img
There is no 100% way to verify your TWRP installation on the N bootloader so you have to take the risk (did you made a SALT backup before?) but ensure you follow this next step briefly:
Take out the battery and disconnect the USB cable. Now follow the topic: Boot into TWRP with a key combination (as you can not verify the TWRP installation just do it). If you skip this step and boot into Android before doing this TWRP will be overwritten by Android so it is crucial important to do this step above directly after flashing TWRP!! if you miss it you will have to flash TWRP again!
If all went well TWRP should boot up.
Android would overwrite TWRP on boot so: you need to boot TWRP once again NOW: Choose Reboot -> Recovery
or on your PC type: adb reboot recovery
If you see TWRP afterwards again then you are safe to use the key combo described in the next topic. If NOT: RE-DO all steps! DO NOT USE THE KEY COMBO described in the next topic until the reboot into recovery worked!
LG G4 (any model):
Ensure you have validated the TWRP installation first! Check the above topic and proceed when verification was successful only!
After installing TWRP correctly, you will still have the original LG factory reset screen/menu booting before TWRP, every time! So the correct and only way to get into TWRP with a key combo is to select two times "Yes" in the official LG factory reset menu, and only then you will get into TWRP (This a restriction by LG. There is no key combo available in some / all / most LG devices to boot directly into recovery and so TWRP).
Power down and pull out the battery. Do not forget to remove any USB cable.
Press power down and hold it down. Put battery back while keeping vol down pressed. Press power button and keep now both buttons pressed. Directly you see the LG logo the first time just release only the power button for 1 second ( do not release vol down ) and then press power again and keep both pressed until you see the factory reset screen. Proceed like you would to the factory reset (as long as TWRP is installed it will not reset but just open TWRP instead).
Download the latest TWRP image file (.img) from the download link and boot TWRP. Go to install and find and select the Images... button. Browse to the image that you downloaded and select it. Choose recovery and swipe to flash.
Download the latest image file (.img) from the download link above. Place it in the root of your /sdcard folder and rename it to twrp.img. Run the following commands via adb shell or a terminal emulator app:
su
dd if=/sdcard/twrp.img of=/dev/block/bootdevice/by-name/recovery
- steadfasterX
2020-12-21T16:32:52Z
Merge branch 'sfX/android-8.1' into android-8.1 Signed-off-by: steadfasterXChange-Id: Iacf8d1a22c19098b8e5ffe02463650b284c0253a # Conflicts: # recovery.fstab - steadfasterX
2020-12-15T19:31:49Z
g4: change /misc to grow (READ!) fixes OTA on UsU'd devices all details: https://github.com/LGgFour/android_device_lge_g4-common/commit/89a404d3ec6e556ac80ce7e60a5b4a82a3ccdcd7 READ THE ABOVE commit msg otherwise you'll very likely encounter a TWRP boot loop (sooner or later) Change-Id: Id7c58edcbc6866e5084bf9c4c7cfa76e0c3c39a3 (cherry picked from commit 23409a9ead252d175de781d3f6165839feb92741) - steadfasterX
2020-12-15T19:29:10Z
g4: fstab fix indents Change-Id: I2c878714d35207905d6df2a65528d7bae9210816 (cherry picked from commit 2abe5bfe2d5e3bec265d3966a0ae03f9ea600c7c) - steadfasterX
2020-08-19T10:10:59Z
g4: fstab: fix encrypt partition backup/restore doing a backup for that partition must be done as emmc partition which results in a dump image. defining it as emmc will not allow it to wipe though as mke2fs does not know what to do on that "fake" emmc fs type used by TWRP. the fix is to define it twice (emmc + a valid fs type) and set the flags properly for each situation! flags: - `removable` as that partition should not be auto mounted - `wipeduringfactoryreset` to auto wipe when factory reset - `wipeingui` to allow a manual wipe - `backup=1|0` to allow backup as raw image while denying the other note: in this particular case formatting as vfat is ok as qseecomd does not care about how it is formatted (as it writes raw to that partition). ofc after encrypting that partition is likely not mountable anymore but that does not matter. Background: https://github.com/Suicide-Squirrel/issues_pie/issues/52 Signed-off-by: steadfasterX(cherry picked from commit c0c067e771141bab1df1cc15402dfd3e0ac74600) - steadfasterX
2020-08-19T08:06:05Z
g4: fstab: encrypt partition handling The encrypt partition contains metadata for FDE. wiping that partition is required if it gets corrupted (rare) or when coming from a higher Android (keymaster) to a lower one. Example: Install LOS 17, encrypt, format data, install LOS 16, encrypt -> fail Background: https://github.com/Suicide-Squirrel/issues_pie/issues/52 Implementation: - auto-select the encrypt partition on backup - auto wipe encrypt on factory reset - add encrypt partition to manual wipe menu Change-Id: Iadc9e9eb550f9dbcd9f2e27a87ee997d4618011f (cherry picked from commit d1bbd305a4181eeda63824b162ebe8cefe49f86a)