• XDA Forums have been migrated to XenForo. We are aware of several issues including missing threads, logins not working, and more. To discuss, use this thread.
  • If you are experiencing issues logging in, we moved to a new and more secure software and older account passwords were not able to be migrated. We recommend trying to reset your password, then contacting us if there are issues.

[MOD][Xposed] NFC Unlocking (based on NFCLockscreenOff Enabler)

subzero2000

New member
Aug 17, 2010
53
16
0
NFC LockScreenOff Enabler screencast

Below is a link to a quick screencast using NFC LockScreenOff Enabler to authorize an NFC tag.

http://www.youtube.com/watch?v=5ix-5utZwAY

If you're not seeing this when you scan a tag when NFC LockScreenOff Enabler is open, then it's likely not detecting your NFC tag.

If this is the case, please download NFC TagInfo from the Play Store - https://play.google.com/store/apps/details?id=at.mroland.android.apps.nfctaginfo

Scan your tag using this app, click the "Tag Information...", and post back here what classes are listed under the "Target technology classes (Android)" section near the bottom of the screen. Use the 3rd screenshot posted on the Google Play page for this app as an example.

Feel free to uninstall this app afterwards, as it is only for gathering information about your NFC tags, and is not necessary for normal operation of NFC tags with your device.
 

Mikegrmn

New member
Aug 24, 2013
620
199
0
You're looking at a completely different app if you're not opening the module.

Sent from my Sony Xperia Z1 (C6903) using Taptalk 4
Thanks, this was probably the best hint ever. Although, the dialog that pops up looks exactly the same as the one that was used a few versions ago (the versions where no icon was used in the upper left).
It's working now.
What's funny is, that this strange view I had some versions ago still popps up. I got it now using trigger to create a non empty nfc chip. But except for trigger (formerly nfc task launcher, or so) I don't have amother app installed that uses nfc chips. And even when I froze trigger, that weird dialog still popped up.
Well whatever. Thanks again for the hint. It's working now and I'm happy:D
 

klau1

New member
Jan 1, 2008
1,793
389
0
Hi yes, I did, just dont know where to put alle th data, thats why i asked is anyone has a screenshot...
Example of Usage in Tasker.

Profile: NFC Intents (33)
Event: Intent Received [ Action:android.nfc.action.TAG_CHANGED Cat:None Cat:None Scheme:* Mime Type:* ]
Enter: NFC State (26)
A1: If [ %tag_uuid ~ 00000000000002 ]
A2: If [ %tag_present ~ true ]
A3: [X] Flash [ Text:Tag go true Long:eek:ff ]
A4: Variable Set [ Name:%taG_2 To:true Do Maths:eek:ff Append:eek:ff ]
A5: Else
A6: [X] Flash [ Text:Tag go false Long:eek:ff ]
A7: Variable Set [ Name:%taG_2 To:false Do Maths:eek:ff Append:eek:ff ]
A8: End If
A9: End If
A10: If [ %tag_uuid ~ 00000000000001 ]
A11: If [ %tag_present ~ true ]
A12: Variable Set [ Name:%taG_1 To:true Do Maths:eek:ff Append:eek:ff ]
A13: Else
A14: Variable Set [ Name:%taG_1 To:false Do Maths:eek:ff Append:eek:ff ]
A15: End If
A16: End If


This is the logic for 2 tags. Of course you have to replace the tag id with your tag id.
Any suggestions and improvements welcome.
 
Last edited:

stealthdave

New member
Jan 18, 2012
162
54
0
Los Angeles
Just installed this new module, and it works great! I had previously gotten NFC Unlock working through a rather complex process involving NFC Lockscreen Enabler, NFC Task Launcher and Tasker (over at this thread, for those who are interested), but this is much simpler! Thanks!

I did find one minor UI issue when I installed 1.9.5, and I do mean minor. You can only authorize new tags to unlock when Enable NFC when is set to screen is off (regardless of lock state). I had initially set mine to phone is locked, but the screen is on for better battery life. Unlock does work with the phone is locked, but the screen is on setting, but you can't authorize new tags. The work around is just to switch on NFC when screen is off and switch it back when you're done, but it would be nice to be able to authorize tags regardless of the current NFC setting.

- Dave
 

Mikegrmn

New member
Aug 24, 2013
620
199
0
I've been using it now for 2 days and it works great. Only thing I don't like is the either on or off sound for NFC events. Instead of sound, I used vibration on my razr HD when I had setup the same functionality via tasker. This way, I knew when my phone was unlocked without looking and without annoying surrounding people. I made a fake skip clip using magnets, some felt and a NFC tag, pretty much the same what Motorola is selling. I clip it to my pants pocket so when I slide out my N3, I can immediately tap the NFC chip.
If any one is interested, I can post some pics. I was thimking about putting up an instructable but haven't done so far because describing the tasker setup would have been tedious. With this xposed module, I'm reconsidering writing one.
 

MohammadAG

Inactive Recognized Developer
Sep 7, 2009
1,080
5,504
0
27
Jerusalem
mohammadag.xceleo.org
Hello,
@MohammadAG

This is the first time i can use your app on stock sony 4.1 :) nealy everything works, only it didn't unlock my device :(

Gesendet von meinem C1905 mit Tapatalk
Stock 4.1? Can you post a screenshot of the lockscreen along with a deodexed copy of android.policy.jar?


Just installed this new module, and it works great! I had previously gotten NFC Unlock working through a rather complex process involving NFC Lockscreen Enabler, NFC Task Launcher and Tasker (over at this thread, for those who are interested), but this is much simpler! Thanks!

I did find one minor UI issue when I installed 1.9.5, and I do mean minor. You can only authorize new tags to unlock when Enable NFC when is set to screen is off (regardless of lock state). I had initially set mine to phone is locked, but the screen is on for better battery life. Unlock does work with the phone is locked, but the screen is on setting, but you can't authorize new tags. The work around is just to switch on NFC when screen is off and switch it back when you're done, but it would be nice to be able to authorize tags regardless of the current NFC setting.

- Dave
This shouldn't be happening, the UI is using standard android APIs. Technically it should work even if the mod isn't even enabled. That's very weird.


I've been using it now for 2 days and it works great. Only thing I don't like is the either on or off sound for NFC events. Instead of sound, I used vibration on my razr HD when I had setup the same functionality via tasker. This way, I knew when my phone was unlocked without looking and without annoying surrounding people. I made a fake skip clip using magnets, some felt and a NFC tag, pretty much the same what Motorola is selling. I clip it to my pants pocket so when I slide out my N3, I can immediately tap the NFC chip.
If any one is interested, I can post some pics. I was thimking about putting up an instructable but haven't done so far because describing the tasker setup would have been tedious. With this xposed module, I'm reconsidering writing one.
Please do, I use my wallet, but my muscle memory always makes me put the wallet in my back pockets so I can't scan it. A clip would be much better, but I can't justify spending $20 bucks on one when a tag is $1.

Sent from my Sony Xperia Z1 (C6903) using Taptalk 4
 

Mikegrmn

New member
Aug 24, 2013
620
199
0
So, here are some pictures I took while making my fake skip clip. Cost is about $1 for the NFC tag, $2 for the felt pieces (you should get about 5 skip clips out of them). The magnets were lying around. I bought a computer mouse some time ago, and the packaging had a neat little cardbox flap that was held in place with the magnets. Any magnets that are strong enough to hold the skip clip together through the felt and some clothing (like the pockets of your trousers) should do.


IMG_20130831_191632.jpg
These are all parts you need. The round shiny thingies are the magnets. I used only one of them for the part that sits outside my pants pockets, and two on the inside. This provides more adhesion when clipped together. Depends on what kind of magnet you have.

IMG_20130831_194341.jpg
These are the pre cut felt clips. If your magnets aren't round, just cut the felt accordingly. Don't forget to let some leeway around the magnet as you need some space where you can put the stitches to hold everything together.

IMG_20130831_195805.jpg
This is how the pieces come together. I stickied the NFC chip on the black felt cut out right above the magnet that is sitting on the green felt. Make sure that the position of the NFC chip is so that it sits completely on the outer side of your pocket and only has one layer on felt on top. I don't know how much layers NFC could take to still work.

IMG_20130831_203205.jpg
This shows the first stitch and how the pieces come together again.

IMG_20130831_204306.jpg
To make sure the magnet doesn't move around too much, I also stitched above the magnet through the whole width of the felt stripe to create a kind of pocket for the magnet. You maybe could also just glue the magnet on, but gluing felt usually makes the felt stiff.

IMG_20130831_210205.jpg
The final "product" stretched out. You can feel where the tag is. This is important so you don't clip the thing on with the tag inside your pocket. Like I said before, I don't know how many of layers of felt/pocket NFC still works through. Maybe I'll put a mark with some stitches on the correct side some time in the future.

IMG_20130831_210513.jpg
The final "product" again, this time clipped together.
Just clip it on your trousers pocket, or jacket, or ...

Have fun.
Please press thanks if you like it.

Once I make a complete instructable out of it, I may also include how to set up everything with xposed and such. I'll put a link to instructables should I post it as instructable.
 
Last edited:

MohammadAG

Inactive Recognized Developer
Sep 7, 2009
1,080
5,504
0
27
Jerusalem
mohammadag.xceleo.org
So, here are some pictures I took while making my fake skip clip. Cost is about $1 for the NFC tag, $2 for the felt pieces (you should get about 5 skip clips out of them). The magnets were lying around. I bought a computer mouse some time ago, and the packaging had a neat little cardbox flap that was held in place with the magnets. Any magnets that are strong enough to hold the skip clip together through the felt and some clothing (like the pockets of your trousers) should do.

<snip>

Once I make a complete instructable out of it, I may also include how to set up everything with xposed and such. I'll put a link to instructables should I post it as instructable.
Thanks! I'm impressed, it looks quite similar to the Moto Skip.
I imagine I can't do this with my current tags, they're 4cm in diameter, I guess I'll have to get smaller ones.
 

Mikegrmn

New member
Aug 24, 2013
620
199
0
Thanks! I'm impressed, it looks quite similar to the Moto Skip.
I imagine I can't do this with my current tags, they're 4cm in diameter, I guess I'll have to get smaller ones.
Yep, I guess upsizing it to 4 cm may look a bit awkward when clipped on :p
I was lucky (or unlucky) that only the samsung ones were available at a store close by. I just don't like ordering via internet, so I sometimes take what I can get.
 

stealthdave

New member
Jan 18, 2012
162
54
0
Los Angeles
Thanks! I'm impressed, it looks quite similar to the Moto Skip.
I imagine I can't do this with my current tags, they're 4cm in diameter, I guess I'll have to get smaller ones.
I got some really small NFC tags from http://www.buynfctags.com/. (No affiliation; just a satisfied customer.) I glued them to my wrist watches and use them to unlock my phone by tapping the band. Their prices are pretty good, less than $1 for the tags I linked to, cost gets lower if you order 25+. (Not a bad idea, btw. Tags can go bad and need to be replaced.) The small sized tags make them great for projects and such.

A note for you crafty types out there, if you're attaching an NFC tag to metal, you're going to need to put a spacer between the tag and the metal, or you'll get interference. Dense foam is a good choice.

- Dave
 

gadgetsnpepsi

New member
Dec 28, 2011
29
2
0
I got some really small NFC tags from http://www.buynfctags.com/. (No affiliation; just a satisfied customer.) I glued them to my wrist watches and use them to unlock my phone by tapping the band. Their prices are pretty good, less than for the tags I linked to, cost gets lower if you order 25+. (Not a bad idea, btw. Tags can go bad and need to be replaced.) The small sized tags make them great for projects and such.
Sweet. I was thinking of doing this same thing myself, but the NFC tags I got off eBay were circular and too big to fit in the band, so I settled with attaching one of my Sony Smart tags to the end of a lanyard attached to my Xperia Z.

The clip looks interesting and easy to make too, so I might go for that first. Thanks for the link! :good:
 

subzero2000

New member
Aug 17, 2010
53
16
0
Here's what the app reports.

Sent from my VS980 4G using Tapatalk
And does what you see on your device when attempting to authorize a tag resemble the video linked in that post, or are you not able to authorize any tags at all? I have a feeling based on that screen shot that the problem is not in your G2, but in the type/brand of NFC tag you're using, which may mean that the app simply may need some more tweaking to it's NFC tag support routines. However, that is a guess. I'll do some research and get back to you sometime soon; probably this weekend.

Sent from my SCH-I605 using Tapatalk
 

jasonsf

New member
Oct 27, 2008
596
90
0
Tucson, AZ
And does what you see on your device when attempting to authorize a tag resemble the video linked in that post, or are you not able to authorize any tags at all? I have a feeling based on that screen shot that the problem is not in your G2, but in the type/brand of NFC tag you're using, which may mean that the app simply may need some more tweaking to it's NFC tag support routines. However, that is a guess. I'll do some research and get back to you sometime soon; probably this weekend.

Sent from my SCH-I605 using Tapatalk
The tag appears to authorize just fine. It comes up and I gave it a name.

I know this phone turns off NFC when it charges wirelessly. I wouldn't be surprised if it is doing something similar when the lockscreen comes on or the screen turns off.
 

subzero2000

New member
Aug 17, 2010
53
16
0
The tag appears to authorize just fine. It comes up and I gave it a name.

I know this phone turns off NFC when it charges wirelessly. I wouldn't be surprised if it is doing something similar when the lockscreen comes on or the screen turns off.
Ok, based on that, then it is most likely an issue with your G2, and not the brand of tag. I know code was added to deal with some LG issues; are you sure you're using version 1.9.5 of this mod?

Sent from my SCH-I605 using Tapatalk
 

subzero2000

New member
Aug 17, 2010
53
16
0
Yep.1.9.5 with latest xposed framework.
Ok, and I assume you've rebooted since installing/upgrading to 1.9.5?

To be honest, it sounds like the G2 support added by MohammedAG may not be quite working correctly, and unfortunately I don't have a G2 that I can test it on. I'm going to have to defer to MohammedAG on this, since it's his code, and I couldn't release a properly signed APK anyways... :)

Last questions from me, what version of Android are you running on your G2, and is it stock or not?

Sent from my SCH-I605 using Tapatalk