Invalid boot image header - Nexus 6 Q&A, Help & Troubleshooting

My Nexus 6 has the last Pure Nexus rom, TWRP, and Magisk.
I updated the Magisk app earlier and it went fine. Then I tried updating the boot image or whatever it is that you also update after the main app updates. But it would not do that update. It just didn't do anything when I hit install. So I rebooted. Now it goes straight to recovery mode and says boot up failed: invalid boot image header.
Is there a way around this or do I need to flash the rom and whatnot? I tried wiping the cache, and that didn't seem to change anything.

Finding a workaround is going to be harder than reflashing.
Flash the same rom as you already have, including gapps and anything else you might have flashed. You won't need to wipe data.

Flashing just the boot image (followed by the Magisk installer if you want to keep root) should be enough. You likely experienced a bug where several Magisk flashing activities ran at the same time and this destroyed the boot image. Get a fresh image installed and you should be up and running again.

That worked! Thanks.
-posting from N6-

Related

[Q] Phone won't boot after root

Hi everyone,
When I first received my phone a few days ago, I unlocked and rooted it. But then I noticed I wasn't passing safetynet so I unrooted it.
Eversince, when I try to reroot it, it won't boot. It stays stuck on the boot animation (I waited up to 20 minutes).
If I reflash the ROM, it boots. If I reflash the ROM, wipe davlik & cache, and root, it stays stuck on the boot animation.
So my guess was that it was not ROM related, nor cache related, so it must be caused by something on my data partition. But I don't want to wipe it if I have another way to fix it.
Any idea on what might be preventing my phone from booting when I root it?
Thanks!
after root do you have flashed superSU?
RotesMeerJogger said:
after root do you have flashed superSU?
Click to expand...
Click to collapse
Well I flashed superSU to root the phone!
But when I do it, it won't boot.
Probably image got corrupted, Download the zip of the rom "oxygen os zip", clean flash it through recovery, try to root again
Daman5202 said:
Probably image got corrupted, Download the zip of the rom "oxygen os zip", clean flash it through recovery, try to root again
Click to expand...
Click to collapse
When I flash if without root it boots perfectly, are you sure about the image being corrupted?
gigaboss said:
When I flash if without root it boots perfectly, are you sure about the image being corrupted?
Click to expand...
Click to collapse
As you said "it stucks on boot", many times the phone gets stuck on boot when the image is corrupted , its called soft brick. Try downloading the zip file of os, flash it through recovery. The img is probably facing some errors while booting with root access. Are you nougat user? 7.1? And are you using default recovery?
As most people have said here already, in general this should work. So which version of oxygenos are you running? And what recovery? Also, after flashing Supersu, you should not wipe caches as far as I know (forgot the source). Re-download the image, and flash it and directly after flash supersu (both in twrp) and your problem should be solved.
donny110 said:
As most people have said here already, in general this should work. So which version of oxygenos are you running? And what recovery? Also, after flashing Supersu, you should not wipe caches as far as I know (forgot the source). Re-download the image, and flash it and directly after flash supersu (both in twrp) and your problem should be solved.
Click to expand...
Click to collapse
OK I am sorry I was not clear enough, this is exactly what I have been doing!
I have TWRP, when I only flash the 3.5.4 OOS it works perfectly. When I flash OOS 3.5.4 and superSU it doesn't boot.
So the image doesn't seem corrupted, I re-downloaded it.
Is it clearer?
gigaboss said:
OK I am sorry I was not clear enough, this is exactly what I have been doing!
I have TWRP, when I only flash the 3.5.4 OOS it works perfectly. When I flash OOS 3.5.4 and superSU it doesn't boot.
So the image doesn't seem corrupted, I re-downloaded it.
Is it clearer?
Click to expand...
Click to collapse
Have you cleared caches before the flash? And are you using the Full OOS 3.5.4? And I assume the most recent Supersu? I did exactly that 2 days ago. Using the full OOS zip that is in one of the threads here on XDA (can't link on phone right now).
Btw. It can bootloop a few times and take awhile once you flash both.. If that doesn't work I guess it's beyond my knowledge. You might want to try if the same thing happens with 3.5.3
gigaboss said:
Hi everyone,
When I first received my phone a few days ago, I unlocked and rooted it. But then I noticed I wasn't passing safetynet so I unrooted it.
Eversince, when I try to reroot it, it won't boot. It stays stuck on the boot animation (I waited up to 20 minutes).
If I reflash the ROM, it boots. If I reflash the ROM, wipe davlik & cache, and root, it stays stuck on the boot animation.
So my guess was that it was not ROM related, nor cache related, so it must be caused by something on my data partition. But I don't want to wipe it if I have another way to fix it.
Any idea on what might be preventing my phone from booting when I root it?
Thanks!
Click to expand...
Click to collapse
I don't have my 3T yet to verify, but did you flash the zip which disables encryption and dm-verity?
EDIT: From the TWRP thread, step 10: http://forum.xda-developers.com/oneplus-3t/development/recovery-twrp-oneplus-3t-t3507308
Any update to this? I have the exact same problem; clean flash 3.5.4 OOS (tried it via twrp, adb sideload and MsmDownloadTool) then flash SuperSU via twrp (tried multiple SuperSU versions) and all results in sitting at the boot animation. I've let it sit for 2 hours and it never gets beyond boot animation. No matter what, I can't get SuperSU to work. However, I have no problem getting phh superuser to boot up. Any idea why SuperSU won't boot for me?
__McB__ said:
Any update to this? I have the exact same problem; clean flash 3.5.4 OOS (tried it via twrp, adb sideload and MsmDownloadTool) then flash SuperSU via twrp (tried multiple SuperSU versions) and all results in sitting at the boot animation. I've let it sit for 2 hours and it never gets beyond boot animation. No matter what, I can't get SuperSU to work. However, I have no problem getting phh superuser to boot up. Any idea why SuperSU won't boot for me?
Click to expand...
Click to collapse
I got to the bottom of my problem (but did not solve it somehow) by formatting and trying every possibility. I lost all my data :crying:
So here is what happens:
-I start with a clean ROM, root it, install kernel, everything works fine EXCEPT for safetynet that won't pass even with root switch
-I try to install suhide 0.55, the phone won't start anymore (stays on boot animation, tried to wait all night)
AND HERE IS THE WEIRD THING.
-If I dirty flash the rom to start over, it boots, if then I flash SuperSU, it won't boot!! As if suhide was still in the data partition and preventing the phone from booting!!
So it means that if I try to install suhide once, I am not able to boot with root anymore... I need to format my data partition and start all over again.
Hmm. My issue is slightly different, I guess. I'm not even attempting suhide, just SuperSU. No matter what, I can't boot up once I flash SuperSU. Guess I'll give it another try with the new 2.79 sr2 and oos4.
Thanks!
__McB__ said:
Hmm. My issue is slightly different, I guess. I'm not even attempting suhide, just SuperSU. No matter what, I can't boot up once I flash SuperSU. Guess I'll give it another try with the new 2.79 sr2 and oos4.
Thanks!
Click to expand...
Click to collapse
Did you have any luck with this? I'm having the same issue. Flash the 4.0.2 update and boots fine. Flash SuperSU or phh (I've tried both!) and I just sit at the boot animation for hours until I get angry and restore nandroid to 3.5.4.
hyperblau said:
Did you have any luck with this? I'm having the same issue. Flash the 4.0.2 update and boots fine. Flash SuperSU or phh (I've tried both!) and I just sit at the boot animation for hours until I get angry and restore nandroid to 3.5.4.
Click to expand...
Click to collapse
https://build.nethunter.com/android-tools/no-verity-opt-encrypt/
I had a similar issue with my op3t after root it, I wipe data but it won't start, I just flash the zip 5.1 no verity opt encrypt and should be work fine without flashing supersu:good:
hyperblau said:
Did you have any luck with this? I'm having the same issue. Flash the 4.0.2 update and boots fine. Flash SuperSU or phh (I've tried both!) and I just sit at the boot animation for hours until I get angry and restore nandroid to 3.5.4.
Click to expand...
Click to collapse
No, never got it working. Upgraded to 4.0.2 and never looked back.
Maybe you already tried this version.. Otherwise...

[RESOLVED] TWRP 3.2.3.1 bootloop?

The newest TWRP 3.2.3.-1 does not let me boot into ROM, just brings me back to TWRP again. I have to restore a backed up boot image (with 3.2.3-0) to boot normally. Even flashing TWRP 3.2.3-0 in TWRP does not bring me back.
Anyone else having experiencing this? I have attached my recovery logs.
I was on stock ...and just install los16 without problem... So i dont have problems with TWRP.
Resolved.
After dirty flashing the ROM zip/GAPPs and flashing TWRP, I was able to boot successfully. I Then just saved a new backup including the newest TWRP.
It is strange that just flashing TWRP would make the OS unbootable.
jhedfors said:
Resolved.
After dirty flashing the ROM zip/GAPPs and flashing TWRP, I was able to boot successfully. I Then just saved a new backup including the newest TWRP.
It is strange that just flashing TWRP would make the OS unbootable.
Click to expand...
Click to collapse
There is always a risk when flashing your device. One of the reasons why I prefer to flash using Linux was that Windows would have so much going on in the background that I risked the data transfer being corrupt. That said, if you're using Windows, I'd close all programs and especially disable any anti-virus running in the background. Sure, Linux may have a few things running, but I have always found it did a better job multitasking resources than Microsoft Windows with a fewer chance of data loss.
It is probably because after installing Google Apps, your /data partition gets corrupted.
So after installing Google Apps, go to TWRP > Wipe > "Format Data" & reboot.
I've the same problem & this resolves the issue for me.
For me, this did not help. I had to reflash everything from bootloader.
Funny thing is: it just has downloaded and installed an OTA update. With open bootloader.
I ran into this issue yesterday when a bad flash caused the infamous "no bootable A/B" error. After I resolved it and install TWRP I kept being rebooted back into TWRP. The 3.2.3-0 version resolved everything. I really do believe 3.2.3-1 is a bit buggy. I mean it works, but once you really start to use it more than the average user, you start to notice little things.
I too had this same issue. Eventually realized that updating TWRP by flashing zip from TWRP caused it. I had to flash stock boot partition, then follow the process for flashing TWRP as if you are flashing it for the first time (first boot into TWRP and then flash the corresponding zip). This resolved the issue.

Recover data from soft-bricked (bootloop) phone

Background:
Went to update Magisk via TWRP, phone now bootloops (and gets really hot when charging).
Before I go ahead with flashing an older firmware, to try and get it running again, I was wondering if there was any way of retrieving data from the phone?
I can still boot into TWRP without issue, although I did notice if i go to Install and select source, Internal Storage shows as empty, while External is fine.
Failing data recovery, any suggestions for unbricking it without wiping anything? I've tried un/reinstalling Magisk via TWRP, wiping data/cache/dalvik, but no luck so far.
Thanks
I know where i ****ed up now. By flashing Magisk directly from TWRP.
Tried reflashing it via the guide on page one:
"Instructions for Root Access"
A) Workaround for flashing Magisk with TWRP – for Advanced Users:
Now getting past the warning screen, but not past the Huawei logo.
Going to try remove Magisk altogether, and see if it boots up. If so, will install Magisk again.
Flashed original ramdisk.img and it now shows the boot animation, but doesn't get past there....progress i guess.

[Guide] Enable encryption on a custom ROM which has it disabled by default

Hello everyone, this thread is a guide on how to enable encryption on ROMs that have it disabled.
ROMs that have encryption disabled, usually do it because TWRP is not fully working, or they want to make switching ROMs an easier task.
This zip was created for, and only tested on Official CrDroid on Oneplus 7 Pro (guacamole), developed by Gabriel Lup.
This patch might work for other ROMs, but support is NOT guaranteed.
Before we start, a disclaimer
I am not responsible for any data loss that occurs because steps were not followed correctly.
Speaking of data loss, you will NEED to backup your data before you start, because you will be completely formatting your device in the process.
Installation steps:​
Download the ROM and flash it in TWRP or fastboot
After ROM is finished installing, reboot to recovery, so that you use the slot you installed your ROM to. If you didn't flash TWRP after installing the ROM, then reboot to fastboot and boot TWRP.
After booting TWRP, and active slot having the ROM installed, flash the enable_encryption.zip
Now go to Wipe > Format data > Type yes.
Now reboot to system, and you will be encrypted. You can check by going into Settings > Security > Encryption and credentials, or you can boot TWRP and check for yourself, after setting a password of course.
Note: Flash Magisk, ONLY after your first boot, and after you have confirmed you're encrypted. Flashing most of the other stuff before first boot, like gapps, should be fine.
Upgrade steps:​Unfortunately, upgrading ROM via OTA is out of the question, so you will need to update via TWRP or fastboot.
Theoretically it can be done because the updated partition is not booted, and there are apps that can flash zip files while system is booted, but I won't be trying it soon, pure and simply because some users lose root after taking an OTA, because of Magisk's addon.d survival script, and without root, modifying partitions is impossible.
There are some workarounds for this problem as well but I won't get into that.
After downloading the zip file of your ROM, and enable_encryption.zip, boot to TWRP.
Flash the update for the ROM.
Reboot to TWRP, or go to fastboot and boot it again.
Flash enable_encryption.zip, magisk if you want it, and reboot system. [NOTE: if your ROM maintainer needs you to flash anything after an update, you can do that as well after flashing this zip.]
You should be fine, and prompted for a password.
Issues that might occur:​The first issue that everyone might point out is
What if I forget to flash the zip after an update, or if I take an OTA?
This is an easy fix, as long as you don't panic. If you boot the ROM without flashing the enable encryption zip, instead of "Enter your password", you will be greeted with "Encryption unsuccessful, to resume using your phone, you will need to factory reset" with a button that says "Erase all data".
DO NOT ERASE ALL DATA, THIS CAN BE EASILY FIXED.
Just go to TWRP, and flash the zip to enable encryption, then reboot, you should be able to enter your password and continue using your device.
Another one could be
What if TWRP currently doesn't support decryption?
Yeah, this happens quite a lot with guacamole and Android 11. Oneplus loves changing how encryption works whenever TWRP maintainer makes it work.
This doesn't matter that much, you can sideload both ROM and this zip, regardless of if TWRP can actually read your data or not.
And finally
Installation of the zip is failing, why?
Well, there are 3 reasons if it ever fails, first one you could solve by redownloading it, or transferring it to device/sideloading again.
The second one, could be that the ROM maintainer packaged the ROM with 100% reserved blocks in the vendor.img, thus disabling writes. I personally don't think this will ever happen on our device, but it could happen.
The third one could be solved by trying out another TWRP.
This zip uses the default encryption method that is used by stock ROM, and that is fileencryption=ice, just a thing to note when choosing to flash this.
Because of this, this zip will not work if a ROM used FBEV2, and then was disabled by the maintainer, this only enables the default FBE we have on our device.
I can't get encryption working with latest crDroid build (7.9 from August 7th). I'm getting ERROR 1 after flashing enable_encryption.zip.
I tried with both regular and FBEv2 TWRP from Nebrassy, same error. If I try to flash enable_encryption.zip a second time, it doesn't return any error but after formatting data and rebooting to system, the phone reboots to TWRP.
Any idea?
Toutatis_ said:
I can't get encryption working with latest crDroid build (7.9 from August 7th). I'm getting ERROR 1 after flashing enable_encryption.zip.
I tried with both regular and FBEv2 TWRP from Nebrassy, same error. If I try to flash enable_encryption.zip a second time, it doesn't return any error but after formatting data and rebooting to system, the phone reboots to TWRP.
Any idea?
Click to expand...
Click to collapse
Strange, try and get me a recovery log by copying /tmp/recovery.log to somewhere accessible after you encounter the error.
I get no problems flashing it. Try using Nebrassy's latest TWRP, I used that one.
Xenos7 said:
Strange, try and get me a recovery log by copying /tmp/recovery.log to somewhere accessible after you encounter the error.
I get no problems flashing it. Try using Nebrassy's latest TWRP, I used that one.
View attachment 5380447
Click to expand...
Click to collapse
Sorry, I ended up flashing another ROM as I don't want to be unencrypted. I might try again later and I'll make sure to get a log this time if still getting the error. Thank you!
Hello there,
I, too, have a problem with flashing CrDroid 7 with encryption. For context, I come from CrDroid 6, which I didn't want to leave unless we can encrypt CrDroid 7.
What I did :
-> MSM Tool in order to fully reset my phone and cleanly install OOS 10 and update to OOS 11 (only way actually, since I had a pesky error related to TWRP being unable to decrypt FBE, which made it kinda impossible to do anything)
-> Unlock bootloader
-> Boot into Nebrassys's TWRP and advance -> flash
-> Installed CrDroid 7.9 (from August 7th) on slot A
-> Switched Slot to Slot A and rebooted to recovery
-> Here, I didn't really got why, but I booted into stock recovery, so I ended up in fastboot to flash Nebrassy's TWRP and advance -> flash it again
From here, I really didn't get what happened or why.
-> Booted into TWRP to find that it can't access /data/media/TWRP/somethingElse
-> Thought that it wasn't normal since I was supposed to flash tyour zip at this point, but since I couldn't access Internal Storage neither from my phone or computer, I decided to format /data with imputing 'yes' in order to "reset" encryption keys and set it available for current TWRP.
-> Reboot to recovery to be able to use /data again
-> Ended up with a "E : Unable to decrypt FBE device", which really makes Internal Storage unavailable. From here, I just had to MSM Tool back too OOS 11 like in first step in order to get a usable phone once again.
I don't really get what I did wrong, so if you have any input, I'm willing to learn :/ Thanks in advance !
Aurion13 said:
Hello there,
I, too, have a problem with flashing CrDroid 7 with encryption. For context, I come from CrDroid 6, which I didn't want to leave unless we can encrypt CrDroid 7.
What I did :
-> MSM Tool in order to fully reset my phone and cleanly install OOS 10 and update to OOS 11 (only way actually, since I had a pesky error related to TWRP being unable to decrypt FBE, which made it kinda impossible to do anything)
-> Unlock bootloader
-> Boot into Nebrassys's TWRP and advance -> flash
-> Installed CrDroid 7.9 (from August 7th) on slot A
-> Switched Slot to Slot A and rebooted to recovery
-> Here, I didn't really got why, but I booted into stock recovery, so I ended up in fastboot to flash Nebrassy's TWRP and advance -> flash it again
Click to expand...
Click to collapse
You booted back into stock recovery because when you flash crDroid, it flashes stock lineage recovery.
Aurion13 said:
From here, I really didn't get what happened or why.
-> Booted into TWRP to find that it can't access /data/media/TWRP/somethingElse
-> Thought that it wasn't normal since I was supposed to flash tyour zip at this point, but since I couldn't access Internal Storage neither from my phone or computer, I decided to format /data with imputing 'yes' in order to "reset" encryption keys and set it available for current TWRP.
-> Reboot to recovery to be able to use /data again
-> Ended up with a "E : Unable to decrypt FBE device", which really makes Internal Storage unavailable. From here, I just had to MSM Tool back too OOS 11 like in first step in order to get a usable phone once again.
I don't really get what I did wrong, so if you have any input, I'm willing to learn :/ Thanks in advance !
Click to expand...
Click to collapse
You should consider trying to sideload the enable encryption zip rather than relying on internal storage. After you side load you need to factory reset and then boot to system.
Another thing you can try is to boot crDroid unencrypted, and then reboot to recovery, flash enable encryption zip, then factory reset and reboot to system.
Thanks for your reply !
gruntparty said:
You booted back into stock recovery because when you flash crDroid, it flashes stock lineage recovery.
Click to expand...
Click to collapse
Yeaaaaaaah, it was obvious, but I missed this so hard. I totally forgot that you had to flash back TWRP when you first flash it. Thanks !
gruntparty said:
You should consider trying to sideload the enable encryption zip rather than relying on internal storage. After you side load you need to factory reset and then boot to system.
Another thing you can try is to boot crDroid unencrypted, and then reboot to recovery, flash enable encryption zip, then factory reset and reboot to system.
Click to expand...
Click to collapse
I'm not used to use sideloading, so I tried on your advice. I didn't managed to make the installation work sadly, I don't really know why, and tbh, I can't really lose time on evenings anymore. I'll try again this week-end. I'll update at this moment if I succed (or not) and with a recovery.log. But when I installed CrDroid with sideload, TWRP kept telling me that no OS was installed, with or whitout changing slot. I still didn't managed to patch the enable_encryption.zip, I got a "error: 1" which don't really talks a lot to me. So... More to come soon I guess.
Anyway, thanks for the help, and thanks for providing the zip too, it was just what I needed to hop on CrDroid 7.
Hello again,
Little update : I did it
I guess being tired didn't really served me well, and I surely did some strange things when flashing the rom since I managed to do it just a few minutes ago.
Regarding the enable_encryption.zip, I also encountered the "Updater process ended with ERROR: 1". I went to check the logs and there was this :
Code:
file size 2093, block size 65536
Installing zip file '/sideload/package.zip'
unknown fuse request opcode 2016
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Extracting updater binary 'META-INF/com/google/android/update-binary'
I:Zip does not contain SELinux file_contexts file in its root.
mount: '/vendor' not in fstab
sed: /vendor/etc/fstab.qcom: No such file or directory
umount: /vendor: Invalid argument
Updater process ended with ERROR: 1
I thought the "mount: '/vendor' not in fstab" strange, so I tried to mount Vendor partition, reflashed the zip, and it worked. I just checked in settings and it says I'm encrypted, I rebooted in TWRP and it asked me for my password.
I think that this would need to be added in first post @Xenos7 and it will also probably fix the issue of @Toutatis_
Again, thanks a lot for proving the zip and for the support guys !
i installed latest update of CrDroid and followed the instruction of upgrading steps but the phone has gone to bootloop. Any solution for this?
Xenos7 said:
Hello everyone, this thread is a guide on how to enable encryption on ROMs that have it disabled.
ROMs that have encryption disabled, usually do it because TWRP is not fully working, or they want to make switching ROMs an easier task.
This zip was created for, and only tested on Official CrDroid on Oneplus 7 Pro (guacamole), developed by Gabriel Lup.
This patch might work for other ROMs, but support is NOT guaranteed.
Before we start, a disclaimer
I am not responsible for any data loss that occurs because steps were not followed correctly.
Speaking of data loss, you will NEED to backup your data before you start, because you will be completely formatting your device in the process.
Installation steps:​
Download the ROM and flash it in TWRP or fastboot
After ROM is finished installing, reboot to recovery, so that you use the slot you installed your ROM to. If you didn't flash TWRP after installing the ROM, then reboot to fastboot and boot TWRP.
After booting TWRP, and active slot having the ROM installed, flash the enable_encryption.zip
Now go to Wipe > Format data > Type yes.
Now reboot to system, and you will be encrypted. You can check by going into Settings > Security > Encryption and credentials, or you can boot TWRP and check for yourself, after setting a password of course.
Note: Flash Magisk, ONLY after your first boot, and after you have confirmed you're encrypted. Flashing most of the other stuff before first boot, like gapps, should be fine.
Upgrade steps:​Unfortunately, upgrading ROM via OTA is out of the question, so you will need to update via TWRP or fastboot.
Theoretically it can be done because the updated partition is not booted, and there are apps that can flash zip files while system is booted, but I won't be trying it soon, pure and simply because some users lose root after taking an OTA, because of Magisk's addon.d survival script, and without root, modifying partitions is impossible.
There are some workarounds for this problem as well but I won't get into that.
After downloading the zip file of your ROM, and enable_encryption.zip, boot to TWRP.
Flash the update for the ROM.
Reboot to TWRP, or go to fastboot and boot it again.
Flash enable_encryption.zip, magisk if you want it, and reboot system. [NOTE: if your ROM maintainer needs you to flash anything after an update, you can do that as well after flashing this zip.]
You should be fine, and prompted for a password.
Issues that might occur:​The first issue that everyone might point out is
What if I forget to flash the zip after an update, or if I take an OTA?
This is an easy fix, as long as you don't panic. If you boot the ROM without flashing the enable encryption zip, instead of "Enter your password", you will be greeted with "Encryption unsuccessful, to resume using your phone, you will need to factory reset" with a button that says "Erase all data".
DO NOT ERASE ALL DATA, THIS CAN BE EASILY FIXED.
Just go to TWRP, and flash the zip to enable encryption, then reboot, you should be able to enter your password and continue using your device.
Another one could be
What if TWRP currently doesn't support decryption?
Yeah, this happens quite a lot with guacamole and Android 11. Oneplus loves changing how encryption works whenever TWRP maintainer makes it work.
This doesn't matter that much, you can sideload both ROM and this zip, regardless of if TWRP can actually read your data or not.
And finally
Installation of the zip is failing, why?
Well, there are 3 reasons if it ever fails, first one you could solve by redownloading it, or transferring it to device/sideloading again.
The second one, could be that the ROM maintainer packaged the ROM with 100% reserved blocks in the vendor.img, thus disabling writes. I personally don't think this will ever happen on our device, but it could happen.
The third one could be solved by trying out another TWRP.
This zip uses the default encryption method that is used by stock ROM, and that is fileencryption=ice, just a thing to note when choosing to flash this.
Because of this, this zip will not work if a ROM used FBEV2, and then was disabled by the maintainer, this only enables the default FBE we have on our device.
Click to expand...
Click to collapse
Hi! Done. Followed all steps and crdroid is now encrypted. But! Very strange behavior which I tested several times. After having OS encrypted I decided to go again to recovery, now from crdroid power/restart menu. But recovery didn't load. Instead, I had a recovery (TWRP Nebrassy) logo flicking. I hard-switched to fastboot, then fastboot boot twrp.img, and entered TWRP menu (temporary TWRP). In there I was trying to flash TWRP on permanent basis again but it failed with an error about mounting data. Format data didn't help. So, I stayed on temporary TWRP and after reboot to System, surprisingly successfully entered my crdroid. The same happens (checked) if I would reboot to Recovery - instead of Recovery I would enter crdroid. The only explanation I see is that encryption (done with this zip) blocks permanently installed TWRP from starting. In case of temporary TWRP it's just being disappeared after reboot and I can enter the system whatever option I choose in temporary TWRP: system or recovery. It would be OK but the sad thing I need the both encryption and recovery. Any ideas?
P.S. I tried also Orangefox recovery - the same story : logo flicking after the try to restart from encrypted crdroid to recovery.
Yagikable said:
Hi! Done. Followed all steps and crdroid is now encrypted. But! Very strange behavior which I tested several times. After having OS encrypted I decided to go again to recovery, now from crdroid power/restart menu. But recovery didn't load. Instead, I had a recovery (TWRP Nebrassy) logo flicking. I hard-switched to fastboot, then fastboot boot twrp.img, and entered TWRP menu (temporary TWRP). In there I was trying to flash TWRP on permanent basis again but it failed with an error about mounting data. Format data didn't help. So, I stayed on temporary TWRP and after reboot to System, surprisingly successfully entered my crdroid. The same happens (checked) if I would reboot to Recovery - instead of Recovery I would enter crdroid. The only explanation I see is that encryption (done with this zip) blocks permanently installed TWRP from starting. In case of temporary TWRP it's just being disappeared after reboot and I can enter the system whatever option I choose in temporary TWRP: system or recovery. It would be OK but the sad thing I need the both encryption and recovery. Any ideas?
P.S. I tried also Orangefox recovery - the same story : logo flicking after the try to restart from encrypted crdroid to recovery.
Click to expand...
Click to collapse
Forgot to add: Format data failed with "couldn't format encrypted data"
Yagikable said:
Hi! Done. Followed all steps and crdroid is now encrypted. But! Very strange behavior which I tested several times. After having OS encrypted I decided to go again to recovery, now from crdroid power/restart menu. But recovery didn't load. Instead, I had a recovery (TWRP Nebrassy) logo flicking. I hard-switched to fastboot, then fastboot boot twrp.img, and entered TWRP menu (temporary TWRP). In there I was trying to flash TWRP on permanent basis again but it failed with an error about mounting data. Format data didn't help. So, I stayed on temporary TWRP and after reboot to System, surprisingly successfully entered my crdroid. The same happens (checked) if I would reboot to Recovery - instead of Recovery I would enter crdroid. The only explanation I see is that encryption (done with this zip) blocks permanently installed TWRP from starting. In case of temporary TWRP it's just being disappeared after reboot and I can enter the system whatever option I choose in temporary TWRP: system or recovery. It would be OK but the sad thing I need the both encryption and recovery. Any ideas?
P.S. I tried also Orangefox recovery - the same story : logo flicking after the try to restart from encrypted crdroid to recovery.
Click to expand...
Click to collapse
I never install TWRP, so I can't really say about that, but I'm sure the zip shouldn't impact the recovery installing/booting.
Try downloading the latest version of Nebraccy TWRP, the August one. That one should work if OnePlus didn't change something with encryption again.
This zip doesn't even touch the boot partition, it only edits 2 lines in vendor partition, which would never make TWRP unable to install.
However, last time I tried, in June and decrypted, TWRP wouldn't install at all anyways.
Xenos7 said:
I never install TWRP, so I can't really say about that, but I'm sure the zip shouldn't impact the recovery installing/booting.
Try downloading the latest version of Nebraccy TWRP, the August one. That one should work if OnePlus didn't change something with encryption again.
This zip doesn't even touch the boot partition, it only edits 2 lines in vendor partition, which would never make TWRP unable to install.
However, last time I tried, in June and decrypted, TWRP wouldn't install at all anyways.
Click to expand...
Click to collapse
Thanks. When next update for crdroid comes, I'll try again from the scratch. Meanwhile, the issue was magically solved. I was sick and tired with this flicking recovery and decided to flash lineage recovery from the command line. It was a surprise when instead of seeing lineage after reboot I saw my Nebrassy TWRP fully loaded and never flicking since then. Crdroid has also successfully run encrypted. I have no explanation for that. Maybe it has something to do with a/b slots but I'm sure I've been choosing the right slots all the time.
Use this to enable FBEv2 instead of sdcardfs. Use the instructions from the OP.
Mount vendor in TWRP before flashing. Also, flash an FBEv2 kernel.
EDIT: Don't complain to the dev or me if your data is gone or your device blows up.
darkflicker said:
Use this to enable FBEv2 instead of sdcardfs. Use the instructions from the OP.
Mount vendor in TWRP before flashing. Also, flash an FBEv2 kernel.
Click to expand...
Click to collapse
Why would you purposely try to break stuff?
Technically, that IS possible, but, just, why?
You receive no visible benefits, and you could lose all your data once major Android version is updated...
Not to mention users will complain to dev when random bugs happen because they use some out of the nowhere kernel.
As for sdcardfs or fuse?
I can bet that people CAN'T know the difference between them, looking at the fact everyone asks if the ROM is sdcardfs or not.
Fact is, using this method on a ROM that's supposed to use regular FBE, is possible, but NOT recommended.
Putting all your data on the line because of theoretical performance bumps is a plainly stupid idea if you ask me.
Either use a FBEV2 ROM, or don't, although people make a big fuss about it being sdcardfs or not, FBEV2 or not.
Those things should NEVER be a deciding factor, because every non developer user, really can't tell the difference.
Xenos7 said:
Why would you purposely try to break stuff?
Technically, that IS possible, but, just, why?
You receive no visible benefits, and you could lose all your data once major Android version is updated...
Not to mention users will complain to dev when random bugs happen because they use some out of the nowhere kernel.
As for sdcardfs or fuse?
I can bet that people CAN'T know the difference between them, looking at the fact everyone asks if the ROM is sdcardfs or not.
Fact is, using this method on a ROM that's supposed to use regular FBE, is possible, but NOT recommended.
Putting all your data on the line because of theoretical performance bumps is a plainly stupid idea if you ask me.
Either use a FBEV2 ROM, or don't, although people make a big fuss about it being sdcardfs or not, FBEV2 or not.
Those things should NEVER be a deciding factor, because every non developer user, really can't tell the difference.
Click to expand...
Click to collapse
You are also forcefully trying to enable encryption on a decrypted and unsupported ROM. The chances of breakage are similar for both. I am just providing the users a choice. If anything breaks, nobody is responsible but them.
darkflicker said:
You are also forcefully trying to enable encryption on a decrypted and unsupported ROM. The chances of breakage are similar for both. I am just providing the users a choice. If anything breaks, nobody is responsible but them.
Click to expand...
Click to collapse
The ROM fully supports encryption on it's kernel, dev is just not using it to keep TWRP support, this was before A11 TWRP got released. I'm assuming he doesn't want users to clean flash just because of encryption.
This zip just reverts the commit made to fstab to disable encryption, and you're still using the kernel developer intended.
But sure, if someone breaks their device, it's their own fault.
Fellas yall going backwards with all this. Encryption is the devil.
Updated the zip to include checks to unmount vendor if someone mounted it manually, so that it shouldn't get errors for that now.
The zip can be found in OP.
Xenos7 said:
Hello everyone, this thread is a guide on how to enable encryption on ROMs that have it disabled.
ROMs that have encryption disabled, usually do it because TWRP is not fully working, or they want to make switching ROMs an easier task.
This zip was created for, and only tested on Official CrDroid on Oneplus 7 Pro (guacamole), developed by Gabriel Lup.
This patch might work for other ROMs, but support is NOT guaranteed.
Before we start, a disclaimer
I am not responsible for any data loss that occurs because steps were not followed correctly.
Speaking of data loss, you will NEED to backup your data before you start, because you will be completely formatting your device in the process.
Installation steps:​
Download the ROM and flash it in TWRP or fastboot
After ROM is finished installing, reboot to recovery, so that you use the slot you installed your ROM to. If you didn't flash TWRP after installing the ROM, then reboot to fastboot and boot TWRP.
After booting TWRP, and active slot having the ROM installed, flash the enable_encryption.zip
Now go to Wipe > Format data > Type yes.
Now reboot to system, and you will be encrypted. You can check by going into Settings > Security > Encryption and credentials, or you can boot TWRP and check for yourself, after setting a password of course.
Note: Flash Magisk, ONLY after your first boot, and after you have confirmed you're encrypted. Flashing most of the other stuff before first boot, like gapps, should be fine.
Upgrade steps:​Unfortunately, upgrading ROM via OTA is out of the question, so you will need to update via TWRP or fastboot.
Theoretically it can be done because the updated partition is not booted, and there are apps that can flash zip files while system is booted, but I won't be trying it soon, pure and simply because some users lose root after taking an OTA, because of Magisk's addon.d survival script, and without root, modifying partitions is impossible.
There are some workarounds for this problem as well but I won't get into that.
After downloading the zip file of your ROM, and enable_encryption.zip, boot to TWRP.
Flash the update for the ROM.
Reboot to TWRP, or go to fastboot and boot it again.
Flash enable_encryption.zip, magisk if you want it, and reboot system. [NOTE: if your ROM maintainer needs you to flash anything after an update, you can do that as well after flashing this zip.]
You should be fine, and prompted for a password.
Issues that might occur:​The first issue that everyone might point out is
What if I forget to flash the zip after an update, or if I take an OTA?
This is an easy fix, as long as you don't panic. If you boot the ROM without flashing the enable encryption zip, instead of "Enter your password", you will be greeted with "Encryption unsuccessful, to resume using your phone, you will need to factory reset" with a button that says "Erase all data".
DO NOT ERASE ALL DATA, THIS CAN BE EASILY FIXED.
Just go to TWRP, and flash the zip to enable encryption, then reboot, you should be able to enter your password and continue using your device.
Another one could be
What if TWRP currently doesn't support decryption?
Yeah, this happens quite a lot with guacamole and Android 11. Oneplus loves changing how encryption works whenever TWRP maintainer makes it work.
This doesn't matter that much, you can sideload both ROM and this zip, regardless of if TWRP can actually read your data or not.
And finally
Installation of the zip is failing, why?
Well, there are 3 reasons if it ever fails, first one you could solve by redownloading it, or transferring it to device/sideloading again.
The second one, could be that the ROM maintainer packaged the ROM with 100% reserved blocks in the vendor.img, thus disabling writes. I personally don't think this will ever happen on our device, but it could happen.
The third one could be solved by trying out another TWRP.
This zip uses the default encryption method that is used by stock ROM, and that is fileencryption=ice, just a thing to note when choosing to flash this.
Because of this, this zip will not work if a ROM used FBEV2, and then was disabled by the maintainer, this only enables the default FBE we have on our device.
Click to expand...
Click to collapse
Is this enable_encryption.zip only works for oneplus 7 pro ?? If so then can you please provide the file that works for Mi A2.

Stuck in boot loop

Hi, I got a situation here. I had to reinstall the rom in my Note 7 Pro after nearly 2 years from teh last time I had to do it.
Unfortunately, I had no idea that the new Magisk version can't be flashed by custom recoveries anymore. I simply flashed my rom using Orange Fox, restarted to the system, used the cell for 2 days, installed everything I needed, and yesterday I downloaded the latest 24310 Magisk version, flashed it using my custom recovery, and restarted in the system again.
Magisk greeted me with a message that it needed extra setup to be fully functional. I restarted in recovery, nothing happened, restarted to system, Maghisk still stuck in the need extra setup to be functional. I resolved to uninstall it using the app, got an error message in the console, tried restoring images, another error. Tried to reboot to recovery to try to reflash magisk, no more recovey, gone. Used adb to reflash recovery, rebooted to it, now I have a message that says Error opening: 'data/adb/magisk' (operation not permitted). Tried to use the Orange Fox option to remove Magisk, got some error messages Error opening: 'data/adb/magisk' (operation not permitted), but it said it was done. Tried to reboot, stuck in boot loop, back in recovery, dirty flashed my actual ROM, still stuck in boot load.
Any way to delete this locked magisk folder to try to completely remove magisk and try to reinstall it the correct way now? Or the only solution is a complete reinstallation of the ROM formatting all partitions? I haven't tried it yet because after 2 years of doing this procedure I barely remember how to do a clean install correctly.
Blackdragonbird said:
Hi, I got a situation here. I had to reinstall the rom in my Note 7 Pro after nearly 2 years from teh last time I had to do it.
Unfortunately, I had no idea that the new Magisk version can't be flashed by custom recoveries anymore. I simply flashed my rom using Orange Fox, restarted to the system, used the cell for 2 days, installed everything I needed, and yesterday I downloaded the latest 24310 Magisk version, flashed it using my custom recovery, and restarted in the system again.
Magisk greeted me with a message that it needed extra setup to be fully functional. I restarted in recovery, nothing happened, restarted to system, Maghisk still stuck in the need extra setup to be functional. I resolved to uninstall it using the app, got an error message in the console, tried restoring images, another error. Tried to reboot to recovery to try to reflash magisk, no more recovey, gone. Used adb to reflash recovery, rebooted to it, now I have a message that says Error opening: 'data/adb/magisk' (operation not permitted). Tried to use the Orange Fox option to remove Magisk, got some error messages Error opening: 'data/adb/magisk' (operation not permitted), but it said it was done. Tried to reboot, stuck in boot loop, back in recovery, dirty flashed my actual ROM, still stuck in boot load.
Any way to delete this locked magisk folder to try to completely remove magisk and try to reinstall it the correct way now? Or the only solution is a complete reinstallation of the ROM formatting all partitions? I haven't tried it yet because after 2 years of doing this procedure I barely remember how to do a clean install correctly.
Click to expand...
Click to collapse
Reflash the stock unrooted boot.img of your room in bootloader. Use adb
Fastboot flash boot boot.img
Similar problem here...
I tried reflashing stock recovery and stock boot.img - now whenever I reboot it just boots into recovery! I don't seem to be able to boot into system any more...
Any ideas?
I'm running AOSIP on a Xiami Mix Mi 3 - I hadn't updated to the latest Magisk in quite some time (since before the app could do it automatically). I have to use the recovery method.
Steps I took are:
Get recovery.zip from my ROM, patched it through the app, then flashed through fastboot. I rebooted while holding down the up arrow to reboot into recovery, then released for the phone to boot.
I got an error after booting that said "there's an internal error with your device" - and it was super buggy, couldn't tap the screen, super slow to load stuff, etc.... I figured it was a magisk issue, so tried to reflash recovery and boot... Not I'm stuck booting into recovery!
Help.
Edit: so - I think it turns out I have one of those RARE xiaomi devices that DOES have ramdisk even though the app doesn't detect it... Go figure. A clean install of the ROM, followed by patching the BOOT image rather than the recovery image - and we're up and running.

Categories

Resources