• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[TWRP]LG V40 / Judypn

Search This thread

SGCMarkus

Recognized Developer
Jan 10, 2011
1,076
2,104
Code:
#include "std_disclaimer.h"
/*
 * Your warranty is now void.
 *
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns about features included in this Recovery
 * before flashing it! YOU are choosing to make these modifications, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 */


Requirements
  1. Unlocked bootloader
  2. working ADB/fastboot on a PC
  3. the TWRP image downloaded
  4. Pie firmware on the active slot

Installation guide (pre metadata encryption):
  1. Copy the twrp image to your phones storage and/or micro sdcard
  2. Start cmd/powershell/terminal with working adb/fastboot
  3. Reboot to bootloader
    1. adb reboot bootloader OR
    2. turn off the phone (or reboot), as soon as it turns on, hold volume down while USB cable is connected
      • If youre unofficially bootloader unlocked, and you nuked laf, its volume up and USB for you
  4. fastboot boot TWRP-judypn-boot.img
  5. Confirm allow system modifications if asked
  6. Press cancel if asked for a password (aka when youre encrypted, could also be that it doesnt show you /data at all and no password screen)
  7. Go to Advanced -> Install Recovery Ramdisk
  8. Select the TWRP image which you copied to your phone/sdcard earlier
  9. TWRP will now be installed to both slots (boot_a and boot_b)
  10. Go to Reboot -> Recovery to make sure TWRP is successfully installed

Features:
  1. Install recovery ramdisk:
    Selecting this, and then an image (e.g. of TWRP) allows you to install the ramdisk (where TWRP resides for example) into both currently installed kernels/boot images
  2. Inject TWRP after install:
    Automatically injects current installed TWRP into the boot image of the ROM/zip youre installing when ticked

Broken:
  1. LGs encryption on Stock
  2. encryption on other ROMs(?)

How to flash ROMs (PRE metadata encryption):
  1. Reboot to TWRP
  2. Make a backup
  3. Install -> select the ROM zip -> tick Inject TWRP -> Swipe for install
  4. wait... ROM will be installed into the NON ACTIVE slot (if youre on a, it will be installed to b, and vice versa)
  5. Reboot system
for gapps, magisk or other mods:
  1. DO NOT REBOOT TO SYSTEM from last step
  2. Go back -> Reboot -> select the non active slot (to where the rom got installed to) -> select recovery
  3. Install gapps, magisk, and whatever else you want
  4. Reboot system

How to initially flash ROMs (metadata encryption):
  1. Reboot to existing TWRP
  2. Make a backup of everything you want to keep
  3. Copy backup to PC (or another external medium)
  4. Flash the ROM
  5. Do NOT inject TWRP (this will break recovery otherwise)
  6. Go to reboot -> Select opposite slot
  7. Reboot to recovery
  8. Perform factory reset (this is to setup encryption)
    1. Apply update (from ADB) with adb sideload for gapps/magisk
      • reboot to bootloader
      • fastboot boot judypn_TWRP_bootable-metadata.img
      • Use as usual
  9. Reboot system

How to update ROMs (metadata encryption):
  • Reboot to bootloader
  • fastboot boot judypn_TWRP_bootable-metadata.img
  • Install -> Select ROM zip
  • do NOT inject TWRP
  • Reboot -> select opposite slot (it will tell you even which it installed the ROM to)
  • Reboot bootloader
  • fastboot boot judypn_TWRP_bootable-metadata.img
  • Install gapps/magisk
Or
  • reboot recovery
  • apply update -> from adb (in e.g. Lineage recovery)
  • On PC: adb sideload <new version zip>
  • (Advanced -> ) Reboot recovery
  • adb sideload gapps/magisk
  • reboot system

Warnings:
  1. Updating a ROM means reflashing the mods you flashed too (e.g. Gapps), addon.d doesnt work properly
  2. Be aware of the slot you are currently on
  3. If youre flashing a ROM to a slot, make sure you also have the required firmware (abl, modem, and so on) in that slot

Infos:
  1. System image/Vendor image and system/vendor are redundant, the image variants are direct copies of the partition (and also their size) while the others are "simply" files copied and repacked
  2. How to use decrypted stock by @Xsavi : https://forum.xda-developers.com/lg-v40/how-to/guide-twrp-data-access-stock-t3970149
  3. Metadata encryption TWRP requires 10 firmware to use properly, no guarantee for it to work on Pie firmware!

Download:
Metadata bootable: https://drive.google.com/file/d/1hdzeH3AIQVf3siQNsI27IS_vmghPESEG/view?usp=sharing + Install zip: https://drive.google.com/file/d/1CQUfg54zD838detcIJqdRiKXdVNtd6Iy/view?usp=sharing
Bootable: https://drive.google.com/open?id=1UnIFbJlXHl6x4azq6H6yS-PRfk-omdTP
Old: https://drive.google.com/open?id=1p3IrbeOxM4ay01JccyifWDuxqqrE0_Dl


Sources:
device tree: https://github.com/SGCMarkus/android_device_lge_judypn-twrp/tree/android-9.0
kernel: https://github.com/SGCMarkus/android_kernel_lge_sdm845/tree/lge-pie-v409-20a

XDA:DevDB Information
TWRP for Judypn, ROM for the LG V40

Contributors
SGCMarkus
ROM OS Version: 9.x Pie

Version Information
Status: Alpha

Created 2019-09-20
Last Updated 2019-09-20
 

Attachments

  • Screenshot_2019-09-20-15-48-39.png
    Screenshot_2019-09-20-15-48-39.png
    221 KB · Views: 4,205
  • Screenshot_2019-09-20-15-48-43.png
    Screenshot_2019-09-20-15-48-43.png
    112 KB · Views: 4,201
  • Screenshot_2019-09-20-15-48-54.png
    Screenshot_2019-09-20-15-48-54.png
    129.4 KB · Views: 4,020
  • Screenshot_2019-09-20-15-48-48.png
    Screenshot_2019-09-20-15-48-48.png
    174.2 KB · Views: 3,711
Last edited:

cephasara

Senior Member
May 8, 2008
120
4
How hard would it be to get this working on the V35? I can get it to install and boot into recovery, but it does not register touch input.
 

lowridincrew,

Senior Member
Jun 24, 2011
466
70
Cleveland
LG V40
Samsung Galaxy A71 5G
Well, having a big issue. I installed TWRP, Install custom rom w/ twrp inject, reboot menu, selected the slot where the rom, restarted, no TWRP, No root, but custom rom and now it comes up as unknown in LG UP so I can try to fix it. I think its mostly a brick since I can't do anything. No Fastboot either because im in slot b and cant switch because no root or fastboot.
 

SGCMarkus

Recognized Developer
Jan 10, 2011
1,076
2,104
Well, having a big issue. I installed TWRP, Install custom rom w/ twrp inject, reboot menu, selected the slot where the rom, restarted, no TWRP, No root, but custom rom and now it comes up as unknown in LG UP so I can try to fix it. I think its mostly a brick since I can't do anything. No Fastboot either because im in slot b and cant switch because no root or fastboot.

did you have pie firmware also in the slot where you installed LOS to?
otherwise.... nothing is ever really a brick, you still have 9008 mode as last option
 

belrik

Senior Member
Nov 25, 2010
466
108
How do the two slots work? I thought that these were for current ROM in one and then new ROM in the other, alternating with each ROM update. Why is one for the ROM and the other holding system partition additions? I would expect gapps to integrate into both A and B sides at once on top of each ROM...
Is there documentation on this?
 

seacrow01

Member
Oct 16, 2015
35
9
Seattle
So I'm bootloader unlocked, rooted on pie and cannot access fastboot. How do I go about installing twrp?

EDIT: tried different USB-C cables and one worked like a charm.
 
Last edited:

TheMadScientist

Recognized Contributor
Well I can confirms this works for pie on a 405ua unlocked bootloader...Nice work mate...


After reading through a bit and playing around. I got recovery installed on ramdisk recovery. Got out of my bootloop by fastboot flashing stock boot img from my current firmware. I did notice slot b I still have stock recovery which helped getting out of the failed encryption loop. And I also have download mode there.
 
Last edited:
  • Like
Reactions: nitrosbacksh94

phoe zay

Senior Member
Jan 2, 2013
143
9
why i cannot enter fastboot mode on my lg v40 v405UM with android pie. When i command adb reboot bootloader it goes to restart phone.Not enter fastboot mode. Please help me.Sorry for my english
 

xaxxelous

Senior Member
Jul 16, 2016
64
17
Sonora
LG V40
Broken:
  1. LGs encryption on Stock
  2. encryption on other ROMs(?)
  3. exFat for external SDs

Does this mean just within recovery or within Pie?.... The exFat part, that is
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Code:
    #include "std_disclaimer.h"
    /*
     * Your warranty is now void.
     *
     * I am not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about features included in this Recovery
     * before flashing it! YOU are choosing to make these modifications, and if
     * you point the finger at me for messing up your device, I will laugh at you.
     */


    Requirements
    1. Unlocked bootloader
    2. working ADB/fastboot on a PC
    3. the TWRP image downloaded
    4. Pie firmware on the active slot

    Installation guide (pre metadata encryption):
    1. Copy the twrp image to your phones storage and/or micro sdcard
    2. Start cmd/powershell/terminal with working adb/fastboot
    3. Reboot to bootloader
      1. adb reboot bootloader OR
      2. turn off the phone (or reboot), as soon as it turns on, hold volume down while USB cable is connected
        • If youre unofficially bootloader unlocked, and you nuked laf, its volume up and USB for you
    4. fastboot boot TWRP-judypn-boot.img
    5. Confirm allow system modifications if asked
    6. Press cancel if asked for a password (aka when youre encrypted, could also be that it doesnt show you /data at all and no password screen)
    7. Go to Advanced -> Install Recovery Ramdisk
    8. Select the TWRP image which you copied to your phone/sdcard earlier
    9. TWRP will now be installed to both slots (boot_a and boot_b)
    10. Go to Reboot -> Recovery to make sure TWRP is successfully installed

    Features:
    1. Install recovery ramdisk:
      Selecting this, and then an image (e.g. of TWRP) allows you to install the ramdisk (where TWRP resides for example) into both currently installed kernels/boot images
    2. Inject TWRP after install:
      Automatically injects current installed TWRP into the boot image of the ROM/zip youre installing when ticked

    Broken:
    1. LGs encryption on Stock
    2. encryption on other ROMs(?)

    How to flash ROMs (PRE metadata encryption):
    1. Reboot to TWRP
    2. Make a backup
    3. Install -> select the ROM zip -> tick Inject TWRP -> Swipe for install
    4. wait... ROM will be installed into the NON ACTIVE slot (if youre on a, it will be installed to b, and vice versa)
    5. Reboot system
    for gapps, magisk or other mods:
    1. DO NOT REBOOT TO SYSTEM from last step
    2. Go back -> Reboot -> select the non active slot (to where the rom got installed to) -> select recovery
    3. Install gapps, magisk, and whatever else you want
    4. Reboot system

    How to initially flash ROMs (metadata encryption):
    1. Reboot to existing TWRP
    2. Make a backup of everything you want to keep
    3. Copy backup to PC (or another external medium)
    4. Flash the ROM
    5. Do NOT inject TWRP (this will break recovery otherwise)
    6. Go to reboot -> Select opposite slot
    7. Reboot to recovery
    8. Perform factory reset (this is to setup encryption)
      1. Apply update (from ADB) with adb sideload for gapps/magisk
        • reboot to bootloader
        • fastboot boot judypn_TWRP_bootable-metadata.img
        • Use as usual
    9. Reboot system

    How to update ROMs (metadata encryption):
    • Reboot to bootloader
    • fastboot boot judypn_TWRP_bootable-metadata.img
    • Install -> Select ROM zip
    • do NOT inject TWRP
    • Reboot -> select opposite slot (it will tell you even which it installed the ROM to)
    • Reboot bootloader
    • fastboot boot judypn_TWRP_bootable-metadata.img
    • Install gapps/magisk
    Or
    • reboot recovery
    • apply update -> from adb (in e.g. Lineage recovery)
    • On PC: adb sideload <new version zip>
    • (Advanced -> ) Reboot recovery
    • adb sideload gapps/magisk
    • reboot system

    Warnings:
    1. Updating a ROM means reflashing the mods you flashed too (e.g. Gapps), addon.d doesnt work properly
    2. Be aware of the slot you are currently on
    3. If youre flashing a ROM to a slot, make sure you also have the required firmware (abl, modem, and so on) in that slot

    Infos:
    1. System image/Vendor image and system/vendor are redundant, the image variants are direct copies of the partition (and also their size) while the others are "simply" files copied and repacked
    2. How to use decrypted stock by @Xsavi : https://forum.xda-developers.com/lg-v40/how-to/guide-twrp-data-access-stock-t3970149
    3. Metadata encryption TWRP requires 10 firmware to use properly, no guarantee for it to work on Pie firmware!

    Download:
    Metadata bootable: https://drive.google.com/file/d/1hdzeH3AIQVf3siQNsI27IS_vmghPESEG/view?usp=sharing + Install zip: https://drive.google.com/file/d/1CQUfg54zD838detcIJqdRiKXdVNtd6Iy/view?usp=sharing
    Bootable: https://drive.google.com/open?id=1UnIFbJlXHl6x4azq6H6yS-PRfk-omdTP
    Old: https://drive.google.com/open?id=1p3IrbeOxM4ay01JccyifWDuxqqrE0_Dl


    Sources:
    device tree: https://github.com/SGCMarkus/android_device_lge_judypn-twrp/tree/android-9.0
    kernel: https://github.com/SGCMarkus/android_kernel_lge_sdm845/tree/lge-pie-v409-20a

    XDA:DevDB Information
    TWRP for Judypn, ROM for the LG V40

    Contributors
    SGCMarkus
    ROM OS Version: 9.x Pie

    Version Information
    Status: Alpha

    Created 2019-09-20
    Last Updated 2019-09-20
    5
    A little update here :)

    Its not as complete as i wanted it to be (encryption still doesnt work... :/ ), but this TWRP should be "good to go" nonetheless.
    It now has the ability to be booted, no need to flash anymore (aka you can then proceed to patch your existing boot slots with TWRP), and it properly formats /data now, without stock complaining about "not properly encrypted" when youre doing the decrypt process.
    OP will be updated soon.
    4
    Hi,
    My phone wouldn't boot after flashing twrp.img. Yesterday it would get stuck at lg boot logo. Today however it goes straight to fastboot mode when i turn it on.
    When i boot to recovery I will first have to go through the old recovery before I get to the new twrp.

    I did try to follow the instruction, but a/b partitioning might have messed it up for me.
    Before I flashed twrp I checked the current slot which was A. Then I flashed the recovery file to slot A. It was pretty unclear if I was supposed to flash it on the current active slot or the inactive one. Instructions says: "4. fastboot flash boot_a TWRP.img (or boot_b, depends on the slot youre on)".
    I'm not able to backup in twrp (in case I mess it up some more) because it says fail to decrypt data.

    How should I proceed? Im still active on slot A, havent tried B. My end goal is to get lineageos 17 on it.

    -Karl

    keymaster probably crashing because of security patch missmatch (boot.img and system need to have the same security patch)

    Currently working on a new TWRP, where you wont have any of these issues...

    For now:
    Flash twrp
    directly boot to it with button combo
    in twrp: flash back stock boot image from your system version (e.g. from a kdz extracted), dont reboot yet
    go to advanced -> install recovery ramdisk -> select twrp.img on your phones memory (internal, or ext. sdcard)
    3
    Well, having a big issue. I installed TWRP, Install custom rom w/ twrp inject, reboot menu, selected the slot where the rom, restarted, no TWRP, No root, but custom rom and now it comes up as unknown in LG UP so I can try to fix it. I think its mostly a brick since I can't do anything. No Fastboot either because im in slot b and cant switch because no root or fastboot.

    did you have pie firmware also in the slot where you installed LOS to?
    otherwise.... nothing is ever really a brick, you still have 9008 mode as last option
    2
    I followed this guide here

    https://forum.xda-developers.com/lg-v40/development/unlock-lg-v40-via-9008-root-t-mobile-t4042207

    deto to step 4a. Reboot right back into fastboot (hold volume down after rebooting) and run: fastboot oem unlock

    I didn't nuke my lafs

    Then I tried to fastboot boot TWRP-judypn-boot.img while still in fast boot.

    It bootup the phone and then it will stuck into LG logo screen, nothing else happens, I have to force restart the phone.

    When I try to go back to fastboot it's not there anymore, I can only go into download mode. Still, no sign of TWRP. I got ATT convert into V405QA720e_01_NAO_US_OP_1230

    Read more at: https://lg-firmwares.com/downloads-file/21672/V405QA720e_01_NAO_US_OP_1230 running with Pie.

    You tried to boot it with the engineering bootloader?
    that wont work, that one is oreo, the kernel in twrp is for pie