Whenever I flash a new rom after a fullwipe, I still have to type in a pin to boot the phone. I think this is called "verified boot". This is also the pin I need in TWRP to decrypt data. So obviously this pin has been stored outside of data or system partitions and is used upon every new install/boot of a new rom to encrypt it immediately upon first boot.
So where is this encryption key stored and how do I delete it?
Lownita said:
Whenever I flash a new rom after a fullwipe, I still have to type in a pin to boot the phone. I think this is called "verified boot". This is also the pin I need in TWRP to decrypt data. So obviously this pin has been stored outside of data or system partitions and is used upon every new install/boot of a new rom to encrypt it immediately upon first boot.
So where is this encryption key stored and how do I delete it?
Click to expand...
Click to collapse
If this link helps you ?
https://source.android.com/security/encryption/index.html
I have this exact problem, not sure how to resolve this issue but it seems my phone needs my pin even after wiping the phone.
I would love to fix this, if anybody has any tips that would be great, I am running a OnePlus 3 with root and twrp.
-thanks.
DonaldKerabatsos said:
I have this exact problem, not sure how to resolve this issue but it seems my phone needs my pin even after wiping the phone.
I would love to fix this, if anybody has any tips that would be great, I am running a OnePlus 3 with root and twrp.
-thanks.
Click to expand...
Click to collapse
Go to fastboot, type fastboot format userdata. Or go to twrp, wipe, wipe data via the button. This should do the same. Beware that data and your internal storage will get wiped.
to disable the pin you have to do this:
setting>security>screen lock> type PIN> PIN
then you will see Secure start-up ( Require PIN to start device/ No Thank you)
I had this problem with all TWRP versions for this device:
When I completely restore all partitions with TWRP and I boot up it gives "Wrong PIN" but the PIN is right. Also tried 1234, 123456, 0000 and 000000. Cache/Dalvik format does not do anything.
Nothing works, so I'm not able to use my lovely P2 now...
Anyone can help me?
Sorry should have googled it:
Firstly you need to boot into TWRP and then follow these steps:
Go to Advanced > File Manager > data > system.
And then delete locksettings.db, gatekeeper.password.key and gatekeeper.pattern.key.
HOW TO FIX
------------------------
Simply boot into TWRP and enter your PIN (if you've set one) to decrypt the stroage. If you don't have TWRP (for whatever reason) you can do so via ADB too but ONLY if you've connected your phone to your PC beforehand and also accepted it's fingerprint on the phone itself.
Delete (or rename) the following files inside /data/system (note that probably not all of them exist for you, simply delete those you can find):
password.key
pattern.key
locksettings.db-wal
locksettings.db-shm
locksettings.db
Reboot the phone and (if you've set a PIN) enter it to decrypt the storage one more time. After that you can simply unlock your phone with a swipe.
Go into Settings > Security and set your preferred unlock method again, Android will ask you if you want to set a boot-time code too. Select whatever you want here, it's a nice security addition but can be annoying sometimes.
Enjoy your phone again!
^This. I was having a similar problem not able to unlock the phone after installing other rom via the dual boot app.
ilmervanhattem said:
I had this problem with all TWRP versions for this device:
When I completely restore all partitions with TWRP and I boot up it gives "Wrong PIN" but the PIN is right. Also tried 1234, 123456, 0000 and 000000. Cache/Dalvik format does not do anything.
Nothing works, so I'm not able to use my lovely P2 now...
Anyone can help me?
Click to expand...
Click to collapse
Yah it's bugs in twrp, try use and flash with my latest compile unofficial twrp-3.1.0-0 that already fix bugs for pin, pasword, or patern encryption decryption
ilmervanhattem said:
HOW TO FIX
------------------------
Simply boot into TWRP and enter your PIN (if you've set one) to decrypt the stroage. If you don't have TWRP (for whatever reason) you can do so via ADB too but ONLY if you've connected your phone to your PC beforehand and also accepted it's fingerprint on the phone itself.
Delete (or rename) the following files inside /data/system (note that probably not all of them exist for you, simply delete those you can find):
password.key
pattern.key
locksettings.db-wal
locksettings.db-shm
locksettings.db
Reboot the phone and (if you've set a PIN) enter it to decrypt the storage one more time. After that you can simply unlock your phone with a swipe.
Go into Settings > Security and set your preferred unlock method again, Android will ask you if you want to set a boot-time code too. Select whatever you want here, it's a nice security addition but can be annoying sometimes.
Enjoy your phone again!
Click to expand...
Click to collapse
After doing this screen lock is by passed but later not able to set new pin. Settings app crashing.
Thanks for this info but I too had this problem yesterday and after 2 hours trying to figure it out had to flash the rom from scratch. Hopefully it can be fixed.
PrasadD said:
After doing this screen lock is by passed but later not able to set new pin. Settings app crashing.
Click to expand...
Click to collapse
Thanks a lot.
I keep this zip on my phone and flash it after every TWRP recovery.
It deletes needed files automatically.
https://mega.nz/#!dYx3lYoQ!4K2swB24JNKihws2BHso0B6D5w-JM-pRlTWksILO2fE
ilmervanhattem said:
Sorry should have googled it:
Firstly you need to boot into TWRP and then follow these steps:
Go to Advanced > File Manager > data > system.
And then delete locksettings.db, gatekeeper.password.key and gatekeeper.pattern.key.
Click to expand...
Click to collapse
Thank you, just fixed my Zenfone 3 Laser pin error after twrp restore just by deleting these 3 files. Went back to settings and set another pin, restart, test, all good without errors. Much appreciated
Hi,
i don't know if it's the correct section but i need a big help.I rebooted my phone this morning but when it comes to write the system pin it says it's wrong.
I can't belive i forgot my pin or i wrote it uncorrect during the configuration.
Now my phone is unable to boot, unable to recovery because of the enrcyption end my pc can't find any device in fastboot, even with the last Motorola drivers.
It's running XPerience Beta 12.0.0.
What can i do if i can't wipe data in any way?
callaghandroid said:
Hi,
i don't know if it's the correct section but i need a big help.I rebooted my phone this morning but when it comes to write the system pin it says it's wrong.
I can't belive i forgot my pin or i wrote it uncorrect during the configuration.
Now my phone is unable to boot, unable to recovery because of the enrcyption end my pc can't find any device in fastboot, even with the last Motorola drivers.
It's running XPerience Beta 12.0.0.
What can i do if i can't wipe data in any way?
Click to expand...
Click to collapse
what were you using before? i mean pattern or pin?
callaghandroid said:
Hi,
i don't know if it's the correct section but i need a big help.I rebooted my phone this morning but when it comes to write the system pin it says it's wrong.
I can't belive i forgot my pin or i wrote it uncorrect during the configuration.
Now my phone is unable to boot, unable to recovery because of the enrcyption end my pc can't find any device in fastboot, even with the last Motorola drivers.
It's running XPerience Beta 12.0.0.
What can i do if i can't wipe data in any way?
Click to expand...
Click to collapse
If you installed experience you should have twrp. Boot to twrp, use file explorer -> /data/system delete locksettings.db
callaghandroid said:
Hi,
i don't know if it's the correct section but i need a big help.I rebooted my phone this morning but when it comes to write the system pin it says it's wrong.
I can't belive i forgot my pin or i wrote it uncorrect during the configuration.
Now my phone is unable to boot, unable to recovery because of the enrcyption end my pc can't find any device in fastboot, even with the last Motorola drivers.
It's running XPerience Beta 12.0.0.
What can i do if i can't wipe data in any way?
Click to expand...
Click to collapse
Why can't you boot into TWRP? If it asks for a password just click "cancel". Then, navigate to Wipe>Format Data and you should be fine.
catsruul said:
Why can't you boot into TWRP? If it asks for a password just click "cancel". Then, navigate to Wipe>Format Data and you should be fine.
Click to expand...
Click to collapse
I came to this solution like ten minutes after i poted this. Trust me that i treid everything. Thank you for the reply.
phone encrypted.
all started one day, i was 0% battery, phone shut down itself, charged, turned on, the first password of encryption is ok, the OS password of the lockscreen GIVES ME ERROR.
i wonder, WHY? i thought i can use the twrp fix to erase the password inside the OS, ok, i try:
1) removed the 5 files with the twrp file manager, rebooted, NOTHING, after the first password accepted the boot logo is FOREVER going.... stuck.
2) tried to dirty flash the same rom i have ( a resurrection remix 5.8.5 by pranay) , nothing, same result
3) tried to format wiping data, cache, dalvik, nothing.
ok so i said myself UPGRATE TO OREO ROM, i boot into twrp ( twrp asks me the password, i enter it.. and WORKS! i don't know why the SAME password no more works into the OS) and with the MTP i transfer all mi video and pictures. ok!
i flashed the NEW twrp 3.2.1 for oreo ( i had 3.1.1.), i download some custom rom oreo, 2 resurrection remix and AEX, i wipe as usual, i install the aex and all works but i do not see the option to add the FINGERPRINT, mmmhhh in the telegram group someone told me that i "need to encrypt" to make the fingerprint option APPEAR into the OS..... ok no problem, i CAN do it! i WANT to do it! i can't live without encryption for privacy reasons. i charge the phone, press on encrypt and it reboots, i see the RR logo, 10 seconds later i am int othe OS. yes... but STILL UNENCRYPTED
i try to change the rom, new formats, new roms, SAME PROBLEM. i discovered that maybe the data partition was ruined, ok i did several "repair", i did several changes to f2fs and return to ext4 .... but sometimes i got some strange errors when trying to change the filesystem TO f2fs.
then i tried to flash the STOCK ROM follwing this guide
https://forum.xda-developers.com/lenovo-p2/development/fastboot-files-stock-firmware-t3649914
i made it all correct, now i am on stock s244 rom, in this rom i can use fingerprint but the encryption password bug is STILL PRESENT, it simply does not encrypt my phone if i press to encrypt! made a lot of tests, repair, change file system of data..... NOTHING HELPED ME. ah yes...... at a precise point into the OS i see that my phone is encrypted. WHAT?
so i boot into twrp and it asks me the password i enter it, but it is WRONG. wrong? NOT POSSIBLE it is the same....the same! i tried a lot of password like password.... default_password, 123456,0000,000000 ........
to recover my twrp i used the command "fastoboot erase userdata", it worked, now i am without a "fake" encryption. i continue to do tests, sometimes my file system showed into the twrp in the wipe menu... is showed as "auto", sometimes as "emmc" ........ MMHHHHH never seen these kind of file systems! so i changed them every time to ext4!
then i tried to flash back my "old" rr rom nougat 5.8.5 , it works, in this rom i see the FINGERPRINT OPTION, but the same bug of impossible encryption at reboot.
- so i think i can try to flash the old twrp 3.1.1 because maybe the latest one is BUGGED! maybe! i flash it....keeping the OREO rom, and still can't encrypt.
- so i try to also flash the 3.1.1 twrp... and another clean instlall of RR nougat, i do all wipes every time, all precise, no dirty flash.... and with rr nougat i CAN use fingerprint but NO encryption.
i wonder ......... i use the SAME twrp image i used for months! same file! my file.
i use the SAME ROM ZIP rr 5.8.5, why in this moment i have a "different" configuration than before? filesystem is the same ext4.... but the phone still does not want to let me encrypt it! and someone must show me the REASON WHY with all oreo roms the user cannot use the fingerprint scanner ( there is no option into the os!) without to use the encryption?
I HAVE ALWAYS USED FINGERPRINT ON OTHER PHONES WITHOUT ENCRYPTION.....
now i have 2 solutions:
1) keep the RR nougat, unencrypted BUT AT LEAST with fingerprint unlock.
2) use the RR ( or any other oreo) rom but unencrypted, and WITHOUT the possibility to unlock with my finger! grrrr!!
please give me your advice, your opinion how is it possible i tested so much different configurations, mxed different twrp, different roms, changed data file system from ext4 to f2fs and the opposite, tried to "repair" file system....... appeared random ENCRYPTED twrp but with an "impossible to know" password.... i also flashed the stock rom with the fastboot command following the guide on xda i posted at the link, i feel really empty and without possibilities to fix this problem.
but as i can remember all started with the phone shut down at 0% battery! from that point my password has never been accepted anymore!!! i was LOCKED OUT from my phone, to be precise not my full phone because the password WORKED to unlock the encryption! ( i recoveredall my files!) but the OS refuses to accept the "same" password i used to unlock the encryption... it is very strange!
First of all, my deep condolences.
Second, dude, you have done so many wrong turns..but let's get to fixing.
First of all, download this: https://androidfilehost.com/?fid=817550096634780916
It's a one click Firmware Rescue Folder, with our oldest Firmware( 6.0 MM).
This tool can always be used, no matter if you're unlocked or locked. So it's your last key to get on Stock Rom. Even if your phone is stuck at bootloop, etc. .
Turn your phone off and open up "flashall - stock reco.bat".
Let it do it's job and do not under any circumstance remove the cable.
Your phone will reboot on its own after it's done.
Once your phone is started, you can either keep on using Stock and setup as usual , OR you skip Google Login, complete the Setup Wizard. And then login into WIFI manually through Quick Settings.
From there tap on the "System Update is avaibable" Message. And so all of the ota updates. Also while you're waiting for the download to complete, enable Developer Options (Tap 5xTimes on Build Number), then enable USB Debugging.
While it is still downloading on your phone, go ahead and download https://dl.twrp.me/kuntao_row/ to your computer, the latest version.
- - - After all ota Updates are done, you should be on S251, ADB Debugging enabled, Google Account still not setup - - -
Okay, open up CMD from your adb-platform tools folder, if you don't have it, download it from its official source here.
Rename the "twrp-3.2.1-0-kuntao_row.img" to "r.img" and put it into the extracted platform tools folder.
Connect your phone to your pc. Open up cmd and navigate to your platform tools folder.
The Commands for CMD are:
cd Downloads
Click to expand...
Click to collapse
C:\Downloads\platform-tools
Click to expand...
Click to collapse
Could be somewhat different, depends on where you have your Downloads folder.
adb devices
Click to expand...
Click to collapse
Tick the one tickable option on the new poped up prompt on your phone. Accept it.
Now, use:
adb kill-server
Click to expand...
Click to collapse
adb reboot bootloader
Click to expand...
Click to collapse
Now, use:
fastboot oem unlock
Click to expand...
Click to collapse
after this, either your phone reboots on its own, or it doesn't. If it doesn't, don't worry, it's fine.
Now, use
fastboot flash recovery r.img
Click to expand...
Click to collapse
fastboot boot r.img
Click to expand...
Click to collapse
in TWRP First Time Pop Up Message. Just tick the one small box, and use the slider.
Go into "Reboot" Menu, and chose recovery
Click to expand...
Click to collapse
No questions asked, just do it.
Wait for Twrp to boot back into twrp. Once you're back in your menu.
Go into "Wipe" ,chose "Factory Reset", then go back and chose "Advanced Wipe", now select the data partition, and chose to change the file system. Chose "f2fs"
Click to expand...
Click to collapse
Now, go back and into the Reboot menu, Chose Recovery again.
Go into "Wipe" again, "Advanced Wipe" -> Select Data Partition only -> Chose Change File System-> Chose ext4-> Go Back into Main menu
Click to expand...
Click to collapse
Chose "Reboot"-> Chose Recovery again.
Click to expand...
Click to collapse
Wait till it boots to twp again. Tap on the right button on your navigation bar, now the logs will show up. Look for anything red; there shouldn't be any errors now.
Go into "Wipe" Menu again -> Chose "Format Data"-> Type yes and accept.
Click to expand...
Click to collapse
Do not reboot under any circumstance.
Now, that this is done, go ahead and reboot back into Recovery.
Main Menu>Reboot>Recovery
Click to expand...
Click to collapse
Go back into the Wipe Menu->Advanced Wipe-> Select data Partition-> change file system->Chose ext4
Click to expand...
Click to collapse
Go back to Reboot menu and once again chose recovery. Wait for it to boot back into Twrp.
Check for any erros on your log. (right button on your navigation bar. Tap again to go back into the Main menu)
Go to Advanced Wipe->Select System Partition-> wipe it.-> Back to the Main menu
Click to expand...
Click to collapse
Now it's time to flash Stuff!
- Flash your Rom
- Depending on what Android Version you're on, flash your desired Custom Kernel which should be compatible with your Rom.
- Flash Gapps, if desired.
- Flash Magisk or SuperSu for Root, if desired.
- Wipe Dalvik and cache. Now go and reboot
Click to expand...
Click to collapse
thank u, i will test it within a few days!
just a doubt.... when u say to put the recovery image here C:\Downloads\platform-tools
i simply generally put the files i want to flash into the folder called "minimal adb and fastboot" becuase i use that way, is it ok?
and i wonder why to use this command "adb kill-server", i've never used it... and why to priorly use "adb devices" ....jus to see if the phone is read by the pc?
ok.. but i suppose the command "adb reboot bootloader" does not require to kill the adb server.... i've never read to do it.
and last thing.... how do you think that this method would save me? it seems just another option to flash the stock rom.. but i already did it followinf the guide i linked, and i also upgraded at the last OTA within the OS....
sm00th4f3 said:
Now it's time to flash Stuff!
Click to expand...
Click to collapse
thank u bro! u are MY ANGEL now it works!! u solved my problem!
realista87 said:
thank u bro! u are MY ANGEL now it works!! u solved my problem!
Click to expand...
Click to collapse
You're welcome. I had to learn how to solve this the hard way....glad that i could help you!
Rocking RR Nougat+Magma Kernel= Best Combo for now
https://forum.xda-developers.com/lenovo-p2/development/rom-resurrection-remix-v6-0-0-t3792929
why not this OREO rom by PriyeshP? i had nougat rr but battery life was not perfect... i had to mad a lot of tweaks with greenify and bocking some services within the options of the RR just to achieve a good battery life, but not perfect idle battery
realista87 said:
https://forum.xda-developers.com/lenovo-p2/development/rom-resurrection-remix-v6-0-0-t3792929
why not this OREO rom by PriyeshP? i had nougat rr but battery life was not perfect... i had to mad a lot of tweaks with greenify and bocking some services within the options of the RR just to achieve a good battery life, but not perfect idle battery
Click to expand...
Click to collapse
Some options aren't working and are still present in the rom.
Battery life on Nougat was pretty good for me. 13hours of sot daily under heavy usage.
sm00th4f3 said:
First of all, my deep condolences.
Second, dude, you have done so many wrong turns..but let's get to fixing.
First of all, download this: https://androidfilehost.com/?fid=817550096634780916
It's a one click Firmware Rescue Folder, with our oldest Firmware( 6.0 MM).
This tool can always be used, no matter if you're unlocked or locked. So it's your last key to get on Stock Rom. Even if your phone is stuck at bootloop, etc. .
Turn your phone off and open up "flashall - stock reco.bat".
Let it do it's job and do not under any circumstance remove the cable.
Your phone will reboot on its own after it's done.
Once your phone is started, you can either keep on using Stock and setup as usual , OR you skip Google Login, complete the Setup Wizard. And then login into WIFI manually through Quick Settings.
From there tap on the "System Update is avaibable" Message. And so all of the ota updates. Also while you're waiting for the download to complete, enable Developer Options (Tap 5xTimes on Build Number), then enable USB Debugging.
While it is still downloading on your phone, go ahead and download https://dl.twrp.me/kuntao_row/ to your computer, the latest version.
- - - After all ota Updates are done, you should be on S251, ADB Debugging enabled, Google Account still not setup - - -
Okay, open up CMD from your adb-platform tools folder, if you don't have it, download it from its official source here.
Rename the "twrp-3.2.1-0-kuntao_row.img" to "r.img" and put it into the extracted platform tools folder.
Connect your phone to your pc. Open up cmd and navigate to your platform tools folder.
The Commands for CMD are:
Could be somewhat different, depends on where you have your Downloads folder.
Tick the one tickable option on the new poped up prompt on your phone. Accept it.
Now, use:
Now, use:
after this, either your phone reboots on its own, or it doesn't. If it doesn't, don't worry, it's fine.
Now, use
in TWRP First Time Pop Up Message. Just tick the one small box, and use the slider.
No questions asked, just do it.
Wait for Twrp to boot back into twrp. Once you're back in your menu.
Now, go back and into the Reboot menu, Chose Recovery again.
Wait till it boots to twp again. Tap on the right button on your navigation bar, now the logs will show up. Look for anything red; there shouldn't be any errors now.
Do not reboot under any circumstance.
Now, that this is done, go ahead and reboot back into Recovery.
Go back to Reboot menu and once again chose recovery. Wait for it to boot back into Twrp.
Check for any erros on your log. (right button on your navigation bar. Tap again to go back into the Main menu)
Now it's time to flash Stuff!
Click to expand...
Click to collapse
The file is not available anymore - do you know where I may be able to find it?
my phone shows "encrypted" but there is no "fingerprint" option in security settings. currently on stock s244 deodexed i tried los 15.1 n stock but cant find fingerprint in settings. can u guide me how to get fingerprint option back pleaseee
fingerprint not showing
Lavesh05 said:
my phone shows "encrypted" but there is no "fingerprint" option in security settings. currently on stock s244 deodexed i tried los 15.1 n stock but cant find fingerprint in settings. can u guide me how to get fingerprint option back pleaseee
Click to expand...
Click to collapse
did you find a solution , I'm having the same problem
Same problem for me.... and nothing works.....
A little Background: I installed a magisk module that broke my g-apps, so I tried to update my rom from 14.0.1.0 to 14.0.2.0 (EEA).
The problem: I flashed the fastboot rom through Mi Flash. Now my phone is stuck in a loading animation when booting (I can access adb commands, but still can't access my files).
I tried everything I could think of, but it just won't boot... I didn't make a backup and I don't want to lose my files if there's any way to avoid that.
A very weird thing though: It gets really close to booting: it even applies reading mode and connects to adb, but the loading screen doesn't disappear.
when I do "adb reboot" the system clock flashes for a second. When I touch the fingerprint sensor it vibrates.
THERE IS NO TWRP FOR MY DEVICE
Thank you so much for your help!
When you used Miflash did you uncheck the "flash all and lock" box which is enabled by default?
Btw:Miflash erases your data
NOSS8 said:
When you used Miflash did you uncheck the "flash all and lock" box which is enabled by default?
Btw:Miflash erases your data
Click to expand...
Click to collapse
I used the keep data option. My bootloader is still unlocked
Try again with the Clean all option.
NOSS8 said:
Try again with the Clean all option.
Click to expand...
Click to collapse
I finnally gave in and did this. My files are all gone but at least my phone works..
Thanks for helping!
keep data option,works on a clean partition, which was not the case for you.
Edit title(SOLVED).