[TEST-TWRP][LL] @all LOCKED H81x users: I need your help :)

steadfasterX

Recognized Developer
Nov 13, 2013
5,593
14,810
263
I playing around for those owning a bootloader LOCKED device
Examples: H812, H818, H815 non-international etc.

Why? Well I want to figure out a method to play around with an incredible hack to boot TWRP permanently without actually installing it in the recovery partition (this requires LL and will not work for MM.).
... and then? We will see. If that works I can maybe do the same for efidroid .. and If that works..? well booting any ROM would be possible.

Please continue here:
https://forum.xda-developers.com/g4/development/locked-twrpinfish-locked-g4-devices-t3573048

Previous OP:

But don't get too excited dude! I just try and error here and even if all that works some day it will take a LOT of time to accomplish!
go ahead and get excited ;)
Here are the pre-requirements you have to met if I say IF I can get this working some day:

  • you have to be rooted by SuperSU >= 2.76 !! (atm this means you have to install LL and u may need to upgrade with FlashFire or similar to this version!)
  • you have to be able to disable SELinux in your booted Android (which should when you have a full rooted device)

Those above are hard facts so it may never work with MM. That also means if MM can get fully rooted by SuperSU and you can use "setenforce 0" the method should work there as well.
If you can not meet ALL of the above 2 requirements lay down and cry. For the others: calm down it will take time to accomplish!

You can test requirement 2 (disable SELinux) by:
adb shell
su
setenforce 0
getenforce

-> you should see "Permissive" as a result. If you see "Enforcing" or error messages post them. Maybe we can help you.

While doing all this I digged into the world of Android exploits (Dirty cow and PoCs like Vikiroot etc) and SELinux in LL and MM. I begin to like SELinux because it does it's job well but that means it makes it impossible to get full root on MM atm.
setenforce sets the SELinux mode. SELinux is NOT the same then having root!
You can have root permissions but SELinux can still block everything you try as root! That's why it is that hard to get MM rooted. I can get the user root in MM without a problem but you can just do nothing more then before because SELinux will block. You have to find an exploit to disable/workaround SELinux first. Nothing around there and I tried many things - even while using the really really great download mode shell (https://github.com/Lekensteyn/lglaf)

The state of my hack (2017-03-14)
  1. FULL takeover/hijack of boot -> DONE (the modifications required are not voiding the Android boot signing chain!)
  2. replace RAM disk -> DONE
  3. boot own RAM disk (TWRP!) -> DONE (atm TWRP 2.8.7-0)
  4. Upgrade bundled TWRP to latest version -> WIP (build compatible with LL required)
  5. Prepare public release -> WIP (do not ask for ETA's!)
  6. boot efidroid instead of TWRP -> WIP (build ok but not booting)

Confirmed to work devices ( as of 2017-03-14)
  • H815 International - unlocked (Thanks @steadfasterX yea its mine and i have no locked device to test with ;) That's why i needed ur help. but i test without touching the boot chain so its similar to locked devices.)
  • LS991 Sprint - locked (Thanks @TheMadScientist420)
  • H815T - locked (Thanks @the_naxhoo)

Previous questions (just here for those who wanted to know how that all started):
I have 3 simple questions first:
  1. Do you have fastboot mode available on your device?
  2. What is your Android version?
  3. Are you able to boot up TWRP with fastboot?

regarding Q1: how to access fastboot?
Usually you can boot into fastboot mode with the adb command from your PC:
adb reboot bootloader
There are also several apps in the play store doing the same from within your device.
Does not work?
Please try to enable OEM unlock in the developer options.
.. and NO THIS WILL NOT UNLOCK your device!! It is just a pre-requirement if the vendor would support unlocking but it may enable fastboot on some devices (just guessing here).
Still does not work?
Try the hardware key method:
  1. You first have to shut down your Android smartphone – turn it off completely, so either press power key once and select “power off”, or press and hold the power button for a few seconds.
  2. After doing so, press and hold (at the same time) the Power and Volume Up keys (keep pressing the buttons for about 6 or 7 seconds).
  3. Plug in the USB cable for your smartphone and establish a connection between your device and your computer.
  4. Release the keys when the download mode is being displayed.

regarding Q2: Determine your Android version
Finding your version is explained e.g. here: http://www.wikihow.com/Check-What-Android-Version-You-Have


regarding Q3: boot TWRP within fastboot

Will that harm you device? No as long as you follow the steps thoroughly

Note: if you use Windows and want to avoid any LG driver issues and do not want install adb, fastboot etc just download and boot FWUL
  1. Optional: Download and boot FWUL
  2. download TWRP (yes even if it NOT matching your exact model! It doesn't harm anything because this is just a temporary boot)
  3. rename the downloaded image file to "twrp.img"
  4. boot into fastboot mode and connect USB cable if not already done
  5. execute:
    fastboot boot twrp.img
    (on FWUL it is: sudo fastboot boot twrp.img)
  6. Do a full backup now
  7. catch the recovery.log (see FAQ #4A)
  8. STOP HERE.
    Do not try to install anything!
    Restoring? Dunno atm. Well it SHOULD work... because you restore a STOCK signed ROM.. so.. You're free to try BUT do this ONLY if you know how to restore a soft bricked device!!!!!!!!!
    Installing root on MM/custom ROMS/Kernels: NO! It will definitively soft brick your device.


Please give me feedback by copy the following snippet and fill in accordingly to your results

Don't quote the whole above post just use the following:

device: exact model (e.g. H818N, H815 SEA, ..)
fastboot: available (please tell me which method used!) / not available (please tell me which method tried!)
Android version: 5.1.1/6.0.0/6.0.1/x.x.x
boot TWRP: error (attach a screenshot of the error message!) / success (attach recovery.log - FAQ #4A)


-
 
Last edited:

the_naxhoo

Senior Member
Jul 7, 2014
258
255
0
Graneros
downloading 'boot.img'... OKAY [ 0.721s]
booting... FAILED (remote: unlock device to use this command)
finished
Model: H815T
Android Version: Marshmallow 6.0

It's necessary unlock bootloader for use the fastboot mode completely. It's not so easy... Thanks for your try :)
 
  • Like
Reactions: steadfasterX

steadfasterX

Recognized Developer
Nov 13, 2013
5,593
14,810
263
Model: H815T
Android Version: Marshmallow 6.0

It's necessary unlock bootloader for use the fastboot mode completely. It's not so easy... Thanks for your try :)
Do you have selected OEM unlock in dev settings?

no problem. thx for trying. maybe it is different between LL and MM?! I need a user reporting that for LL as well..
this is the first method. the second one not mentioned here is a little bit more complicated but if you wanna give it a try lemme know.
 

ReeS86

Senior Member
Oct 5, 2008
122
93
58
Kitchener ON
Similar to previous posts
Canadian G4 - H812 (Rogers)
Android version - 5.1 Lollipop
Fastboot/Bootloader - not able to access with either terminal command or power + vol up
Selinux can be set to either permissive or enforcing once rooted.

Cheers and keep up your good work!
 
  • Like
Reactions: steadfasterX

steadfasterX

Recognized Developer
Nov 13, 2013
5,593
14,810
263
ok just a short note:

I'm working on a hack to boot into whatever bootimage I like. This will be needed for locked devices only.
It is a heavy heavy task and it is still a LOT to do but just that you know these will be the hard requirements when I get this ever working:

  • you have to install LL
  • you have to be rooted by SuperSU
  • setenforce 0 have to work in your booted Android

I have updated the OP with the information above as the fastboot method will not work for you.

Those above are hard facts. It may never work with MM and I may never try to do this for MM as long as LL works.
If you can not meet ALL of the above 3 requirements lay down and cry. For the others: calm down it will take time to accomplish!

The state of my hack:
  1. FULL takeover/hijack of boot -> DONE (the modifications not voiding the Android boot signing chain!)
  2. replace RAM disk -> WIP (most parts done)
  3. boot own RAM disk -> WIP (still crashing atm. previous step needs more time to investigate and verify)
 

steadfasterX

Recognized Developer
Nov 13, 2013
5,593
14,810
263
ok just a short note:

I'm working on a hack to boot into whatever bootimage I like. This will be needed for locked devices only.
It is a heavy heavy task and it is still a LOT to do but just that you know these will be the hard requirements when I get this ever working:

  • you have to install LL
  • you have to be rooted by SuperSU
  • setenforce 0 have to work in your booted Android

I have updated the OP with the information above as the fastboot method will not work for you.

Those above are hard facts. It may never work with MM and I may never try to do this for MM as long as LL works.
If you can not meet ALL of the above 3 requirements lay down and cry. For the others: calm down it will take time to accomplish!

The state of my hack:
  1. FULL takeover/hijack of boot -> DONE (the modifications not voiding the Android boot signing chain!)
  2. replace RAM disk -> WIP (most parts done)
  3. boot own RAM disk -> WIP (still crashing atm. previous step needs more time to investigate and verify)
oh damn... just after writing this i was able to BOOT into TWRP from my hack.. this is .. amazing! The problem: The bootloader of LL expects another kernel image then MM! so.. i have to modify TWRP to get it loaded. Atm I can load TWRP 2.8.7.0
I think this is a dramatic breakthrough and now the time is come where I need help from the locked device users again!

If you want to help send me a PM with subject "FIsH". I haven't setup the installation process yet but will do so asap so you can try if you can get the same result.
For easier processing use Linux. If you do not have Linux use FWUL.
Do not write me if you do not know how to restore from a soft bricked device!! It shouldn't but who knows?

.
 

welder73

Senior Member
Jan 9, 2013
2,859
1,915
193
Belgrade
oh damn... just after writing this i was able to BOOT into TWRP from my hack.. this is .. amazing! The problem: The bootloader of LL expects another kernel image then MM! so.. i have to modify TWRP to get it loaded. Atm I can load TWRP 2.8.7.0
I think this is a dramatic breakthrough and now the time is come where I need help from the locked device users again!

If you want to help send me a PM with subject "FIsH". I haven't setup the installation process yet but will do so asap so you can try if you can get the same result.
For easier processing use Linux. If you do not have Linux use FWUL.
Do not write me if you do not know how to restore from a soft bricked device!! It shouldn't but who knows?

.
Have you heard about Safestrap? It's modified Twrp for Motorola Razr XT910/XT912.
I had that phone for 4 years and I flashed a LOT of roms with it.The interesting part is that Motorola has it's bootloader locked but Safestrap allow flashing and booting any custom rom/kernel,they even have Nougat now...
Here is the link,maybe it will help you :)
https://forum.xda-developers.com/droid-razr/general/installing-using-safestrap-3-75-2015-t3181430
 

TheMadScientist

Recognized Contributor
Mar 5, 2014
8,201
4,037
253
VT
I need help from the users owning a bootloader LOCKED device
Examples: H812, H818, H815 non-international etc.

Why? Well I want to figure out a method to play around with an incredible hack to boot TWRP permanently without actually installing it in the recovery partition (this requires LL and will not work for MM.).
... and then? We will see. If that works I can maybe do the same for efidroid .. and If that works..? well booting any ROM would be possible.

But don't get too excited dude! I just try and error here and even if all that works some day it will take a LOT of time to accomplish!

Here are the pre-requirements you have to met if I say IF I can get this working some day:

  • you have to be rooted by SuperSU (atm this means you have to install LL)
  • you have to be able to disable SELinux in your booted Android (which should when you have a full rooted device)

Those above are hard facts so it may never work with MM. That also means if MM can get fully rooted by SuperSU and you can use "setenforce 0" the method should work there as well.
If you can not meet ALL of the above 2 requirements lay down and cry. For the others: calm down it will take time to accomplish!

You can test requirement 2 (disable SELinux) by:
adb shell
su
setenforce 0
getenforce

-> you should see "Permissive" as a result. If you see "Enforcing" or error messages post them. Maybe we can help you.

While doing all this I digged into the world of Android exploits (Dirty cow and PoCs like Vikiroot etc) and SELinux in LL and MM. I begin to like SELinux because it does it's job well but that means it makes it impossible to get full root on MM atm.
setenforce sets the SELinux mode. SELinux is NOT the same then having root!
You can have root permissions but SELinux can still block everything you try as root! That's why it is that hard to get MM rooted. I can get the user root in MM without a problem but you can just do nothing more then before because SELinux will block. You have to find an exploit to disable/workaround SELinux first. Nothing around there and I tried many things - even while using the really really great download mode shell (https://github.com/Lekensteyn/lglaf)

The state of my hack (2017-03-12)
  1. FULL takeover/hijack of boot -> DONE (the modifications required are not voiding the Android boot signing chain!)
  2. replace RAM disk -> WIP (most parts done)
  3. boot own RAM disk -> WIP (still crashing atm. previous step needs more time to investigate and verify)

Previous questions (just here for those who wanted to know how that all started):
I have 3 simple questions first:
  1. Do you have fastboot mode available on your device?
  2. What is your Android version?
  3. Are you able to boot up TWRP with fastboot?

regarding Q1: how to access fastboot?
Usually you can boot into fastboot mode with the adb command from your PC:
adb reboot bootloader
There are also several apps in the play store doing the same from within your device.
Does not work?
Please try to enable OEM unlock in the developer options.
.. and NO THIS WILL NOT UNLOCK your device!! It is just a pre-requirement if the vendor would support unlocking but it may enable fastboot on some devices (just guessing here).
Still does not work?
Try the hardware key method:
  1. You first have to shut down your Android smartphone – turn it off completely, so either press power key once and select “power off”, or press and hold the power button for a few seconds.
  2. After doing so, press and hold (at the same time) the Power and Volume Up keys (keep pressing the buttons for about 6 or 7 seconds).
  3. Plug in the USB cable for your smartphone and establish a connection between your device and your computer.
  4. Release the keys when the download mode is being displayed.

regarding Q2: Determine your Android version
Finding your version is explained e.g. here: http://www.wikihow.com/Check-What-Android-Version-You-Have


regarding Q3: boot TWRP within fastboot

Will that harm you device? No as long as you follow the steps thoroughly

Note: if you use Windows and want to avoid any LG driver issues and do not want install adb, fastboot etc just download and boot FWUL
  1. Optional: Download and boot FWUL
  2. download TWRP (yes even if it NOT matching your exact model! It doesn't harm anything because this is just a temporary boot)
  3. rename the downloaded image file to "twrp.img"
  4. boot into fastboot mode and connect USB cable if not already done
  5. execute:
    fastboot boot twrp.img
    (on FWUL it is: sudo fastboot boot twrp.img)
  6. Do a full backup now
  7. catch the recovery.log (see FAQ #4A)
  8. STOP HERE.
    Do not try to install anything!
    Restoring? Dunno atm. Well it SHOULD work... because you restore a STOCK signed ROM.. so.. You're free to try BUT do this ONLY if you know how to restore a soft bricked device!!!!!!!!!
    Installing root on MM/custom ROMS/Kernels: NO! It will definitively soft brick your device.


Please give me feedback by copy the following snippet and fill in accordingly to your results

Don't quote the whole above post just use the following:





-
Ls991 rooted lolipop. Spare phone willing to test i dont have any fastboot but kernels set to permisive for viper to work
 
Last edited:

steadfasterX

Recognized Developer
Nov 13, 2013
5,593
14,810
263
Have you heard about Safestrap? It's modified Twrp for Motorola Razr XT910/XT912.
I had that phone for 4 years and I flashed a LOT of roms with it.The interesting part is that Motorola has it's bootloader locked but Safestrap allow flashing and booting any custom rom/kernel,they even have Nougat now...
Here is the link,maybe it will help you :)
https://forum.xda-developers.com/droid-razr/general/installing-using-safestrap-3-75-2015-t3181430
I heard about that but I cannot find how he actually implement to boot his custom twrp. Besides that his approach has many disadvantages and idk if it works in LL. It is an distributed as apk which makes changes hard (for me). It is an own customized twrp version which makes upgrading it very hard. I think about multirom which is a better standard for multiple ROMs. But if we can have efidroid it will combine all. Thx anyways :cowboy:

.

Sent from my LG-H815 using XDA Labs
 

LaughingCarrot

Senior Member
Jan 5, 2013
114
31
0
Now if the American variants (barring T-Mobile) didn't have anti-rollback, I'd gladly test this. Even if we manage to circumvent the anti-rollback measures, we'd then have to figure out how to enable fastboot.
 

TheMadScientist

Recognized Contributor
Mar 5, 2014
8,201
4,037
253
VT
Now if the American variants (barring T-Mobile) didn't have anti-rollback, I'd gladly test this. Even if we manage to circumvent the anti-rollback measures, we'd then have to figure out how to enable fastboot.
lol i never updgraded mine im still on old sprints zv6 do have a qfuze2 setoff cant roll back to zv5 but i got some leway i think zv6 7 8 9 and a are all rollbackable
plus i just dont really care if i brick mine in the prosscess ive got a few others to use. plus i finnally ordered my octo box with tag so i may be able to roll back even farther after words