yashsingh1/xdaforums huggingface dataset:
[Nexus 6P General] kevtrysmoddin:
this just saved my day restored a backup enter bootloop manged to get it to boot then found myself locked out and then xda to the rescue
[Nexus 6P General] infernusdark:
Smart Lock is missing

Solved sorry

Enviado desde mi Nexus 6P mediante Tapatalk
[Nexus 6P General] xSilas43:
Just thought i would mention that with the unofficial build here https://idlekernel.com/twrp/nexus/ that i have not had the lockscreen password restore bug as well as the efs restore bug.
[Nexus 6P General] rpxz:
This has actually been out for a while now. I originally touched on the topic here.

http://xdaforums.com/showpost.php?p=68014070&postcount=5355
[Nexus 6P General] pitflyer:
So with this version you don't have to remove lock screen security to do backups? I ask because removing lock screen security removes my fingerprints, so its a minor annoyance to re-enroll and then re-enable all the apps to use fingerprints again.
[Nexus 6P General] Gizmoe:
No it doesn't fix the issue. However, if you only wipe locksettings.db from data/system and nothing else. You can use fingerprint to unlock device. Then just go to setup fingerprints. It will require setting up new pin or swipe and then that's it. It all works again and your prints are still there.
[Nexus 6P General] mobileman88:
Hi.

This does not work if the hardware we are restoring is not the same device. It ends up that I can no longer add fingerprints. The whole reader is disabled
[Nexus 6P General] Gizmoe:
Yeah not across devices. Sorry it's an old thread. Just popped up in participated.
[Nexus 6P General] xSilas43:
I personally havent had to delete anything and have restored at least 6 nandroids with that bersion of twrp.
[Nexus 6P General] ptclik85:
Can someone please help me. I can't seem to backup my rom. I keep getting error 255. I tried updating to the unofficial version of twrp, 3.0.2.3 but it didn't work. Any other help would be greatly appreciated.
[Nexus 6P General] penciluser:
Are you backing up everything?
[Nexus 6P General] ptclik85:
I actually figured out the issue. It was the actual rom. Everything is good now.
[Nexus 6P General] jova33:
I just ordered my 6P today, so I don't have it in hand.

So using that version of TWRP you don't have to disable lock screen security to restore backups?
[Nexus 6P General] xSilas43:
I hadnt previiusly and had no issues but now on 7.1 i did have to delete locksettings.db after a restore.
[Nexus 6P General] DocteurN:
Yes, same here, with 7.1 I had to delete locksettings.db after a restore like old times ;)
[Nexus 6P General] sirxdroid:
But otherwise backup/restore works OK with 7.1.1?
[Nexus 6P General] DocteurN:
Yes it works OK :good:
[Nexus 6P General] mobileman88:
Does it work for restores to a replacement device now? Previously, I will lose all of my fingerprint reader functionality after restore
[Nexus 6P General] kiefferbp:
You have to delete files corresponding to fingerprint data to get fingerprint functionality back. I had to do this yesterday.

I don't have the XDA thread with me right now that shows the exact files to delete but it should be easy to find with a search. I think one of the folders to delete was data/fpc and then you had to delete fingerprint data for each user.
[Nexus 6P General] mobileman88:
Did you manage to do that when restoring to a different 6P ? Previously I tried and it does not work. All fingerprint functionality results in errors. Can't even register a new finger. Had to do a factory reset then restore from TiBU
[Nexus 6P General] kiefferbp:
Yep. I RMAed my 6P for the dying at 15-20% issue and restored my other 6P's backup on the replacement. After doing so it said that my fingerprint hardware was not available. Here is thread:

http://xdaforums.com/nexus-6p/help/fingerprint-issue-restoring-twrp-backup-t3307734/page1

I followed the advice with the 3 thanks and fixed it.
[Nexus 6P General] Nex23:
Thanks man, you saved my life !
[Nexus 6P General] v12xke:
Is it still a requirement to remove security (pin, pattern, etc.) prior to making a TWRP backup, or was that fixed with 3.0.3-0? Is the best practice to restore Vendor too, or just stick with Boot, System, Data. Thanks.
[Nexus 6P General] Bryanx86:
Yep need to remove pin
[Nexus 6P General] Benjamin_L:
People are reporting backup restoring with pin/password is working fine with 3.1.0. so let's hope it works fine for everyone
[Nexus 6P General] mobileman88:
Works fine for me except across devices. The op with the files to remove still stands. Tested it on 2 separate 6p
[Nexus 6P General] Upy3r:
Lol, posted while the phone was on the Pocket.. my bad sorry for the nonsense.
[Nexus 6P General] cognitivedissonance:
I’m not sure if this thread is pinned, but it really should be. This is absolutely imperative info for anyone RMAing their phone. The fix for the fingerprint sensor when transferring / flashing a TWRP nandroid from one N6P to another is probably going to save me hours of setup time. Seriously, thank you so much OP and those who collaborated to provide this info!
[Nexus 6P General] SlimSnoopOS:
It is pinned. View the General section from a browser and you'll see the pin icon. Glad you found this useful.
[Nexus 6P General] xBr4v3x:
Has anyone experienced the encryption pattern (pattern/pin required to start android) being changed when flashing something with twrp, but it doesn't go away when you delete the locksettings file?

I've been running Carbon for a couple days now, finally got to flashing supersu to make use of root. Well, after doing this, when I rebooted, it asked for my pattern to start android, except it doesn't work. I've tried several times and deleted the file mentioned here, but nothing has worked so far..
[Nexus 6P General] cognitivedissonance:
So I was wondering about this as well. My question is this - wouldn't someone be able to boot to the bootloader or to the lockscreen and then run an adb command to delete the locksettings.db? Presumably you'd need to do this from a shell session granted su access, but from what I can recall of using that, I wasn't ever required to enter a password, it just gave me su access as soon as I entered the proper command. Then again, I'm absolutely horrible with adb, so there's a good chance I am missing something.
[Nexus 6P General] ajm786:
That would never work.

When your phone is encrypted, it boots in 2 "separate" steps. It boots up the first time, then prompts you for your pattern or pin. That decrypts the phone. Once you input the right pattern/pin, it then continues to boot the second step, fully booting up to the home screen.

You can't delete the lockscreen.db settings from TWRP unless you decrypt your phone. Likewise, even if you were able to delete it, it has no effect on the actual encryption; you'd just be deleting the file which controls the lockscreen security from your homescreen.
[Nexus 6P General] dudikaz:
camera doesn't work for me after doing this on nexus 6p. made a backup. tried lineage os for like 30mins. restored. and faced numerous problems. one of them is desribed in this op. but i cannot get my camera work no matter what. starts working only if i factory reset. so twrp backup is a useless piece of crap. :(
[Nexus 6P General] Opmovers:
is this legal?

Such a quick easy fix... I love you all so much!!!! Thank you thank you thank you!! Who figured this out first? IM so happy i want to thank them directly. We are not worthy of your awsomeness. We pale in comparison.
[Nexus 6P General] opz187:
yes pattern fails. at last on nexus factory ROMs. might be a different story with aosp ones
[Nexus 6P General] chrisomnia1:
i can't seem to restore a backup at all. Bootloops on me.
[Nexus 6P General] PieOfJustice:
Good to know to disable lock before backups.
[Nexus 6P General] c3k:
please confirm you have a different kernel than the stock one, otherwise you are encrypted afaik (even without a secure lockscreen)
[Nexus 6P General] kingmikel:
I'm using Kylo kernel. First thing I did when I got the phone was decrypt though.
[Nexus 6P General] kingmikel:
Okay same thing happened to me at first. Only restore system, data, and boot. If you restore any of the other options, it'll boot loop
[Nexus 6P General] sirxdroid:
What else are you backing up? You should only be backing up those 3 things.
[Nexus 6P General] siegesoldier:
Make sure your vendor image version build matches your backup. That seemed to fix it for me. Would be best to back that up along with everything else if that turns out to be the case
[Nexus 6P General] gqukyo:
I couldn't restore my stock backup as well as my PureNexus backup either and I had pin and prints. Wish I would've seen this first. Now even when I try to flash all back to stock, it messes up. My recovery wouldn't mount system for some reason, even after I entered in the correct code to decrypt. I might just decrypt...
[Nexus 6P General] n9900229:
So what I'm reading, even if you have some sort of security you know and setup. When you flash the Rom , the security you need to put on whether pin or fingerprint, etc. It will not accept it because of the flash?
[Nexus 6P General] gqukyo:
So it appears we should only backup and restore system, data, and boot? I can understand system and data but why restore boot if there's no change? Most if not all custom roms leave the boot img alone no?
[Nexus 6P General] efrant:
No, not really. Most ROMs include their own boot image, which may be stock, but not necessarily. And root on MM requires a custom boot image.
[Nexus 6P General] Spartan117H3:
I ran into the same problem today, it recognizes my fingerprint, but does not recognize my 8 character password. Oh well, I was going to re-flash anyway. I am encrypted.
[Nexus 6P General] mikexda:
I may be totally off base here because I have not tried it myself. But why can't you simply restore your backup. Then while still in TWRP go delete /data/system/locksettings.db?
[Nexus 6P General] jackdubl:
Sounds like nobody has really done a successful restore yet, from what I'm reading, and there is no tried-and-true procedure on how to backup or restore yet either.
[Nexus 6P General] Spartan117H3:
You... backup with no password.... then restore... then put your password back on (if you want to).
[Nexus 6P General] jackdubl:
And what exactly should I backup? Vendor data? Vendor.img? Does it change depending on if I'm switching roms? Switching Android versions? Do I need to restore vendor stuff ever? If so, when? Seems to me these are questions at the moment. One person wrote they couldn't restore a nandroid no matter what they tried. Have you backed up and successfully restored a nandroid yet?
[Nexus 6P General] Spartan117H3:
No? TWRP gives you all 3 settings by default, you just hit backup and swipe it. The only reason they could not restore the Nandroid was because if you have a password when backing up, the password won't work when restoring...
[Nexus 6P General] jackdubl:
You don't sound like you've actually tried one yet.
[Nexus 6P General] Spartan117H3:
Wow. Ok. Let me break it down for you. It doesn't prevent you from restoring. It has NOTHING to do with restoring OTHER than this: it just prevents you from entering your original password on boot. So if you restore a backup that did not have a password, then you will get a successfully working restore. Yes I have done it. If you still cannot comprehend the meaning behind this post/thread, just move on.
[Nexus 6P General] jackdubl:
Well, I've read other threads where people moved from i build to L or M, then tried to restore Nandroid, and it bootlooped until they did something with vendor. So I don't think it 's quite as simple as it used to be.
[Nexus 6P General] Spartan117H3:
I never said I bootlooped when I tried it. I said, I could not enter my 8 character password. The reason those other people bootlooped is because they flashed a different vendor than what they restored. IE if you have a backup from L, flash M's Vendor, then restore a L-Vendor-backup, then you will bootloop. You have to flash L's Vendor, restore, then proceed from there.
[Nexus 6P General] jackdubl:
And when you restore vendor in those situations, do you restore vendor, vendor.img, or both?
[Nexus 6P General] Spartan117H3:
Vendor is vendor.img.. When they are talking about vendor they are talking about the vendor.img corresponding to whatever version they were on. To get it, you either find an uploaded one, or you can go to Google's official site, extract their firmware of the SAME version of your backup, then flash that using fastboot.
[Nexus 6P General] jackdubl:
Well, actually I'm talking about, in twrp, you can backup vendor, vendor.img, or both, or neither. So I was asking which should I be backing up and restoring.
[Nexus 6P General] sirxdroid:
It's probably a good idea to include vendor in the backup so you don't have to worry about issues if in 2 weeks you want to restore an old backup, no hunting for the right vendor.img, etc. boot, vendor, system are closely related .
[Nexus 6P General] Spartan117H3:
If you WANT to, it would be vendor, not "vendor image". Same with System and not System image... It's just boot, system, and data.

It's assumed that you are backing up before any update or before you change something that could possibly cause you to want to restore.
[Nexus 6P General] jorgen2009:
Mike, you deserve a medal ;) Your solution made it possible to login again. I was set to fingerprint security with an additional PIN before I made a backup. Then after restoring, the fingerprint reader accepted my fingerprint, but the PIN security was set back to Swipe, so I could logon with just my fingerprint and a simple swipe. Good find!

Everyone having restore issues, follow Mike's instructions and thank him

Btw, I'm on a Nexus 5X, but that probably won't matter
[Nexus 6P General] Stephen:
If you try to go into settings and security, does it crash out on you?
[Nexus 6P General] jorgen2009:
No, I can set a new PIN without problems. This is a really good working and reliable solution until TWRP is updated
[Nexus 6P General] firewoood:
thanks for the kindly remind:D
[Nexus 6P General] jackdubl:
OK, well before you told me vendor WAS vendor.img . And I guess that means I should always backup vendor, just in case. But then I wouldn't always be restoring vendor when I restore a backup. It now depends on the situation. I think you are proving my point. Things aren't as simple as system/data/boot and disable security.
[Nexus 6P General] efrant:
The vendor image file from the factory image is written to the "vendor" partition. In TWRP, you can back up "vendor" or "vendor image". The difference is that vendor image is a block-level backup, rather than a file-level backup. When you restore either, you end up with the same contents, but with the "vendor image" you keep the same signature as the vendor image in the factory image. (Same goes for "system" vs. "system image".) The features are more useful for devices that don't have factory images available and for users who want to upgrade via an OTA update. If the signature of the boot, system and vendor (and maybe other) partitions don't match the original factory image files, the OTA update will fail to install.
[Nexus 6P General] Spartan117H3:
Because you said vendor.img vs vendor, not vendor image vs vendor. Many people refer to vendor.img as simply vendor.

If you always backup before you do something that could possibly cause an issue, then you just back up the three defaults.
[Nexus 6P General] tech_head:
This is a great find.

Disabling security has the effect of resetting Android Pay.

Every time I want to backup my device I need to fix Android Pay.

This means I don't care and will only need to fix it after a restore. :)
[Nexus 6P General] Born<ICs:
.

Thanks for that write up.

Would you mind explaining the current state of TWRP 2.8.7.2 and what Team Win needs to complete so we have a TWRP that plays nice with 6.0?

Thanks much

.

.
[Nexus 6P General] anglerstock:
So do we have to backup both vendors in order to have a successful restore down the road or the 3 defaults are enough?
[Nexus 6P General] y2kbugger:
I am very confused at how you can go in and delete a .db to remove the pin. This only works with unencrypted then right? How could you decrypt without entering the pin?

Note: I haven't tried any of this yet.
[Nexus 6P General] jamespat93:
I tried to recover a full MPangler backup with TWRP but it just gets stuck on the boot screen. I was coming from chroma rom and now no matter what rom I flash I can't get past the boot screen. Does anyone know how to fix this?

At first I tried to restore more than system, data, and boot but even when I just try to restore those 3 it still won't get past the logo.
[Nexus 6P General] smalltownbird:
Try flashing the correct vendor.img?
[Nexus 6P General] vampire_8_7:
Dude you are a live saver, Thumbs up mate. Thanks.
[Nexus 6P General] DespairFactor:
You can fix it from TWRP by mounting system, navigating to /data/system and deleting these files: locksettings.db, locksettings.db-shm, and locksettings.db-wal
[Nexus 6P General] ucisilentbob:
WHen this happened the first time i was freaking out. Thankfully i found this PSA and all was good.
[Nexus 6P General] JsChiSurf:
Just to point out, it's probably not necessary to mount /system for deleting the applicable content in the /data partition.
[Nexus 6P General] sean222:
Does anyone know if this issue is something that will be fixed or is this just how it is now?
[Nexus 6P General] galaxys:
Should be fixed sometime by the twrp developers....
[Nexus 6P General] xSilas43:
Not quite sure what exactly happened here but I restored a backup with pin and somehow it restored fine. I think it's because I backed up vendor as well as restored it.
[Nexus 6P General] mrchennyken:
Restoring from a NANDroid backup didn't work for me either... fingerprint would not register. Had to start fresh and use Titanium Backup. Much more work.
[Nexus 6P General] p2im0:
It would be great if the OP could update Post 1 with the solution to solve the issue and prevent others from having to dig through pages.
[Nexus 6P General] kingmikel:
Updated :)
[Nexus 6P General] cabbieBot:
Thank you for doing that! There are other files that need to be deleted as well, though . . . I believe five in total. I would post them but my angler is currently occupied booting up after a dalvik/cache wipe.

EDIT: Okay here they are. I got myself caught in the OP's situation and first I tried just deleting locksettings.db and it didn't work, then I did the 3 beginning "locksettings" and that didn't work either, then finally I deleted all 5 and I was then able to restore my nandroid successfully. Hope this helps someone out there, this is such a nasty lil bug.

locksettings.db

locksettings.db-shm

locksettings.db-wal

gatekeeper.password.key

gatekeeper.pattern.key
[Nexus 6P General] tracerit:
it seems Smart Lock is removed from the system when restoring and deleting the locksettings.db file.
[Nexus 6P General] zamula:
Nope, just re-enable it under Trust agents.
[Nexus 6P General] kingmikel:
I have only deleted locksettings.db and it has worked for me. I can update it with the rest, but can someone explain what the others do?
[Nexus 6P General] Chilidog:
Can anyone else confirm?
[Nexus 6P General] xSilas43:
I can confirm this has worked for me every restore I've done and it's been about 4 successful restores no issues.
[Nexus 6P General] zenkinz:
for folks who have the pin security enforced by exchange security policy, there'll be no way to remove the lock security. so how?
[Nexus 6P General] Chilidog:
Just vendor not vendor image right? What is it anyway?
[Nexus 6P General] xSilas43:
Yeah just vendor not vendor image.
[Nexus 6P General] midas69:
And I can confirm that it doesn't work for everyone. I've tried 3 times and it's never worked for me. Very odd.

Also very odd, deleting just the 2 files has worked for me in all 3 instances where restoring the vendor partition didn't work. Yet, as posted above, some people need to delete more than just those 2 files.

This whole thing is very confusing.
[Nexus 6P General] boynamedstacy:
So after we boot into the rom after deleting the 5 files, how can you enable fingerprints again?
[Nexus 6P General] cabbieBot:
Just as you normally would . . . go into Settings -> Security to choose the fingerprint option and rescan your prints.
[Nexus 6P General] AxlRose-RX:
my trwp backups never restore even with security disabled (finger and pattern), I select to backup all, then when I apply the restore it goes to a boot loop, only way for me is to restore data partition then dirty flash and can go backup and running again with my data and apps intact, of course I end up having to re-root and re-install my root apps
[Nexus 6P General] xSilas43:
Sounds like an internal error. I would recommend going back to stock and restarting.
[Nexus 6P General] kingmikel:
Don't select all, only back up and restore system, data, boot. I ran into the same problem.
[Nexus 6P General] ilpolpi65:
Same here ....no chance : I tried everything

First time that I have a problem with twrp
[Nexus 6P General] SSVanderbilt:
same here, no idea what I'm doing wrong
[Nexus 6P General] igknight:
I've had it do the bootloop on me multiple times. Mine seems to want to reboot during the restore, thus messing it up. First time was when I first got the phone, put Pure Nexus on it, had issues with SIM card, so did restore to stock, soft bricked it for about an hour till I figured out what was going on. Had to do the restore one partition at a time for it to work.

Last time soft bricked it good for 4 hours. Trying to get the 6.0.1 update something went wrong (my end, nothing big), so figured I would restore from TWRP and try again. TWRP rebooted during system partition, then TWRP couldn't mount the /system drive after. Took me a while to get it working again, should have been smart enough to just fastboot system on the 6.0.1, thats how I ended up fixing it.

Cannot say that I have had the lock screen issue, but not sure if I ever recovered with it locked. (I am encrypted fyi)
[Nexus 6P General] xSilas43:
Only thing I would recommend is a full wipe / RUU restore. Sounds like a twrp issue to me, maybe download and install that?

Twrp should be decrypting when it runs anyways.
[Nexus 6P General] bagarwa:
Summary

I am going to do my first Nandroid backup soon and I'm all sorts of confused now. Looks like different people are having different experience. Let me try to sum up the most common steps -

1. If you disable secure lockscreen, it will remove your fingerprints too. That's what it explicitly says on the warning popup when you try to remove lockscreen security.

2. When you create the nandroid backup, backup system, data, boot and vendor. Vendor is the important one, without which the issues will occur.

3. After restoring the nandroid, boot into twrp and then delete /data/sytem/locksettings.db. If that doesn't fix it, delete the locksettings.db-shm and locksettings.db-wal in the same location. If that doesn't fix it either, delete gatekeeper.password.key and gatekeeper.pattern.key in the same location.

4. If you hadn't disabled lockscreen security earlier, your fingerprints should still be in record. But smart lock will be disabled. You can re-enable Smart Lock under Trust agents.

Let me know if I missed something.
[Nexus 6P General] kingmikel:
Everything looks great, I personally don't backup or restore vendor and I haven't had any issues. It doesn't hurt to back it up, but if you get any errors then restore again without vendor. Also I haven't removed my finger prints, I just delete the locksettings.db that way I don't have to set up my finger prints again, I just set up another pin and voila! If you do decide to remove your prints/password/pin, then you will be good and do not have to worry. If you need any help let us know!
[Nexus 6P General] yass090:
I've already rooted my phone and play to unroot it, I never backed up my phone. Did I make a mistake?
[Nexus 6P General] Gizmoe:
User edit. Mods please remove.
[Nexus 6P General] tech_head:
Why are you unrooting?
[Nexus 6P General] xSilas43:
Nah, wipe all and flash a stock img