Question Broken encryption after deleting lockscreen from TWRP - Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40

Hello, I have a little f3 running miui 14 based on Android 13 I forgot my lock pattern I tried to solve it by deleting the lockscreen file from twrp it already removed the screen lock but when I enter the device it leaves me locked, that is, when I try to open an application I get locked indicates a sign that says wait until the device is completely rebooted before opening applications failure caused by this action that I did from twrp . when accessing the security section Where it is encrypted and credentials it appears to me as encrypted and when I touch it it does nothing .I know that the solution is to make a full flash but the photos that I have inside the phone are extremely important and I don't have backup copies of them almost 30 gigabytes of family photos so I ask for any help or explanation that can help me I have advanced knowledge in this field but had never experimented with the security of Andorid 13 from Miui. logically I tried to connect it to the PC in mtp mode but it does not show me any device driver problem it is not only that the Data partition is encrypted from twrp it asks me for a password

Skyfall191299 said:
I tried to solve it by deleting the lockscreen file from twrp it already removed the screen lock
Click to expand...
Click to collapse
You have access on /data through TWRP. Problem solved.

@Skyfall191299 please don't ask off-topic. you have deleted locksettings.db which contains the necessary link to synthetic password. Either restore the backup of locksettings.db and remember your pattern, or factory reset device. there is no way to decrypt userdata without pattern, not even in TWRP*
WoKoschekk said:
You have access on /data through TWRP. Problem solved.
Click to expand...
Click to collapse
* only for some recent insecure MIUI ROMs with FBE or older ROMs with no FBE encryption at all.

alecxs said:
only for some recent insecure MIUI ROMs with FBE or older ROMs with no FBE encryption at all.
Click to expand...
Click to collapse
He deleted /data/system/locksettings.db! With an encrypted device it's impossible to find and delete that single file on /data.

but how he deleted without knowing the pattern?

alecxs said:
but how he deleted without knowing the pattern?
Click to expand...
Click to collapse
don't ask me... ask @Skyfall191299

WoKoschekk said:
You have access on /data through TWRP. Problem solved.
Click to expand...
Click to collapse
I mean the personal data of the mobile, not the /data path, when I enter /storage (where the user's folders are stored) nothing appears

Skyfall191299 said:
not the /data path, when I enter /storage (where the user's folders are stored) nothing appears
Click to expand...
Click to collapse
Everything you stored or installed since last factory reset is stored on /data. Everything. Your /storage/emulated/0 path isn't mounted in TWRP but you have /sdcard instead. But both of those paths are only tmpfs that lead to /data/media. That's exactly that path that TWRP does not backup. It's your internal storage.

Skyfall191299 said:
Hello, I have a little f3 running miui 14 based on Android 13 I forgot my lock pattern I tried to solve it by deleting the lockscreen file from twrp it already removed the screen lock but when I enter the device it leaves me locked, that is, when I try to open an application I get locked indicates a sign that says wait until the device is completely rebooted before opening applications failure caused by this action that I did from twrp . when accessing the security section Where it is encrypted and credentials it appears to me as encrypted and when I touch it it does nothing .I know that the solution is to make a full flash but the photos that I have inside the phone are extremely important and I don't have backup copies of them almost 30 gigabytes of family photos so I ask for any help or explanation that can help me I have advanced knowledge in this field but had never experimented with the security of Andorid 13 from Miui. logically I tried to connect it to the PC in mtp mode but it does not show me any device driver problem it is not only that the Data partition is encrypted from twrp it asks me for a password
Click to expand...
Click to collapse
CC: @WoKoschekk
@Skyfall191299 In order to declutter the following thread on advice of my esteemed team mate @alecxs
[Deprecated] Universal DM-Verity, ForceEncrypt, Disk Quota Disabler [11/2/2020]
Hi all! For the past couple of months, I've been looking into making a more universal solution to disable dm-verity and forceencrypt. Needing to take different zips, modify them for different devices, and then cross your fingers when you switch...
forum.xda-developers.com
I've moved your above quoted post and other related posts out of that thread and create a new one for you in order to be able to discuss issue with broken encryption after deleting lockscreen from TWRP.
Regards
Oswald Boelcke
Senior Moderator

Related

Encrypted SD files are locked

I chose to encrypt the files on my SD card using the option in under system. i have flashed to a new ROM and forgot to copy the files from my SD to my PC and now they all have locks on them and i cannot open them . anyone know how i can unlock them in any way or do i need to just delet them and move on?
TIA
Based on what I know of how the encryption works, I think you're going to be stuck deleting the files and moving on. Everything I've read says that you can't recover files encrypted by one handset on a different handset (which your newly flashed handset is, in terms of the encryption algorithm).
Sorry.
celith said:
Based on what I know of how the encryption works, I think you're going to be stuck deleting the files and moving on. Everything I've read says that you can't recover files encrypted by one handset on a different handset (which your newly flashed handset is, in terms of the encryption algorithm).
Sorry.
Click to expand...
Click to collapse
Thanks for your help
Yep, they're gone. When you flashed, you wrote over the key you need to decrypt them.

Encrypting just reboots the phone

I want to encrypt my OnePlus 3 but every time I hit "encrypt" my phone just reboots.
So I took a look at the logs and it says "Orig filesystem overlaps crypto footer region. Cannot encrypt in place."
So even after spending about 2 hours looking into this issue all I could find is that apparently android needs about 16KB of space at the end of some partition.
I found some how to's but unfortunately the steps are very complicated and I don't know how to follow them on the OnePlus 3.
So does anybody know how to solve this issue? There is an resize option in TWRP but it doesn't give you any options and doesn't solve the problem.
My OP3 already says it is encrypted. That's the way it came out of the box. Yours didn't? That's odd.
Sent from my D5803 using Tapatalk
Yes, it was encrypted out of the box but I installed TWRP and CM13. It seems like the partitioning got messed up somehow while wiping/formatting /data.
anyone23 said:
Yes, it was encrypted out of the box but I installed TWRP and CM13. It seems like the partitioning got messed up somehow while wiping/formatting /data.
Click to expand...
Click to collapse
After flash back OOS and doing a factory reset it will encrypt automatically again.
Planet X said:
After flash back OOS and doing a factory reset it will encrypt automatically again.
Click to expand...
Click to collapse
Yes, of course but I want to keep on using CM13.
Encryption is usually no problem with CM. I've been using CM with encryption on my Nexus 5 for 2 years.
I just don't know how to fix the partitioning.
Okay, after unsuccessfully playing around with the resize2fs command, I found the solution.
As resizing while Android is running doesn't work, I booted into TWRP, unmounted all partitions and then opened a terminal in the advanced menu.
I already knew that the /data partition is the one I needed to shrink and it's called /dev/block/sda15. So I used the command "resize2fs /dev/block/sda15 1xxx..."
On first try I accidentally used a number far too high but in the error message I got, it stated the current size and so I simply subtracted 40 from this value and ran the command again (4 should be enough for 16kb, but I wanted to make sure).
Well, now the encryption was successful.
I still think that this problem occurred after a format using TWRP and it needs be fixed as this is a problem very difficult to diagnose for the average person like me. TWRP seems to format the whole memory for /data but Android needs 16kb of free space for encryption.
I already had the same problem with encryption on a Moto G falcon after a TWRP format a few months ago.
anyone23 said:
Okay, after unsuccessfully playing around with the resize2fs command, I found the solution.
As resizing while Android is running doesn't work, I booted into TWRP, unmounted all partitions and then opened a terminal in the advanced menu.
I already knew that the /data partition is the one I needed to shrink and it's called /dev/block/sda15. So I used the command "resize2fs /dev/block/sda15 1xxx..."
On first try I accidentally used a number far too high but in the error message I got, it stated the current size and so I simply subtracted 40 from this value and ran the command again (4 should be enough for 16kb, but I wanted to make sure).
Well, now the encryption was successful.
I still think that this problem occurred after a format using TWRP and it needs be fixed as this is a problem very difficult to diagnose for the average person like me. TWRP seems to format the whole memory for /data but Android needs 16kb of free space for encryption.
I already had the same problem with encryption on a Moto G falcon after a TWRP format a few months ago.
Click to expand...
Click to collapse
I'm running cm13 with encryption on my OnePlus 3 too. I didn't had to resize my partitions.

Encrypted storage MI5S PROBLEM

Hey,
I don't remember but one rom which I tested encrypted my storage, I know the pattern key to unlock it but it's very irritating. What's more... I'm on xiaomi.eu rom now and I updated it yesterday up to latest version. It was dirty updated. Just downloaded package and updated form twrp. After reboot some apps don't want to open or they are opening like 5 minutes, literally! Apart that I can't access internal storage neither on phone nor at computer. Camera can't make photos cause there is no storage at phone.
What happened? How can I decrypt storage to get rid of this pattern while booting or flashing roms?
And what happened to. rom after update?
Can you help me guys?
I think flashing SuperSu then going to settings (in ROM) and disable security then reboot should disable it, worked once for me, but another time it didn't.. I think this feature is called secure boot or secure startup

TWRP Asking Password...

Earlier in OnePlus 3 days...
I have set up fingerprints to unlock my device with pattern lock.
Then ...
I had deleted ... The below mentioned files from data/system...
1. locksettings.db
2. locksettings.db-shm
3. locksettings.db-wal
4. gatekeeper.password.key
5. gatekeeper.pattern.key
Because i dont want any security on my phone but i want my fingerprints to unlock my device very quickly and after removed the above mentioned files, i did that no more secure lockscreen and fingerprints working fine.
Now... In 'OnePlus 5T'...
I have set-ups my fingerprints to unlock my device with pattern lock.
Then ...
I had deleted ... The below mentioned files from data/system...
1. locksettings.db
2. locksettings.db-shm
3. locksettings.db-wal
4. gatekeeper.password.key
5. gatekeeper.pattern.key
As i don't want any security in my phone because my family need my Phone sometimes so i want swipe up to unlock my phone and fingerprints to unlock my device very quickly but as in OnePlus 3 it was working very fine but in 'OnePlus 5T' it is not working... When i reboot my phone it is showing blank screen, no home screen only wallpaper is showing.
When i get back into TWRP recovery (Blu_Spark) it is asking me a password to unlock modification and i have deleted the lockscreen security files already though.
Any solution?
I know many of you will saying decrypt your phone.
So, i have already format data and wipe internal storage.
Still when i followed the above steps, it still ask me a password in TWRP recovery.
How to solve that issue?
Note: Please Do Not Suggest to me to entered family's member fingerprints or tell them the password or pattern as i simply mentioned above what i want.
The default password in TWRP is "default_password" (without quotation marks). You could try that...
Didgeridoohan said:
The default password in TWRP is "default_password" (without quotation marks). You could try that...
Click to expand...
Click to collapse
Thank you for the reply.
I have not tried that password but i will soon... any idea about the above first issue? Home screen is not showing anything, only showing Wallpaper of the phone?
Can someone let me know how to find the password ?
The default one (default_password) seems to not be working
Using bluespark TWRP by the way and stock Oxygen OS with fingerprint password
Not sure if the data partition is encrypted, but it sure does look like it as in TWRP file manager I can not browse in folders in sdcard properly since they folder names are hashed
Edit:
Nevermind
Removed the fingerprint and data is no longer encrypted
This is a weird one and I would still like to know how to bypass it by not always removing the fingerprint if possible
So if someone knows, feel free to reply back
Normas Interruptor said:
Thank you for the reply.
I have not tried that password but i will soon... any idea about the above first issue? Home screen is not showing anything, only showing Wallpaper of the phone?
Click to expand...
Click to collapse
I have the exact same issue!! I deleted the 5 keys and I can only see the wallpaper and it doesn't allow me to set a new pin. TWRP is asking me for a password that I never set. Did you ever figure out how to solve the problem? I would like to figure out how to decrypt my data before having to do a reformat... :crying:
CoCoGirl886 said:
I have the exact same issue!! I deleted the 5 keys and I can only see the wallpaper and it doesn't allow me to set a new pin. TWRP is asking me for a password that I never set. Did you ever figure out how to solve the problem? I would like to figure out how to decrypt my data before having to do a reformat... :crying:
Click to expand...
Click to collapse
Well, this issue only appear when you have encrypted device...
So, to get ride of this situation again... Just format data with yes command and always flash no-vrrity zip to stay decrypt now you can delete these 5 files and stay decrypted and you can use your phone without any issues.
Normas Interruptor said:
Well, this issue only appear when you have encrypted device...
So, to get ride of this situation again... Just format data with yes command and always flash no-vrrity zip to stay decrypt now you can delete these 5 files and stay decrypted and you can use your phone without any issues.
Click to expand...
Click to collapse
That will wipe my entire internal drive as well right? I don't mind using my phone encrypted, but I'd just want to get past the encryption now so that I can access and backup my files before flashing or formatting.
CoCoGirl886 said:
That will wipe my entire internal drive as well right? I don't mind using my phone encrypted, but I'd just want to get past the encryption now so that I can access and backup my files before flashing or formatting.
Click to expand...
Click to collapse
Yes! you are right, formatting data can format your entire storage including internal storage but that will be happens only once..... Install TWRP recovery by codeworkx universal and format data, that will be erase the entire storage for sure but once you done with that... copy and paste Oxygen OS ROM file along with No-verity.zip file...
first flash ROM then flash No-verity.zip so you can stay decrypted ever.
Flashing no-verity.zip all the time in every rom at last is the best practice to stay decrypted.
Normas Interruptor said:
Yes! you are right, formatting data can format your entire storage including internal storage but that will be happens only once..... Install TWRP recovery by codeworkx universal and format data, that will be erase the entire storage for sure but once you done with that... copy and paste Oxygen OS ROM file along with No-verity.zip file...
first flash ROM then flash No-verity.zip so you can stay decrypted ever.
Flashing no-verity.zip all the time in every rom at last is the best practice to stay decrypted.
Click to expand...
Click to collapse
Ah I see... the problem is that I don't have any backup of my files right now. So even if I format only once, my entire storage will be forever gone.
Did you figure out how to solve the problem of "when i reboot my phone it is showing blank screen, no home screen only wallpaper is showing" without reformatting?
CoCoGirl886 said:
Ah I see... the problem is that I don't have any backup of my files right now. So even if I format only once, my entire storage will be forever gone.
Did you figure out how to solve the problem of "when i reboot my phone it is showing blank screen, no home screen only wallpaper is showing" without reformatting?
Click to expand...
Click to collapse
You have to erase the entire storage that is the only solution... trust me i have faces this issue several times when my phone as not decrypted and i lost my entire storage almost 10 times
If you have a fingerprint set, OR a pin or password, your TWRP pass is ALWAYS the same as your phone pin or pass Just tried it on mine.
Normas Interruptor said:
You have to erase the entire storage that is the only solution... trust me i have faces this issue several times when my phone as not decrypted and i lost my entire storage almost 10 times
Click to expand...
Click to collapse
jesus christ!
McDumbdumb said:
If you have a fingerprint set, OR a pin or password, your TWRP pass is ALWAYS the same as your phone pin or pass Just tried it on mine.
Click to expand...
Click to collapse
Yup, that's the solution
LucasBass said:
Yup, that's the solution
Click to expand...
Click to collapse
Glad to get some confirmation, I was fairly certain this had worked across multiple TWRP versions, but glad to hear it works from other users
CoCoGirl886 said:
I have the exact same issue!! I deleted the 5 keys and I can only see the wallpaper and it doesn't allow me to set a new pin. TWRP is asking me for a password that I never set. Did you ever figure out how to solve the problem? I would like to figure out how to decrypt my data before having to do a reformat... :crying:
Click to expand...
Click to collapse
Same exact issue here as well. Did you ever find a solution without losing your data?
p3ric0 said:
Same exact issue here as well. Did you ever find a solution without losing your data?
Click to expand...
Click to collapse
Unfortunately no. I had to format in the end and lose 9 months of photos, data, etc :crying:.
Now I know not to mess with the lockscreen keys because the newer android versions (i think 6.0 and over) has a security patch to prevent access to phone even if you delete the keys. From now on, if your touchscreen doesn't work then your best bet is to boot into TWRP, plug in a mouse via OTG cable and try to flash a new rom, which should preserve your internal drive data.
CoCoGirl886 said:
Unfortunately no. I had to format in the end and lose 9 months of photos, data, etc :crying:.
Now I know not to mess with the lockscreen keys because the newer android versions (i think 6.0 and over) has a security patch to prevent access to phone even if you delete the keys. From now on, if your touchscreen doesn't work then your best bet is to boot into TWRP, plug in a mouse via OTG cable and try to flash a new rom, which should preserve your internal drive data.
Click to expand...
Click to collapse
Dammit I was afraid of that
I tried doing a factory reset (leaving internal storage) but now the phone gets stuck on the Welcome screen "One sec.."
My internal storage is encrypted so all the folders are hashed and I can't even recover any backups I had in the phone. ADB doesn't want to detect the device while it's in TWRP so I can't sideload adb. My only hope is to buy an OTG adapter today, put my latest twrp backup on a flashdrive, and hope I can recover that way.
Nope. The OTG adapter works but TWRP can recovery everything except data.. gives an error "extractTarFork() process ended with ERROR: 255" when I try. Sighhh
p3ric0 said:
Dammit I was afraid of that
I tried doing a factory reset (leaving internal storage) but now the phone gets stuck on the Welcome screen "One sec.."
My internal storage is encrypted so all the folders are hashed and I can't even recover any backups I had in the phone. ADB doesn't want to detect the device while it's in TWRP so I can't sideload adb. My only hope is to buy an OTG adapter today, put my latest twrp backup on a flashdrive, and hope I can recover that way.
Click to expand...
Click to collapse
You deleted the lockscreen keys from the OP right? If so, I don't think an OTG adapter would help. Because once you deleted the password then it will default to TWRP's password but it doesn't exist? However, if you never deleted the keys and can access TWRP's screen to enter your password then you should be able to decrypt and extract your backup. I had a pattern password and you can use the mouse connected to OTG cable to draw your pattern to unlock.
I'm actually having the same touchscreen issue on my device again... but the screen would randomly work. So I am waiting for it to start working before I reflash.
p3ric0 said:
Same exact issue here as well. Did you ever find a solution without losing your data?
Click to expand...
Click to collapse
CoCoGirl886 said:
You deleted the lockscreen keys from the OP right? If so, I don't think an OTG adapter would help. Because once you deleted the password then it will default to TWRP's password but it doesn't exist? However, if you never deleted the keys and can access TWRP's screen to enter your password then you should be able to decrypt and extract your backup. I had a pattern password and you can use the mouse connected to OTG cable to draw your pattern to unlock.
I'm actually having the same touchscreen issue on my device again... but the screen would randomly work. So I am waiting for it to start working before I reflash.
Click to expand...
Click to collapse
So, TWRP asking password because our Device is encrypted but when i erase the internal storage and decrypt the device then problem got solved because encryption is a culprit here.

Unending trouble with system partition for hydrogen

hi guys, I am having trouble with my MI Max having 32GB internal memory.
From it's behaviour for last few days I have inferred it's system partition is the culprit.
On stock miui rom, it gives msg that encryption unsuccessful and I need to factory reset it. But even after doing factory reset it shows the same msg.
Its with locked boot loader but referring one thread I could install twrp latest version on it by replacing recovery image in stock rom and flashing with mi flash tool in edl mode.
So with two I tried installing few vision rooms like miui eu ROM, RR and crdroid based on Oreo. All the rooms while flashing fine error E1001, saying system image not updated and flashing failed.
I even tried repairing file system, fixing file system, Channing file system to fat, exfat, ext2, ext3, ext4 and f2fs several times (from advanced wipe menu) but things are not improving. Even tried formatting data partition as it's suggested at few places.
I am out of ideas after spending few days trying to fix it by flashing several times.
So please if some one can assist in resolving the issue, I would really appreciate.
Thank you in advance.
You need to format data not wipe . Go to twrp choose wipe , format data and type yes . Note, by doing this you will lose all of your data if you want to keep it make sure to save it to your PC or USB drive.
Zasnizas said:
You need to format data not wipe . Go to twrp choose wipe , format data and type yes . Note, by doing this you will lose all of your data if you want to keep it make sure to save it to your PC or USB drive.
Click to expand...
Click to collapse
Have already done it several times by now. Didn't make any difference.
harpy.eagle said:
Have already done it several times by now. Didn't make any difference.
Click to expand...
Click to collapse
As discussed yesterday on unofficial LineageOS (nijel8) thread the nand is damaged. You need to delate partition, compact unallocated space & then recreate the exactly the same partition. That way it won't be on the same spot & it will work.
Use a PC with an partition manager.
https://gparted.org/
Zola III said:
As discussed yesterday on unofficial LineageOS (nijel8) thread the nand is damaged. You need to delate partition, compact unallocated space & then recreate the exactly the same partition. That way it won't be on the same spot & it will work.
Use a PC with an partition manager.
https://gparted.org/
Click to expand...
Click to collapse
Tks a lot for the reply. It gave a ray of hope to me. Though I am hearing modifying partition on android device for the first time to fix it. That too for bricked device and to do it on PC. Is there any thread guiding about it? Would read a bit about how to do it in order to not mess things up even more.
harpy.eagle said:
Tks a lot for the reply. It gave a ray of hope to me. Though I am hearing modifying partition on android device for the first time to fix it. That too for bricked device and to do it on PC. Is there any thread guiding about it? Would read a bit about how to do it in order to not mess things up even more.
Click to expand...
Click to collapse
It's still ain't bricked so you can do this relatively easy. When it's bricked EDL programmer for used NAND chip used is needed.
So take a deep breath, see the exact size & type of the partition, delate it, create a new one exactly the same (type, size & name).
https://s10629.pcdn.co/wp-content/pictures/2010/01/captured_Image1.png51.png
https://helpdeskgeek.com/wp-content/pictures/2010/01/captured_Image1.png111.png
The tool I gave you URL is very good documented and with plenty examples & user guides available all which can be found on the site, it uses graphics GUI so it's as easy as it can be. So if you are inexperienced read/watch first how it's done. After you are done flash what you want in TWRP.
Best regards.
What I meant to ask is, how to access partitions of mobile on PC? I have used partitioning app on windows but never for android device. Anyway, as u have clued, I shall try accessing partitions with mobile connected in edl mode.

Categories

Resources