Causes and solutions "UIDs on system are inconsistent... I'm feeling lucky"? HTC One Mini 2/Android 4.4.2/HTC Sense 6.0/Not rooted/4 weeks old

A couple of days ago i encountered this message on my phone:

UIDs on system are inconsistent

You need to wipe your data partition or your device will be unstable

[I'm feeling lucky]  (button)

...and then ensued a long day of tech support &amp; research which i wanted to share here.  Web searching did not solve my problem directly, and while i can add a couple of insights that i didn't find elsewhere, i don't really have an answer.  Many of the information i found was from people who had rooted their phones, and therefore not directly relevant to me - i am approaching this from an un-rooted phone

.

Symptoms/history

Phone crashed while browsing HTC's blinkfeed, and restarted

It limped along for a few minutes and restarted again

Phone then gets stuck at white HTC/android screen and remains there (left for several hours) - ie cannot power off, screen remains on

Later, i discovered that you can proceed beyond this screen by ejecting the sim card - this then shows the lock screen (active background, time, date etc) but on top of this is the message UIDs on system are inconsistent... and one button which says "I'm feeling lucky".  Whether you can press the button seemed to be allowed if you changed the position of the sim card - (ie if out, push it in, if in, eject it).

After dismissing the strange message, i am left with a black screen with notification bar at the top, and navigation bar at the bottom.  No apps; no widgets.  The notification bar was working, in that i could swipe down, enter settings etc.  Further, if i received a text, i could then access my messages via the notification bar, but could not reply to a text because the keyboard did not load.  Having used an app like messages or settings, i could switch between them with the bottom right navigation button as usual.  I found that i could receive phone calls, and once done so, i could dial others by switching back to the phone app.  This about sums up the functionality of the phone.

The other comment was that the phone could not be switched off.  Holding down the power button and selecting power off simply resulted in a restart of the phone.

After further investigation with HTC technical support i found i could restart the phone in safe mode, but exactly the same process happens (ie restart, ejecting and re-inserting the sim card and agreeing to the "I'm feeling lucky" button to get back to the main lock screen).  

HTC technical support wanted me to do a hard reset: this can be done in one of two ways, by software (an option under settings>backup &amp; reset>Reset phone) or by hardware (holding down volume-down and power during start up.  The software method had no effect on the described behavior.  We tried this several times.  The hardware method was unsuccessful, the phone simply restarted in safe mode.

HTC technical support finally admitted defeat, unable to think of something else suggested sending it in for repair.  Vodafone tech support also offered to send a pack for returning the phone for repair.

All comments/further info from the community will certainly be interesting, but please also see below, as i did manage to avoid sending back the phone for repair as I did eventually succeed in the hard reset.
A Solution

On reflection, my thoughts were 1) this seems like a software problem, possibly malware of unknown origin and 2) it seems to be interrupting the power-cycling of the phone.

Therefore, before committing to sending the phone out to either HTC or Vodafone to look at, i tried my own hard-reset of the phone.  Without access to remove the battery, i simply discharged the battery completely (wifi,GPS,Bluetooth,NFC,active call).

Now, plugging in the phone to charge, i found that i could enable a hard reset (holding down power and volume down) i get a basic text interface with option to do a hard reset.  This was sucessful.  Clearly this is a much stronger version of the factory reset than via the menus.

My phone is now set up again and working happily, and i dont need to send if off for "repair".

Possible causes

My feeling is this was a piece of malware, although i have no direct proof.  As a resource to assist others, below i list the most recent apps i downloaded.
/Trigger: SMS Plugin/NFC ReTag FREE/No One Dies/Rightmove Property Search/Contacts Optimizer/Google Keyboard/AnyTag NFC Launcher/Proxy Settings/Aix Weather Widget/Bright Weather/

In hindsight, i accept that some of these are from lesser-known sources, albeit all acquired via the play store, i didn't pay close attention to the permissions.

Summary

My primary motivation for posting here is because i failed to find useful advice yesterday when i needed it.  Many others have posted about this message, some also suspecting malware, but most say a factory reset solved the problem.  I hope to add to the situation the following new pieces of information

1) Eject and reinsert of the SIM card to proceed when frozen

2) Running the battery down as a method of doing a hard reset, if the other method fails

3) A list of apps i recently downloaded, might help point towards a possible source of malware, albeit useless until compared with other users who encounter the same problem.