[GUIDE] Use NFC to unlock your phone, Galaxy S3 or other!

Search This thread

nacron

Senior Member
Dec 30, 2005
608
136
Hawaii
Thanks for this find! I've added it to the OP for others. It's worked pretty consistently for me with this new module for the 30 minutes I've had it installed, and hopefully it will lead to better battery life. (Battery life wasn't too bad, but I was starting to notice a difference with NFC always on.)



I'm sorry to hear that it's not working for you. Hopefully Google will eventually enable this functionality in Android proper. The Moto X certainly shows that it's not only possible, but practical.

- Dave

Ok, I've done some reading and the waits actually do something so I've reenabled it for the time being as it's unlocking the screen correctly. I have my tectile in my wallet so I just tap my pocket to get it to unlock. I also had to program a task to enable the password screen upon startup because it seems to bypass the security sometimes when you restart the phone and bring you directly to the home screen.

So the fix for TW roms bringing up the unlock screen after unlock is to use secure settings to remove and readd the pass after screen off.

[EDIT]
Dave, can you try my commands on your non TW rom to see if it works too?

I'm using this NFC launcher as it utilizes the NFC detect on and NFC remove commands sent by the Xposed plugin I found. http://xdaforums.com/attachment.php?attachmentid=1767289&d=1362023682

So what I have set is:

Task Boot Lock
1. System Lock

Task Lock
1. Secure Settings > Set Pin (when you create this step you input either your pin or password in secure settings)

If you're using the modifed AnyTAG NFC Launcher, you'll have to separate the unlock in two steps. If you are using the NFC Task Laucher, you can combine this into one step.

Task NFC Unlock Step 1
1. Secure Settings > Wake Device > Screen Bright 5 Seconds
2. Secure Settings > Password/Pin > Disabled
3. Task > Wait 5 miliseconds

Task NFC Unlock Step 1
1. Display > Keyguard > On
2. Task > Wait 5 miliseconds
3. Display > Keyguard > Off

Profile Boot Lock
1. Event > System > Device Boot
-> Task Bootlock

Profile Display off
1. Event > Display > Display Off
-> Task Lock

The only problem I'm having now is that the screen does not time out correctly when unlocked via NFC. Trying to research that.
 
Last edited:
  • Like
Reactions: arnemetis

stormwyrm

Member
Jan 12, 2012
23
3
I got a bunch of NFC tags today and tried this, but had a little trouble with NFC task launcher and Tasker interacting. You have to install Tasker BEFORE installing NFC Task Launcher, and then enable 'Allow External Access' in 'Settings > Misc' in Tasker. Enabling this in Tasker if you installed NFC Task Launcher first as per the instructions for some reason fails to permit NFC task launcher from executing Tasker tasks.

I also experienced the trouble with the home button bringing up the lock screen, and worked around it by adding additional tasks to clear password on unlock and re-enable the password when locking. I'm using a Nexus 4 still with stock Google Android 4.3 ROM by the way (no time to set up anything else yet), so I don't know if this issue is launcher-related.
 
I got a bunch of NFC tags today and tried this, but had a little trouble with NFC task launcher and Tasker interacting. You have to install Tasker BEFORE installing NFC Task Launcher, and then enable 'Allow External Access' in 'Settings > Misc' in Tasker. Enabling this in Tasker if you installed NFC Task Launcher first as per the instructions for some reason fails to permit NFC task launcher from executing Tasker tasks.

I also experienced the trouble with the home button bringing up the lock screen, and worked around it by adding additional tasks to clear password on unlock and re-enable the password when locking. I'm using a Nexus 4 still with stock Google Android 4.3 ROM by the way (no time to set up anything else yet), so I don't know if this issue is launcher-related.

Yes, I noticed this when I recently had to re-install and things did not go as smoothly as they should have. I need to update the guide, I just haven't had time yet. The reminder is appreciated. :)

- Dave
 

GalaxyUser50

Senior Member
Aug 18, 2013
95
13
Did this on my sprint s three and got two errors. One is from Tasker in the notifications saying no active profiles. Second is from scanning the tag. It tells me Tasker has not be granted permissions. Pics are below. Pretty sure I did everything right, recognizes the chip and attempts it. Any help is appreciated. Thanks

Edit. So I got it to work, but I'm having the issue where my home button sends to lock screen and my lights stay on all the time after the NFC unlock. Any help? Thanks again.

Sent from my SPH-L710 using XDA Premium 4 mobile app
 

Attachments

  • 1380588960747.jpg
    1380588960747.jpg
    72.5 KB · Views: 231
Last edited:

nacron

Senior Member
Dec 30, 2005
608
136
Hawaii
I got a bunch of NFC tags today and tried this, but had a little trouble with NFC task launcher and Tasker interacting. You have to install Tasker BEFORE installing NFC Task Launcher, and then enable 'Allow External Access' in 'Settings > Misc' in Tasker. Enabling this in Tasker if you installed NFC Task Launcher first as per the instructions for some reason fails to permit NFC task launcher from executing Tasker tasks.

I also experienced the trouble with the home button bringing up the lock screen, and worked around it by adding additional tasks to clear password on unlock and re-enable the password when locking. I'm using a Nexus 4 still with stock Google Android 4.3 ROM by the way (no time to set up anything else yet), so I don't know if this issue is launcher-related.

The reason the home brings up the lock screen is because the pin isn't entered, it's bypassed. My method above your post is probably the same as yours. I've disabled it because I couldn't get it to work all the time and I looked weird tapping my phone on my wallet in my pocket lol

Sent from my SPH-L710 using Tapatalk 4
 

arnemetis

Member
Oct 4, 2013
12
0
VZW S4 not unlocking

Hello everyone, thank you for this excellent guide and those who have added helpful comments.

Unfortunately I cannot seem to unlock my phone, even though everything appears to be working. When I place my phone over my tag it makes the appropriate noises and I see the toast message telling me it has issued the unlock command, it just sits at the lock screen. Trying to use the tag to lock works flawlessly, and once I utilized sebidraghici's alterations the phone does not lock from the phone from blanking the screen during calls via proximity sensor.

I have a Verizon GS4 running stock, rooted via the VRUAME7 version exploit detailed here. I opted for the NFCLockscreenoffEnabler plugin and left it at it's default of On At Lockscreen. I rebooted between steps when the install instructions requested it. I downloaded the NFC-Unlock-Tasker-Tasks.zip and imported them into tasker, and upon inspection they seem to be fine. I have had no issues using Tasker and NFC Task Launcher for other tag actions.

I believe because I do see the toast message and it simply doesn't work, that Verizon's latest version is preventing the pin code bypass entirely now. I hope I am wrong, and that perhaps someone here can help. Any thoughts?
 
Hello everyone, thank you for this excellent guide and those who have added helpful comments.

Unfortunately I cannot seem to unlock my phone, even though everything appears to be working. When I place my phone over my tag it makes the appropriate noises and I see the toast message telling me it has issued the unlock command, it just sits at the lock screen. Trying to use the tag to lock works flawlessly, and once I utilized sebidraghici's alterations the phone does not lock from the phone from blanking the screen during calls via proximity sensor.

I have a Verizon GS4 running stock, rooted via the VRUAME7 version exploit detailed here. I opted for the NFCLockscreenoffEnabler plugin and left it at it's default of On At Lockscreen. I rebooted between steps when the install instructions requested it. I downloaded the NFC-Unlock-Tasker-Tasks.zip and imported them into tasker, and upon inspection they seem to be fine. I have had no issues using Tasker and NFC Task Launcher for other tag actions.

I believe because I do see the toast message and it simply doesn't work, that Verizon's latest version is preventing the pin code bypass entirely now. I hope I am wrong, and that perhaps someone here can help. Any thoughts?

Check out @nacron's update to this guide for TouchWiz, and see if that helps.
 
  • Like
Reactions: arnemetis

arnemetis

Member
Oct 4, 2013
12
0
It works! Thank you stealthdave, and big thanks to nacron for his helpful post above!! including those steps, and changing my password technique to pin versus pattern (as pattern is not supported) I have been able to get this working in two applications. First I have the unlocking enabled as the first step for my tag that I stuck on my car mount, which works quite well as plugging in power turns on the screen so I don't have to touch anything as I throw it into the mount. I also tossed a simple tag into my wallet just for unlocking, so I just touch my phone to my backside once the screen is on for the patented butt-unlock! Surprised it works through the wallet and jeans. Again thank you so much guys for your help, a little patience and reading goes a long way! :highfive:
 

oswade

Senior Member
Jun 18, 2010
1,057
119
Wow this would be a killer feature if any manufacturers actually implemented it.
 

Cheetah1024

Senior Member
Jun 19, 2012
321
59
Internet. I live on the Internet.
There's a new XPosed Framework module in town that makes this whole thread obsolete. Check out the new NFC Unlock module, forked from the NFC LockScreenOff Enabler module already used in this project. Way simpler, fewer moving parts to configure, and works well. OP will be updated with the new info.

Yep, this works even bettter and faster, but still u need Taster to lock again, when going to standby...

Sent from my LG P880
 
Yep, this works even bettter and faster, but still u need Taster to lock again, when going to standby...

Sent from my LG P880

You should be able to just tell your phone when to lock in the settings as normal with the new XPosed module. I was able to turn off all of my Tasker profiles, and my phone locked according to my "Screen Security" settings as expected.
 
Oct 23, 2008
38
2
Athens
need help

i have a galaxy s3, rooted, omega 43.1 custom rom
i use xposed framework and i can unlock my phone from my nfc tag!
i don't use any security on my phone (no gesture or pin to unlock) (i am bored having to unlock it all the time)
but sometimes i wish my phone was locked (my nephew is killing my battery)
so i want to use an nfc tag to hard-lock my phone in a way that it can only be unlocked from the same nfc tag...! do you have any ideas?
 

tommyleinen

Member
Apr 27, 2011
34
4
i have a galaxy s3, rooted, omega 43.1 custom rom
i use xposed framework and i can unlock my phone from my nfc tag!
i don't use any security on my phone (no gesture or pin to unlock) (i am bored having to unlock it all the time)
but sometimes i wish my phone was locked (my nephew is killing my battery)
so i want to use an nfc tag to hard-lock my phone in a way that it can only be unlocked from the same nfc tag...! do you have any ideas?

Trigger app + Secure settings app + Tasker

Create a task in tasker to use secure settings to enable lock screen pin. Then a seperate task to disable lockscreen. Then open Trigger, swipe the tag and map the first task to tasker lock task and the second task to tasker unlock task. Now your tag will lock and unlock the phone.:good:
 

Besus44

New member
Dec 16, 2013
3
0
Almost perfect

I'm having an issue with the home button on my Samsung GS3 where after I use my nfc tag to unlock the phone the home button somehow causes the lock screen to activate if it is pressed. As with others, the home button works fine if I unlock the phone by without the nfc tag. However, I haven't seen (or may have missed) a work around for this problem. Any help to fix this would be greatly appreciated.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    UPDATE!!! There's a new XPosed Framework module in town that makes this whole thread obsolete. Check out the new NFC Unlock module, forked from the NFC LockScreenOff Enabler module already used in this project. Way simpler, fewer moving parts to configure, and works well. Check it out. Otherwise, this has been a fun way to learn how to use Tasker! :D Thanks, all!



    Original Post

    This is a guide to show you how to set up your phone to be unlocked by an NFC tag. There are several other threads on the subject for various phones and carriers, but it took me several weeks worth of research and testing to come up with something that actually worked on my phone, and this tutorial is the culmination of that effort. In theory, it should work for a wide variety of ROMs (including Stock), phones and carriers, and even survive ROM updates (provided you maintain root), but I have only tested it on a Sprint Galaxy S3 (model d2spr) that is rooted and running CyanogenMod 10.1.

    DISCLAIMER! I am NOT responsible for any damage to your phone, loss of data, use of your phone, or spontaneous sharknadoes that may occur if you try these steps! It worked for me, but I make no guarantees that it will work for you! Back up all your data and your ROM, and use this at your own risk!

    HARDWARE REQUIREMENTS
    • An NFC capable phone, like your Sprint Samsung Galaxy S3 with Root Access enabled
    • An NFC tag, such as Samsung TecTiles

    SOFTWARE REQUIREMENTS

    STEP 1: Install the software!
    Install all of the software listed above.
    Open XPosed Framework and enable the MoDaCo Toolkit OR the NFCLockscreenoffEnabler.apk in the Modules tab

    STEP 2: Turn on NFC scanning all the time
    Normally, Android only scans for NFC tags when the phone is unlocked. We need to scan for NFC tags when the phone is locked, and in our case, when the screen is off. Open the MoDaCo Toolkit app and check the box to Enable NFC when screen is off under Settings -> Wireless

    WARNING!!! Turning on NFC scanning when the screen is off may adversely affect your battery life!

    STEP 2 ALTERNATIVE: Turn on NFC scanning at Lockscreen
    Open the NFCLockscreenoffEnabler.apk app and select Enable NFC when phone is locked, but the screen is on. This option should be a little easier on your battery. (Thanks to @nacron for finding this!)

    STEP 3: Make Secure Settings a Device Administrator
    Open Secure Settings and go to the Configuration Menu by tapping the wrench icon in the upper-right hand corner. Once there, check the box next to Device Administrator and select "Activate" on the confirmation screen.

    STEP 4: Teach Tasker how to Lock and Unlock your phone
    We can either do this the easy way, or the hard way.

    Easy Way - Import the Tasks
    1. Download and unzip NFC-Unlock-Tasker-Tasks.zip and copy the enclosed XML files to your phone
    2. Open Tasker and long-press the Tasks tab
    3. Select Import and open the files that you just copied
    4. There is no step 4.

    Hard Way - Manually Enter the Tasks
    If you don't trust the import function, or just want to learn more about creating tasks in Tasker, you can create the tasks manually.


    Open Tasker and select the Tasks tab. Create a new Task by tapping the big "+" sign, name it "LOCK", and add the following actions:

    1. Select Task -> If
      • Under Condition on the LEFT side of the condition, type TRUN (the variable for Tasks Running)
      • Tap the Condition Operator icon (the grey button in the middle) and select Doesn't Match, or !~
      • On the RIGHT side of the condition, type *Unlock*
    2. Under the If statement, select Plugin -> Secure Settings then tap Edit.
      Select Keyguard and set the following options:
      • Select radio button On
    3. Select Plugin -> Secure Settings then tap Edit.
      Select Lock Device and set the following options:
      • Box for Device Admin Enabled is checked
    4. Select Task -> End If

    Create a new Task named "Unlock", and add the following actions:
    1. Select Task -> Stop And select the Lock Task that we created earlier.
    2. Select Plugin -> Secure Settings then tap Edit.
      Select Wake Device and set the following options:
      • Wake Type: Screen & Keyboard Lights On
      • Duration: 30 seconds
    3. Select Task -> Wait and set duration to 100 MS
    4. Select Plugin -> Secure Settings then tap Edit.
      Select Keyguard and set the following options:
      • Select radio button On
    5. Select Task -> Wait and set duration to 100 MS
    6. Select Plugin -> Secure Settings then tap Edit.
      Select Keyguard and set the following options:
      • Select radio button Off
      • Check box Run in background (No Notification)



    If you run this Task now, you probably won't notice anything different right away. However, if you lock your phone and then unlock it, you'll notice that any security that you had set up is now bypassed. That's why we needed to teach Tasker how to lock your phone, as well.


    STEP 5: Teach NFC Task Launcher to Unlock your phone
    • Open NFC Task Launcher and create a new task for NFC named "Unlock Phone".
    • Take your NFC tag and follow the instructions on the screen to write the tag for this task.
    • Add a new Task by tapping the big "+" icon in the upper right corner.
      • Select Category Tasker
      • Check "Tasker Task" and tap "Next"
      • Type "Unlock" in the field next to the magnifying glass icon under Tasker Task and tap "Add to Task"

    Congratulations! You can now unlock your phone with your NFC tag! Of course, as we mentioned above, this leaves your phone without any passcode protection that you may have previously enable. Which leads us to our final step...

    STEP 6: Teach Tasker to Lock your phone
    • Open Tasker and select the Profiles tab
    • Create a new Profile with the big "+" at the bottom of the screen and select Event
    • Select Display -> Display Off
    • Go back to the Profiles page by tapping the "< Event Edit" icon in the upper left corner.
    • Select the Lock Task that you made earlier

    Now when the screen goes off, your phone is secure again.

    That's it! My hope is that this tutorial is easy to follow so that anyone who wants to unlock their phone with an NFC tag can get it working. While there are a lot of steps, I tried to make them clear and specifically looked for a method that was flexible enough to allow me to update my phone or even use a different phone with this method, without having to track down a modified NFC.apk for my specific firmware every time I wanted to update.

    In regards to how battery life is affected by having NFC turned on all the time, my personal experience shows no appreciable decrease in battery life. I went all day yesterday without charging (about 15 hours) with typical usage for me, which includes 2-3 hours of podcast playback over both wired and bluetooth headphones, occasional GMail and Facebook usage, Solitaire, and 45-60 minutes of phone calls, which is on par with what I was getting before the hack. As with all things, your mileage may vary. If battery life becomes an issue, try the new NFCLockscreenoffEnabler.apk plugin that @nacron found instead of the MoDaCo one which gives you the On At Lockscreen option in addition on Always On. It should save you a bit on battery life.

    Many thanks to the authors of the software I used (XPosed Framework, MoDaCo Toolkit Plugin, NFCLockscreenoffEnabler.apk, NFC Task Launcher, Tasker, Secure Settings Plugin), as well as this thread and this web page for giving me the framework to construct this rather elaborate NFC hack. :)

    I would love to hear from others if this works on other phones.

    Changelog:
    • 2013-09-05 - Add NFCLockscreenoffEnabler.apk option for NFC on at Lockscreen (thanks @nacron for this!)
    • 2013-08-14 - Changes to the Tasker Tasks that make the lock and unlock functions run a bit more smoothly by avoiding collisions. (i.e., if you're unlocking the phone, it won't try to lock it until the unlock is done.) I've also added easy-to-import XML files for the Tasks, so you don't have to type them in manually anymore!
    • 2013-08-09 - Initial release (can you "release" a process?)
    2
    Hello,

    After trying this on a Samsung Galaxy S3 Stock 4.1.2 and Slim Bean (worked like a charm), I have found a glitch on the stock firmware. When making a call the screen would go off via the Proximity sensor so <b>Tasker</b> would lock the phone.

    So I made a little addon to the following part and the problem stoped:

    Original:

    STEP 6: Teach Tasker to Lock your phone
    • Open Tasker and select the Profiles tab
    • Create a new Profile with the big "+" at the bottom of the screen and select Event
    • Select Display -> Display Off
    • Go back to the Profiles page by tapping the "< Event Edit" icon in the upper left corner.
    • Select the Lock Task that you made earlier

    Modified:

    STEP 6: Teach Tasker to Lock your phone
    • Open Tasker and select the Profiles tab
    • Create a new Profile with the big "+" at the bottom of the screen and select Event
    • Select Display -> Display Off
    • Go back to the Profiles page by tapping the "< Event Edit" icon in the upper left corner.
    • Select the Lock Task that you made earlier
      [*] Select Display off (long-press) -> Add -> State -> Sensor -> Proximity sensor -> Check invert

    That's it!

    Now when you get a call and answer it Tasker will know that the proximity sensor is used and will not lock the phone
    Hope it works for you too.

    Thanks,
    [/QUOTE]
    1
    New instructions and importable task files make getting this set up a whole lot easier! Updates in the OP!

    I've attached a cheap NFC tag to my watch wristband, cleverly disguised by gold nail polish, and unlock by NFC is now my preferred unlock method.

    Thats slick man. I may have to use that for myself lol :good:
    1
    Hi, can I use this method to unlock my LG Lucid2?

    I want to use it on GSM network...

    Wrong kind of "unlock", I'm afraid. This unlocks your screen so that you can bypass the lock screen; it doesn't do anything for carriers locking the phone to their network. Think of this as using an NFC tag as your password.
    1
    @lloydcabraham and @bleAf! , what version(s) of Android are you running? I'm on 4.2.2 (CM 10.1.2), and my Home button is working as expected. I'm also using Nova Launcher as opposed to the stock Android launcher. Also, I presume that you haven't inadvertantly remapped the Home button, either by Tasker or some other setting or app? (Forgive me if some of this sounds like basic tech support stuff; just spitballing ideas since I can't reproduce.)