[Q] Encrypting phone, using TWRP, and custom roms - ONE Q&A, Help & Troubleshooting

Does anyone know a way to use encrypted phone and use TWRP and flash custom roms with it?
The thing is that my company Exchange server needs the phone to be encrypted to be able to sync mails, contacts and calendar.
It seems TWRP can't flash custom roms while the phone is encrypted?
What I have done/tested this far:
1) Flash CM11S 44S with the fastboot images so the phone is completely stock.
2) After reboot I encrypted the phone
3) Reboot to fastboot and flash TWRP
4) reboot back to CM11S to see it still works
5) Reboot back to recovery and flash CM12 rom (with full wipe)
After I reboot I get to the screen asking my PIN code to decrypt the phone. After inserting the pin I get a screen which just states that the PIN was correct but my data is corrupted and I need to do a factory reset.
After factory reset, the same info comes up at the next boot.
IS there a way to make this work?

Different ROMs might use slightly different methods of encryption. So I guess you can't really make big ROM changes when encrypted. Cm11s to cm11 might work bit you are probably not too interested in that.

I started to use Nine app for mails and stuff. Nine keeps the east policies on app basis so I can continue to use my phone with cm and have work mails etc on the phone

Related

Root = bootloop on 5.0.1

Hi all,
So I'm far from a noob at at all of this (doing the custom android thing for years). But I'm not exactly constantly fiddling with my phone all the time anymore either. Basically I get a set-up that works for me, and I stick with it.
I've patiently been waiting to update to Lollipop. And today I did it. I did it by flashing the required factory images with fastboot.
AND IT WORKS. No problem. It boots. I go through the initial set-up. I can let it restore all my apps and passwords from the google servers, etc. So far so good.
My problem is that I cannot root. After I try, it bootloops (stuck at the Google splash, with my unlocked icon).
I tried to root before my first boot. I tried after the initial boot (before set-up and signing in). I tried rooting after setting it all up, and singing in, and letting google restore all of my apps. No matter which sequence I try, it will reboot a couple times at the first Google splash, and then fall back to Recovery.
(So, I'm on back on my rooted 4.4.4 nandroid, I think it's Mahdi Rom-- I forget)
Vital Stats:
Trying to install factory images of 5.0.1, all stock (system, boot (kernel), radio, bootloader)
Factory reset
(the above works fine)
TWRP 2.8.1.0
SuperSU-v2.40 (flashed via recovery)
Any ideas? Thanks for any help.
No, but could you try the previous version of SuperSU? Just to rule out the new version that I haven't tested please?
I updated to 5.0.1 earlier
Flashed all the img files exact userdata and then booted in to Android.
I then flashed TWRP 2.8.1.0 and used that to flash SuperSU 2.37
All that worked fine.. I then did a play update and SuperSU updated to 2.40
All working fine as far as I can tell. Apps needing root are working!
iowabeakster said:
Hi all,
So I'm far from a noob at at all of this (doing the custom android thing for years). But I'm not exactly constantly fiddling with my phone all the time anymore either. Basically I get a set-up that works for me, and I stick with it.
I've patiently been waiting to update to Lollipop. And today I did it. I did it by flashing the required factory images with fastboot.
AND IT WORKS. No problem. It boots. I go through the initial set-up. I can let it restore all my apps and passwords from the google servers, etc. So far so good.
My problem is that I cannot root. After I try, it bootloops (stuck at the Google splash, with my unlocked icon).
I tried to root before my first boot. I tried after the initial boot (before set-up and signing in). I tried rooting after setting it all up, and singing in, and letting google restore all of my apps. No matter which sequence I try, it will reboot a couple times at the first Google splash, and then fall back to Recovery.
(So, I'm on back on my rooted 4.4.4 nandroid, I think it's Mahdi Rom-- I forget)
Vital Stats:
Trying to install factory images of 5.0.1, all stock (system, boot (kernel), radio, bootloader)
Factory reset
(the above works fine)
TWRP 2.8.1.0
SuperSU-v2.40 (flashed via recovery)
Any ideas? Thanks for any help.
Click to expand...
Click to collapse
Try not doing that? When you go through the initial configuration, choose "Set up as a new device". Maybe the restore is somehow corrupting SuperSU?
BirchBarlow said:
Try not doing that? When you go through the initial configuration, choose "Set up as a new device". Maybe the restore is somehow corrupting SuperSU?
Click to expand...
Click to collapse
It happens even if I try to root before setting anything up at all.
albert_htc,
Are you saying: I should also flash the stock recovery first. Then boot for the first time. Then re-flash TWRP. Then flash SuperSU.
I never flashed the stock recovery. TWRP was on already on it.
Thanks guys. I'll give it another rip (doing stock recovery, then flashing back to TWRP) sometime soon.
iowabeakster said:
It happens even if I try to root before setting anything up at all.
albert_htc,
Are you saying: I should also flash the stock recovery first. Then boot for the first time. Then re-flash TWRP. Then flash SuperSU.
I never flashed the stock recovery. TWRP was on already on it.
Thanks guys. I'll give it another rip (doing stock recovery, then flashing back to TWRP) sometime soon.
Click to expand...
Click to collapse
Yes, flash the factory image using the batch file so every partition gets re-flashed. Now I'm thinking maybe your recovery is corrupt.
Run flash-all.bat and when your device reboots, go through all of the initial configuration and download all of the Gapps updates. Once that's all completed, go ahead and route using TWRP. If you find yourself still having the same problem, try live booting TWRP to flash SuperSU.
BirchBarlow said:
Yes, flash the factory image using the batch file so every partition gets re-flashed. Now I'm thinking maybe your recovery is corrupt.
Run flash-all.bat and when your device reboots, go through all of the initial configuration and download all of the Gapps updates. Once that's all completed, go ahead and route using TWRP. If you find yourself still having the same problem, try live booting TWRP to flash SuperSU.
Click to expand...
Click to collapse
I'm not going to flash over my user data, nandroids, app back-ups, etc. I'll stay with kit kat forever on my nexus 5 before I do that. Version numbers aren't that important. Hours wasted getting things set-up again are.
My recovery works fine. Both on kit kat and lollipop. My only problem is a boot loop when I flash SuperSU (via TWRP), on lollipop. I will try flashing stock recovery, though and then reflashing TWRP.
iowabeakster said:
I'm not going to flash over my user data, nandroids, app back-ups, etc. I'll stay with kit kat forever on my nexus 5 before I do that. Version numbers aren't that important. Hours wasted getting things set-up again are.
My recovery works fine. Both on kit kat and lollipop. My only problem is a boot loop when I flash SuperSU (via TWRP), on lollipop. I will try flashing stock recovery, though and then reflashing TWRP.
Click to expand...
Click to collapse
It's a tedious process, but it really isn't all that hard to back everything up to a computer, and you can do it easily with fastboot and a single command line.
Or what I'd recommend doing is just booting up, backing up all folders to a PC and then resetting and restoring later, backup apps with Titanium Backup (what I always do). A lot of us flashed factory images when Lollipop came out, so it isn't that bad once you start on the road.
Have you tried rooting from the bootloader via Chainfire's cf-auto root? I know I've read that sometimes rooting from recovery doesn't work properly, and that only certain zips will work. I've used the auto root each time (from stock fastboot flashing 5.0 & 5.0.1) with lollipop and it works fine. Link
Unzip and run batch file in bootloader. It will wipe everything if you haven't already unlocked bootloader (fastboot oem unlock). If you are already unlocked it won't wipe anything.
snappycg1996 said:
It's a tedious process, but it really isn't all that hard to back everything up to a computer, and you can do it easily with fastboot and a single command line.
Or what I'd recommend doing is just booting up, backing up all folders to a PC and then resetting and restoring later, backup apps with Titanium Backup (what I always do). A lot of us flashed factory images when Lollipop came out, so it isn't that bad once you start on the road.
Click to expand...
Click to collapse
I just backed the /sdcard, to my PC. I just re-ran titanium.
I can deal with "/sdcard issues" from updating to lollipop easy enough. That's a 30 second fix. I can deal with setting up my email accounts to my email client app. I can deal with launcher settings, and all the other apps, widgets, etc. Those are things that I can slowly get back to where I want. They aren't critical. But yeah, very tedious.
I think "starting over" may be much more tedious for me than most people though. I run ssh servers and clients on all PCs, servers, and phones (disabling passwords and using rsa encryption keys for security). It's very nice, once I get it all set up in that I can access everything (from anything) very easily. I do need root for that though also.
But if I can't just hit a "restore" to get it all my ssh addresses, keys, fingerprits, etc back to where it was and then I have to: reverify new fingerprints, generate new keys, re-enable passwords to transmit new keys for everything, then disable passwords (for all machines) ... well... I just get very very grumpy.
anactoraaron said:
Have you tried rooting from the bootloader via Chainfire's cf-auto root? I know I've read that sometimes rooting from recovery doesn't work properly, and that only certain zips will work. I've used the auto root each time (from stock fastboot flashing 5.0 & 5.0.1) with lollipop and it works fine. Link
Unzip and run batch file in bootloader. It will wipe everything if you haven't already unlocked bootloader (fastboot oem unlock). If you are already unlocked it won't wipe anything.
Click to expand...
Click to collapse
I'll check that out. Thanks.

Pixel 2 TWRP 3.3.0-0 not decrypting data partition

Tried flashing the latest Magisk update in fastboot (v20) with the latest Android 10 update, and my phone went into bootloop, so I reflashed the factory boot.img and got stuck loading on the G splash screen for 16 hours until I shut it off. I booted TWRP to backup the /data partition before reflashing to factory and starting fresh, but it won't mount (shows 0mb) and doesn't prompt for any decryption passwords. Won't boot OS even with dirty flash and OTAs. I need to backup the data partition because I have a lot of important user data on it. Any advice on getting TWRP to decrypt the data (had fingerprint set up with PIN as unlock)?
Seeing as how it's 4 days after your post, I'm going to guess you've already learned that you're pretty much FUBARed. I had the same thing happen last month. Unfortunately, the only way out is through, and in this case that means going through the process of a full wipe and the subsequent hours/days of installing all your user apps and setting everything up from scratch.
This is because of a incompatibility in recent builds of TWRP with Pixel2 images past April that makes it impossible to decrypt the data partition. The only workaround is to wipe the entire device, install the Pixel2 factory image from April, flash TWRP, boot the device and setup your password/pin, boot into TWRP and decrypt the device one time, and then flash the latest Pixel2 factory image and TWRP/Magisk like normal. Outside of that, the only other option is to remove your password/pin every time you need to access recovery.
As for the exact details of how or why this is an issue, I can't say, as I don't have the technical know how to parse a lot of what I've read about the problem, only just enough to understand what the problem is and how to get around it.

How to bypass recovery password

Hello,
This is my story:
I have my Mix 2S for few months for now and I have been trying many custom roms (Pixel Experience, LineageOS etc.). Today I wanted to restore backup with PE and then my problems begin.
Everything was fine until I rebooted, after that I could only boot into recovery. So I got into recovery and decided to format data. Data formatted without any problems, I copied by backup with all files from computer, wiped everything and then tried to restore PE. It couldn't restore data, so I decided to restore ROM only (I have lost clean zip, my connection is slow, so I have to download it for an hour (tomorrow I will try). Then I tried to reboot, the effect was similar but...
I can't get into my recovery because there is a password. I know my password because I set it by myself but I believe that restore was not fully fine.
I use OrangeFox recovery (10.3 if I remember good), my phone has an unlocked bootloader, I can get into fastboot but I can't flash anything because nothing happens. I tried to install driver for it but I don't see the difference.
I had a fingerprint set in system. I have the whole backup.
My phone version is 6/128.
I can't find anything, maybe stress makes me a fool.
EDIT
I found a solution, the whole problem was caused by Windows 10 feature that blocks files from the Internet. I had to unlock recovery file (TWRP) and now I can do anything with my phone.

Restoring data from stock 11.1.1

Hi,
So it seems when i restore data via TWRP it triggers the protection which encrypts the whole sdcard, can this be avoided?
Here are the steps i did:
Full wipe
fastboot boot twrp (Nebrassy)
sideload stock 11.1.1
sideload magdisk
Finished setting up the device
Then booted twrp again
Did full backup
And then it never boot again to system... no idea why could be the twrp.
Now i'm stuck with this backup, every time i restore it, the entire sdcard gets encrypted.
I've tried flashing both stock boot and patched boot but it didn't help
Any ideas or should i do it all again and lose twrp, seems to be very buggy at v11.1.1
I managed to solve this issue myself.
Encryption is forced by default since android v10 i think so that means when you try to flash any data it has to be either the same type or it would encrypt the whole internal storage, i.e. you can backup just fine but if you restore and reboot the phone will tamper with all the data making it unreadable.
You need to disable encryption first then flash the data and then it works fine, unless you disabled it to begin with of course.
Another key point here is that when the phone encrypts the entire storage you won't be able to flash anything else until you completely erase everything.
Wasted hours on this on OP6 and OOS 11.1.1 + Unofficial Twrp,
Here is a short summary of the main points:
Full backup from TWRP works fine but copy it elsewhere or you might lose it when restoring
If you booted into encryption i used to flash lineageos recovery then boot into it and do a full wipe, then flash twrp back. i don't think it works from that twrp version
If you want to disable encryption or restore backups use this one (only one that worked) https://forum.xda-developers.com/t/...ncrypt-disk-quota-disabler-11-2-2020.3817389/
If you want OOS v11.1.1 + TWRP + Root + Backups do it in the following order: Unlock Bootloader, Boot TWRP, Install TWRP permanently, Flash Magdisk, Flash DFE
Not sure it's important but lineageos has a script for A\B slot phones like OP6 to sync slots, should be used at least once after flashing V11 just in case to avoid possible problems https://wiki.lineageos.org/devices/enchilada/install
I'm also adding stock and patched boot images in case someone needs them.

Stuck in Bootloop | TWRP installed

Hi, i just got my old 5 year old (now retired) device to bootup because someone had made a kernel for the device which supports overclocking so for the fun I wanted to try it
but there was one weird problem, it seemed that though the root permissions from years ago remained just like they were but magisk manager itself had lost root permissions though I was still able to grant root permissions to other applications normally
I was on an unofficial Lineage OS build and thought of returning to original Miui for the device, got the fastboot rom, got Mi flash, flashed it, booted up
but there was a catch, it would always throw an error on the login Miui account screen at startup saying "Couldn't check device security, please try again"
I had tried everything possible including:
adding a Xiaomi account
skipping sign in
Inserting a sim
None of them seemed to do anything so i flashed twrp recovery again as using mi flash to flash ur device's stock rom gets rid of custom recovery
Now here is the mistake I made
**I wiped the device clean using TWRP**
now i tried going into adb sideload mode, no matter what I did my PC wouldn't detect my device, tried going into fastboot mode and still my PC wouldn't recognise the device and same goes for Mi flash tool
additionally the device would automatically exit out of fastboot mode within 2 minutes and go on to the power off screen
I do have charge on the device it says it's at 87% on the TWRP menu
I can no longer bootup, im stuck at the MI logo on bootup
Device: Mi Max 2
Additional notes: I am not in a hurry as that is not my primary device so it is okay if you want to take your time to reply, even if there's no way i can get my phone to see the light of day again it's alright as the phone was retired and sitting collecting dust for 2 years now
I do not wish to visit a service center as it's not worth it for a device I'm just gonna use for a few hours then put it back into its grave again
just download that same, or another custom ROM, and flash it via TWRP (just put ROM in SD card).
Nothing is gone, i mean if you delete system via twrp of course it will bootloop as it don't have system.
And for reverting back to original stock ROM , i think it have to do something with encryption, or maybe just the fact you unlocked bootloader.
Best is to stay away from stock ROM, find some custom ROM which have similar to MIUI (stock rom) , somewhat improved, if you want to get as much stock ROM experience.
kraken-gz said:
just download that same, or another custom ROM, and flash it via TWRP (just put ROM in SD card).
Nothing is gone, i mean if you delete system via twrp of course it will bootloop as it don't have system.
And for reverting back to original stock ROM , i think it have to do something with encryption, or maybe just the fact you unlocked bootloader.
Best is to stay away from stock ROM, find some custom ROM which have similar to MIUI (stock rom) , somewhat improved, if you want to get as much stock ROM experience.
Click to expand...
Click to collapse
Hi, thanks for the reply, I tried using an SD card and unfortunately it wouldn't detect that too, what i found was I didn't wipe System it still shows that it's taking up some place (3597 MB)
i would be fine getting a custom rom on the device infact i have crdroid ready to be installed
could it be that the TWRP i installed (yes I downloaded the latest version and didn't flash the old one i had years ago) have some bugs? (I did install it from official TWRP website)
also note: though you see a Senior Member title below my name, im a complete and utter noob
BR4UTAL said:
Hi, thanks for the reply, I tried using an SD card and unfortunately it wouldn't detect that too, what i found was I didn't wipe System it still shows that it's taking up some place (3597 MB)
i would be fine getting a custom rom on the device infact i have crdroid ready to be installed
could it be that the TWRP i installed (yes I downloaded the latest version and didn't flash the old one i had years ago) have some bugs? (I did install it from official TWRP website)
also note: though you see a Senior Member title below my name, im a complete and utter noob
Click to expand...
Click to collapse
Lol I thought I was the only proper noob here on xda but nice to meet other noobs here too .
I think Kraken-gz is right, once the older devices are OEM off-support its best to stay away from OEM servers, I lost couple of old lesser-known-brand devices to OEM mischief i'd say coz it happened twice to me when I reloaded the original ROMs and tried to connected to the net they went dead on the next bootup, I think the OEMs have something going on there to boot out the older devices so newer ones could be pushed in the market sooner than they were supposed to. Possible.
so, first, in twrp, try to completely format it, follow this to do it
Just, a note: in advanced wipe delete system, data, dalvik cache and cache.
When trying to reboot into system, make sure twrp complains that it have no system. (that way, you know you deleted it)
reboot it, again in twrp.
try to flash custom ROM, should work as it have clean memory.
If it doesnt flash, then make sure to note all log file from twrp while flashing, and post it here, in order to see, what failed in flashing. If it succeds, it should load custom rom . If custom rom dont work, try another one, maybe older, or one that you had previous time (before trying to go into stock rom) (just, to try to boot it somehow. But before trying another custom rom, if one fails, do proper wiping described above.
If that fails try to download oldest stock ROM, and flash it. Maybe newest is blocking it.
If that fails, there is something called EDL mode, when fastboot is not available (for hard brick, like this).
here is video just to give you overview how to do it
and text also
Edit:
WAIT, try to format it, without wiping system. maybe it will boot again.
If not, other solutions are not applicable, if you dont find way to detect that sd card. Only EDL remains.
kraken-gz said:
so, first, in twrp, try to completely format it, follow this to do it
Just, a note: in advanced wipe delete system, data, dalvik cache and cache.
When trying to reboot into system, make sure twrp complains that it have no system. (that way, you know you deleted it)
reboot it, again in twrp.
try to flash custom ROM, should work as it have clean memory.
If it doesnt flash, then make sure to note all log file from twrp while flashing, and post it here, in order to see, what failed in flashing. If it succeds, it should load custom rom . If custom rom dont work, try another one, maybe older, or one that you had previous time (before trying to go into stock rom) (just, to try to boot it somehow. But before trying another custom rom, if one fails, do proper wiping described above.
If that fails try to download oldest stock ROM, and flash it. Maybe newest is blocking it.
If that fails, there is something called EDL mode, when fastboot is not available (for hard brick, like this).
here is video just to give you overview how to do it
and text also
Edit:
WAIT, try to format it, without wiping system. maybe it will boot again.
If not, other solutions are not applicable, if you dont find way to detect that sd card. Only EDL remains.
Click to expand...
Click to collapse
Tried wiping data, cache and dalvik cache and formatting data, none seemed to help
and still no sd card being detected
Now edl mode
I would love to boot into edl mode but the thing is my device isn't being recognised by adb nor is it being recognised by fastboot commands
so that's where I'm stuck for now
OldNoobOne said:
Lol I thought I was the only proper noob here on xda but nice to meet other noobs here too .
I think Kraken-gz is right, once the older devices are OEM off-support its best to stay away from OEM servers, I lost couple of old lesser-known-brand devices to OEM mischief i'd say coz it happened twice to me when I reloaded the original ROMs and tried to connected to the net they went dead on the next bootup, I think the OEMs have something going on there to boot out the older devices so newer ones could be pushed in the market sooner than they were supposed to. Possible.
Click to expand...
Click to collapse
Perhaps that is true

Categories

Resources