NFC Full Proximity Detection (NOW Available!)

Search This thread

klau1

Senior Member
Jan 1, 2008
1,794
392
Thanks to madfish73! I did not write this code, but thanks to madfish73, we can enjoy NFC Proximity! :laugh:


Introduction:


You can now define new tasks based on whether your NFC tag is in contact or not.

Each NFC tag now has an IN CONTACT and LOST CONTACT state.

For example:

1.) Car Mode:
you can now define [car mode] to be ON only when your phone is in contact with the [CAR] NFC tag. This way, once you remove your phone, it's LOST Contact with the [CAR] NFC Tag, it can TURN OFF [CAR] Mode.

2.) Night Stand NFC:
You can put your phone on [Silent mode] ONLY when the NFC Tag is IN CONTACT, and have [Sound] return to [Normal] when the NFC Tag is in LOST CONTACT state. That way, you'll never have to Swipe Again before you remove your phone to turn the Volume back on, or completely forget and MISS all your calls.

You won't need to SWIPE again just to toggle it off.

Of course you can still retain the regular function simply by NOT defining an action on LOST Contact State.

What this mod can do?

after did this mod, with AnyTag(mod) + tasker + secure settings plugin + secure settings helper, you can:
1. put your phone on the "Bedside tag", your phone turn to silence mod, take the phone off the tag, your phone auto turn off silence mod
2. put your phone on the "CarDock tag", your phone auto unlock, turn to CarHome mode, run some special apps, take the phone off the tag, your phone auto kill some special apps, exit carhome mode, lock screen ...
3. Other things you can image....

How to use tasker to auto unlock your phone and run some apps?

tasker + secure settings plugin + secure settings helper
Create task, add actions:
1. Secure Settings, Screen & Keyboard Lights On 5 seconds
2. Wait 60ms
3. Secure Settins, Keyguard Enabled
4. Wait 100ms
5. Secure Settings, Keyguard Disabled/BG
6. run apps ....
7. do things you want ...
8. Secure Settings, Screen & Keyboard Light On 10 Seconds


Instructions:

1. Download the mod AnyTag.apk from attachments. Install it.
2. Download the mod Nfc.apk (device dependence) from attachments, copy it to /system/app/Nfc.apk, reboot
(the attachment contains the NFC.APK modded from the i747 JB LK4 ROM)
(there are a few other ones for other devices ie Nexus, Note 2 @ source)

NFC.APK Full Install Instructions (just for those that need clarification for Step 2):
Enable NFC while screen locked/Off

Tested on my stock ROM LK4, but should work on odexed/deodexed ROM

Install :
- Download NFC.APK (In Attachment) (Mirror: NFC modded with Full Proximity Detection and Screen-Off / Lock Screen Detection for i747 JB LK4 ROM)
- Use root explorer and copy system/app/ Nfc.apk and Nfc.odex to ext SD card (for backup purpose)
- delete Nfc.odex from system/app (for odexed ROM only)
- Overwrite downloaded Nfc.apk to system/app (device may rebooted itself)
- Change permission of Nfc.apk to rw-r-r
- Reboot device


Step 3:
In Anytag, since there are now TWO states to each NFC Tag, you'll have to define the activity for EACH state:

In the Anytag App:

1.) Hold the NFC Tag to the phone
2.) AnyTag will ask you if you want to define the activity
3.) Accept
4.) Define some activity or just leave it blank for later
5.) Remove the NFC Tag from the phone
6.) AnyTag will ask you if you want to define the activity
7.) Accept
8.) Define some activity or just leave it blank for later


Video demo


"Bedside Tag": http://youtu.be/_c9Lo-jwErg
galaxy note2(china telecom N719): http://youtu.be/UlbxGoGjysI
TouchStone& "Carmode Tag": http://youtu.be/zeJZ_Cy7_mM

Learn More:
Mod Details:

1. mod nfc.apk(mod android source code and rebuild), when tag lost, broadcast intent with action "android.nfc.action.TAG_LOST"
2. mod AnyTag NFC Launcher apk, play a trick with TagId, when intent action is "TAG_LOST", Tagid=Tagid + "_TAG_LOST", otherwise, Tagid = Tagid + "_TAG_DISCOVERED"

Source Implementation details and code:
http://xdaforums.com/showthread.php?t=2122019

Mirror Downloads:
Mirror: AnyTAG1.2.6-mod.apk
Mirror: NFC modded with Full Proximity Detection and Screen-Off / Lock Screen Detection for i747 JB LK4 ROM (Nfc-mod-combine.apk)
 

Attachments

  • Nfc-mod-combine.apk
    447.2 KB · Views: 297
  • AnyTAG1.2.6-mod.apk
    2.1 MB · Views: 330
Last edited:

torch29

Member
Mar 5, 2009
10
0
Cool, thanks! I can't wait to try it.

Sent from my SAMSUNG-SGH-I747 using xda app-developers app
 

maidmarian4

Member
May 25, 2011
25
1
Sounds awesome! I've seen some apps that will do this, but I had to use data ... and only have 200 mb/mth.
What does NFC mean though? Is it something you buy?
 

fruitloopy

Member
Apr 3, 2013
6
0
Android version 4.1.2 not working with this

Running stock Galaxy S3 rom with MB5 firmware.
Overwriting the NFC.APK with this one gets a reboot and then continuous NFC Service failed to start messages.
Any chance of adapting this for 4.1.2?

NFC.APK attached if you need it. Thanks.
 

geronphillips

Member
May 29, 2013
39
0
OnePlus 7
anytag popup

Has anyone found a way to prevent the popup for choosing between anytag and the inbuilt software? If it makes a difference, i'm using the xposed module instead of modified nfc.apk
 

S.Bartfast

Member
Dec 12, 2009
27
1
Adelaide
Does one need to have rooted their device for this to work?

I tried installing "Nfc Service" in an LG G3 but it fails saying "Application not installed".
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Thanks to madfish73! I did not write this code, but thanks to madfish73, we can enjoy NFC Proximity! :laugh:


    Introduction:


    You can now define new tasks based on whether your NFC tag is in contact or not.

    Each NFC tag now has an IN CONTACT and LOST CONTACT state.

    For example:

    1.) Car Mode:
    you can now define [car mode] to be ON only when your phone is in contact with the [CAR] NFC tag. This way, once you remove your phone, it's LOST Contact with the [CAR] NFC Tag, it can TURN OFF [CAR] Mode.

    2.) Night Stand NFC:
    You can put your phone on [Silent mode] ONLY when the NFC Tag is IN CONTACT, and have [Sound] return to [Normal] when the NFC Tag is in LOST CONTACT state. That way, you'll never have to Swipe Again before you remove your phone to turn the Volume back on, or completely forget and MISS all your calls.

    You won't need to SWIPE again just to toggle it off.

    Of course you can still retain the regular function simply by NOT defining an action on LOST Contact State.

    What this mod can do?

    after did this mod, with AnyTag(mod) + tasker + secure settings plugin + secure settings helper, you can:
    1. put your phone on the "Bedside tag", your phone turn to silence mod, take the phone off the tag, your phone auto turn off silence mod
    2. put your phone on the "CarDock tag", your phone auto unlock, turn to CarHome mode, run some special apps, take the phone off the tag, your phone auto kill some special apps, exit carhome mode, lock screen ...
    3. Other things you can image....

    How to use tasker to auto unlock your phone and run some apps?

    tasker + secure settings plugin + secure settings helper
    Create task, add actions:
    1. Secure Settings, Screen & Keyboard Lights On 5 seconds
    2. Wait 60ms
    3. Secure Settins, Keyguard Enabled
    4. Wait 100ms
    5. Secure Settings, Keyguard Disabled/BG
    6. run apps ....
    7. do things you want ...
    8. Secure Settings, Screen & Keyboard Light On 10 Seconds


    Instructions:

    1. Download the mod AnyTag.apk from attachments. Install it.
    2. Download the mod Nfc.apk (device dependence) from attachments, copy it to /system/app/Nfc.apk, reboot
    (the attachment contains the NFC.APK modded from the i747 JB LK4 ROM)
    (there are a few other ones for other devices ie Nexus, Note 2 @ source)

    NFC.APK Full Install Instructions (just for those that need clarification for Step 2):
    Enable NFC while screen locked/Off

    Tested on my stock ROM LK4, but should work on odexed/deodexed ROM

    Install :
    - Download NFC.APK (In Attachment) (Mirror: NFC modded with Full Proximity Detection and Screen-Off / Lock Screen Detection for i747 JB LK4 ROM)
    - Use root explorer and copy system/app/ Nfc.apk and Nfc.odex to ext SD card (for backup purpose)
    - delete Nfc.odex from system/app (for odexed ROM only)
    - Overwrite downloaded Nfc.apk to system/app (device may rebooted itself)
    - Change permission of Nfc.apk to rw-r-r
    - Reboot device


    Step 3:
    In Anytag, since there are now TWO states to each NFC Tag, you'll have to define the activity for EACH state:

    In the Anytag App:

    1.) Hold the NFC Tag to the phone
    2.) AnyTag will ask you if you want to define the activity
    3.) Accept
    4.) Define some activity or just leave it blank for later
    5.) Remove the NFC Tag from the phone
    6.) AnyTag will ask you if you want to define the activity
    7.) Accept
    8.) Define some activity or just leave it blank for later


    Video demo


    "Bedside Tag": http://youtu.be/_c9Lo-jwErg
    galaxy note2(china telecom N719): http://youtu.be/UlbxGoGjysI
    TouchStone& "Carmode Tag": http://youtu.be/zeJZ_Cy7_mM

    Learn More:
    Mod Details:

    1. mod nfc.apk(mod android source code and rebuild), when tag lost, broadcast intent with action "android.nfc.action.TAG_LOST"
    2. mod AnyTag NFC Launcher apk, play a trick with TagId, when intent action is "TAG_LOST", Tagid=Tagid + "_TAG_LOST", otherwise, Tagid = Tagid + "_TAG_DISCOVERED"

    Source Implementation details and code:
    http://xdaforums.com/showthread.php?t=2122019

    Mirror Downloads:
    Mirror: AnyTAG1.2.6-mod.apk
    Mirror: NFC modded with Full Proximity Detection and Screen-Off / Lock Screen Detection for i747 JB LK4 ROM (Nfc-mod-combine.apk)
    1
    if anyone is running Tasks's AOKP for gs3, I got this mod working with the NFC.apk for the Galaxy Nexus running AOKP 4.2.2 here
    http://xdaforums.com/attachment.php?attachmentid=1767294&d=1362024040