Encryption on the 5X? - Nexus 5X Q&A, Help & Troubleshooting

Hey guys, I unlocked the bootloader, flashed twrp and root. Then I proceeded to do a fastboot format userdata. But after the boot the encryption was still there. Now I am running PureNexus latest build along with ElementalX kernel. I would like to remove encryption when I will be flashing another rom, How do I do that? Do I simply need to do a fastboot format userdata? Will I lose Twrp and root if I do that?

If you format user data and then boot with the stock kernel it will just re encrypt the device.
Only way to stop this to format usersata and then BEFORE booting the device flashing a kernel or custom rom with force encrypt disabled.
Keep in mind the installation instructions that come with your custom ROM or kernel though. Some require you to be on stock before flashing.
I would generally consider dirty flashing a different ROM over purenexus a bad idea, so you best revert to stock, format user data to disable encryption, do a factory reset then install the new custom rom.
You will lose everything though and have to start from scratch. You may get away with using titanium backup for backup and restoring apps if you know what you are doing.
If the ROM has a kernel with force encrypt disabled then you just flash the whole ROM through fastboot and boot it. What ROM are going to try?

Someone told me on reddit to just simply format data using twrp and that it will remove the encryption and wipe my whole internal storage. Is that correct?

I believe it does just that.

Related

How to enable encryption

I am currently running a decrypted MM stock build on my 5X.
I want to upgrade to Noughat and then re-decrypt my phone. I think that flashing the factory image is the best way to do, but first, how can I re-enable encryption, so nothing bad can happen while flashing the factory image?
Just backup your data beforehand.
Flash factory image will format all your data, so the next time you boot up the device will be encrypted because encryption on by default in stock ROM.
To turn on encryption do these....
Go to settings then in security select Encrypt Phone,anyways there will not be any error in flashing factory due to decryption until and unless you have a bad config of fastboot adb etc or have a bad usb cable..if you want to decrypt again in Nougat I think you know how to..flash Elemental X/ Franco / some kernel with force encrypt disabled then go to fastboot mode and wipe userdata.
dkreventon said:
I am currently running a decrypted MM stock build on my 5X.
I want to upgrade to Noughat and then re-decrypt my phone. I think that flashing the factory image is the best way to do, but first, how can I re-enable encryption, so nothing bad can happen while flashing the factory image?
Click to expand...
Click to collapse
You're trying to do too much. It's pointless to encrypt, upgrade to 7.0, then decrypt. Factory reset and wipe system, upgrade via fastboot, flash SuperSU or a modified boot.img to stay decrypted, then boot up. Update your adb and platform tools before all this.
Sent from my Nexus 5X using Tapatalk
Ken.Adams said:
Go to settings then in security select Encrypt Phone
Click to expand...
Click to collapse
I agree with the other posters that there is no need to encrypt, but if one were to encrypt, this doesn't work if you have TWRP installed, it just hangs on reboot.
Best way to re-encrypt is to install stock boot.img and let it encrypt on its own.

Do I need to use RemoveForceEnc.zip if I'm flashing a custom ROM?

Currently I'm following this process when I want a super clean flash of a new ROM
- Use Back2Stock script to get stock Motorola Marshmallow
- Flash TWRP
- Flash ROM
- Flash GAPPS
I keep coming back to these steps for one major reason : TWRP will not let me format or erase the DATA or INTERNAL STORAGE partition. This means that if I keep flashing different ROMs through TWRP, there will be junk data piling up in the DATA or INTERNAL STORAGE. But I digress..
I want to know if encryption is removed automatically when I flash custom rom like AOKP or RRemix? Does it depend on the ROM? Or should be including that RemoveForceEnc.zip in my steps?
Apparently those steps also cause my to not have root in my custom ROM.
The new steps I'm running now :
- Use Back2Stock script to get stock Motorola Marshmallow
- Flash TWRP
- Flash Fixed Firmware (marshmallow version)
- Flash SuperSU v2.79-SR3
- Flash ROM
- Flash OpenGAPPS (ARM version)
I'm no expert, but as far as I know you can only encrypt your data partition again from within Android Settings > Security. It won't be automatically encrypted again by simply flashing a new custom ROM.
Perhaps it could encrypt it when you flash stock, which is actually something I'd like to confirm because I removed encryption on my Z Play yesterday and am currently running LOS, so if I eventually flash stock again I wonder if it will automatically encrypt my data partition back.... I'm guessing no, but it's something I'd like to confirm (and/or try later on).
I don't have you TWRP problem, meaning I can format everything on my TWRP (if I go to advanced format I can select all options there and have everything wiped), but I usually simply do wipes on TWRP, then flash ROM, then Gapps, then boot, then install Magisk Manager (from Play store) and root from there.
Confirmed. When you flash stock you're re-encrypted (sad).

Restoring encryped TWRP backup, does it work after one flashed unencrypted ROM?

Hi all
Before I flash a test (unencrypted) 8.1 firmware, I would like to check:
Currently I run encrypted 8.0 OOS 5.0.4 and codeworkx latest TWRP.
If I backup with TWRP (first remove security) and then factory reset (and format /data)
If I next flash decrypted ROM, can I straightforward revert back to OOS 5.0.4 with same TWRP?
Someone who did so, please raise a hand.
Thanks for letting me know.
Encryption happens on boot, so if you back up was encrypted and you don't flash no verity after restore. Then it will re- encrypt
PCWright86 said:
Encryption happens on boot, so if you back up was encrypted and you don't flash no verity after restore. Then it will re- encrypt
Click to expand...
Click to collapse
I am not sure I follow why data re- encrypt is needed upon boot for restored encrypted data.
Or do you mean decrypt and re-encrypt? I thought crypt was file based.
I was rather wondering if the restored 8.0 OOS backup has the keys and code and setup to read encrypted data files. Especially when coming from 8.1 which may have different parameters. I guess it does but wanted to know someone who had restored encrypted OOS TWRP 8.0 data after running decrypted 8.1 ROM. Have you?
But then again, I do not understand well and therefore ask.
Because: if I don't like the firmware with decrypted data, I want to revert back to original encrypted OOS including its data. Since it takes much time to get the hundreds of apps configured.
The boot image of the backup will encrypt the phone again. In short, yes you can restore and be encrypted on ,OOS again
PCWright86 said:
The boot image of the backup will encrypt the phone again. In short, yes you can restore and be encrypted on ,OOS again
Click to expand...
Click to collapse
Thanks for explaining. I feel more confident now about what to expect!

Device encrypted

I came from MIUI 9 official. I unlocked bootloader, flashed TWRP 3.2.1 vasishath, flashed Magisk and it said: "encrypted data detected, keep forceencryp"t. Then I did full wipes, then I installed AEX rom, gapps, and my device appears as encrypted. If i boot to recovery also is encrypted and asks me toenter pin. Encrypted by default? Is this MIUI, TWRP or AEX feature?
How can I decrypt? I want to decrypt to avoid future problems with dirty flashing and some other things, In addition, encryption slows down the system theoretically.
You need to FORMAT Data (not wipe) to remove encryption, Magisk will then prevent your rom from encrypting again on boot.
If your rom has a survival script for magisk, there is no need to reflash it on updating the rom.
If it doesn't then you will need to reflash it on update to prevent your rom from encrypting it on boot.
Me too....

[Q] Decrypting data partition using TWRP?

Hello,
Previously I'm on Xiaomi.eu Stable 11.0.5 based on Android 9, did backup on system and other partition except data partition.
I updated to Xiaomi.eu Stable 11.01 based on Android 10. Flashing done without problem. After first boot, PIN code I used doesn't work to unlock the phone. (yes, i forgot to disable phone lock before updating)
Then I boot to twrp, it's prompt for decryption PIN, after decryption. I try to restore system partition, but it lead to bootloop.
I boot to TWRP again, but now it doesn't prompt for decryption PIN and my data partition still encrypted.
Is there any possiblity to decrypt it on TWRP so I can backup it to OTG drive before I clean Install it?
Or there are any other method to decrypt the files cause I can still access the files as MTP devices.
Thank you very much for your help
@underd0g, try to flash the ROM, of which data you want to restore, dirty before. This may make encrypt key availiable.
rp158 said:
@underd0g, try to flash the ROM, of which data you want to restore, dirty before. This may make encrypt key availiable.
Click to expand...
Click to collapse
Do you mean that I need to reflash the ROM previously I used?
Okay let me try it. Thank you for your answer.
edit: reflashing ROM fixed the problem
I´Hello I have the same problem,
Unfortunate flashing via OTG does not solve the problem.
Also I am not able to flash a stock rom via the mi flash tool
Hello, i don´t know wy but after several formats and installations it worked and I´m running now on 20-3-19
Thanks all

Categories

Resources