LG G5 Root & Recovery Bounty Thread! [Currently $4,875] [T-Mobile DONE! Who's Next?!]

Which version of the LG G5 are you most interested in seeing rooted first?


  • Total voters
    1,049

autoprime

Recognized Developer / Inactive Recognized Contrib
Jun 23, 2010
2,638
11,890
203
First off, this is a fantastic idea and I would be extremely interested to see if something like this does in fact work. I never even considered something like this.

The only part I would be concerned about is missing the ability to run the "adb disable-verity" command, as the stock boot.img will still have dm-verity enabled. If booting from the recovery partition DOES allow you to run the userdebug kernel, I would just make sure that you aren't deleting system files (as you stated above, just reiterating).

Other than that, this looks like a great way to get a more stable use of the root shell! Thanks for your great work as usual :)
not 100% sure on this... perhaps I'm thinking of Nougat rules and not Marshmallow.. but does running dm-verity even stick after a reboot?
because the verity flag should be in the boot.img (ramdisk) and reset itself on each boot. so if the phone is booting into android after a reboot and actually fully boot.. the verity disable stuff may not even be "in play" again until you re-run "adb disable-verity". And in that case.. the phones already back into android.. working.. and retaining the system changes.

but again.. its possible I'm thinking of nougat rules which removed the ability to disable verity and have it stick after a reboot (without modifying the boot.img/ramdisk.. which wouldnt work in this situation because the bootloader is locked and therefore boot.img must be signed and wouldnt boot if edited).

but ya as I said before.. it may take some trial and error to see whats working and what isnt working after a system edit and going back to stock boot. I really see no reason to delete ANY files in system when you have the power to use the adb pm hide/disable command to freeze the apps from running etc (adb pm disable may need to be run in root shell to work). It's not like deleting files in system will save space... system partition is always a set size.. 5GB-ish and will always take up 5GB of space whether you run a 100MB ROM or a 5GB ROM.

So freezing apps may get around the stock kernel getting mad about system changes and not booting. As you may recall from the hex edited TOT... you edited build.prop and things still booted on stock boot.img.. so changes can certainly be made in system while keeping the stock boot.img happy and android booting... just have to find the perfect combo/list of mods that keeps it that way.

And since no ones really using the stock recovery for anything (on locked bootloader devices.. no TWRP obv) it would be great to dual boot this way.. best of both worlds I suppose (if any of this works.. as you said.. it may all fall apart when it comes to verity). the main unknown is how much in system can be changed while still making stock boot.img happy.


*EDIT*
derp.. so we cant use recowvery after all... must use dirtysanta. I wasnt thinking n forgot recowvery expects the bootloader unlocked and uses a custom boot img in the recovery slot to open the root shell. so a dirtysanta "boot edition" edit is needed changing sde1 (boot partition) to sde2 (recovery partition).

I decided to pull my g5 out to try all this but unfortunately the boot.img doesn't seem to work on my t-mobile g5 so I can only get as far as flashing it but cant boot with it :rolleyes: I still may be able to test some dm-verity stuff while on my stock boot.img.. see what can/cant be edited in system with stock boot still booting into android.


*EDIT 2*
as I've said in my next post...
so far I can confirm that android still boots on the stock boot.img with the following system changes:
mount -o rw,remount,rw /system
mount -o ro,remount,ro /system
editing/replacing host file in /system/etc/ (needs chmod 0644 after changes)
editing build.prop (needs chmod 0644 after changes)

now more changes need to be tested.. like hotspot mods and other framework edits to see what's possible while using stock boot.img.
 
Last edited:

Honestly Annoying

Senior Member
May 17, 2016
479
853
0
chicago
twitter.com
not 100% sure on this... perhaps I'm thinking of Nougat rules and not Marshmallow.. but does running dm-verity even stick after a reboot?
because the verity flag should be in the boot.img (ramdisk) and reset itself on each boot. so if the phone is booting into android after a reboot and actually fully boot.. the verity disable stuff may not even be "in play" again until you re-run "adb disable-verity". And in that case.. the phones already back into android.. working.. and retaining the system changes.

but again.. its possible I'm thinking of nougat rules which removed the ability to disable verity and have it stick after a reboot (without modifying the boot.img/ramdisk.. which wouldnt work in this situation because the bootloader is locked and therefore boot.img must be signed and wouldnt boot if edited).
Ah darn... too bad that won't work :/

Just to talk about dm-verity, the command DOES stick after reboot. You can verify this yourself by trying to run the "adb disable-verity" command again after a reboot and it will throw you an error (can't remember the exact wording, but it says something about how it already is disabled). You can also pull the boot.img from the phone after running the command, extract the contents, and check the files to see if dm-verity has been disabled (file is /etc/recovery.fstab from the boot.img extraction). So yeah if we can figure out exactly what will cause the phone to bootloop without turning off dm-verity that would be extremely helpful.

ALSO (just thought of this) your idea could actually still work. Here are the steps to make that work (you must be completely stock for this to work!!!)

1. Follow the full guide I provided here BUT ONLY THROUGH STEP 5
2. Run this command in your cmd/terminal
Code:
adb pull /storage/emulated/0/bootbackup.img
Great, now you have a copy of your stock boot.img to revert back to. Move this to you desktop or another easy to access location.
3. Finish the rest of the guide. Now you should have the userdebug kernel running and dm-verity off
4. On you computer, run these commands
Code:
adb root
adb push [pathtouserdebugboot.img] /storage/emulated/0/userdebug.img
adb push [pathtostockboot.img] /storage/emulated/0/stock.img
adb shell
dd if=/storage/emulated/0/userdebug.img of=/dev/block/sde2
dd if=/storage/emulated/0/stock.img of=/dev/block/sde1
reboot recovery
If it boots back into Android system, you are now dual-booting the userdebug kernel and the stock kernel! Now to make sure run this
Code:
adb root
adb disable-verity
Awesome! Now reboot the phone normally and it should be the stock, stable kernel. Whenever you want to use the root shell to make changes, just run
Code:
adb reboot recovery
and you should be good to go :D
 
  • Like
Reactions: Arunscape

autoprime

Recognized Developer / Inactive Recognized Contrib
Jun 23, 2010
2,638
11,890
203
...
ALSO (just thought of this) your idea could actually still work. Here are the steps to make that work (you must be completely stock for this to work!!!)
...
Yup your steps to just use adb root shell to swap the imgs via dd will work for dual booting for the meantime. In the final form, if this even ends up being something worth using, an edit to dirtysanta could maybe be made so debug img goes right into the recovery slot instead of all the swapping around. but a few dd commands never hurt anyone either :cyclops:

for initial testing it might be easiest to keep the debug boot img in the boot partition slot.. and flash the stock boot img to recovery.
if keeping the debug boot img in the boot slot... I believe android will NOT try to patch recovery to restore stock recovery due to the boot partition hash being different than expected. If the stock boot img is written into the boot partition slot.. android will try to patch recovery and remove whatever is in the recovery slot UNLESS a mod to system is made (like removing the recovery-from-boot.p file in /system).

then they could follow your thread HERE to get ADB root up to and including step 8 (you said step 5 tho so maybe I'm missing something?)... but either way.. it should be before they reboot for the first time... they have to pull the boot backup img as you mentioned:
Code:
adb pull /storage/emulated/0/bootbackup.img
then continue with step 9 (reboot into recovery to wipe data)
then when back in android:
Code:
adb root
adb disable-verity
adb push [path-to-bootbackup.img] /storage/emulated/0/stock.img
adb shell
dd if=/storage/emulated/0/stock.img of=/dev/block/sde2
reboot
and now the stock boot img is in the recovery partition slot.
and anyone who wants to try to boot back into stock kernel (before making any changes to system at all) can just:
Code:
adb reboot recovery
or boot into recovery with the volume/power buttons at boot. yes, this takes you to a "factory reset" screen.. but since the stock boot.img is in the recovery partition slot now.. after you hit "yes" twice (confirming factory reset) it won't actually wipe data but instead will boot into android using the stock boot img.

and after rebooting into "recovery".. hopefully the phone boots into android eventually.. despite a potential red warning screen.

if not.. then this whole idea pretty much goes out the window.

if it does actually boot into a working android then more mods to system can be tested.
to get the ABD root shell back.. just reboot the phone normally and since the debug boot img is still in the boot partition slot the phone will boot and you'll have access to root again with:
Code:
adb root
and from there you could then try to remount system... and edit your hosts file or something.
example: http://adblock.mahakala.is/
Code:
adb push [path-to-hosts] /data/local/tmp/hosts
adb root
adb shell
mount -o rw,remount,rw /system
cp /data/local/tmp/hosts /system/etc/hosts (use mv if cp doesn't work)
chmod 0644 /system/etc/hosts
mount -o ro,remount,ro /system
reboot recovery
and hopefully that reboots you back to "recovery" and boots the stock boot img you have there.
this time it will surely have a yellow or red warning message on boot and may reboot the phone again.
hopefully after that initial reboot it goes back to trying to boot recovery(stock boot img) and actually boots into a working android.
at that point you'd be booted using stock kernel (so no more kernel weirdness) but have a hosts mod to block ads.

hopefully I havent missed a step in here. But hopefully the above steps are the easiest route to testing this whole dual boot thing.
now someone needs to test!

*edit*
so far I can confirm that android still boots on the stock boot.img with the following system changes:
mount -o rw,remount,rw /system
mount -o ro,remount,ro /system
editing/replacing host file in /system/etc/ (needs chmod 0644 after changes)
editing build.prop (needs chmod 0644 after changes)

so those who only want build.prop edits or ad blocking could ADB root n make the changes then go back to stock boot.img and the phone should still work. And I still suggest using adb pm hide/disable over deleting system apks/odex files. I suppose the next tests could be hotspot/tether mods n see if stock boot img still boots with those changes. what other changes have people been making with ADB root?
 
Last edited:

adu1982

Senior Member
Dec 14, 2013
55
9
0
All this work has me more excited about my g5, was about to send it in for repair (after 2 months of use my power button does not work) but since i have not taken any updates i am just gonna deal with it....since when they fix it i think they update it to the last version too right?
Go root...?

Dunno if ever posted here but i pledge 30$ for sprint root that will give tether and is doable...without major brick risk. So put me down for that since i can see it in our midst.

Have rooted all my other devices successfully in the past but i am not a developer.....just sheep follower.

Sent from my LGLS992 using XDA-Developers mobile app
 
Last edited:
  • Like
Reactions: kchannel9

Veliion

Senior Member
Sep 18, 2013
426
97
0
Guys, this is probably not going to happen. First careless XDA users made jcase stop development for this phone. Then when we got a beacon of hope when Honestly Annoying got some kind of root to work, the same type of users made him stop development.

Unless this community can read before they post and some experience developer tries again, this is not going to happen.

Questions about a bricked phone in a thread the clearly says EXPERIMENTAL are what ruins our chances on ever getting a G5 root.

I am asking, no begging, the developers to try again and to ignore the careless users who don't read or appreciate what you are trying to do.

And I hope that the careless users change their way and actually read the thread before posting questions, there is a search function.

Sincerely,

The rest of the community
 

VonbraunZ

New member
Feb 14, 2011
2
2
0
I have to say this is my first lg, I'll never own one again, the community has alot of toxic people. My $200 still stands regardless
 
Last edited:

djparent

Senior Member
Jan 3, 2010
147
92
0
Saskatoon
If I follow Honestly Annoying post -about getting adb root, - can I install apps via adb that require su permissions when running? Like AFWall+, AdAway and a couple others.
Please read thru the threads yourself and you will find the answer. All the information you seek has been discussed already. As you read through the thread you will understand how posts like your question are extremely annoying, it has been asked SO many times. This is why the devs have stopped support. They aren't here to answer the same questions over and over. Enjoy your reading. :)
 

paleman27

Senior Member
Dec 29, 2010
658
75
0
San Juan
With little hope, this really isn't a hot thread anymore. I'm sure the OP will update it when he has time.
LG G6 is just around the corner... I don't think it matters anymore whether someone achieves root on the AT&T version. I guess my learned lesson here is to wait for the root before buying a new phone. On the bright side I got Nougat today. Lol!
 
Last edited:

andyroidking

Senior Member
Mar 10, 2016
209
101
53
LG G6 is just around the corner... I don't think it matters anymore whether someone achieves root on the AT&T version. I guess my learned lesson here is to wait for the root before buying a new phone. On the bright side I got Nougat today. Lol!
Yeah, this is a great phone and my first not to have root on.... would have made it awesome. Lessons learned.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone