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

MohammadAG

Inactive Recognized Developer
Sep 7, 2009
1,080
5,504
0
27
Jerusalem
mohammadag.xceleo.org
Requires Xposed Framework!

This module is based off qwerty12's NFCLockScreenOffEnabler, coupled with madfish73's modifications.

The Moto X had a feature called the Motorola Skip, a $20 NFC tag that unlocks your device.
(Speaking of the Moto Skip, here's a tutorial by @Mikegrmn on how to make a similar tag)
This Xposed module imitates that, while giving a bit more freedom as it also works with the screen off, and with any NFC tag.

Screenshots:


Compatibility:
Any 4.0-4.4 NFC-equipped device that can run Xposed Framework.

Download:
http://repo.xposed.info/module/pk.qwerty12.nfclockscreenoffenabler

Source code:
https://github.com/MohammadAG/NFCLockscreenoffEnabler

Credits:
  • qwerty12 for original module.
  • madfish73 for tag lost support
  • rovo89 for the Xposed Framework
  • Niek Haarman for ListViewAnimations, initially I wanted the NFC tag list animated but it was unnecessary overhead, I kept support for swiping to delete tags though.
  • Roman Nurik for his UndoBar implementation.

Reason for fork:
I spent a lot of time researching how the lockscreen works so I could bypass the user's code without actually storing the code somewhere, and even when that was done, my implementation was insecure and left a big security hole, I also spent some time looking for ways to secure that which I've come up with. An explanation of how it was secured can be found here.
In any case, when I decided to post my work in that thread, it was because I felt I shouldn't fork another version of the module. However, 2 days later, I feel that it got buried in the thread with no one knowing about it, so I emailed qwerty12 and asked him if I could make a thread about the module with all the updates.

Suggestions?
I feel like the name and icon could be changed, if anyone has suggestions, feel free to reply with them down below :)

FAQ
  • This module isn't installing, it's saying something about signatures!
    Due to this being a fork, and no one can share their signatures, you're going to have to uninstall all previous versions prior to installing this.​
  • This module isn't working, what's wrong?
    Do you have Xposed Framework installed? Installing the Installer app isn't enough, you need to hit Install/Update it in. After that, you'll have to tick the module to enable it and soft reboot. If the module still doesn't work, turn on debug mode and attach a logcat after a reboot.​
  • I did what the question above said, I still can't unlock my phone using NFC!
    Have you authorized the tag? See this video by @subzero2000 to know how to do that http://www.youtube.com/watch?v=5ix-5utZwAY
    If you can't authorize the tag as in the video, someone (probably me) messed up somewhere, refer to http://forum.xda-developers.com/showpost.php?p=46950451&postcount=101 to help us debug the problem.
    If you can authorize a tag, but still can't unlock, your manufacturer did something to the lockscreen that's very far from stock Android. Leave a comment and we'll try to help. Alternatively, ask a developer for your device to have a look at it.​
  • An app pops up each time I scan the tag saying that the tag is empty, what should I do?
    Either write to the tag so it does something else, or install this http://forum.xda-developers.com/showthread.php?t=2474379
  • How do I configure Tasker?
    An intent is broadcasted as of version 1.9.5 that can be picked up by apps like Tasker.
    Just configure the app to receive the intent with action "android.nfc.action.TAG_CHANGED". The intent has two extras:
    "tag_uuid": type String, this extra holds the tag ID
    "tag_present": type boolean, this extra is true when the tag is detected, and false when it's lost.
    These extras can be used in Tasker by using the variables %tag_uuid and %tag_present​
 
Last edited:

dtekkt

Senior Member
Sep 16, 2010
616
299
0
Vienna
Great, works as advertised. Only two things then it would be perfect:
Allow to disable the NFC tag sound and vibration, it's very annoying

Gesendet von meinem C6903 mit Tapatalk 4
 

dtekkt

Senior Member
Sep 16, 2010
616
299
0
Vienna
Done


My device doesn't vibrate when using NFC, so I couldn't find out where that happens :/
Thanks, works perfect without this annoying sound :thumbup: I could send you my NFC apk, I am using a xperia Z1. If it doesn't work out, doesn't matter as long as that annoying sound is gone :D

Gesendet von meinem C6903 mit Tapatalk 4
 

MohammadAG

Inactive Recognized Developer
Sep 7, 2009
1,080
5,504
0
27
Jerusalem
mohammadag.xceleo.org
Thanks, works perfect without this annoying sound :thumbup: I could send you my NFC apk, I am using a xperia Z1. If it doesn't work out, doesn't matter as long as that annoying sound is gone :D

Gesendet von meinem C6903 mit Tapatalk 4
You could, or just wait it out. I'll be getting the Z1 when it reaches Israel.

Sent from my Samsung Galaxy S4 (GT-i9500) using Taptalk 4
 

dtekkt

Senior Member
Sep 16, 2010
616
299
0
Vienna
You could, or just wait it out. I'll be getting the Z1 when it reaches Israel.

Sent from my Samsung Galaxy S4 (GT-i9500) using Taptalk 4
Great then I'll wait, the vibration is not that annoying. Great to know another great dev will get this fabulous device

Gesendet von meinem C6903 mit Tapatalk 4
 

glimmling

Senior Member
Jan 27, 2011
245
109
0
tuetenmensch.blogspot.com
Hello,

The module is crashing for me, when I want to authorize a NFC tag.
My device is a LG Optimus L7 II P710
Please have a look at the following logcat:

build.board: 7x27
build.bootloader: unknown
build.brand: lge
build.cpu_abi: armeabi-v7a
build.cpu_abi2: armeabi
build.device: vee7e
build.display: JZO54K
build.hardware: vee7
build.host: android-5pm-server-03
build.id: JZO54K
build.manufacturer: LGE
build.model: LG-P710
build.product: vee7e_open_eu
build.radio: unknown
build.serial: 530b90b9
build.tags: release-keys
build.time: 1373443135000
build.type: user
build.user: goodluck
version.codename: REL
version.incremental: P71010e-EUR-XX.1373443047
version.release: 4.1.2
version.sdk_int: 16

10-12 12:24:12.129 I/ActivityManager(9185): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=pk.qwerty12.nfclockscreenoffenabler/.NFCLockScreenOffEnablerActivity bnds=[128,254][236,377] u=0} from pid 15338
10-12 12:24:12.729 I/ActivityManager(9185): Displayed pk.qwerty12.nfclockscreenoffenabler/.NFCLockScreenOffEnablerActivity: +550ms
10-12 12:24:14.769 I/ActivityManager(9185): START {cmp=pk.qwerty12.nfclockscreenoffenabler/.NfcTags u=0} from pid 16988
10-12 12:24:15.119 I/ActivityManager(9185): Displayed pk.qwerty12.nfclockscreenoffenabler/.NfcTags: +266ms
10-12 12:24:17.349 I/ActivityManager(9185): START {act=android.nfc.action.TECH_DISCOVERED flg=0x20000000 cmp=pk.qwerty12.nfclockscreenoffenabler/.NfcTags (has extras) u=0} from pid -1
10-12 12:24:17.349 W/ActivityManager(9185): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.nfc.action.TECH_DISCOVERED flg=0x20000000 cmp=pk.qwerty12.nfclockscreenoffenabler/.NfcTags (has extras) }
10-12 12:24:17.379 E/AndroidRuntime(16988): at pk.qwerty12.nfclockscreenoffenabler.NfcTags.createAskForNameDialog(NfcTags.java:236)
10-12 12:24:17.379 E/AndroidRuntime(16988): at pk.qwerty12.nfclockscreenoffenabler.NfcTags.onNewIntent(NfcTags.java:189)
10-12 12:24:17.399 W/ActivityManager(9185): Force finishing activity pk.qwerty12.nfclockscreenoffenabler/.NfcTags
10-12 12:24:17.939 W/ActivityManager(9185): Activity pause timeout for ActivityRecord{42cd0128 pk.qwerty12.nfclockscreenoffenabler/.NfcTags}
10-12 12:24:20.479 W/InputDispatcher(9185): channel '42efb928 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnablerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
10-12 12:24:20.479 E/InputDispatcher(9185): channel '42efb928 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnablerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
10-12 12:24:20.479 W/InputDispatcher(9185): channel '4318fbc8 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NfcTags (server)' ~ Consumer closed input channel or an error occurred. events=0x9
10-12 12:24:20.479 E/InputDispatcher(9185): channel '4318fbc8 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NfcTags (server)' ~ Channel is unrecoverably broken and will be disposed!
10-12 12:24:20.479 W/InputDispatcher(9185): Attempted to unregister already unregistered input channel '42efb928 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnablerActivity (server)'
10-12 12:24:20.479 I/ActivityManager(9185): Process pk.qwerty12.nfclockscreenoffenabler (pid 16988) has died.
10-12 12:24:20.479 I/WindowState(9185): WIN DEATH: Window{42efb928 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnablerActivity paused=false}
10-12 12:24:20.489 W/InputDispatcher(9185): Attempted to unregister already unregistered input channel '4318fbc8 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NfcTags (server)'
10-12 12:24:20.489 I/WindowState(9185): WIN DEATH: Window{4318fbc8 pk.qwerty12.nfclockscreenoffenabler/pk.qwerty12.nfclockscreenoffenabler.NfcTags paused=false}
10-12 12:24:20.489 W/ActivityManager(9185): Force removing ActivityRecord{42af7238 pk.qwerty12.nfclockscreenoffenabler/.NFCLockScreenOffEnablerActivity}: app died, no saved state


Thank you!
 

tripex2k

Senior Member
Apr 16, 2011
114
37
58
Villingen-Schwenningen
I tried to get it working with several NFC tag stickers, keychain chips and id cards, but well, nothing really works to get it to unlock my HTC One. I run the ViperOne 2.7 rom with Exposed framework and wrote the pin as text to the cards for testing and enabled a pinlock. Any ideas what could be wrong? Which infos do you need.
 

MohammadAG

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

The module is crashing for me, when I want to authorize a NFC tag.
My device is a LG Optimus L7 II P710
Please have a look at the following logcat:

Thank you!
The logcat you posted seems to lack the first line in the crash, which has the word Exception in it and/or Caused by. Can you crash the app again and post another logcat?

Sent from my Samsung Galaxy S4 (GT-i9500) using Taptalk 4
 

MohammadAG

Inactive Recognized Developer
Sep 7, 2009
1,080
5,504
0
27
Jerusalem
mohammadag.xceleo.org
I tried to get it working with several NFC tag stickers, keychain chips and id cards, but well, nothing really works to get it to unlock my HTC One. I run the ViperOne 2.7 rom with Exposed framework and wrote the pin as text to the cards for testing and enabled a pinlock. Any ideas what could be wrong? Which infos do you need.
A logcat would be enough. Also if you could please post a deodexed copy of android.policy.jar.

Sent from my Samsung Galaxy S4 (GT-i9500) using Taptalk 4
 

08BajaBoy

Senior Member
Aug 23, 2012
53
16
0
Downey
I can't install version 1.9. it gives me a message saying "An existing package by the same name With a conflicting signature is installed." Should I delete 1.1 and install 1.9?