Overview

Unlock your phone by just picking it up! No more pesky password or gesture PIN, just scan an NFC tag! This guide covers creating an NFC ring, putting an NFC tag in your nail polish, modding your Android installation to read tags from the lockscreen, and creating an automation toolchain to unlock the phone when the desired tag is scanned.

The software side of this project can be pretty tricky, and even scary if you've never jailbroken a phone before, which is required to get the phone to read NFC from the lockscreen.

However, you can still do a lot of fun projects without modding your Android install, just skip that step and head straight to the page about NFC+ Tasker Automation. You won't be able to log into your phone with your nail polish, but you could do all kinds of other things like start playing Barry White when you place your phone on the nightstand (just sayin').

NFC Tag Ring

Measure your finger or ring that fits well to determine what size to go for-- then seek out RFID tags with a coil close to this same diameter.
You can also take a bigger tag like the business card-size one pictured above, and dissolve away the plastic with acetone (cover with plastic and a rubber band and keep in a well-ventilated space until the antenna and chip can be easily removed).

Test your tag periodically to be sure it still scans (here we're using the NFC Tools app).
If using a larger tag, you will need to rewind the antenna coil to fit your finger. Be careful not to scratch or break the thin enameled antenna wire!
We modeled up two 3D printable rings with channels for the antenna coil, should you have a 3D printer handy. Adjust the size to match your finger and tuck the wire and chip into the interior groove on the ring. Test that it still scans! We broke a few tags before we got one to work.

The most straightforward way to make an NFC ring is to glue a tag to an adjustable ring base (with E6000 craft adhesive, of course). The black tag pictured came out of our MiFare bracelet (we just cut it open and removed the tag disc).

NFC Manicure

Another way to put NFC tags on your hand is to laminate one into your nail polish! We pulled this small tag out of one of the leather fobs in the store, and trimmed the plastic close to the antenna until the layers peeled apart, then removed any stick residue with rubbing alcohol.
Curve the antenna coil over a round object like a ring mandrel. The tag should fit snugly to the curve of your nail without springing up away from it.
Apply bonding agent and gel base coat layer to your nail.
Stick the tag to the base coat, using a piece of clear packing tape to keep it in position if necessary. Cure the base coat layer in your UV lamp for ~2 minutes, then remove the tape. The tag should be pretty stuck to your nail by now!
Apply and cure several coats of gel top coat over the nail and tag, making sure to seal in the edges of the antenna coil.

We used three coats, but you may prefer even more! After the final coat, use rubbing alcohol to wipe away the sticky residue and you've got a fancy new RFID manicure!

Mod Android Installation

Use these instructions at your own risk! We assume no responsibility for what happens to your phone. The instructions below WILL wipe all your personal data from your device and there is the potential to cause permanent damage to your phone. Also your warranty will probably be voided. You have been warned!
This guide was created using an Apple computer running OS X 10.9.2 and a Nexus 4 Android phone running KitKat 4.4.2. We'll try to keep the instructions as general as possible, but if you're using something other than these exact devices and software versions, the process may differ, and the suggested tools here might not work for you.

Install Android File Transfer and back up important data on phone including photos, videos, sms messages, music, etc. If you use Google to back up your contacts, double check they're all synced. This guide makes no claim that your app settings/logins will be preserved, even if you follow the backup steps described below. OK enough disclaimers, LET'S START HACKING!

You'll need to download the command line tools fastboot and adb, both for communicating with your phone while it's plugged into your computer. Various rooting packages online contain these programs but the safest place to download them is just to grab the whole Android ADK for your OS and locate these tools inside the platform tools directory. You may want to copy fastboot and adb to another folder closer to your home folder for easier command line navigation later (like your desktop).
Now let's prep your phone! First up make sure it's charged at least 80%. To communicate over USB, you'll need to enable the developer features on your phone. Inside Settings, select About phone and repeatedly tap Build number until a popup indicates you have enabled developer mode.

Go back one screen (to the main settings menu) and select Developer options. Check the box to enable USB debugging.

In Settings -> Security, check the box to allow installation of apps from Unknown sources.

If you haven't already, use system update to make sure your phone is running Android 4.4.2.
Open Terminal and navigate to the folder containing fastboot and adb (mine is a folder on my desktop called RootNexus4, seen in the Terminal screenshot above). With the phone plugged in and awake (no lock screen), type:
chmod 755 *type ./adb devices
You should see your device appear in a list and be labeled device. If your device is labeled unauthorized, be sure the phone is awake and unlocked (no passcode/lock screen) and try unplugging/replugging. Then type:
./adb backup –apk –all –f backup.ab
to initiate a system backup (system and app settings), and confirm the backup on your phone's touchscreen. This can take up to 20 minutes or more. If it finishes instantly, be suspicious. Remember, we're not guaranteeing anything here-- you may lose your system and app settings if this backup is not performed/restored successfully.

You already remembered to separately back up your important files like photos and videos, right? The next step will wipe all the personal data from your device, so now's your last chance to back up. When the backup is finished, power down your phone and unplug it from USB.

Press and hold the Power and Volume down buttons until you see the bootloader menu. The bottom line of text should say your phone is locked.

Now plug your phone into your computer with a microUSB cable.

In Terminal type:
./fastboot oem unlock
This will erase all your data! You made a backup, right?!

Press the Volume up button to select Yes. Then press the Power button to confirm. After erasing, the bottom line of text should now say unlocked. Congrats, you unlocked the bootloader! Press the power button again to reboot your phone.
Set up your phone as if it were new (enter your info), or skip through if you plan to restore your settings from a backup. Check for system updates in Settings->About phone, and perform any system updates required to get you to Android 4.4.2 if you haven't already.

In Settings -> About phone, you will have to re-enable developer options by tapping the build number repeatedly, then in Developer options turn USB debugging back on. In Settings -> Security, re-check Unknown sources to allow apps from unknown sources.
Install CyanogenMod, the easiest way is to visit http://get.cm on your device (you'll also have to download the desktop installer for mac during this process - G+ support community)

All that modding was for one purpose: to swap out the NfcNci.apk file, which is accomplished by downloading and running this updater for NfcNci.apk for cyanogenmod11/android 4.4.2. Use Android File Transfer to drag this zip file onto your phone.
To run this updater (.zip), power down your phone and re-start in bootloader mode (holding power and volume down buttons). Press the Volume down button until the option Recovery mode appears. Press the Power button to select and launch into recovery mode.
Using the Volume down/up buttons to scroll and the Power button to select, scroll to and select install zip then choose zip from /sdcard.
select /0 then scroll to the updater zip file and select it. Scroll to and select Yes on the confirmation screen, which will run the update and install the custom NfcNci.apk file.

Then select go back until you see the reboot system now option, and select it to restart your phone.

Congrats, now your phone will poll NFC on the lock screen! Test it out by holding a tag to your phone when the screen is on but still locked-- you should hear the quiet noise that indicates a tag has been read!

Now it's time to set up the custom actions that will unlock the phone when the correct NFC tag is near the phone.
Google publishes factory images for its devices, so if something goes wrong, you can always download and install previous/fresh versions of the operating system. I found my phone softbricked whenever I tried to manually install Android KitKat (4.4) or manually update the NfcNci.apk file, and so eventually I reinstalled Jelly Bean (4.3) and used the built-in system update to get my phone up to 4.4.2, required for this guide.

NFC + Tasker Automation

You'll need four apps: Tasker, Secure Settings, NFC Trigger and its companion tag-reuse plugin.

The installation order matters! Install and open Tasker first.
Open Tasker and go to settings. Check the box for Allow External Access. This will let NFC Trigger tell Tasker to start a task.
Create a new task (I called mine Unlock). Click the plus (+) to add a new action then select plugin. Choose Secure Settings then Dev Admin Actions then Password/Pin. Check the box next to Device Admin Enabled and enter a password to unlock your phone. Tap the save icon at the top of the screen. Tap the Tasker logo to go back to the Task Edit screen.

Add two more actions: the first is very similar to above, but in Secure Settings select Actions -> Keyguard - Off.

The third action sets a user-defined variable in Tasker, named NeedsLock, to 1 (check the box labeled use maths).
Create a new task that re-secures your phone (I called mine Reengage). Make an IF statement that checks if NeedsLock is 1 (using maths), then inside the IF statement add three actions that reverse the actions of the Unlock task (re-enable keyguard, set password, set NeedsLock to 0).
Your Tasks screen should look like above, with two tasks!
Make a new Profile that activates the Reengage task whenever the display turns off. Now that Tasker is configured, it's time to set up the NFC Trigger app.
Create a new trigger and select NFC, then tap Next.
On the next screen create a new action, and scroll down to select Tasker -> Tasker Task. Then tap Next.
Tap the magnifying glass icon to be provided with a list of Tasker tasks to choose from. Choose Unlock (or whatever you named your login task), and tap Add to Task.

If no tasks appear in the list, it means you installed/opened NFC Trigger before configuring Tasker to allow outside access, so you'll need to uninstall and reinstall NFC Trigger.
Give your task a name-- this name appears as a notification when the task is triggered, so I called mine "Authenticating ring." Tap Next.
NFC Trigger will ask you to scan your desired tag. If it scans but displays an error, you may have forgotten to install the Tag Reuse plugin app for NFC Trigger-- no biggie, just grab it from Google Play and try again.
The above message will display, then tap Done.

Repeat to create an NFC Trigger task for each tag you want to unlock your phone-- I added an "Authenticating manicure" task and attributed it to my nail polish tag.
Now try it out! Lock your phone's screen, then press the power button to wake it up. The password screen should appear, and when you bring the tag against the phone, it should unlock! Enjoy your new mod and show it off to your friends!