(Yet Another) Question on Encryption - OnePlus 6T Questions & Answers

So, I've been reading ad nauseum on this topic with regards to flashing new ROMs on my 6t and getting locked out due to decryption.
Among other threads and places across the interweb, I've read all of these:
https://forum.xda-developers.com/search/forum/8259?query=Encryption
During my travels I've discovered that the s**t doesn't really hit the fan until "data" is wiped via TWRP. I see that the recommend process for flashing new ROMs goes like this:
Boot on twrp
Flash ROM
Flash twrp installer
Reboot to twrp
Factory reset
Reboot to system
Am I understanding this correctly that if I transpose steps 4 and 5, then I shall plan on losing all of my data, but if I reboot from TWRP (right back into TWRP) before step 5 (aka data wipe), I shouldn't loose my data?
Assuming that is correct, does it matter if I leave a lock screen password enabled before rebooting to TWRP from the soon-to-be replaced ROM? I ask this because removing the lock screen password did not seem to reduce my chances of encountering permananly encrypted data.
Thanks!

notorious.dds said:
So, I've been reading ad nauseum on this topic with regards to flashing new ROMs on my 6t and getting locked out due to decryption.
Among other threads and places across the interweb, I've read all of these:
https://forum.xda-developers.com/search/forum/8259?query=Encryption
During my travels I've discovered that the s**t doesn't really hit the fan until "data" is wiped via TWRP. I see that the recommend process for flashing new ROMs goes like this:
Boot on twrp
Flash ROM
Flash twrp installer
Reboot to twrp
Factory reset
Reboot to system
Am I understanding this correctly that if I transpose steps 4 and 5, then I shall plan on losing all of my data, but if I reboot from TWRP (right back into TWRP) before step 5 (aka data wipe), I shouldn't loose my data?
Assuming that is correct, does it matter if I leave a lock screen password enabled before rebooting to TWRP from the soon-to-be replaced ROM? I ask this because removing the lock screen password did not seem to reduce my chances of encountering permananly encrypted data.
Thanks!
Click to expand...
Click to collapse
Yes. For the love of god. Someone please clear up how we can flash on the go. I don't always have access to a computer with Adb/fastboot.
Every time I try to switch roms, upon rebooting to TWRP, my folders encrypt. Then I have to format data and voila, no fricking ROM to flash and I'm stuck

idkwhothatis123 said:
Yes. For the love of god. Someone please clear up how we can flash on the go. I don't always have access to a computer with Adb/fastboot.
Every time I try to switch roms, upon rebooting to TWRP, my folders encrypt. Then I have to format data and voila, no fricking ROM to flash and I'm stuck
Click to expand...
Click to collapse
Yeah A/B partition are a nuisance when it comes to flashing. I'd recommend you to do a clean flash of the ROM. Follow these steps.
1. Download the Latest Stable OOS from OnePlus's Website. Download the ROM ZIP of your Choice as well as the latest TWRP Installer. Transfer these to your phone and also copy them to a Laptop as you might have to Format Data.
2. Now Reboot to Recovery and flash OOS ZIP and TWRP Installer. Let it finish. Once it's done Reboot to Recovery from Within TWRP.
3. Again flash OOS and TWRP Installer. If for some reason your folders are messed up (as you posted in the image earlier) just go to Wipe and Format Data. And transfer the OOS and TWRP Installer to Internal and Flash them. Let it finish.
4. Once that's done, now again Reboot to Recovery and now flash ROM and TWRP Installer. After that's done, again Reboot to Recovery.
5. Again, flash ROM and TWRP Installer. Once done, Reboot to Recovery.
6. Now flash Gapps of your Choice. Stock are Recommend while anything above Nano will work. AROMA won't work. Once Gapps are flashed now go to Wipe and do a Factory Reset (Swipe to Factory Reset). Once that's Done, hit Reboot System and wait for the ROM to Load.
7. After the Initial Setup, Reboot to Recovery and flash Magisk and Custom Kernel if you want.
Personally I Format Data after flashing Gapps to get a "clean install". But that's not necessary. Also if you want to flash ROMs often I'd suggest investing in Swift Backup. It's an excellent app for Backups and can Backup almost Anything. Hope this helps.
This is what I do. Occasionally I get the Encrypted Folders but if followed correctly all is smooth. I can flash any ROM without Encryption. Except maybe stock OOS.

Thanks Mannan.
However, what I'm really looking for is someone to explain the following:
1. Which action or actions is it that triggers the phone to be encypted without a way to decrypt when flashing a new rom? My suspicion is that if the phone was encrypted while having been boot from slot A, then wiping data while in slot A results in data loss. By extension, rebooting into slot B and then wiping data allows slot B to now hold the encryption key. I'm sure this theory has got some errors, but it's the best I can come up with having no intrinsic knowledge on the topic.
2. Are there any means of mitigating data loss should the phone become encrypted? I.e. If possible, can I back up data (minus /data/media) and then restore that when I can't get access to /data/media?
With regards to question #1, I developed my "suspicion" after lossing ambition to test it. When I get my ambition back to fight this issue, I'll try again. I'm just getting sick of transfering 25+ gigs of data via adb every time the data gets encrypted and I can't get it decrypted.

notorious.dds said:
Thanks Mannan.
However, what I'm really looking for is someone to explain the following:
1. Which action or actions is it that triggers the phone to be encypted without a way to decrypt when flashing a new rom? My suspicion is that if the phone was encrypted while having been boot from slot A, then wiping data while in slot A results in data loss. By extension, rebooting into slot B and then wiping data allows slot B to now hold the encryption key. I'm sure this theory has got some errors, but it's the best I can come up with having no intrinsic knowledge on the topic.
2. Are there any means of mitigating data loss should the phone become encrypted? I.e. If possible, can I back up data (minus /data/media) and then restore that when I can't get access to /data/media?
With regards to question #1, I developed my "suspicion" after lossing ambition to test it. When I get my ambition back to fight this issue, I'll try again. I'm just getting sick of transfering 25+ gigs of data via adb every time the data encryption kicks in.
Click to expand...
Click to collapse
You're not that far off, actually. And while I'm no developer I suspect that Encryption kicks in when
a). You flash stock OOS. No matter what ROM you are on, when you flash OOS it's possible you can get encrypted. I'm not sure about this but if a developer could confirm that'd be great. This one time, I flashed OOS Stable while on Beta and it Encrypted my Storage. So I had to retransfer with a computer to flash it the required two times. So basically avoid flashing OOS when on a Custom ROM. Even when switching ROMs.
b). Just as you said, when you Wipe Data within TWRP and then Reboot to TWRP it also Encrypts the Device. So I usually Wipe Data after flashing ROM & Gapps. Otherwise if you Wipe Data after flashing ROM it will Encrypt you.
And to answer that last Question the app I personally use is called Swift Backup. It's an amazing app and although it costs $5.49 it can Backup Apps and Data. It can also backup the Files in Android/obb. Give it a go.

Mannan Qamar said:
You're not that far off, actually. And while I'm no developer I suspect that Encryption kicks in when
a). You flash stock OOS. No matter what ROM you are on, when you flash OOS it's possible you can get encrypted. I'm not sure about this but if a developer could confirm that'd be great. This one time, I flashed OOS Stable while on Beta and it Encrypted my Storage. So I had to retransfer with a computer to flash it the required two times. So basically avoid flashing OOS when on a Custom ROM. Even when switching ROMs.
Click to expand...
Click to collapse
I've been fiddling around with OOS and The Pixel Experience (aka TPE) ROM. I've yet to need to flash OOS in order to loose my ability to decrypt. Flashing TPE screws everything up quite nicely as well. That said, I have gotten into the situation where TWRP (booted from either slot) has got everything encrypted. However, in one case, I was able to get the data back by recreating the boot_a partition as it existed before I wiped data. I think there may be something to be learned here. However, subsequent attempts to use this method have not been successful. In other words, I'm not sure what I actually learned.
Mannan Qamar said:
And to answer that last Question the app I personally use is called Swift Backup. It's an amazing app and although it costs $5.49 it can Backup Apps and Data. It can also backup the Files in Android/obb. Give it a go.
Click to expand...
Click to collapse
I'm still using Titanium Backup (paid version as well). It works quite well and I'm happy with it. That said, it's still a much bigger pain in the butt to restore vs performing a nandroid restore of the data. It's apples and oranges though. In order for the nandroid to provide any real value, you pretty much have to do right before need it... unless you never do anything on your phone. It also only works with the ROM from which it was created... obviously. Since my current nandroid backup of /data is > 22 gb, its fairly cumbersome.

notorious.dds said:
I've been fiddling around with OOS and The Pixel Experience (aka TPE) ROM. I've yet to need to flash OOS in order to loose my ability to decrypt. Flashing TPE screws everything up quite nicely as well. That said, I have gotten into the situation where TWRP (booted from either slot) has got everything encrypted. However, in one case, I was able to get the data back by recreating the boot_a partition as it existed before I wiped data. I think there may be something to be learned here. However, subsequent attempts to use this method have not been successful. In other words, I'm not sure what I actually learned.
I'm still using Titanium Backup (paid version as well). It works quite well and I'm happy with it. That said, it's still a much bigger pain in the butt to restore vs performing a nandroid restore of the data. It's apples and oranges though. In order for the nandroid to provide any real value, you pretty much have to do right before need it... unless you never do anything on your phone. It also only works with the ROM from which it was created... obviously. Since my current nandroid backup of /data is > 22 gb, its fairly cumbersome.
Click to expand...
Click to collapse
I dunno if it will work but when you get Encrypted try booting the TWRP image. Maybe that'll work.

Doesn't this problem occur with backups and restore from twrp as well?.... This A/B stuff I'm not used to but I'll keep reading and hopefully something in my brain will kick in lol...

Mannan Qamar said:
I dunno if it will work but when you get Encrypted try booting the TWRP image. Maybe that'll work.
Click to expand...
Click to collapse
Yeah, that I defintitely tried. No dice. However, I just backed up everthing and I'm about to start blowing the thing up with ROM flashes. Consider it a stress test. I'll report back.

What I've got so far...
Coming from OOS 9.0.14 running on slot B with a lock screen pattern enabled, I boot into TWRP on slot B.
I then flashed The Pixel Experiance ROM via it's .zip file. (The flash is then applied to slot A because it goes to the inactive slot).
Flashed the TWRP install .zip
Changed active slot to A
Reboot to recovery (aka TWRP) ... now in slot A.
wiped data (minus storage)
Flashed magisk
Reboot system
This got me into the new ROM with data intact. However, when rebooting to recovery (still slot A), it would ask for a pattern but yet wouldn't accept the pattern to decrypt. Rebooting back into Pixel Experience the data was decrypted. So, even the data would decrypt when booted into system, I could no longer get to the data from within TWRP. I then changed the lock pattern from within Pixel Experience and reboot to TWRP, it still couldn't decrypt the data. Rebooting back to system succeeded in that it actually boot, but I could no longer unlock the phone (stuck on "phone is starting"). My presumption at this point was that Pixel Experience could no longer decrypt the data.
I then:
Reboot to TWRP (slot A still)
Flashed OOS
Flashed TWRP
Set active slot to B
Reboot to recovery (aka TWRP)
wiped data (minus storage)
reboot to system
At this point OOS failed to boot and I was returned to TWRP. Data was still not able to be decrypted. I then did a factory reset plus wiped storage (aka data, dalvik, and internal storage) and tried to boot to system... still failed and sent me back to TWRP. This time, although data was empty, it was decrypted. I tried to reboot system again. It failed again and sent me back to TWRP.
So, at this point , I've wiped data and internal storage but I cannot get stock OOS to boot. So, I reboot to bootloader and executed:
Code:
fastboot -w
My understanding is that this should do the same this as performing a factory reset from within TWRP. However, rebooting to system succeeded this time.
So, the new questions are:
1. How is it that I can decrypt data when booted into Pixel Experience on slot A, but I cannot decrypt the data via TWRP?
2. If I removed the lock screen pattern from OOS before flashing PixelExperience, would I have been able to decrypt the data in both the ROM and within TWRP?
3. Why is factory resetting via fastboot effective when doing so in TWRP is not?

notorious.dds said:
What I've got so far...
Coming from OOS 9.0.14 running on slot B with a lock screen pattern enabled, I boot into TWRP on slot B.
I then flashed The Pixel Experiance ROM via it's .zip file. (The flash is then applied to slot A because it goes to the inactive slot).
Flashed the TWRP install .zip
Changed active slot to A
Reboot to recovery (aka TWRP) ... now in slot A.
wiped data (minus storage)
Flashed magisk
Reboot system
This got me into the new ROM with data intact. However, when rebooting to recovery (still slot A), it would ask for a pattern but yet wouldn't accept the pattern to decrypt. Rebooting back into Pixel Experience the data was decrypted. So, even the data would decrypt when booted into system, I could no longer get to the data from within TWRP. I then changed the lock pattern from within Pixel Experience and reboot to TWRP, it still couldn't decrypt the data. Rebooting back to system succeeded in that it actually boot, but I could no longer unlock the phone (stuck on "phone is starting"). My presumption at this point was that Pixel Experience could no longer decrypt the data.
I then:
Reboot to TWRP (slot A still)
Flashed OOS
Flashed TWRP
Set active slot to B
Reboot to recovery (aka TWRP)
wiped data (minus storage)
reboot to system
At this point OOS failed to boot and I was returned to TWRP. Data was still not able to be decrypted. I then did a factory reset plus wiped storage (aka data, dalvik, and internal storage) and tried to boot to system... still failed and sent me back to TWRP. This time, although data was empty, it was decrypted. I tried to reboot system again. It failed again and sent me back to TWRP.
So, at this point , I've wiped data and internal storage but I cannot get stock OOS to boot. So, I reboot to bootloader and executed:
My understanding is that this should do the same this as performing a factory reset from within TWRP. However, rebooting to system succeeded this time.
So, the new questions are:
1. How is it that I can decrypt data when booted into Pixel Experience on slot A, but I cannot decrypt the data via TWRP?
2. If I removed the lock screen pattern from OOS before flashing PixelExperience, would I have been able to decrypt the data in both the ROM and within TWRP?
3. Why is factory resetting via fastboot effective when doing so in TWRP is not?
Click to expand...
Click to collapse
Well starting from the way you flashed the ROM, the rule of thumb is that you NEVER manually change slots. Now since you are on stock follow the instructions I posted earlier to flash PE or any other ROM for that matter. I think when you manually set the slot it somehow messed up Decryption. Next, after flashing OOS from TWRP when you are on a Custom ROM, you must always Format Data. The command you ran via Fastboot (fastboot -w) does just that.
So I just flashed Bootleggers from Stock OpenBeta 11. These are the steps I followed. I was successfully able to flash and was able to keep my Data intact. These are the steps I followed.
Starting from OpenBeta 11 I flashed ROM (Bootleggers) and then TWRP Installer. Then go to Reboot and Select Recovery. Once in Recovery, again flash ROM and TWRP Installer. Once done, reboot to Recovery. Flash Gapps and then go to Wipe and do a Swipe to Fa Tory Reset. This will Delete all your Data except Internal Storage. This is a necessary step when flashing a ROM. Once done, reboot to System. After this I was able to boot up Successfully with my Internal Storage as it was before flashing. After that I restored my backup. Everything is working and I can enter and Decrypt TWRP without error.

This thread should be pined as a guide because instalation notes in ROM threads are so basic.

A couple of things come to mind reading this thread in reference to encryption
1) if security patches dont match on A/B, it seems to trigger a lockout with encryption. i may be wrong.
2) if internal storage isnt wiped, i.e.-if you use the "factory reset' option in twrp, your data is still there and that in itself post-flash can trigger encryption error as the data is still there.
I think about it like this, despite it being A/B partitions, the data is like a middle layer that isnt individualized to one partition or the other. so a trigger/failure for secure boot encrypts it all.

kitcostantino said:
A couple of things come to mind reading this thread in reference to encryption
1) if security patches dont match on A/B, it seems to trigger a lockout with encryption. i may be wrong.
2) if internal storage isnt wiped, i.e.-if you use the "factory reset' option in twrp, your data is still there and that in itself post-flash can trigger encryption error as the data is still there.
I think about it like this, despite it being A/B partitions, the data is like a middle layer that isnt individualized to one partition or the other. so a trigger/failure for secure boot encrypts it all.
Click to expand...
Click to collapse
I'm pretty sure, that if you flash anything with a security patch earlier than the one you're currently using your data will get encrypted.
Which is why it happens with going back to OOS from custom, because they're always late with security patches compared to custom roms.

The hardest thing for.me coming from an A only device (Axon 7) has been learning order of operations. as long as one flashes rom followed by twrp and then a reboot into recovery, followed by installing magisk, things usually go okay. Going from aosp to aosp went okay, but like you said moving from OOS to AOSP or vice versa always yielded encryption lock. maybe we could make a merged security patch or something of the sort to bridge the gap. im no dev, so im sure someone who knows more than i can tell us why that wouldnt work. it would be really cool for One Plus to gain a better foothold in custom OS before the majority of crack flashers and devs swear off. Dont get me wrong, OOS is amazing and i feel with the inherent features, is superior to any other stock rom, but android is all about choice.
i really and truly wish someone would make a version of TWRP that had a dual boot set up vs A/B. I have had devices (looking at you, Droid Bionic) that never had proper root/bl unlock and had amazing rom communities bc of safestrap/dual boot/etc. i am more than willing to give up internal storage space to duplicate/clone /data and anything else that is on both systems. i also wish recovery had its own partition again, but that one is beyond our control at this point as it resides in boot now.
Maybe its conceivable. Who knows.

I have no issues. I don't lose anything when I flash ROMs. I boot to twrp, factory reset(not wipe storage), flash ROM, flash twrp installer....boot ROM, reboot twrp, flash gapps, custom kernel. Then I factory reset again (not wipe storage) and then install magisk..done....no issues. It will fail boot once and then boot fine because of this process but only after you do this. So if you reboot later you are fine...I keep all my stuff

First off, I want to thank all of you who contributed to this thread. I'm defintely gaining a better understanding of some of the pitfalls associated with A/B devices and encryption. Thanks!
Mannan Qamar said:
Well starting from the way you flashed the ROM, the rule of thumb is that you NEVER manually change slots. Now since you are on stock follow the instructions I posted earlier to flash PE or any other ROM for that matter. I think when you manually set the slot it somehow messed up Decryption.
Click to expand...
Click to collapse
So, my understand is that flashing a new ROM from within TWRP flashes it to the inactive slot. Therefore, my assumptions as to the reasoning behind rebooting from TWRP back into TWRP before wiping data were that:
Any modifiations made to the boot partition intended to affect the new ROM need to be made to the boot partition that shares the same slot as that of the new ROM, and
Wiping data while booted into image of TWRP which shares the same slot as the new ROM has some magical effect on preserving the ability to decrypt data vs wiping data while booted into the image of TWRP that resides in the slot of the ROM to be replaced.
It is these assumptions (combined with my execution of the basic recipe failing to prevent encryption lock-out) which led me to manually changing slots. I will say this... after flashing PE and TWRP.zip from within TWRP on slot B, simply rebooting to recovery brought me right back to TWRP on slot B. If PE is now on slot A, how does installing magisk, etc. do me any good while in slot B? Also, are my assumptions misguided as to the "why" rebooting to TWRP before installing magisk, wiping data, etc is necessary?
Mannan Qamar said:
Next, after flashing OOS from TWRP when you are on a Custom ROM, you must always Format Data. The command you ran via Fastboot (fastboot -w) does just that.
Click to expand...
Click to collapse
Lightbulb status: on
Thanks!
kitcostantino said:
If security patches dont match on A/B, it seems to trigger a lockout with encryption. i may be wrong.
Click to expand...
Click to collapse
Is this why in Mannan Qamar's earlier post he appears to be flashing the new ROM to BOTH slots before trying to boot into system?
ebproject said:
I'm pretty sure, that if you flash anything with a security patch earlier than the one you're currently using your data will get encrypted.
Which is why it happens with going back to OOS from custom, because they're always late with security patches compared to custom roms.
Click to expand...
Click to collapse
I'm assuming that flashing OOS to BOTH slots as is mentioned earlier with regards to flashing a custom ROM won't help when going back to OOS given the old vs new issue. Has anyone verified that yet?
It's my understanding that the sure security patch is applied to the system partition, correct? Is part of that patch included in boot, or no?

jamescable said:
I have no issues. I don't lose anything when I flash ROMs. I boot to twrp, factory reset(not wipe storage), flash ROM, flash twrp installer....boot ROM, reboot twrp, flash gapps, custom kernel. Then I factory reset again (not wipe storage) and then install magisk..done....no issues. It will fail boot once and then boot fine because of this process but only after you do this. So if you reboot later you are fine...I keep all my stuff
Click to expand...
Click to collapse
I notice that the FIRST thing you do is "factory reset". That's definitely not standard with the install threads I've read. Hmmmmm, interesting.
Also, why do you boot the ROM before flashing gapps, and kernel? It seems unnecessary since you're just factory resetting again. I'm sure I'm missing something on this one.

notorious.dds said:
I notice that the FIRST thing you do is "factory reset". That's definitely not standard with the install threads I've read. Hmmmmm, interesting.
Also, why do you boot the ROM before flashing gapps, and kernel? It seems unnecessary since you're just factory resetting again. I'm sure I'm missing something on this one.
Click to expand...
Click to collapse
Booting to ROM solved the encryption issues

idkwhothatis123 said:
Yes. For the love of god. Someone please clear up how we can flash on the go. I don't always have access to a computer with Adb/fastboot.
Every time I try to switch roms, upon rebooting to TWRP, my folders encrypt. Then I have to format data and voila, no fricking ROM to flash and I'm stuck
Click to expand...
Click to collapse
If you stuck on encrypted storage ever, reboot to system and after you see the setup screen, reboot to recovery again. Voila, your storage is decrypted now.
It happened to me all the time when I flash OOS and this way I am able to decrypt my internal storage.

Related

Axon 7 randomly stopped booting

Hi there, I have an Axon 7 with LineageOS that was working like a charm until I rebooted it today. It was in the normal lineage OS boot animation with the blue circle moving from right to left, except it never stopped. Now after trying a few more times, it just keeps playing the animation except the phone will vibrate slightly every several seconds. The phone is encrypted but that hasn't been a problem. When I reboot to TWRP, it says Unable to mount storage.
I tried wiping Cache and Dalvik / ART Cache, but this didn't help. Finally, I do have a backup from 7-20-2017 but I'd rather not have to go back to that...
Any recommendations?
Chrono7x said:
Hi there, I have an Axon 7 with LineageOS that was working like a charm until I rebooted it today. It was in the normal lineage OS boot animation with the blue circle moving from right to left, except it never stopped. Now after trying a few more times, it just keeps playing the animation except the phone will vibrate slightly every several seconds. The phone is encrypted but that hasn't been a problem. When I reboot to TWRP, it says Unable to mount storage.
I tried wiping Cache and Dalvik / ART Cache, but this didn't help. Finally, I do have a backup from 7-20-2017 but I'd rather not have to go back to that...
Any recommendations?
Click to expand...
Click to collapse
So you can't see the internal storage from TWRP? I'm guessing encryption actually plays a part here. Formatting data is probably the best course of action, though you should flash magisk or superSu if you do, to get rid of encryption. But you obviously lose everything that's on the internal storage.
Maybe make a system and boot backup and clean flash Lineage. Like, wipe system and caches, then flash the bootloader, modem, LOS and whatever else you flash
Choose an username... said:
So you can't see the internal storage from TWRP? I'm guessing encryption actually plays a part here. Formatting data is probably the best course of action, though you should flash magisk or superSu if you do, to get rid of encryption. But you obviously lose everything that's on the internal storage.
Maybe make a system and boot backup and clean flash Lineage. Like, wipe system and caches, then flash the bootloader, modem, LOS and whatever else you flash
Click to expand...
Click to collapse
Is it easier to just use the backup I have currently? If so, what are the steps necessary for that (sorry for newb questions, haven't messed with it in a while)
EDIT: Also, TWRP claims decryption is successful when it is loading up.
Chrono7x said:
Is it easier to just use the backup I have currently? If so, what are the steps necessary for that (sorry for newb questions, haven't messed with it in a while)
EDIT: Also, TWRP claims decryption is successful when it is loading up.
Click to expand...
Click to collapse
Again. Can you see the internal storage?
Don't restore the backup. Your problem is basically either on /system (clean flash of the ROM will do) or on /data (complete format of data is needed). So try the non destructive one first
Choose an username... said:
Again. Can you see the internal storage?
Don't restore the backup. Your problem is basically either on /system (clean flash of the ROM will do) or on /data (complete format of data is needed). So try the non destructive one first
Click to expand...
Click to collapse
I don't see any storage folder. So if I want to install the latest LOS and frankly just start from scratch, can I follow the guide here https://wiki.lineageos.org/devices/axon7/install#installing-lineageos-from-recovery starting from "Installing LineageOS from recovery"? Will I still need to install something to wipe the encryption?
Chrono7x said:
I don't see any storage folder. So if I want to install the latest LOS and frankly just start from scratch, can I follow the guide here https://wiki.lineageos.org/devices/axon7/install#installing-lineageos-from-recovery starting from "Installing LineageOS from recovery"? Will I still need to install something to wipe the encryption?
Click to expand...
Click to collapse
What? No... That's for normal phones. How did you manage to install LOS without knowing that you need the univ. bootloader and modem?
So, you can't access the internal storage via the file manager on TWRP i'm guessing.
Wipe - Format data, after that flash the Universal bootloader, modem, LOS, Magisk, GApps. Magisk takes care of dm-verity and disables encryption. Don't try to uninstall it though or your internal storage will get encrypted as soon as you do. But if you want to change ROMs you can just fpash it before booting and it won't ger encrypted.

Stuck with a OP5 with no OS

Hi everyone,
I have been happy with the Marshmellow version the OS since I bought my phone when it came out (Unlocked, Encrypted). I have performed one update since I had the phone. Today, after seeing the latest posts after not being on this site for a year, I decided to make the move to upgrade to OOS 5.1.0!! Why not, nothing else going on this weekend. I upgrade TWRP to 3.2.1-1, I make a full backup, I follow the upgrade instructions... it fails with the continuous spinning balls on reboot. I Do some research... oh, it is "challenging" to upgrade but possible. No big deal, I will just restore my backup and try again at some other time. My backup restore fails Error 255, I try the fixeS I found such as unmounting data... No Luck). Can not restore the data partition. I guess I should have decrypted everything prior to backing up based on what I read later.
I at least backed up my SD card using adb prior to all this, so I decided to just reinstall ANY OS to get my phone running again for tonight. Well I have not had much luck. I downgraded TWRP to 3.2.1-0, I have tried installing:
OnePlus5Oxygen_23_OTA_033_all_1804110400_eb1766 - Originally installed with not errors but phone reboots back into TWRP after a failed 1st reboot. (I do get a "failed to mount /vendor")
lineage-15.1-20180423-nightly-cheeseburger-signed with Gapps (Gapps failed with I think a error 7)
I was messing with the data partition, wiped, formatted, etc. I am sure this is some of the issues. One other thing is that TWRP always boots to the "keep System Read only" I find this strange and had never seen before. I select to allow modification, but it seems like nothing changes on reboot.
At this point I would just like to get a stock OS image on the phone. IS there something I am missing?
https://forum.xda-developers.com/oneplus-5/how-to/guide-mega-unbrick-guide-hard-bricked-t3698370
Sounds good, let me give it a try.
I've been thru this already. Here is the simplest way to get your 1+5 back to work, while having the latest LineageOS installed. It takes a bit of time and patience, but it works:
Using fastboot, reinstall TWRP 3.2.1-1 (or newer, if any)
Wipe all partitions, namely Dalvik/ART cache, Cache, System, Data and Internal storage
Sideload the latest OOS (version 5.10 or later, if any) with Android 8.1. This version will be OK for LineageOS 15.1 and you will no longer have that stupid error 7 when installing LOS 15.1
If OOS boots into recovery and asks for passwords or PIN or schema ... click on the "forgotten" link. OOS Recovery will then remove encryption and wipe out any data that was left.
Reboot phone, and start OOS session. Do not use any security stuff (PIN or schema or whatever) that would encrypt the phone. At least not now - If necessary, you will add it at the end of this whole process.
Once OOS is working, reboot to Bootloader. Since TWRP has been erased with OOS default recovery, you will have to reinstall it.
From TWRP, wipe Dalvik/ART cache, Cache, and Data partitions. This time, do not touch System or Internal storage
Sideload Lineage OS latest version. If you need to use Google Apps (e.g. Open Gapps), sideload it now before rebooting
Reboot (you might have to reboot twice, don't worry about that).
Once booted in LineageOS, do whatever you like - add accounts, root phone, etc.
Enjoy! (you may want to shout "Vive la France!", well ... don't hesitate!)
Sorry for my poor English. If anything here is unclear to you, please let me know.
I Have no idea what happened. I came home to start working on my phone, powered it up, and boom I have Android 8.1. Ok, Whatever...
Now I wonder if I should go for lineage or not.
kuhnto said:
Now I wonder if I should go for lineage or not.
Click to expand...
Click to collapse
It all depends on how important privacy is to you. If you don't care, then stick to the original OnePlus firmware. If you do, then switch to LineageOS.

Need help Axon 7 encryption stopping from flashing

Ok have a ZTE Axon 7 can't flash any thing because of it instantly encryption and I get recovery and then game over any one have a Cure for this......... thanks in advance.
You have to do a factory wipe, to remove encryption. Then when setting up the phone again when it prompts you to set a security pin or finger sprints skip that part.
chairmanmarv said:
You have to do a factory wipe, to remove encryption. Then when setting up the phone again when it prompts you to set a security pin or finger sprints skip that part.
Click to expand...
Click to collapse
Tried that and it didn't work.....it doesn't matter what I flash stock ROMs tell me my password is correct but memory is corrupt and need to be wiped and when I flash a custom ROM it doesn't boot just two flashes of the led and that's it.
Which TWRP recovery are you on?
What I mean by Factory reset is a full Factory wipe your whole internal is erased. It is like a clean slate new phone.
You should have all the necessary files for your flash on your sd card there is an option to select storage to flash from there.
So when I first swapped from Stock Nougat to AEX I was encrypted on 5/4 ROM my internal was locked by encryption and could only dirty flash roms. it was annoying so I factory wiped and flashed latest AEX from there and didn't set up security right away so no encryption.
I realised my TIBU back ups were all on internal so had to basically start from scratch oops lol.
It is a little outdated now with the official Oreo roms but user @Oki 's guide helped me a lot and has clear steps and guides to get you all rooted and sorted on custom roms.
https://forum.xda-developers.com/axon-7/how-to/guide-axon-7-custom-oreo-roms-newbies-t3786693
chairmanmarv said:
Which TWRP recovery are you on?
What I mean by Factory reset is a full Factory wipe your whole internal is erased. It is like a clean slate new phone.
You should have all the necessary files for your flash on your sd card there is an option to select storage to flash from there.
So when I first swapped from Stock Nougat to AEX I was encrypted on 5/4 ROM my internal was locked by encryption and could only dirty flash roms. it was annoying so I factory wiped and flashed latest AEX from there and didn't set up security right away so no encryption.
I realised my TIBU back ups were all on internal so had to basically start from scratch oops lol.
It is a little outdated now with the official Oreo roms but user @Oki 's guide helped me a lot and has clear steps and guides to get you all rooted and sorted on custom roms.
https://forum.xda-developers.com/axon-7/how-to/guide-axon-7-custom-oreo-roms-newbies-t3786693
Click to expand...
Click to collapse
Just found out that the phone has bricked itself it would play any video or sound so did a hard reset now just getting a constant boot loop trying to get it in to EDL as we speak.....got EDL flashed stock ROM in miflasher now stuck on splash screen.......been on the splash screen for 10 minutes now.......
chairmanmarv said:
Which TWRP recovery are you on?
What I mean by Factory reset is a full Factory wipe your whole internal is erased. It is like a clean slate new phone.
You should have all the necessary files for your flash on your sd card there is an option to select storage to flash from there.
So when I first swapped from Stock Nougat to AEX I was encrypted on 5/4 ROM my internal was locked by encryption and could only dirty flash roms. it was annoying so I factory wiped and flashed latest AEX from there and didn't set up security right away so no encryption.
I realised my TIBU back ups were all on internal so had to basically start from scratch oops lol.
It is a little outdated now with the official Oreo roms but user @Oki 's guide helped me a lot and has clear steps and guides to get you all rooted and sorted on custom roms.
https://forum.xda-developers.com/axon-7/how-to/guide-axon-7-custom-oreo-roms-newbies-t3786693
Click to expand...
Click to collapse
Ok now got the thing back was able to reunlock the bootloader and installed recovery flashed candy rom with one issue could not mount system so now just flashed Oreo stock rom so all good again....... thanks for the help
The stock ROM encrypts by default, and formatting data partition in twrp is the only way to remove it. But to prevent the encryption before it happens, you have a few options:
1. If you dont plan to root, flash @jcadduono's no verity opt encrypt zip (Google it)
2. Magisk and SuperSU can optionally disable encryption before it happens. Magisk Manager has a config option if you're installing from the app. You can use Aroma SuperSU config if SuperSU is your root method of choice.
Hope that helped!
I would like to note that AOSP/Lineage/CM-based ROMs dont encrypt by default. though Im sure it could be enabled if you wanted to. This seems to be unique to the stock ROMs, mainly because Google insists that phone OEMs should go for higher security by enabling encryption as the default.
AnonVendetta said:
The stock ROM encrypts by default, and formatting data partition in twrp is the only way to remove it. But to prevent the encryption before it happens, you have a few options:
1. If you dont plan to root, flash @jcadduono's no verity opt encrypt zip (Google it)
2. Magisk and SuperSU can optionally disable encryption before it happens. Magisk Manager has a config option if you're installing from the app. You can use Aroma SuperSU config if SuperSU is your root method of choice.
Hope that helped!
I would like to note that AOSP/Lineage/CM-based ROMs dont encrypt by default. though Im sure it could be enabled if you wanted to. This seems to be unique to the stock ROMs, mainly because Google insists that phone OEMs should go for higher security by enabling encryption as the default.
Click to expand...
Click to collapse
Yep this is the problem I am having now....... can't find much info about it.

Need a little help understanding A/B partitions

I have a few questions I'm new to the a/b partitions thing I've read the page on a/b partitions. But I'm still in the mud.
1 I'm on Verizon bootloader unlocked twrp 3.2.3-23 and magisk installed I have 9.0.11 installed twrp and magisk in slot a/b
now is it necessary to backup stock rom? If I install lets say crDroid in slot A install twrp installer I know twrp goes into both slots reboot back to recovery making sure I'm still in A install gapps and magisk reboot back to recovery making sure again I'm still in A slot then reboot to crDriod that should work yes?
2 Now If I wanted to go back to my stock rom witch is in B slot can I not reboot back to twrp and switch to slot B and go to stock?
Thanks guys this A/B partition is still clear as mudd
Making a back up is always recommend, but it's up to the user to decide if the want to or not. The down side is loosing all your data, so there is that.
The short answer to your 2nd question is no you can not dual boot ROMs on this device. I posed the same question in a different thread and you can read the explanation from Dark Nightmare here.
https://forum.xda-developers.com/showpost.php?p=78375631&postcount=988
Sent from my ONEPLUS A6013 using Tapatalk
foamerman said:
I have a few questions I'm new to the a/b partitions thing I've read the page on a/b partitions. But I'm still in the mud.
1 I'm on Verizon bootloader unlocked twrp 3.2.3-23 and magisk installed I have 9.0.11 installed twrp and magisk in slot a/b
now is it necessary to backup stock rom? If I install lets say crDroid in slot A install twrp installer I know twrp goes into both slots reboot back to recovery making sure I'm still in A install gapps and magisk reboot back to recovery making sure again I'm still in A slot then reboot to crDriod that should work yes?
Click to expand...
Click to collapse
I'm new to A/B as well but have been flashing quite a bit. Maybe someone can correct me if I'm wrong. From what I've observed, ROMs are designed to flash to the slot you're not using and, on reboot, switch slots. TWRP zip installer is designed to install to both slots. Magisk and Gapps, however, install to the current slot. This means you should flash the ROM (which flashes to the non-active system and boot partitions and possibly others), flash the TWRP installer (which installs to both boot partitions, including the one that was just flashed). Then reboot back into recovery (which will be the other slot that the ROM was installed to), and then install all the other zips needed (i.e., Gapps, Magisk, etc...).
Switching A/B partitions in the TWRP reboot menu also triggers the partition switch after reboot, if needed. It doesn't seem to immediately switch before a reboot however, even though it gives that impression.
foamerman said:
2 Now If I wanted to go back to my stock rom witch is in B slot can I not reboot back to twrp and switch to slot B and go to stock?
Click to expand...
Click to collapse
The data partition, which contains user apps and system and user app data, is not slotted. Moving back and forth between slots that share a common ROM type and are close in version might not pose a problem. But A/B slotting wasn't designed for switching Roms back and forth. It was designed to try to ensure that there is always a valid bootable ROM without regard to use data (i.e., potentially, after a factory-reset). Don't expect to boot up an AOSP modded ROM using the data and apps from an OygenOS ROM. Do a backup of all partitions to be safe (with the exception of system and vendor since system_image and vendor_image give a bit-for-bit copy, instead of file-for-file copy). Copy the TWRP directory to a computer afterward, if possible. Make sure to wipe data if flashing a ROM of a different type, not just a different version (after flashing everything but before initial system boot).
phillymade said:
Making a back up is always recommend, but it's up to the user to decide if the want to or not. The down side is loosing all your data, so there is that.
The short answer to your 2nd question is no you can not dual boot ROMs on this device. I posed the same question in a different thread and you can read the explanation from Dark Nightmare here.
https://forum.xda-developers.com/showpost.php?p=78375631&postcount=988
Sent from my ONEPLUS A6013 using Tapatalk
Click to expand...
Click to collapse
Nsane457 said:
I'm new to A/B as well but have been flashing quite a bit. Maybe someone can correct me if I'm wrong. From what I've observed, ROMs are designed to flash to the slot you're not using and, on reboot, switch slots. TWRP zip installer is designed to install to both slots. Magisk and Gapps, however, install to the current slot. This means you should flash the ROM (which flashes to the non-active system and boot partitions and possibly others), flash the TWRP installer (which installs to both boot partitions, including the one that was just flashed). Then reboot back into recovery (which will be the other slot that the ROM was installed to), and then install all the other zips needed (i.e., Gapps, Magisk, etc...).
Switching A/B partitions in the TWRP reboot menu also triggers the partition switch after reboot, if needed. It doesn't seem to immediately switch before a reboot however, even though it gives that impression.
The data partition, which contains user apps and system and user app data, is not slotted. Moving back and forth between slots that share a common ROM type and are close in version might not pose a problem. But A/B slotting wasn't designed for switching Roms back and forth. It was designed to try to ensure that there is always a valid bootable ROM without regard to use data (i.e., potentially, after a factory-reset). Don't expect to boot up an AOSP modded ROM using the data and apps from an OygenOS ROM. Do a backup of all partitions to be safe (with the exception of system and vendor since system_image and vendor_image give a bit-for-bit copy, instead of file-for-file copy). Copy the TWRP directory to a computer afterward, if possible. Make sure to wipe data if flashing a ROM of a different type, not just a different version (after flashing everything but before initial system boot).
Click to expand...
Click to collapse
OK I understand what you both are saying my understanding is that data is still there in both slots yes? so If I want to go back to my 9.0.11 stock rom I should be able to just reboot to twrp and select slot B and go back to to stock yes? guys I'm sorry this is my first A/B partition phone I'm just trying to figure it out
foamerman said:
OK I understand what you both are saying my understanding is that data is still there in both slots yes?
Click to expand...
Click to collapse
As long as it isn't wiped, yes.
foamerman said:
so If I want to go back to my 9.0.11 stock rom I should be able to just reboot to twrp and select slot B and go back to to stock yes? guys I'm sorry this is my first A/B partition phone I'm just trying to figure it out
Click to expand...
Click to collapse
No. Except for the possible exception that both slots contain different versions of the same ROM, the data will work with one ROM but not the other.
When flashing a ROM in TWRP, just mke sure to make a nandroid backup first and follow the installation directions. If you have to switch back, you will need to flash the nandroid backup.
It is a pain and there are pitfalls. This phone is relatively new and this is the cost of flashing a custom ROM/bootloader.
No. Except for the possible exception that both slots contain different versions of the same ROM, the data will work with one ROM but not the other.
When flashing a ROM in TWRP, just mke sure to make a nandroid backup first and follow the installation directions. If you have to switch back, you will need to flash the nandroid backup.
It is a pain and there are pitfalls. This phone is relatively new and this is the cost of flashing a custom ROM/bootloader.[/QUOTE]
OK one more I think lol If I have 9.0.11 on my internal storage can I not go into slot A and wipe it and install it back on there and be OK?
foamerman said:
OK one more I think lol If I have 9.0.11 on my internal storage can I not go into slot A and wipe it and install it back on there and be OK?
Click to expand...
Click to collapse
Internal storage is an encrypted folder in the data partition that is wiped separately from data. As long as you don't wipe internal storage for any reason it should be ok, in theory. But it's not in practice.
Most of the problem with this phone is maintaining encryption back and forth between ROMs. Honestly, if you can't afford to lose data, don't try to flash ROM's yet. I have had very little luck flashing back and forth and, after reflashing data, being able to avoid a bootloop. TWRP has only supported encryption on this phone for a month or so and IMHO it's not ready for prime time. I have relied on Titanium Backup and moved it's backup folder back and forth between my phone and computer.
Nsane457 said:
Internal storage is an encrypted folder in the data partition that is wiped separately from data. As long as you don't wipe internal storage for any reason it should be ok, in theory. But it's not in practice.
Most of the problem with this phone is maintaining encryption back and forth between ROMs. Honestly, if you can't afford to lose data, don't try to flash ROM's yet. I have had very little luck flashing back and forth and, after reflashing data, being able to avoid a bootloop. TWRP has only supported encryption on this phone for a month or so and IMHO it's not ready for prime time. I have relied on Titanium Backup and moved it's backup folder back and forth between my phone and computer.
Click to expand...
Click to collapse
Well the mud is starting to clear up a little. Yea I've been a little leery about trying to install roms yet. I have read all the post in the Recovery thread mauronofrio is getting a 6t soon so maybe he can figure it out. But again Thank you.

How do you go from a custom rom back to OOS?

Love this phone, but using custom roms have been the most frustrating thing with this device. I like testing out multiple roms because you never know which one you will enjoy until you actually use it. But every time I want to go back to OOS, I find myself having to use the MSM tool and start from scratch.
TWRP Nandroid backups are pretty much useless it seems. There are probably over 20 methods here explaining how to backup and restore (don't restore vendor, don't restore system, etc...). I have tried literally every combination and every time I restore, it never works and just loops back to TWRP and leaves me w/an encrypted device. Bring in the MSM.
Flashing the full stock rom usually results in the same thing or no change at all.
Does anybody have a simple straight to the point method of going back to OOS from custom rom? Much appreciated
msmdownloadtool will 100% wipe the phone (backup!!) And return the phone to 100% stock with OxygenOS and even re-lock the bootloader. That's the fastest and easiest way and I've done it a few times.
Edit : just fully read your post and you're familiar with MSM. Just use Google cloud backup in combination with backing up files and using sms backup and restore... There is no way you can keep your data partition from a custom ROM and have it boot or work right on OOS. Even switching custom ROMs without wiping data can cause massive instability, but at least it has a chance at booting.
How to restore,I have no real clue, but to get back to at least a working version of OOS with your internal storage intact..
After you flash OOS and twrp installer, reboot back to twrp.. it will likely be encrypted.. from there go to the wipe menu, then swipe for factory reset.. wipes data, not internal storage.. then boot into OOS.. at that point you can boot back to twrp and flash magisk or whatever else you need to do.
If that fails, you'll lose all data doing this next step, but it will boot.. use the "format data" option in twrp, type yes, then reboot to system. Then you can set it up, download or transfer whatever you want to flash, then reboot to recover and flash away... All without having to use the msm tool

Categories

Resources