Decrypting the device - OnePlus 3 Questions & Answers

OK,
So I like to tinker with custom ROMs (Resurrection remix) and having to decrypt the device each time is kinda annoying so I was thinking about decrypting my device. I'm aware I will lose data (adb pull + adb push should solve the issue) with fastboot format. What's not clear to me if, after running the format, I'll have to flash the ROM again. In theory format should wipe everything from the partitions (I assume system/data/internal) so the ROM flash would be required, but neither of the guides I read they mentioned it. And good reading about the process?

Check here: https://forum.xda-developers.com/on...-verity-force-encryption-op3t-t3688748/page53

Related

[Q] Struggling with TWRP, f2fs, adb, fastboot, uCyan

I'm not flashing etc. my SXS (or other cells) often, so I may missed some informative posts regarding my problems. Usage of
Report/Log of actions and problems
I tried to fastboot flash openrecovery-twrp-2.8.4.1-LT26i.img and openrecovery-twrp-2.8.5.0-nozomi.img but f2fs was not available and also installing uCyan-12.1-b04.zip gave me errors
Using adb "fastboot flash boot boot_carbon_3-11-14_with_twrp.img" I was able to use the included TWRP 2.8.0 to clean flash (wiped all except sdcard) "uCyan-12.1-b04.zip"
With TWRP 2.8.0 I also was not able to format all partitions except sdcard with f2fs (probably because of the carbon kitkat-kernel?)
(as expected) TWRP 2.8.0 was gone after the flashing
I tried to reinstall TWRP by installing eu.chainfire.supersu-2.46-246-Android-2.1.apk & com.jmz.soft.twrpmanager.apk in uCyan, this gave me errors and FC and then also forced System shutdowns
Vol+ (fastboot, blue light) und adb USB connect seems to not work with uCyan-12.1-b04 for me, but not sure what is the culprit.
I would like to achieve and ask how to do:
install TWRP 2.8.x permanently (into FOTAkernel)
format all partitions except sdcard with f2fs
install uCyan-12.1-b04
all of this possibly without using uCyan (or another ROM) and without App-Installation (Cell offline) so only with TWRP & adb also to make a clean backup of uCyan: is this possible?
ChriMo said:
I'm not flashing etc. my SXS (or other cells) often, so I may missed some informative posts regarding my problems. Usage of
Report/Log of actions and problems
I tried to fastboot flash openrecovery-twrp-2.8.4.1-LT26i.img and openrecovery-twrp-2.8.5.0-nozomi.img but f2fs was not available and also installing uCyan-12.1-b04.zip gave me errors
Using adb "fastboot flash boot boot_carbon_3-11-14_with_twrp.img" I was able to use the included TWRP 2.8.0 to clean flash (wiped all except sdcard) "uCyan-12.1-b04.zip"
With TWRP 2.8.0 I also was not able to format all partitions except sdcard with f2fs (probably because of the carbon kitkat-kernel?)
(as expected) TWRP 2.8.0 was gone after the flashing
I tried to reinstall TWRP by installing eu.chainfire.supersu-2.46-246-Android-2.1.apk & com.jmz.soft.twrpmanager.apk in uCyan, this gave me errors and FC and then also forced System shutdowns
Vol+ (fastboot, blue light) und adb USB connect seems to not work with uCyan-12.1-b04 for me, but not sure what is the culprit.
I would like to achieve and ask how to do:
install TWRP 2.8.x permanently (into FOTAkernel)
format all partitions except sdcard with f2fs
install uCyan-12.1-b04
all of this possibly without using uCyan (or another ROM) and without App-Installation (Cell offline) so only with TWRP & adb also to make a clean backup of uCyan: is this possible?
Click to expand...
Click to collapse
According to the first list, You had done most of the stuff correctly. You just didn't have partitions in f2fs and no TWRP, right?
The TWRP in carbon should work with f2fs conversion, but given that You get problems, we will need to go via a kinda lengthy method.
Flash the uCyan-12.1-b04 normally via the recovery.Don't bother flashing gapps or other zips now.
Then to get root, You don't need to install SuperSU. You can do so via Settings> Developer Options> Root option for adb and apps.
Then follow the procedure from here to flash TWRP.
After You have TWRP version 2.8.4.1, then reboot to recovery, now convert needed partitions to f2fs and flash the ROM and gapps!

Phone still encrypted after reflash/factory reset?

Hello,
I hope someone will be able to help with this, although it is very much a case of user error! I upgraded my G3 to Marshmallow using the steps detailed here:
http://forum.xda-developers.com/lg-g3/development/stock-d855-30b-images-kdz-flashables-t3282012
It all worked perfectly until I decided to encrypt the handset. The encryption process worked as expected, but as I always did on previous Android versions, I used the CryptFS Password app to change the encryption password. The app advised that it was unable to change the password and that I should run the command via shell, which I did and it seemed to work. The problem is, I changed it to an alphanumeric password and my lock screen is just a numeric PIN, so upon reboot it prompts me to enter the password to decrypt but only allows me to enter numbers.
So, I kicked myself for not changing the lockscreen from PIN to password before rebooting, but figured I could just wipe/reflash and start again. However, when I reflash, I still get prompted for the encryption password at boot. So I figured I'd just enter the password wrong 30 times and factory reset the device that way, except that doesn't work either. It says it's going to reset, reboots to recovery (TWRP 2.8.7.0) and says it has reset, but then boots back to the encryption screen again (which now advises that I am -5 of 30 attempts!!).
Flashing CM13 or 12 works fine. I have settled on CM12 at the moment because it seems to be a bit more stable, but I'd ideally like to get back to stock Marshmallow. Is this possible?
I have tried wiping all partitions and data from within TWRP, and formatting partitions, all to no avail.
Is there any way I can reinstall stock Marshmallow?
Trying flashing marshmellow KDZ and it should reset everything
Let me know how things go
TTib said:
Hello,
I hope someone will be able to help with this, although it is very much a case of user error! I upgraded my G3 to Marshmallow using the steps detailed here:
http://forum.xda-developers.com/lg-g3/development/stock-d855-30b-images-kdz-flashables-t3282012
It all worked perfectly until I decided to encrypt the handset. The encryption process worked as expected, but as I always did on previous Android versions, I used the CryptFS Password app to change the encryption password. The app advised that it was unable to change the password and that I should run the command via shell, which I did and it seemed to work. The problem is, I changed it to an alphanumeric password and my lock screen is just a numeric PIN, so upon reboot it prompts me to enter the password to decrypt but only allows me to enter numbers.
So, I kicked myself for not changing the lockscreen from PIN to password before rebooting, but figured I could just wipe/reflash and start again. However, when I reflash, I still get prompted for the encryption password at boot. So I figured I'd just enter the password wrong 30 times and factory reset the device that way, except that doesn't work either. It says it's going to reset, reboots to recovery (TWRP 2.8.7.0) and says it has reset, but then boots back to the encryption screen again (which now advises that I am -5 of 30 attempts!!).
Flashing CM13 or 12 works fine. I have settled on CM12 at the moment because it seems to be a bit more stable, but I'd ideally like to get back to stock Marshmallow. Is this possible?
I have tried wiping all partitions and data from within TWRP, and formatting partitions, all to no avail.
Is there any way I can reinstall stock Marshmallow?
Click to expand...
Click to collapse
try booting into twrp, go into command terminal, manually format data partition using command line, then reflash cm12 and wipe cache and dalvik (you may not need to reflash it but why not if you are going back to mm)
if your partitions are the same as mine this is the command you want to run.
mke2fs -T ext4 /dev/block/mmcblk0p44
make sure you don't format the wrong partition check that your variant has the same partition (grab an app called diskinfo and click on data partition then alter the last parameter to w/e ur data partition is)
mmcblk0p44 is the paramater you want to change if yours isn't identical. this should reset encryption as data is the partition that gets encrypted.
after all of this use a guide to install marshmallow (kdz or something)
(when i encrypted my data partition twrp could no longer mount the partition to format it, but if you use command land format it formats the partition without mounting it.)
i'm assuming this is your issue as well.
KronicSkillz said:
try booting into twrp, go into command terminal, manually format data partition using command line, then reflash cm12 and wipe cache and dalvik (you may not need to reflash it but why not if you are going back to mm)
if your partitions are the same as mine this is the command you want to run.
mke2fs -T ext4 /dev/block/mmcblk0p44
make sure you don't format the wrong partition check that your variant has the same partition (grab an app called diskinfo and click on data partition then alter the last parameter to w/e ur data partition is)
mmcblk0p44 is the paramater you want to change if yours isn't identical. this should reset encryption as data is the partition that gets encrypted.
after all of this use a guide to install marshmallow (kdz or something)
(when i encrypted my data partition twrp could no longer mount the partition to format it, but if you use command land format it formats the partition without mounting it.)
i'm assuming this is your issue as well.
Click to expand...
Click to collapse
Hi, thanks for the advice, I gave it a try last night. My /data partition was named /dev/block/mmcblk0p43 according to DiskInfo, so I made sure the partition was unmounted in TWRP and formatted it via the terminal following your instructions and then reflashed the MM zip from the original link and... still encrypted.
I haven't tried flashing the kdz yet, as I use Linux and I don't believe there is a way to flash kdz files using *nix. I'll have to wait until the weekend and I'll try and do it via a VM.
I don't understand how this encrypted partition is still even there. I have CM12 installed and working, it's showing the full amount of disk space available, I've done multiple wipes, formats and resets, yet the minute I put MM on it, the phone thinks it's encrypted again.
I do actually know the encryption key, is there any way I can unlock the phone via ADB or something similar?
Not sure if it's relevant, but my phone model is D855. I don't think I mentioned that before.
Thanks for the help, I really appreciate it!
TTib said:
Hi, thanks for the advice, I gave it a try last night. My /data partition was named /dev/block/mmcblk0p43 according to DiskInfo, so I made sure the partition was unmounted in TWRP and formatted it via the terminal following your instructions and then reflashed the MM zip from the original link and... still encrypted.
I haven't tried flashing the kdz yet, as I use Linux and I don't believe there is a way to flash kdz files using *nix. I'll have to wait until the weekend and I'll try and do it via a VM.
I don't understand how this encrypted partition is still even there. I have CM12 installed and working, it's showing the full amount of disk space available, I've done multiple wipes, formats and resets, yet the minute I put MM on it, the phone thinks it's encrypted again.
I do actually know the encryption key, is there any way I can unlock the phone via ADB or something similar?
Not sure if it's relevant, but my phone model is D855. I don't think I mentioned that before.
Thanks for the help, I really appreciate it!
Click to expand...
Click to collapse
very strange when i did that it got rid of my encrypted partition... i'm not sure what else to say except maybe see if someone will lend you a windows pc to do kdz flash.
KronicSkillz said:
very strange when i did that it got rid of my encrypted partition... i'm not sure what else to say except maybe see if someone will lend you a windows pc to do kdz flash.
Click to expand...
Click to collapse
I flashed the kdz via LGUP and... now the phone won't boot to anything except TWRP. Have tried restoring two previous nandroid backups, installing CM12 and MM, all install without reporting errors. LGUP detects it as an unknown device, so can't flash kdz again. Might have bricked this one. :crying:
Phew. Okay, solved! I followed the following guide to flash an old version of the stock firmware: http://www.androidrootz.com/2014/07/how-to-unroot-lg-g3-all-variants.html.
Then, I upgraded, rooted, flash TWRP and finally installed MM again and it seems to be back to normal ("Android is starting" screen as we speak. Fingers crossed!). Thanks to everyone who helped me out with this one!

F2FS on OOS4.0.. Help me decide please!

Hello,
I've just installed the new OOS4.0, and I also wanted to update the filesystem to F2FS:
I've managed to get everything working with twrp-3.0.2-1.28 (ext4 cache/system - f2fs userdata) but then, I enrcypted the data via the settings menu, and now the TWRP fails to decrypt (password invalid). I understand that this is some kind of incompatibility since if I try with the official recovery it decrypts without problems.
Since I still have to copy all my userdata to the phone and install everything, what should I do before?
a) Keep data encrypted and wait for a TWPR fix, and eventually flash with the official recovery if needed?
b) Reformat and keep the data unencrypted?
c) You tell me?
Thank you for your help.
Hurizen said:
Hello,
I've just installed the new OOS4.0, and I also wanted to update the filesystem to F2FS:
I've managed to get everything working with twrp-3.0.2-1.28 (ext4 cache/system - f2fs userdata) but then, I enrcypted the data via the settings menu, and now the TWRP fails to decrypt (password invalid). I understand that this is some kind of incompatibility since if I try with the official recovery it decrypts without problems.
Since I still have to copy all my userdata to the phone and install everything, what should I do before?
a) Keep data encrypted and wait for a TWPR fix, and eventually flash with the official recovery if needed?
b) Reformat and keep the data unencrypted?
c) You tell me?
Thank you for your help.
Click to expand...
Click to collapse
Question you have to ask yourself is why do you need twrp?
As of right now, unless you're a flashaholic, twrp in ob/OOS4.0 is only used for rooting purposes and custom kernels (not too many out there and stock kernel is pretty good). If you don't flash root before first boot (fresh flash or data wipe) , it will encrypt and you will have twrp pin issues.
If you're planning on sticking with ob/OOS4.0 for a while, you might as well just stick with stock recovery and just adb sideload the ob/oos roms.
When xposed gets release for Android 7.x, twrp will become quite popular.
I'll just stick with stock recovery for a while then.. Thank you!

boot up pin

Hello,
Whenever i encrypt my phone on DU, when i set the lock screen Password it asks me if i want the phone to ask it to be able to boot, but then, the phone refuses to boot and says that the Password is wrong.
But when i boot into twrp the Password works and i can decrypt the data partition.
I already had the issue but with the phone accepting the boot pin but twrp not.
This is on a fresh DU install with previously formated data partition.
DO NOT encrypt via custom roms: it's cause of troubles and compatibility issues, especially when returning to OxygenOS.
So:
1) Put device in bootloader mode, plug it to computer, type fastboot format userdata via ADB terminal.
2) Go in TWRP and wipe all the partitions (be sure to have /cache formatted in ext4, otherwise change its filesystem):
3) Always from TWRP, flash latest OOS firmware (4.1.6 or OB19);
3) Reboot and configure setup with your PIN required at bootup;
4) After completing wizard, reboot in TWRP;
5) Now you can wipe anything and flash your rom.
Now device should require your PIN even at first boot of DU.
Ps until doing another fastboot format userdata, device will keep encryption.
Simone98RC said:
DO NOT encrypt via custom roms: it's cause of troubles and compatibility issues, especially when returning to OxygenOS.
So:
1) Put device in bootloader mode, plug it to computer, type fastboot format userdata via ADB terminal.
2) Go in TWRP and wipe all the partitions (be sure to have /cache formatted in ext4, otherwise change its filesystem):
3) Always from TWRP, flash latest OOS firmware (4.1.6 or OB19);
3) Reboot and configure setup with your PIN required at bootup;
4) After completing wizard, reboot in TWRP;
5) Now you can wipe anything and flash your rom.
Now device should require your PIN even at first boot of DU.
Ps until doing another fastboot format userdata, device will keep encryption.
Click to expand...
Click to collapse
Thanks for the answer, do you know why custom rom encryption doesnt work ? I used to to this on my old s5 and it worked perfectly
nikexv2 said:
Thanks for the answer, do you know why custom rom encryption doesnt work ? I used to to this on my old s5 and it worked perfectly
Click to expand...
Click to collapse
Maybe if you give his post a thumbs up he might continue helping you out , I mean that's the least you could do ......
Xceeder said:
Maybe if you give his post a thumbs up he might continue helping you out , I mean that's the least you could do ......
Click to expand...
Click to collapse
If members had to wait for thumbs up before they answer to someone's post then they wouldn't answer most of them.
What kind of **** philosophy is this, i hope for you that's not your way of thinking everyday.
And even, that's none of your business, maybe i forgot to like his post ?
Come on, do not vent on XDA, do not make useless quarrels ?
@nikexv2 sorry, but technically speaking, I don't know the reason of problematic encryption on custom roms.
Just enable encryption with official firmware and there's no other compatibility issue.
Encryption still remains when you full wipe device via recovery.
Have a good day.
nikexv2 said:
If members had to wait for thumbs up before they answer to someone's post then they wouldn't answer most of them.
What kind of **** philosophy is this, i hope for you that's not your way of thinking everyday.
And even, that's none of your business, maybe i forgot to like his post ?
Click to expand...
Click to collapse
It works like this - you ask for help and if someone gives you good advice or helps you out in any way then a quick thumbs up is appreciated , it's just courtesy but anyway I hope you get your phone sorted out ...
nikexv2 said:
Hello,
Whenever i encrypt my phone on DU, when i set the lock screen Password it asks me if i want the phone to ask it to be able to boot, but then, the phone refuses to boot and says that the Password is wrong.
But when i boot into twrp the Password works and i can decrypt the data partition.
I already had the issue but with the phone accepting the boot pin but twrp not.
This is on a fresh DU install with previously formated data partition.
Click to expand...
Click to collapse
Not sure what's wrong with your set up but I came from OOS OB19 to DU, wiped userdata to switch data to ext4, flashed DU + beans gapps (recommended for DU) then booted up, encrypted my phone via Settings > Security and set ask pin on booting device, same pin has worked on all ROMs, even tried some OOS based ones like Freedom OS CE, now on Omni + open gapps, I'm using blu spark latest recovery.

Possible to decrypt the Razer Phone?

I haven't been able to decrypt the Razer Phone yet, I want viper4android to work on it but it refuses because of encryption.
I've tried these things directly after a fresh flash without booting in to the system:
1. Formatting Data in Twrp (causes bootloop)
2. Trying to get rid of it via Magisk flashing tricks. (No success, still encrypted)
3. Modified .fstab files from "forceencrypt=" to "encryptable". (No success, still encrypted)
Anyone got any ideas on how to get rid of encryption? I'm out of ideas for now.
Thanks in advance
Fastboot erase data
RUNNERX said:
Fastboot erase data
Click to expand...
Click to collapse
Totally forgot about fastboot. However, it doesn't seem to work, it throws me a error message.
I tried these commands:
fastboot erase data (Doesn't work like I said.)
fastboot format data (Doesn't work)
fastboot erase userdata (Doesn't work)
fastboot format userdata (Command works, but bootloops after reboot)
(Edit1: Can't remember what it was, but I do know it said FAILED.)
(Edit2: My drivers are properly installed btw)
Sorry for double post but have anyone successfully decrypted it yet?
I tried the things that worked for me in the past but still haven't managed to get anywhere. Now that more time has gone by have you had any luck?
In magisk there is a "preserve force encryption". I'm so afraid of losing data that I have not tried this option.
Munk0 said:
I tried the things that worked for me in the past but still haven't managed to get anywhere. Now that more time has gone by have you had any luck?
In magisk there is a "preserve force encryption". I'm so afraid of losing data that I have not tried this option.
Click to expand...
Click to collapse
I've been looking at the kernel source for the Razer Phone, it seems like during the first boot the kernel encrypts data. So for the past month I've been learning how to build kernels and succeded quite a bit with different phones (Galaxy S5/S7/S8 and Pixel 2), however the Razer Phone I've not had much success with yet, still working out build errors and other stuff.
So the kernel might be what encrypts data and a custom kernel with encryption deactivated might help, but it would be nice if anyone have the solution to decrypt WITHOUT a custom kernel.
However I'm not 100% sure if it really is the kernel doing it, so take my post with a grain of salt.
If you find something else about decryption, please tell me aswell.
Best regards,
Nao

Categories

Resources