[STOCK] [H872] [11g] T-Mobile G6 Stock Collection

ryanrod

Member
Jun 5, 2013
39
23
0
San Jose, CA
What Encryption message are you talking about? The one in TWRP where it asks you for a Passcode?

So far, I have tried removing dm-verity and force-encryption from both the 11h and 20a kernels, but I have not been successful. The OS always ends up encrypting data. However, after I flash Magisk I no longer get any passcode prompts in TWRP. I am able to backup and restore system and data no problem.

The only thing I have not tried is a rom packed with dm-verity and force-encrypt removed and root built in. That is the next thing on my list once I get a deodexed 11h rom done.
So as you are suggesting, there are two possible encryption passcode promts. 1. in twrp recovery 2. at system boot

I still get the encryption passcode when booting into twrp as well. I have magisk flashed already. I wonder why it is still there.... Did I need to reboot into twrp after fomatting the data partition/before flashing the FullStock zip? Does uninstalling/re-flashing magisk fix it?

I was getting the encryption passcode prompt for the system boot at one point, but as I said, formatting the data partition before flashing the FullStock zip fixed that.
 

Ken C

Senior Member
Mar 5, 2011
848
184
0
ryanrod;77807243 I was getting the encryption passcode prompt for the system boot at one point said:
Just for my clarification, when your saying this ^ your talking about when you boot to system after flashing a rom etc? The white screen with yes or no on it?

Throughout all this I can say I've only seen that screen once come up on it's own. And only once that I've noticed could I go in tb pro and see 3 lines for storage where you'd see them on first opening the app. An example would be that you can't use the SD card in tb pro to write the app backups to. At least I can't.

Out of curiosity what are you running when you see that? And is it only right after root?

Sent from my LG-H872 using Tapatalk
 

weakNPCdotCom

Senior Member
Aug 16, 2018
436
504
0
Atlanta
So as you are suggesting, there are two possible encryption passcode promts. 1. in twrp recovery 2. at system boot

I still get the encryption passcode when booting into twrp as well. I have magisk flashed already. I wonder why it is still there.... Did I need to reboot into twrp after fomatting the data partition/before flashing the FullStock zip? Does uninstalling/re-flashing magisk fix it?

I was getting the encryption passcode prompt for the system boot at one point, but as I said, formatting the data partition before flashing the FullStock zip fixed that.
Ill explain the issue and steps for flashing and hopefully that will answer your question.

The 11g, 11h and 20a stock ROMs will try to encrypt the data partition on your phone the first time you boot to the OS. Sometimes it will show "Encrypting.." on the screen with a little android guy. Other times it might just say "Starting Android.." or something like that with a progress bar. Either way, it will always try to encrypt your data.

Now. Assuming you have been using your phone and now want to reflash a rom (Stock or otherwise) and flash magisk in the process:

You reboot to TWRP. If TWRP asks you for a passcode, that means your data is encrypted, and TWRP will not be able to mount the system, vendor or data partitions.

In order for anything to flash correctly, you will need to go to Wipe -> Format Data. This will format the entire data partition and remove encryption. But TWRP still has not mounted system, vendor or data at this point. So you need to either

A.) go back to the main TWRP menu and tap Reboot -> Reboot Recovery
or
B.) Manually mount System and Data.

Option A is generally safer because sometimes when I have manually mounted system it still wouldnt flash because the partition was somehow in use.

After rebooting back to recovery, all partitions will be mounted correctly, your data will not be encrypted, and you will not get a password prompt in TWRP. You will just get the standard excerpt about it being dangerous and asking if you want to keep the device read only blah blah.

Now at this point, you can flash whatever rom you want. After flashing any roms or bootloaders or anything that is going to replace a part of the OS, then you flash Magisk.

Watching the magisk flash logs on the screen, you could see one or more of the following:
"encrypted data detected. preserving force encryption"
something regarding it patching dm-verity
then at the end it will try and repack the patched boot image. At this point, whether your device is going to be force-encrypted or not, magisk has patched boot and any other areas needed so that you TWRP will be able to work without entering a passcode when you boot to recovery.

Now, when you initially boot to the OS, key point is that you do not enable secure startup when setting up your phone. I think this is the one thing I missed when I have been explaining this to everybody and it's the one thing I never do when I set up my phone. I dont know why it never came to mind until now. That is the feature that asks you to enter a passcode or pattern on boot and ultimately encrypts the entire device.
You can add a pattern or passcode to the phone for your screen lock, but enabling secure startup may just hose all of the work you did with formatting and flashing magisk.

I hope this helps. I am going to be uploading pre-rooted SysBoot roms for 11g, 11h and 20a today with patched kernels that should have dm-verity and force-encryption disabled. I am not sure if the patched kernels are actually going to work, but the roms will at least have root integrated. Ill post an update when they are online.
 

Ken C

Senior Member
Mar 5, 2011
848
184
0
Thank you man that's what I was looking for. Thanks for mentioning the secure startup deal, I've always wondered about that. I was going to pull the rom but I'll wait until you put up what your working on been holding off doing anything for that.

Totally appreciate it

Sent from my LG-H872 using Tapatalk
 

weakNPCdotCom

Senior Member
Aug 16, 2018
436
504
0
Atlanta
Thank you man that's what I was looking for. Thanks for mentioning the secure startup deal, I've always wondered about that. I was going to pull the rom but I'll wait until you put up what your working on been holding off doing anything for that.

Totally appreciate it
No problem. probably gonna hang on to my G6 a couple more weeks too so I can finish some things up.

The new roms are uploading. Should be up later this afternoon
 
  • Like
Reactions: Ken C

ryanrod

Member
Jun 5, 2013
39
23
0
San Jose, CA
Ill explain the issue and steps for flashing and hopefully that will answer your question.

The 11g, 11h and 20a stock ROMs will try to encrypt the data partition on your phone the first time you boot to the OS. Sometimes it will show "Encrypting.." on the screen with a little android guy. Other times it might just say "Starting Android.." or something like that with a progress bar. Either way, it will always try to encrypt your data.

Now. Assuming you have been using your phone and now want to reflash a rom (Stock or otherwise) and flash magisk in the process:

You reboot to TWRP. If TWRP asks you for a passcode, that means your data is encrypted, and TWRP will not be able to mount the system, vendor or data partitions.

In order for anything to flash correctly, you will need to go to Wipe -> Format Data. This will format the entire data partition and remove encryption. But TWRP still has not mounted system, vendor or data at this point. So you need to either

A.) go back to the main TWRP menu and tap Reboot -> Reboot Recovery
or
B.) Manually mount System and Data.

Option A is generally safer because sometimes when I have manually mounted system it still wouldnt flash because the partition was somehow in use.

After rebooting back to recovery, all partitions will be mounted correctly, your data will not be encrypted, and you will not get a password prompt in TWRP. You will just get the standard excerpt about it being dangerous and asking if you want to keep the device read only blah blah.

Now at this point, you can flash whatever rom you want. After flashing any roms or bootloaders or anything that is going to replace a part of the OS, then you flash Magisk.

Watching the magisk flash logs on the screen, you could see one or more of the following:
"encrypted data detected. preserving force encryption"
something regarding it patching dm-verity
then at the end it will try and repack the patched boot image. At this point, whether your device is going to be force-encrypted or not, magisk has patched boot and any other areas needed so that you TWRP will be able to work without entering a passcode when you boot to recovery.

Now, when you initially boot to the OS, key point is that you do not enable secure startup when setting up your phone. I think this is the one thing I missed when I have been explaining this to everybody and it's the one thing I never do when I set up my phone. I dont know why it never came to mind until now. That is the feature that asks you to enter a passcode or pattern on boot and ultimately encrypts the entire device.
You can add a pattern or passcode to the phone for your screen lock, but enabling secure startup may just hose all of the work you did with formatting and flashing magisk.

I hope this helps. I am going to be uploading pre-rooted SysBoot roms for 11g, 11h and 20a today with patched kernels that should have dm-verity and force-encryption disabled. I am not sure if the patched kernels are actually going to work, but the roms will at least have root integrated. Ill post an update when they are online.
Thank you for the comprehensive expanlation. I really appreciate the help! This is the best thing that I have read regarding encryption anywhere. It may be a cool idea to have a general sticky thread for the whole forum for this kind of stuff.

I currently have the ecryption passcode prompt in twrp. So that means my data was encrypted somehow. Here is what I did: When I flashed FullStock I formatted the data partition and then did option B in your example (went to mount and then manually selected system/data and then flashed FullStock) without rebooting twrp. Then I rebooted into twrp to flash Magisk. When flashing Magisk I did not pay attention the logs so I don't know if the force-encrypted message came up. I will keep an eye out for messages regarding encryption next time.

Next time I will try rebooting into twrp after formatting the data partition ( your option A). Then flash FullStock and Magisk in the rebooted session of twrp.

I can see that the secure start-up setting is not enabled on my phone. It is under settings/personal/fingerprints & security. It is set to "No, thanks." I understand that this is serparate from a lockscreen pin.

I will definitley format data and re-flash FullStock and Magisk the correct way (Option A). Then I will flash the SysBoot zip on top of that. I can do this as soon as my backup phone is running again and then give you an update. Thanks so much for the support and the work on these zips!
 

weakNPCdotCom

Senior Member
Aug 16, 2018
436
504
0
Atlanta
I will definitley format data and re-flash FullStock and Magisk the correct way (Option A). Then I will flash the SysBoot zip on top of that. I can do this as soon as my backup phone is running again and then give you an update. Thanks so much for the support and the work on these zips!
You're welcome man. and btw, if you are gonna flash a SysBoot rom and Magisk, go with the Rooted one. You won't have to flash magisk because its flashed with the rom and you'll be all set.
 
  • Like
Reactions: Ken C

Ken C

Senior Member
Mar 5, 2011
848
184
0
UPDATE
Additional File Added for 11G

SysBoot w/Patched Kernel + Magisk Root

Enjoy!
Dude, thanks for this.

And your explanation on how you been going about rooting and flashing etc. I agree that they should probably be a sticky or if there's a way for you to copy them to the beginning of this thread. Your the first person to say what to do and what we should expect, most others are do this, do that, but never mention what we should see while doing it. I copied your instructions and saved them. I don't think I was doing anything totally different that I can notice right off.

I pulled the file above this post, and if I get you right all I have to do is flash that zip and it should set everything right?

If not that's fine, the instructions are the biggest deal for me. I really do appreciate what you've been up to. (And putting up with all my questions) It would take me longer because of all the research I'd have to do just to get up to speed and that's not an option with a 3 month old in the house.

I thank you and I believe my wife does too.

Sent from my LG-H872 using Tapatalk
 

weakNPCdotCom

Senior Member
Aug 16, 2018
436
504
0
Atlanta
Dude, thanks for this.

And your explanation on how you been going about rooting and flashing etc. I agree that they should probably be a sticky or if there's a way for you to copy them to the beginning of this thread. Your the first person to say what to do and what we should expect, most others are do this, do that, but never mention what we should see while doing it. I copied your instructions and saved them. I don't think I was doing anything totally different that I can notice right off.

I pulled the file above this post, and if I get you right all I have to do is flash that zip and it should set everything right?

If not that's fine, the instructions are the biggest deal for me. I really do appreciate what you've been up to. (And putting up with all my questions) It would take me longer because of all the research I'd have to do just to get up to speed and that's not an option with a 3 month old in the house.

I thank you and I believe my wife does too.
If the info I typed up is really that helpful then I could probably add a hidden section to the OPs that explains it all. I worked in Tech Support for years before I started working in development so I guess I have been tuned to explain things that way.

Anyhow, I don't know what your exact setup is at the moment. But if you aren't running a full stock setup already then you'll need to make sure you flash a FullStock zip for whichever version you are wanting to run.

If your LG boot logo is a small circle on a black background then you would have either of the nougat bootloaders. but if it's the lg thinQ boot logo you have the 20a bootloader.

Either flash FullStock first for the SysBoot rom you want to flash (which is what I recommend because it flashes modem and everything) or flash SysBoot for whatever bootloader version you are running. SysBoot only includes boot and system, so if you don't have the right bootloader it will not run right.

But to answer your question, the steps will be to
Format data, reboot to recovery.
wipe system data cache and dalvik
flash FullStock if you aren't already on stock or you just want to be safe with a full flash
then flash SysBoot w/Root and you'll be all done. Don't need to flash magisk. just reboot to system.


Also, FYI, when I test flashed 11h it was android 7.0 just like 11g. So I don't really know what the true differences are between the two.
 
  • Like
Reactions: Ken C

Ken C

Senior Member
Mar 5, 2011
848
184
0
If the info I typed up is really that helpful then I could probably add a hidden section to the OPs that explains it all. I worked in Tech Support for years before I started working in development so I guess I have been tuned to explain things that way.

Anyhow, I don't know what your exact setup is at the moment. But if you aren't running a full stock setup already then you'll need to make sure you flash a FullStock zip for whichever version you are wanting to run.

If your LG boot logo is a small circle on a black background then you would have either of the nougat bootloaders. but if it's the lg thinQ boot logo you have the 20a bootloader.

Either flash FullStock first for the SysBoot rom you want to flash (which is what I recommend because it flashes modem and everything) or flash SysBoot for whatever bootloader version you are running. SysBoot only includes boot and system, so if you don't have the right bootloader it will not run right.

But to answer your question, the steps will be to
Format data, reboot to recovery.
wipe system data cache and dalvik
flash FullStock if you aren't already on stock or you just want to be safe with a full flash
then flash SysBoot w/Root and you'll be all done. Don't need to flash magisk. just reboot to system.


Also, FYI, when I test flashed 11h it was android 7.0 just like 11g. So I don't really know what the true differences are between the two.
I'm pulling the full stock zip now. Got that sysboot + mroot file you posted yesterday already. So flash full stock, then the file I just mentioned and boot to system?

Shouldn't be a problem and thanks again.


Sent from my LG-H872 using Tapatalk
 

Ken C

Senior Member
Mar 5, 2011
848
184
0
@Ken C

How did it work for you?
Been a madhouse around here lately, my plan (without outside influence) is to do it today at some point. I'm on a very old version of aex with his older sperate kernel and as the days go by I'm getting more and more freezes and random reboots. (Kernel panics I'm guessing at this point.) So it'll be done when there is time today. May even be in the middle of the night so I can do it with some peace and no distraction from your instructions.

Sent from my LG-H872 using Tapatalk

---------- Post added at 10:36 AM ---------- Previous post was at 10:34 AM ----------

Also been trying to fix a car speaker without having to go and buy a new set for one speaker. You know, if it isn't this, it'll be that type of deals. I'll drop a post as soon as i do though

Sent from my LG-H872 using Tapatalk
 

weakNPCdotCom

Senior Member
Aug 16, 2018
436
504
0
Atlanta
Been a madhouse around here lately, my plan (without outside influence) is to do it today at some point. I'm on a very old version of aex with his older sperate kernel and as the days go by I'm getting more and more freezes and random reboots. (Kernel panics I'm guessing at this point.) So it'll be done when there is time today. May even be in the middle of the night so I can do it with some peace and no distraction from your instructions.

Sent from my LG-H872 using Tapatalk

---------- Post added at 10:36 AM ---------- Previous post was at 10:34 AM ----------

Also been trying to fix a car speaker without having to go and buy a new set for one speaker. You know, if it isn't this, it'll be that type of deals. I'll drop a post as soon as i do though

Sent from my LG-H872 using Tapatalk
no worries man I know how it goes. just checking up on you.
if you flash these they work well with AEX 5.8. I also flashed the Nebula Kernel but I honestly don't notice much difference between it and stock.
 
  • Like
Reactions: Ken C

Ken C

Senior Member
Mar 5, 2011
848
184
0
no worries man I know how it goes. just checking up on you.
if you flash these they work well with AEX 5.8. I also flashed the Nebula Kernel but I honestly don't notice much difference between it and stock.
Well speaker is back in the car and seems to sound better. I'll know on certain songs where the bass is exactly right. Played "Immigrant Song by Zeppelin" and didn't hear anything off so maybe it'll be a good day for it to happen.
Lol
And thanks for that extra bit of info just now

Sent from my LG-H872 using Tapatalk
 

Ken C

Senior Member
Mar 5, 2011
848
184
0
If the info I typed up is really that helpful then I could probably add a hidden section to the OPs that explains it all. I worked in Tech Support for years before I started working in development so I guess I have been tuned to explain things that way.

Anyhow, I don't know what your exact setup is at the moment. But if you aren't running a full stock setup already then you'll need to make sure you flash a FullStock zip for whichever version you are wanting to run.

If your LG boot logo is a small circle on a black background then you would have either of the nougat bootloaders. but if it's the lg thinQ boot logo you have the 20a bootloader.

Either flash FullStock first for the SysBoot rom you want to flash (which is what I recommend because it flashes modem and everything) or flash SysBoot for whatever bootloader version you are running. SysBoot only includes boot and system, so if you don't have the right bootloader it will not run right.

But to answer your question, the steps will be to
Format data, reboot to recovery.
wipe system data cache and dalvik
flash FullStock if you aren't already on stock or you just want to be safe with a full flash
then flash SysBoot w/Root and you'll be all done. Don't need to flash magisk. just reboot to system.


Also, FYI, when I test flashed 11h it was android 7.0 just like 11g. So I don't really know what the true differences are between the two.
Got one last question before I commence with this it may mean nothing but I noticed it and thought it could be worth mentioning.

In you instructions from the other night you say to flash the full stock zip before doing anything else. Do you boot it into system after for it to set things up? Give a chance for all the code to do it's thing and settle down before continuing with the rest? Or are you flashing one on top of the other in succession?

I want to say that back in the day we would let a newly flashed rom settle itself before moving on. Kinda like aex and magisk first then flash the kernel?

It seems as if they're sperate flashes and to different parts of the system But I thought I'd better ask first just in case.

Sent from my LG-H872 using Tapatalk

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

I'm gonna owe you a beer for all this man. You in Florida by any chance? Lol

Sent from my LG-H872 using Tapatalk
 

weakNPCdotCom

Senior Member
Aug 16, 2018
436
504
0
Atlanta
Got one last question before I commence with this it may mean nothing but I noticed it and thought it could be worth mentioning.

In you instructions from the other night you say to flash the full stock zip before doing anything else. Do you boot it into system after for it to set things up? Give a chance for all the code to do it's thing and settle down before continuing with the rest? Or are you flashing one on top of the other in succession?

I want to say that back in the day we would let a newly flashed rom settle itself before moving on. Kinda like aex and magisk first then flash the kernel?

It seems as if they're sperate flashes and to different parts of the system But I thought I'd better ask first just in case.

Sent from my LG-H872 using Tapatalk

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

I'm gonna owe you a beer for all this man. You in Florida by any chance? Lol

Sent from my LG-H872 using Tapatalk
lol nah one state away in GA. it's no problem. but to answer you

No, don't boot to system after flashing FullStock. You flash FullStock to get everything on there. Bootloader, modem, system, etc. Then you actually want to do a wipe of system, data, cache and dalvik since you are flashing the rooted sysboot which has been deodexed. After flashing SysBoot with Root, you can then boot to system.

You'll be starting up with a version of stock that is significantly smaller in size and magisk + magisk manager will already be set up and ready to go
 
  • Like
Reactions: Ken C