[MOD] Modified NfcNci.apk to poll while screen is off.

Search This thread

CptanPanic

Senior Member
Jun 15, 2011
193
66
I have modified the default polling mode of NfcService.java to poll for Nfc Tags even when the screen is off. This is done for the Nexus 4. To install move the old NfcNci.apk/odex from /system/app to keep just in case, and then just copy over the modified NfcNci.apk and change the permissions to 644. I used adb shell, and adb push to move and install the file in recovery mode, but any way should work. This is my first android development, so this may not work for everyone.

Update:
Just to clarify, this is made for stock 4.2.1

Update: 2/17/13
I have made a new version for stock 4.2.2. Just download copy to /system/app/NfcNci.apk and rename /system/app/NfcNci.odex file.
 

Attachments

  • NfcNci.apk
    345.4 KB · Views: 1,554
  • NfcNci.mod.4.2.2.apk
    345.5 KB · Views: 2,502
Last edited:

Vertana

Senior Member
Jul 5, 2011
54
9
I appreciate the work as I'm positive it'll help a lot of people, but I'm curious how this affects battery life. For anyone using it, have you noticed a significant drop in battery life?
 

steslatt

Senior Member
Oct 22, 2010
428
76
Great work, thanks a lot. Don't suppose you could do a version that works without unlocking the screen just when waking the device? So it wouldn't work with screen off but would when you pressed the power button. If you know what I mean?
 

brium13

Senior Member
Jun 8, 2007
95
4
Hello, thank you for the work, but it does not work for me.

I use CyanogenMod 10.1, when I replace the modified file no longer works the NFC and NFC menu also disappears

An idea?

thank you
 
Last edited:

G405T

Senior Member
Dec 9, 2011
58
12
Hello, thank you for the work, but it does not work for me.

I use CyanogenMod 10.1, when I replace the modified file no longer works the NFC and NFC menu also disappears

An idea?

thank you

I just did this out myself and had similar issues on the jellytime rom.. To fix it you need to extract/pull original apk from your rom (either the original zip or your backup if you have one) and then overwrite the classes.dex file in to old apk with the classes.dex file out of CptanPanics apk (you can do this with any archive manager capable of opening a zip file!).

Flash you modded original apk file and it should then work fine :)


And thanks for the mod!
 
Last edited:
  • Like
Reactions: brium13

brium13

Senior Member
Jun 8, 2007
95
4
I just did this out myself and had similar issues on the jellytime rom.. To fix it you need to extract/pull original apk from your rom (either the original zip or your backup if you have one) and then overwrite the classes.dex file in to old apk with the classes.dex file out of CptanPanics apk (you can do this with any archive manager capable of opening a zip file!).

Flash you modded original apk file and it should then work fine :)


And thanks for the mod!

hello, thank you for your help, I made the handling but it still does not work!

I replaced the file with 7zip classes.odex are weight is 343Kb instead of 345kb

An idea?

Thank you in advance.
 

G405T

Senior Member
Dec 9, 2011
58
12
hello, thank you for your help, I made the handling but it still does not work!

I replaced the file with 7zip classes.odex are weight is 343Kb instead of 345kb

An idea?

Thank you in advance.

.odex? was that a typo? Surely your CM rom is de-odexed?

The file size sounds right, so assuming you did that correctly and pushed the apk to /system/app with adb; the next best thing to check would be that you have set the permissions of the apk to 644.. for example:

->adb remount
->adb shell
->su
->chmod 644 /system/app/NfcNci.apk

If that doesnt solve your problem, Im not sure that I can help without trying it out for myself. Also, make sure you have copied the classes.dex to and from the right apks and them pushed the original apk back!! Its easy to mix them up!
 
Last edited:
  • Like
Reactions: brium13

aznxk3vi17

Senior Member
Jun 28, 2011
356
56
Charlottesville
Reporting back with some preliminary battery life information: it's not looking too hot.

I've drained 35% in 3 hours. I have done absolutely nothing to the phone but let it sit. I'm going to have to revert back; this is too much drain for just a tiny bit of convenience.
 
  • Like
Reactions: Vertana

steslatt

Senior Member
Oct 22, 2010
428
76
For me NFC does not work while the phone is in deep sleep and I don't appear to be having serious battery drain. I am happy with the mod, it is exactly what I wanted, now I don't have to unlock the phone, just wake the device with power button then it works :)
 

brium13

Senior Member
Jun 8, 2007
95
4
sorry, I made a typo, the name is classes.dex ...
I repeated the manipulations but it still does not ...
 

brium13

Senior Member
Jun 8, 2007
95
4
It's okay, I managed, good good goog, thank :good:

I share my file. "Should be put in the first post"

NfcNci.apk for CyanogenMod 10.1
 

Attachments

  • NfcNci.zip
    290.1 KB · Views: 288
  • Like
Reactions: kirvad

steslatt

Senior Member
Oct 22, 2010
428
76
Reporting back with some preliminary battery life information: it's not looking too hot.

I've drained 35% in 3 hours. I have done absolutely nothing to the phone but let it sit. I'm going to have to revert back; this is too much drain for just a tiny bit of convenience.

I've drained 8% over 2 hours. Thats with wifi on but not connected and gps on.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 27
    I have modified the default polling mode of NfcService.java to poll for Nfc Tags even when the screen is off. This is done for the Nexus 4. To install move the old NfcNci.apk/odex from /system/app to keep just in case, and then just copy over the modified NfcNci.apk and change the permissions to 644. I used adb shell, and adb push to move and install the file in recovery mode, but any way should work. This is my first android development, so this may not work for everyone.

    Update:
    Just to clarify, this is made for stock 4.2.1

    Update: 2/17/13
    I have made a new version for stock 4.2.2. Just download copy to /system/app/NfcNci.apk and rename /system/app/NfcNci.odex file.
    9
    CM10.1 update.zip

    here a update.zip from this Version, the update.zip renamed the original NfcNci.apk to NfcNci.apk.old.
    http://xdaforums.com/showpost.php?p=36183507&postcount=53
    9
    Thanks for the testing. I will make one that works with just the screen on but locked .

    Sent from my Nexus 4 using Tapatalk 2

    Attached is a version tthat has the Nfc Polling on if the screen is on.
    6
    The One with Only work on screen on doesnt work on cm 10.1, can someone upload a Nfc.apk which works only on screen on, but locked and on CM 10.1 ?

    Nevermind, did it myself:
    2
    Google wallet works fine for me.

    Sent from my Nexus 4 using Tapatalk 2