yashsingh1/xdaforums huggingface dataset:
[HTC U12+ Questions & Answers] LibertyMonger:
Yes, I guess. If we just update Magisk without unrooting or removing the old Magisk properly we will continue to have face unlock greyed out until we RUU and try again. And when we fix face unlock from RUU, we have to uninstall Magisk properly before updating. I'm not sure if the Magisk uninstall zip is working properly now but I know it wasn't before.

Now that I have been using the uninstall zip and running these commands before updating Magisk, I no longer get the face unlock issue.

echo KEEPVERITY=true>>/data/.Magisk

echo KEEPENFORCEENCRYPT=true>>/data/.magisk

I flash the uninstall zip, reboot bootloader, boot TWRP again, run these commands then flash the Magisk update.

May not be the fix but it works for me.
[HTC U12+ Questions & Answers] k_l_o:
:( Didn't work for me.
[HTC U12+ Questions & Answers] Freak07:
It’s really a strange issue. It seems not consistent at what point it breaks.

Thanks for you insight!
[HTC U12+ Questions & Answers] LibertyMonger:
I wonder, is anyone having this issue after RUU and remain unrooted, complete stock?
[HTC U12+ Questions & Answers] mammothjojo88:
If your Unrooted complete stock with a relocked bootloader, no. I did go back to stock to see if this fixed it and it does. I even unlocked my bootloader while stock and was able to use face unlock. It has to do with magisk and how its interacting with face unlock. Something is flagging it to be grayed out after flashing Magisk. I was able to try it with Twrp and a custom Kernel and had face unlock. So not sure
[HTC U12+ Questions & Answers] EMJI79:
Is uninstalling Magisk enough to bring it back? (With unlocked bootloader and custom kernel)
[HTC U12+ Questions & Answers] k_l_o:
I've tried it a few times/different ways, and Face Unlock was still gone. I think you'll need to reflash boot and/or system images. I haven't tried because I want my phone rooted.
[HTC U12+ Questions & Answers] LibertyMonger:
No, from my experience, I was flashing magisk wrong and it caused some kind of corruption. When updating magisk, we can't just flash or update it. It has to be uninstalled properly with stock boot restored before updating. If we figure this out and continue to flash magisk properly, face unlock continues to work.

If you have the greyed out face unlock, you have to ruu to fix it and learn to flash magisk properly. I haven't had any problems since figuring this out. There may be another way but I haven't seen it and others may have a different issue than me but from my experience it is completely magisk related.

My advice is to read up a little more on flashing, uninstalling and updating magisk.
[HTC U12+ Questions & Answers] LibertyMonger:
I recently flashed magisk without typing those two commands in emulator and instantly had issues with face unlock. Since then, I have been working for three days trying to get both slots on 1.25 so I have ruu'd quite a bit and every time I flash magisk and type those two commands, I never have a problem with face unlock.
[HTC U12+ Questions & Answers] k_l_o:
Appreciate your continued efforts with this...

Next OTA, I'll RUU back to stock 1.25, take the OTA, and execute those two commands before installing Magisk. We need a sticky on this procedure, in the HTC U12+ forum and not Magisk's. Funny thing is, don't really need the feature, but just nags at me that it's broken...
[HTC U12+ Questions & Answers] EMJI79:
Before you enter TWRP to flash Magisk, do you have face unlocked set, fingerprint set or none of them?
[HTC U12+ Questions & Answers] LibertyMonger:
I execute those commands after installing magisk for the first time after the RUU.

---------- Post added at 12:37 AM ---------- Previous post was at 12:36 AM ----------

I don't think it matters, the main thing is making sure magisk is installed properly.
[HTC U12+ Questions & Answers] EMJI79:
But it may matter. You never know with those kind of issue.
[HTC U12+ Questions & Answers] k_l_o:
1.25.617.4 > 1.30.617.2

Steps I took:

1. Uninstall Magisk via TWRP 2. Flashed boot.img + system.img 3. D/L OTA and upgraded 4. Installed TWRP 5. Installed Magisk via TWRP 6. While in TWRP executed the "2 Lines" 7. Face Unlock worked until reboot, same as always.

What did I do wrong? Not RUUing 1.25.617.4?
[HTC U12+ Questions & Answers] LibertyMonger:
All I know is I used to lose face unlock when uninstalling or updating or flashing Magisk and now I never have issues. It is surely a magisk issue. I do not set up face unlock first after installing magisk for the first time after an RUU. It hasn't mattered either way for me.

---------- Post added at 05:14 AM ---------- Previous post was at 05:09 AM ----------

You shouldn't have to uninstall magisk if you are fastboot flashing boot.img and system.img.

Did you fastboot flash them?

I would say run those commands when doing anything with magisk. Run them after running the magisk uninstall. Run them again after installing magisk. But I think you would have been fine if you didn't run the uninstall zip. It doesn't fully remove magisk.

I fastboot flashed the decrypted 1.25 system.img and boot.img then rebooted to make sure it worked and run the ota. Then I booted into TWRP and ran the commands, flashed magisk, then ran the commands again just to be safe and all was fine for me. Flashing system.img removes magisk and makes you stock with all your data
[HTC U12+ Questions & Answers] k_l_o:
Yup, flashbooted the boot.img + system.img.

You're right, of course, about not needing to uninstall Magisk. Didn't even think how flashing the original boot.img should've gotten rid of Magisk because it's a STOCK Boot.img. :o I'm an idiot, but a paranoid idiot so I was just thinking get rid of Magisk at all cost... Regarding the commands, you had mentioned executing the command AFTER flashing Magisk, but I should've entered then before AND after just to be safe, as you just said... I'll try it again if a RUU of 1.30 get release...
[HTC U12+ Questions & Answers] LibertyMonger:
If you are s-off you can try flashing the system.img and boot.img again and start over without losing data.

But I think running that uninstall zip caused the problem.
[HTC U12+ Questions & Answers] DeeZZ_NuuZZ:
On latest EU update, magisk installed, custom kernel etc and face unlock still works fine, even after updating magisk, it works fine. Hm
[HTC U12+ Questions & Answers] k_l_o:
Stupid Question, but have you rebooted? Face Unlock always worked after initial boot up, but is gone after another reboot.
[HTC U12+ Questions & Answers] DeeZZ_NuuZZ:
Yes rebooted several times already
[HTC U12+ Questions & Answers] k_l_o:
:( :( :(

Well, RUU for 1.30.617.2 became available so I gave it one more try. I FLASHed Boot + System images, TWRP, Kernal, 2 commands, Magisk, 2 commands, rebooted... This time I DIDN'T FLASH Magisk Uninstaller, which left me worse than when I did. Couldn't even get Face Unlock working for the initial boot, unlike when I DID flash Magisk Uninstaller.

Very frustrating...
[HTC U12+ Questions & Answers] LibertyMonger:
Flashing an RUU wipes system so it wipes Magisk as well. No need for the uninstaller. Not sure what's wrong buddy, all I know is I had your issues for my first couple weeks but have not had this problem in a long time since.

Plus flashing the RUU flashed stock boot and stock system so there was no need to flash them again.

You only fastboot flash boot and stock to prevent having to flash an RUU so you can keep your data. When you are rooted and can't take an OTA because of not having pure stock. Flashing system no matter how you flash it wipes and completely removes magisk. Therefore you do not need the uninstaller. You are doing something wrong.
[HTC U12+ Questions & Answers] k_l_o:
I get all you're saying...

Let me ask this, how did you enter the 2 commands? For me, while in TWRP, I used TERMINAL. Should I be entering the 2 commands some other way?

Also, install Magisk via TWRP or the Patch_Boot method?
[HTC U12+ Questions & Answers] LibertyMonger:
Yes I enter the commands in TWRP in terminal and install Magisk after booting up and setting up my device if it is from an RUU.

It's been really easy for me lately to avoid the loss of face unlock. Do you have the latest twrp installed? I don't think it matters much but there has been an update.

And you check the box for face unlock in Magisk hide?
[HTC U12+ Questions & Answers] k_l_o:
Based on what you're saying, it seems I've been installing Magisk the wrong way. I've been flashing it instead of patch_boot method. I will give this one more try and report back later... Thanks for having the patience to work with me.
[HTC U12+ Questions & Answers] LibertyMonger:
I flash it normally with twrp
[HTC U12+ Questions & Answers] k_l_o:
[/COLOR]

WHAT???!!!! You FLASH it normally? Installing from within TWRP using the Magisk zip file?

I just finished going through the patch_boot.img method, and let me tell you, it was an adventure. I was in a boot flashing loop. If you'd follow me. For the patch_boot method, each time I flashed the patch_boot, it erased my TWRP recovery, so had to re-flash TWRP which to get root would have to reflash Magisk.zip within TWRP. You get what I'm saying? Anyhoo... still didn't work. Still no Face Unlock. I thought I'd FINALLY cracked it. My phone said not so fast...

If your patience and good will will allow you, could you please give me your step by step, as detailed as you can, on upgrading to OTA. Mind you, I didn't RUU 1.30, so if that's what you did, then there's no need. Also, feel free to tell me to take a hike if you're not up to know. I toooootally understand...
[HTC U12+ Questions & Answers] LibertyMonger:
I told you a page back that I flash it in TWRP.

So let's start with what Android version you are on right now? And what version of TWRP you are using and what version of Magisk you are using?
[HTC U12+ Questions & Answers] k_l_o:
I read your earlier post. If those are your steps, and you didn't leave out anything, then there's no point rehashing and inconveniencing you. It's just that I repeated your steps, and they seem straight forward, either I'm not performing that correctly, or there's a small step somewhere that might've been left out, because it's a "no-brainer" to you, but not as common sense to me.

FYI, I'm on 1.30.617.2, TWRP 3.2.3-2 and Magisk 17.2(Beta, and didn't matter if I ran 17.1, either) I have the 1.30 boot and system images from the 1.30 RUU.
[HTC U12+ Questions & Answers] LibertyMonger:
Ok, if you can't get face unlock working and you hid it in Magisk hide then you will have to run the RUU again. Sorry but that's the only way I know how. I'm not sure if you can fastboot flash system and boot.img cause I'm not sure if you will have decrypted them properly.

But if you have the decrypted boot.img and system.img you can fastboot flash them just to avoid having to set your data up all over again. That will clean your system like stock leaving your apps and data intact. Either way, the following steps will be the same whether you run the RUU or fastboot flash system and boot.

But let's say you run the RUU again, boot up afterwards and set everything up to get you into Android. Make sure you have the Magisk app installed and all your accounts are set up and you are fully booted, you can do

adb reboot bootloader

-then I just boot into TWRP, I don't install it.

fastboot boot twrp-3.2.3-2-ime.img

-then I flash the latest Magisk

-then you can run the commands in TWRP terminal

-then reboot into Android and go to your Magisk app and go to Magisk hide and check the box for face unlock.

-then you should be able to set up face unlock.
[HTC U12+ Questions & Answers] k_l_o:
So you don't ever install the PERMANENT TWRP? Maybe that's it?

Please remember I didn't RUU 1.25 for the 1.30 OTA. I just fastboot flash 1.30 boot and system images. My Face Unlock is really messed up... I re-fastboot flash 1.30 boot and system images, just now, and booted up, NO TWRP or Magisk. My Face Unlock is greyed out. I cleared cache + data for Face Unlock, and still greyed out. I think I'll need to deal with the hassle of RUUing 1.30 if I ever want my Face Unlock to work, which as I've mentioned before, don't really need. I'm fine with the fingerprint unlock since it's a natural way for me to pick up my phone.
[HTC U12+ Questions & Answers] LibertyMonger:
Yeah but face unlock works so good. The only way I was able to fix the issue was to RUU. Back when I figured out how to fix face unlock we weren't using the decrytped system and boot.img. So try the RUU and go by my steps. That is what has worked for me, I don't know about anyone else. Good luck buddy.

And let me know how you type those commands in terminal.
[HTC U12+ Questions & Answers] k_l_o:
You didn't answer my question, did you ever install the PERMANENT TWRP?

I used TERMINAL in TWRP to enter these two commands:

echo KEEPVERITY=true>>/data/.Magisk<ENTER>

echo KEEPENFORCEENCRYPT=true>>/data/.magisk<ENTER>

Did I at least do that correctly?
[HTC U12+ Questions & Answers] LibertyMonger:
Yes the commands are correct and no I haven't permanently installed TWRP although I don't think that has anything to do with it. Although it might, who knows. I would just boot TWRP for now.
[HTC U12+ Questions & Answers] k_l_o:
OH.MY.GOD. FINALLY!!!!

It's was the Permanent TWRP! I can't be the only person that installed the Permanent TWRP, am I? Or those pple just don't care enough for Face Unlock? I even flashed the Magisk Uninstaller as my first step...

[MENTION=3795321]LibertyMonger[/MENTION] - I wish I can buy you a six-pack for your assistance and patience... :highfive:

TL/DR - DON'T install Permanent TWRP if you want Face Unlock!
[HTC U12+ Questions & Answers] parlayed:
I have the permanent TWRP installed (and I updated it to the latest version) with Magisk & my Face Unlock still works.

I do agree that once Face Unlock totally stops/something triggers it disabled, the only way to get it back is to RUU :(
[HTC U12+ Questions & Answers] k_l_o:
You DO???!!! I'm not going to install the Permanent TWRP, just yet...

I didn't RUU, gave it one last shot with flashing boot + system and flash only the TEMP TWRP because that was the only thing I haven't tried, yet. Now that I have Face Unlock, I was right, don't really need it... Womp, womp... :D
[HTC U12+ Questions & Answers] EMJI79:
I have used temp TWRP and still have had Face Unlock greyed.
[HTC U12+ Questions & Answers] k_l_o:
You have my greatest sympathies...

If you want any help, just keep posting. Not as well versed as [MENTION=3795321]LibertyMonger[/MENTION], but who knows? I might be some assistance.
[HTC U12+ Questions & Answers] EMJI79:
My computer is down at the moment. I have seen there's a method to RUU just with the SD card but I prefer not to mess with my smartphone without having a computer to fix it.

But thanks, maybe I'll ask for your help later.
[HTC U12+ Questions & Answers] LibertyMonger:
Very happy to hear it buddy, enjoy!
[HTC U12+ Questions & Answers] k_l_o:
Yes, there is and it's VEEEEEEEERY easy... Just need to download a RUU.zip, has to be a .zip file.
[HTC U12+ Questions & Answers] EMJI79:
But to boot into temporary TWRP to flash Magisk, you still need a computer?
[HTC U12+ Questions & Answers] k_l_o:
Yup, no going around that...
[HTC U12+ Questions & Answers] k_l_o:
Are you on a kernal by any chance? Why I ask? Probably because I BROKE IT, AGAIN...

I realized I skipped over the CleanSlate kernal. So I booted into TEMP TWRP again to flash the CleanSlate. Coming out of reboot, Face Unlock is no longer there. I UnHide/Hide Face Unlock in Magisk, along with clearing date... Nope! Maybe that's why [MENTION=916084]parlayed[/MENTION] has Permanent TWRP installed and Face Unlock is still working for him. He doesn't have a kernal installed, like you...

[MENTION=916084]parlayed[/MENTION] - Please feel free to report back.
[HTC U12+ Questions & Answers] parlayed:
I am currently using the Viper Magisk module ROM with Freak07's latest kernel, but I have used CleanSlate as well.

Remember that after you install Magisk, hide FaceUnlock in Magisk, clear data for FaceUnlock in the app settingsnand then reboot. Then you will need to setup FaceUnlock again. It took me forever to realize I needed to setup my face again for it to work. I was assuming it was not working, but I only needed to set it up again.
[HTC U12+ Questions & Answers] k_l_o:
Nope, doesn't work for me. I think the kernel screwed me up... I might try Permanent TRWP, NO Kernel, Magisk and see if Face Unlock works...
[HTC U12+ Questions & Answers] LibertyMonger:
No the kernel didn't screw it up. I don't know what you're not doing right. You need titanium backup to wipe data on face unlock I think. I have a back up of face unlock with titanium backup but haven't had to try it yet to see if it restores it. Haven't needed to.

You're making it too difficult somehow someway buddy.
[HTC U12+ Questions & Answers] k_l_o:
All I did was flash Cleanslate, nothing less, nothing more and Face Unlock grayed out. That should normally be no big deal, right? It's just my phone...
[HTC U12+ Questions & Answers] LibertyMonger:
I don't know buddy. I had your issues for the first couple weeks and that was it. Only thing that ever caused me to lose face unlock was Magisk.
[HTC U12+ Questions & Answers] k_l_o:
Well, I know how to get it working on my phone if I really want to now. I just don't need it as much as you like that feature. I'll just leave it alone for now, until I get bored again. And I can stop pestering everyone here, as well.
[HTC U12+ Questions & Answers] parlayed:
I decided to RUU to update to 1.30. Here are my steps with everything and my Face Unlock is still working:

1.) RUU and set everything up on 1.30

2.) Boot Temp TWRP

3.) Install Permanent TWRP

4.) Reboot

5.) Boot to Temp TWRP

6.) Install Kirisakura kernal by Freak07 (CleanSlate would also work)

7.) Reboot

8.) ADB reboot to recovery (TWRP)

9.) Install Magisk 17.2 & reboot

10.) Enter Magisk and hide Face Unlock

11.) Clear data on Face Unlock app

12.) Reboot

13.) Click on Face Unlock and setup my face again

Hopefully this helps ?
[HTC U12+ Questions & Answers] JEANRIVERA:
on step 3 you install PERM TWRP but on step 5 you boot TEMP TWRP why would you do that for? :confused:
[HTC U12+ Questions & Answers] k_l_o:
MEANT for [MENTION=916084]parlayed[/MENTION]

Wow! Thanks for the great step-by-step write up.

You didn't need to execute the 2 commands in TWRP Terminal? The commands are:

echo KEEPVERITY=true>>/data/.Magisk

echo KEEPENFORCEENCRYPT=true>>/data/.magisk

I'll use your steps, BUT I'm not RUU-ing, just flashing boot and system images. I'll let everyone know how that went, later tonight.

P.S. - But I do agree with [MENTION=453495]JEANRIVERA[/MENTION], why the PERM and then TEMP? And what made you think to do it this way?
[HTC U12+ Questions & Answers] parlayed:
I did that because I did not want to install the touchscreen hexpatch and because I had not installed the kernel yet that has that patch included.

I also wanted to reboot between each step to make sure Face Unlock was still working so if it had stopped I would know which item/step caused it.
[HTC U12+ Questions & Answers] LibertyMonger:
You can get answers on the Magisk page on how to install and uninstall properly. Just have to read through it. It's highly advised to read it all to prevent these issues.

I don't know what the fix or answer is I just know face unlock is finicky with Magisk. But luckily I haven't had issues with it like I did in the beginning.
[HTC U12+ Questions & Answers] k_l_o:
Aside from RUU-ing, I followed all your steps, including ALL the reboots, but couldn't get Face Unlock to work. Frankly, I knew from the start that it wasn't going to work because after flashing boot + system, cleared data in Face Unlock, it was still greyed out. I performed the rest of the steps anyway because, "Why not?" Hopefully, your guide helps others.
[HTC U12+ Questions & Answers] DeeZZ_NuuZZ:
So you did the RUU again and in magisk hide the face unlock? If done several RUU now, with restoring data and reflashed magisk and flashes v17.2 and it still works fine for me...
[HTC U12+ Questions & Answers] k_l_o:
No, I didn't RUU. I followed all the steps, including all the roboots after every step. I don't like RUU-ing because setting the phone up can take over 2hours for me. I don't need the feature enough to go thru that headache.
[HTC U12+ Questions & Answers] parlayed:
After doing your restore of Boot & System, if Face Unlock was not available then, for sure the other steps (in my opinion) would not help restore it.

Doing the RUU can take a little bit longer, but with Google restoring all data and settings I don't find it too bad, plus I think that is the only way to get Face Unlock working once something flags it and it's disabled as you have described.

Good luck!
[HTC U12+ Questions & Answers] DeeZZ_NuuZZ:
Did you in any way tampered vendor?

You can also backup data with TWRP, and restore after RUU, there is also a twrps file which needs to be in a specific directory...I think it is in one of the guides thread. If you can't find it I will search for the thread later.

This way if you flash TWRP after RUU is done with a full boot, you won't tamper system and vendor, so it should be fine.
[HTC U12+ Questions & Answers] k_l_o:
Yes, I read about that .twrps file. Forgot about it until you brought it up. I also remember having trouble changing the permissions on that file to 0664. I used Root Explorer and could only get the .twrps to 0660. Anyway you can upload a 0664 version? *Nevermind - Got it to 0664. I think I put it in the right folder.

Regarding vendor, don't think I've touched that. I've only installed TWRP, Cleanslate and Magisk.
[HTC U12+ Questions & Answers] DeeZZ_NuuZZ:
Tried placing the file via TWRP? Because even if I upload mine, you still have to set the permissions. But you can also try solid explorer or so. And if you place that file into the system/root folder where it has to be, it won't get deleted even if you RUU the phone. At least for me it is there all time and thus if I boot TWRP it won't tamper the system/vendor
[HTC U12+ Questions & Answers] LibertyMonger:
I'm having a little bit of a hard time understanding exactly which folder this file goes in, can you clarify from my screenshot please?
[HTC U12+ Questions & Answers] DeeZZ_NuuZZ:
Like you can read there, in the /persist folder. It's directly under root.

Screenshot in attachment, don't look at the file changed date. It is from few hours ago, because I restored stock boot and reflashed TWRP via the zip installer.

File size may vary, it will edit it according to the settings made in TWRP.
[HTC U12+ Questions & Answers] LibertyMonger:
That's what I thought but then it says system/emulated/0/twrp then you said something about in the root folder so I got a little confused. Thanks buddy.
[HTC U12+ Questions & Answers] LibertyMonger:
I've made a backup of the face unlock files before setup. Has anyone tried restoring a titanium backup restore of these files to see if it fixes this issue?
[HTC U12+ Questions & Answers] DeeZZ_NuuZZ:
Yeah you should place it in both, but I think the persist folder is enough.

At least when it was only in that folder and I booted TWRP after RUU it was no problem and I still could take ota
[HTC U12+ Questions & Answers] Alan-B:
Hi,

I just updated in stock version 1.30.401.2 DUGL.A initialization it about configuring to the face, but this function is not there! not even drunk it's not in the list. I have good stock version without root !!

Is there a question of region playing!

And with the last Magisk it does not change anything ...

PS: yet the .apk is well in rom!
[HTC U12+ Questions & Answers] EMJI79:
I saw on the RUU thread we cannot use external sd above 32gb? I have a 200.
[HTC U12+ Questions & Answers] gsm0607455890:
I had the problem yesterday

it takes a small card ùsd max 8GB of memory, I managed with a 4Gb but never with a 64 or a 128GB
[HTC U12+ Questions & Answers] EMJI79:
And I bought a 200gb for that and to be future proof. :(
[HTC U12+ Questions & Answers] gsm0607455890:
I found a 4gb in an old electronic device and now I will keep it preciously