yashsingh1/xdaforums huggingface dataset:
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] KillerofJoy:
I have had all the same results with every possible way I could work 10d tot as well as every kdz I could find.. I have never had a single update issue even while being a tester.. Seems N has a rollback stopper built in somewhere as that's the message on the LGUP tool while throwing out the error.. I have been on N with the 10a kdz.. locked oem and unlocked oem switch as well.. Through adb just in case.. lol A tot would be the most excellent way I believe.. Maybe tungkick would be willing to come through again.. Put in a possible request for a tot..
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] sammael1069:
anyone else in a position to pull this off, it sounds promising
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] vmartinez39:
Oh cool so I wasn't the only one having issues with trying to flash 10d twrp tot or any marshmallow kdz. I went back to my LG G4. Have been flashing my G5 and none of the marshmallow kdz will work. Tried every combination with no success.

I lost twrp and can't do any experiments as someone suggested. I'm in the same boat as all who are now on 20A. Wish I would have been more patient and waited. Got caught up in the nougat excitement.

---------- Post added at 05:19 AM ---------- Previous post was at 05:11 AM ----------

Murphy's law can go to hell..... My LG G4 just decided to bootloop hardware error.... with TWRP and CM14.1.....

Perfect...
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] lordodin912:
[MENTION=2684188]autoprime[/MENTION] Just flashed complete.zip in TWRP over 10D, removed recovery-from-boot.p from /system after flash then immediately flashed supersu without rebooting back into recovery*. It worked! TWRP stayed (rebooted to check after the OS booted, of course) and successfully rooted. Thank You!

Could I restore my TWRP backup of 10D? Would I just need the modem of 10D or would the new BL mess everything up?

* Tried to click reboot to recovery inside TWRP for fun but still booted to OS.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Mike_77:
I did not update TWRP.. Flashed the 20A Complete, dm verity, and the SuperSu 2.78 R5. No issues with TWRP or root.. Everything worked perfectly
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Jaistah:
Try booting back to Recovery and see if TWRP stayed
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
I have some wonderful news! [MENTION=5672995]jcadduono[/MENTION]'s dirtycow root method on the V20 works on our H830. Simply run the instructions as stated and you get TWRP back.

https://github.com/jcadduono/android_external_dirtycow#running
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] KillerofJoy:
Even on N?.. My biggest issue running these types of commands through a terminal is no root so errors cause everything starts with su...
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
Yeah I'm on 20A. I was able to dd twrp and then flash supersu.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] KillerofJoy:
Which terminal app did you use or was it through adb or fastboot?

---------- Post added at 12:07 PM ---------- Previous post was at 12:05 PM ----------

Thx would appreciate it..
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
I used adb personally but I bet you could use a terminal on the phone itself if you lacked access to a pc.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Mike_77:
Hadn't needed to reboot into TWRP, but now that I tried, no TWRP..
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
i can confirm dirtycow worked for me to reflash twrp. you have to make sure to have the newest version of twrp.img. i was also able to root 20a with the newest supersu.zip.

i will try going back to 10j nandroid i had made before i upgraded to 20a
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] KillerofJoy:
Nah I got a pc and like I said no root no su access through terminal.. I thank you for heads up.. As will the dozens that follow.. adb it is will try this method later this evening..
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Cel1n:
Can you make full step-by-step quide what you doing? For windows 10 pc ...Because I don't have linux for building necessary files.

Because I recived software brick and recover phone using LGUP and kdz...

Thank you.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
i can confirm dirtycow worked for me to reflash twrp. you have to make sure to have the newest version of twrp.img. i was also able to root 20a with the newest supersu.zip.

i will try going back to 10j nandroid i had made before i upgraded to 20a

download all the files from here:

https://build.nethunter.com/android-tools/dirtycow/arm64/

and follow these instructions:

**pushing files**

adb push dirtycow /data/local/tmp

adb push recowvery-applypatch /data/local/tmp

adb push recowvery-app_process64 /data/local/tmp

adb push recowvery-run-as /data/local/tmp

adb push twrp.img /sdcard/twrp.img

**end pushing files**

1) adb shell

2) cd /data/local/tmp

3) chmod 0777 *

4) ./dirtycow /system/bin/applypatch recowvery-applypatch

"<wait for completion>"

5) ./dirtycow /system/bin/app_process64 recowvery-app_process64

"<wait for completion, your phone will look like it's crashing>"

6) exit

7) adb logcat -s recowvery

"<wait for it to tell you it was successful>"

8) CTRL+C

9) adb shell reboot recovery

"<wait for phone to boot up again, your recovery will be reflashed to stock>"

10) adb shell

11) getenforce

"<it should say Permissive, adjust source and build for your device!>"

12) cd /data/local/tmp

13) ./dirtycow /system/bin/run-as recowvery-run-as

14) run-as exec ./recowvery-applypatch boot

"<wait for it to flash your boot image this time>"

15) run-as su

16) dd if=/sdcard/twrp.img of=/dev/block/bootdevice/by-name/recovery
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] KillerofJoy:
Go to the tung thread in op theirs a script to fix it..
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
okay will do thanks for the headsup, didnt see that the first time i flashed 20a, i will restore my nandroid again and run those commands.

i just wiped all partitions and repaired system,data,and cache to be safe within twrp

---------- Post added at 07:07 PM ---------- Previous post was at 07:04 PM ----------

i do like nougat but will be waiting with marshmallow until xposed gets upgraded to be compatible, i only upgraded to nougat as a test
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
Cool. Thanks for testing the rollback. It will be good to know that we can still run 6.0.1 with the 7.0 bootloader/modem and all that.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Cel1n:
godfather123189 Thank you very much! It works!!! I have both root and twrp now!
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
unfortunately i am still stuck in the twrp loop

i ran those dd commands from the op, and the response is the files cannot be found
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] lordodin912:
[MENTION=2684188]autoprime[/MENTION] Update: Tried to restore 10D TWRP backup and got stuck in bootloop, stupid BL. Had to re-flash 20A like before to get phone working again.

Would it be possible to flash the BL&Modem from 10D after restore? Or would it BRICK? Like taking risks but the BL is where I draw the line ha. Thanks
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] sammael1069:
[MENTION=1630273]godfather123189[/MENTION]

Did you do this step

adb push twrp.img /sdcard/twrp.img
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
Unfortunately you and [MENTION=1630273]godfather123189[/MENTION] are paving the way in knowing the answer to that. :) You'd have to give it a shot. I assume either by flashing the individual zips for the BL/Modem or by using the complete 10d zip and see what happens.

---------- Post added at 07:53 PM ---------- Previous post was at 07:48 PM ----------

I just wanted to do a quick re-cap. There seem to be two scenarios and they are approached differently.

1) You have TWRP on MM and you flash the "complete" 20a. Before you reboot the phone you must mount /system in TWRP and delete "recovery-from-boot.p" which sits at the root of /system. From there you can flash SuperSU and TWRP sticks.

2) You've updated to 20a using the KDZ. You lose TWRP in the process. [MENTION=5672995]jcadduono[/MENTION]'s V20 dirtycow root method works on our phone. You simply follow the instructions found at https://github.com/jcadduono/android_external_dirtycow#running exactly as stated and you regain TWRP and can flash SuperSU if you wish.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] lordodin912:
Waiting for feedback from [MENTION=2684188]autoprime[/MENTION] ha don't wanna trip something....only phone I have right now so need be a lil careful.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
No kidding! I'm in the same boat so I've tried to not be completely adventurous. Theoretically if we had been able to restore back to 10d via LGUP we'd have re-installed the old BL/Modem in the process so perhaps it's telling in the sense that LGUP does not permit this.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] lordodin912:
My thoughts exactly. Hopefully wrong though and we can downgrade.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] waylo:
There is the same anti rollback level for this and the 10d onwards firmwares, so doing a complete .zip flash (of the version you were on--you can't mix versions), followed by a data format (if data was not encrypted), followed by a twrp mm restore, should theoretically get you back to where you started.

Make sure you format /data the correct way, not a factory reset/wipe.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
yes, i actually added that step to the instructions per my steps i followed during dirtycow

---------- Post added at 08:12 PM ---------- Previous post was at 08:11 PM ----------

im still stuck in the twrp loop i have tried to reflash the complete zip for 10j and 20a both twrp loop. i am just about ready to flash 20a through lgup again and then try dirtycow steps again

---------- Post added at 08:19 PM ---------- Previous post was at 08:12 PM ----------

just reflashed through lgup. up and running nougat again.

going to run through the intial setup and try dirtycow again
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] sammael1069:
once i was in twrp i flashed

no-verity

sr5su-v2.78

LG-H83020a-Flashable.Boot
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
in what order? boot first?
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] autoprime:
For everyone on M with TWRP who wants rooted 20A... just skip the "reboot recovery" step in between flashing COMPLETE ZIP and SuperSU ZIP. My mistake for suggesting the reboot recovery... didn't know it would force a reboot into system (I have since tested it myself to confirm). Based on the H850 N update reports, I was worried people would lose TWRP if flashing SU immediately after COMPLETE ZIP... but I'm now going to assume those reports were usererror.. flashing incorrect SU or something. I have updated the OP to reflect this change.

(Pinging [MENTION=4053492]vmartinez39[/MENTION] [MENTION=1778755]eminem5055[/MENTION] [MENTION=2876912]Barsky[/MENTION] [MENTION=1489049]NinjaNerdBGM[/MENTION] [MENTION=3510429]carnivalrejectq[/MENTION] [MENTION=2081315]benchmade707[/MENTION] )

Now... THE GOOD NEWS IS that z28james confirmed that [MENTION=5672995]jcadduono[/MENTION]'s recowvery still works. This is expected behavior as dirtycow has STILL not been patched in current android security updates. DirtyCow is expected to be patched in Decembers update next week but we won't see on the H830 until after the new year. It'll be interesting to see if the next update will have a higher fuse version.

if u want to go back to 10D I would flash the 10D bootstack zip and modem as well. 10D and 20A are both version 01 so it's safe.

if using M bootstacks you may also want the old TWRP. Can't confirm yet if new TWRP works on M bootstacks. maybe someone else has tried it and can fill everyone in.

if you have root you can just dd the new twrp img to the recovery partition.

only 10A has a lower rollback value so far. so using 10D - 20A is safe. I personally would try to match bootstack/modem/boot/system.. but some swapping around may work. as I mentioned above... I'm not sure if the new TWRP works on old bootstack.

We will have to wait and see if future updates use a higher fuse version. That would most likely stop all downgrading to M. So if that happened it may be best to avoid the new bootstacks/modems which increase the fuse values. System/boot don't touch fuses b themselves (but may or may not work with different bootstacks/modems).
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] jcadduono:
I've updated the thread @ http://xdaforums.com/v20/development/h918-recowvery-unlock-v20-root-shell-t3490594 for you guys.

TWRP 3.0.2-1 for G5 is already using the G5 (v20a) / V20 (v10d) Nougat kernel, be sure to let me know if you run into issues with it.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Mike_77:
Already done. Thanks for everything!
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] vmartinez39:
can this be done on Locked Bootloader? Silly question, I relocked my phone and made it full stock after flashing to 20A.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] autoprime:
you can unlock the bootloader on 20A.. then run recowvery to get TWRP https://github.com/jcadduono/android_external_dirtycow#running

and with TWRP you can root by flashing the SuperSU zip (or flashing a pre-rooted custom rom).
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
none of those dd commands to fix twrp loop worked.

so i got up and running on 20a with root and no encryption; after flashing 20a in lgup and running through dirtycow again

i am now going to nandroid 20a and try flashing 10j bootstack and restore 10j nandroid

i am also going to flash the older twrp to see if the newer 1 was causing the loop earlier after the downgrade
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Barsky:
$ ./dirtycow /system/bin/app_process64 recowvery-app_process64

"<wait for completion, your phone will look like it's crashing>"

When I do this step, the phone reboots itself and then just sits at the T-Mobile logo. I pull the battery, reboot and it comes back up. I the run "getenforce" and it still comes back Enforcing. Thus, the dd command fails.

Do I need to just let it sit on the tmobile screen a long time?

While it sits at that screen (no led flashing) I do the "adb logcat -s recowvery" and it returns * give jcadduono a hug, will ya? *

I've tried this twice. Phone was wiped on a fresh 83020a. Any hints?

Thanks
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
follow the instructions line for line.

when it looks like the phone froze at the tmo screen move to the next step

the ctrl + c is a step
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Barsky:
OK, 3rd try was the charm. This time when it stayed on the T-mobile screen I typed adb reboot recovery which just rebooted the phone. getenforce came back permissive and I now have twrp.

Thanks much!!
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
hey guys look back at my instructions in post #55 on page 6 if you need the instructions for dirtycow. i updated them to be more clear on how to use them. they are confirmed working if you also need the link for twrp i can add it to the instructions but you can find it here on xda

---------- Post added at 11:44 PM ---------- Previous post was at 11:39 PM ----------

following these steps i was able to get back to 10j:

first flash stock 20a via lgup

run through the dirtycow steps

restore nandroid of 10j

before leaving twrp:

flashed boot,bootloader,and modem from 10j

and flashed the no-encryption zip and the newest supersu
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] vmartinez39:
I had my phone in 20A and followed the dirtycow scripts and now have TWRP Again.

I'm having a problem that when I entered TWRP it asked me for a password. Once go through TWRP couldn't load the data partition (because it was encrypted). I then made a TWRP backup. I also noticed a new "system image" partition that was just strange.

I flashed the no-verity-opt-encrypt-4.1.zip

When I rebooted my phone it asked to wipe data because the encryption password failed. Now my phone won't boot and it is stuck in TWRP.

I tried flashing 20A again, then no-verity-opt-encrypt but it seems my phone is still looping.

---------- Post added at 01:15 AM ---------- Previous post was at 01:07 AM ----------

My system partition is empty. Even after flashing 20A of this post.

I'm struggling here if anyone else can provide some details.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
I'd honestly reflash using the 20a kdz and start fresh.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
yeah i would use lgup to reflash 20a, run through dirtycow.

in twrp the first time, you need to do a data format before using the no encrypt zip, thats where you messed up
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] dubntz:
This works!

This worked flawlessly. I now have root again. Thanks!
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
my recommendation for anyone that hasnt upgrded to 20a as of yet.. i would recommend upgrading to 10j and making a nandroid for your current setup and make sure you can download the boot,bootloader, and modem flashable zips.

that way if you do want to downgrade back to marshmallow, you can restore the nandroid and flash the zips like i did and you're back in business :)

---------- Post added at 04:23 AM ---------- Previous post was at 04:20 AM ----------

also PSA: if you do a fresh install from LGUP and want root, after following dirtycow, do a format in twrp and reboot back to recovery prior to flashing the no encryption zip. otherwise you will not be bootable
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] vmartinez39:
Yes thanks for that, I didn't format the data before applying the no-verity-opt-encrypt

We finally got here. Thanks again for your help. All I did after following the "dirtycow" instructions, went int TWRP and formatted the data. Then Flashed the no-verity-opt-encrypt.

Also I made a backup of my phone using LG Bridge before trying this, the DirtyCow instructions to get back TWRP. Is it safe to restore the backup from that? I'll restore and see what happens. I really doubt it will restore recovery and all the modifications done by DirtyCow.

I'll report back what happens. And from now on, no more wreckless updates without making a backup for me.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
i doubt bridge will restore the backup since the system is now modified, but it might,

but you shouldnt worry, if you do want to go back to stock&no root/recovery.. just reflash using LGUP
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] shaneg79:
so are those who upgraded to nougat and don't have a nandroid backup out of luck as far as downgrading to marshmallow?
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
for the moment, yes. until we figure out another way of downgrading

if someone is willing to try it i will give a copy of mine and instructions on using it

i will of course provide an empty data.img in the backup so you will have to reflash supersu after using it
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] shaneg79:
Is flashing cm 14.1 ok at least? Thanks for your reply! :)
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] godfather123189:
i havent tried flashing cm, but if its compatible with the bootloader and modem that we got in 20a, then you should be good
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] lordodin912:
Now when (hopefully) we get xposed for N, then there won't be much reason to want to go back, very nice to know we can though.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] vmartinez39:
LG Bridge backups restored on my TWRP 20A

I just noticed that it's not really a true backup. It's a hit or miss with some apps. Some restore flawless while others still require to login and configure fresh. It's not perfect but I feel it's awesome substitute for backups without having to do a TWRP.

I think I'll stick with stock and while I can't wait for CM14.1 to go official, just having LG bridge for making stock backups is really awesome.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] lordodin912:
You could run CM and stock at the same time. Dual Boot
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] benchmade707:
I went through the dirtycow method and while it booted into TWRP once, when I tried to restore a nandroid it went into bootloop. I couldn't get it back with LGUP, and BitDefender kept blocking a virus from that install, I don't know if that's related to my issues with LGUP. I'm getting errors at 10% everytime when trying to go back to 10D.

I did get the system back up under 20A using lgbridge, but I'm still unable to flash the 10D with LGUP. Every time I get the "0x2BC, invalid command response code = 0x80000121" error at 10-11%, with both refurbish and upgrade. When I close LGUP, I get a windows message about "cleanup.exe" being missing, I assume that's the file my Anti-Virus doesn't like. Could that blocked file be causing the failed LGUP flashes?

It's safe to flash a 10j Nandroid over a 20a stock system after manually getting into TWRP, right?
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] autoprime:
yes, it's "safe" to flash anything between 10D, 10i, 10j and 20A. you won't brick. whether something works or not is another story.

cleanup.exe is from my UPPERCUT file. can you look through your anti-virus logs or something to double-check which files exactly it has an issue with? want to make sure everything is running ok and the issue is just cleanup.. or if it's a larger issue. thanks!
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] shaneg79:
Just curious I was able to flash cm 14.1 after going through dirtycow steps in the past I know I could flash back to 10j would that be possible to flash back to 10j from cm 14.1?
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] z28james:
[MENTION=1630273]godfather123189[/MENTION] has confirmed for us that you have to downgrade your bootloader/modem as well or else you bootloop.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] benchmade707:
I'm attaching the screen I took of the virus definitions.

I knew the ARB would be good, I just wanted to make sure that was OK to do, flashing a rooted MM nandroid over an unrooted Nougat since my system didn't seem to like it. My whole reasoning for wanting to flash a rooted 10d is so I can get back to TWRP and hopefully successfully flash the nandroid I took just before I flashed Nougat. I'm just going to stick with MM until Xposed is updated and we figure out the root.
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] carnivalrejectq:
Anything I can do to get root back without a pc?
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] shaneg79:
I would be willing to try it if you could provide it to me with instructions :) thanks!
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] eocobby721:
Can someone please help with a video of this instructions. I don't mind if I have to throw in some $$.

Thanks :)
[T-Mobile LG G5 ROMs, Kernels, Recoveries, & Other ] Ducter:
Here are the original instructions, if you have ADB set up it's literally just copy paste and your done, if you don't you can download it. I run Ubuntu, I downloaded all the files into one folder, opened terminal in the folder and off to the races. If you are on Windows, it's the same basically. If you are stuck at a particular place I can try and help you out.