FORUMS

Hands-on With T-Mo LG G4 and Q&A

XDA Senior Member WinDroidGuy posted a hands-on video of the T-Mobile LG G4, and he is now … more

Quick Notes – Notification Panel Reminders

This app by XDA Senior Member yogi.306 is a quick and productive tool that … more

Who Is Your Favorite YouTuber That Covers Mobile?

There are dozens of talented YouTubers who cover mobile, but we want to know which … more

Galaxy S6 Shipping with Different Camera Models

One of the Galaxy S6’s most flaunted features is its spectacular camera, its 16MP … more
Post Reply Subscribe to Thread Email Thread

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

3rd December 2012, 01:22 AM |#1  
OP Senior Member
Thanks Meter: 69
 
More
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.
Attached Files
File Type: apk NfcNci.apk - [Click for QR Code] (345.4 KB, 1034 views)
File Type: apk NfcNci.mod.4.2.2.apk - [Click for QR Code] (345.5 KB, 1894 views)
Last edited by CptanPanic; 18th February 2013 at 01:12 AM. Reason: Added new version
The Following 28 Users Say Thank You to CptanPanic For This Useful Post: [ View ]
 
 
3rd December 2012, 04:47 AM |#2  
jerdog's Avatar
Developer & Moderator Committees / OEM Relations / XDA Portal Team - Harbinger of Doom
Flag Gallifrey
Thanks Meter: 4,612
 
More
Great work. Moving to Android Development

Sent from my Nexus 4 using XDA Premium HD app
The Following User Says Thank You to jerdog For This Useful Post: [ View ]
3rd December 2012, 05:13 AM |#3  
Member
Thanks Meter: 9
 
More
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?
3rd December 2012, 06:54 AM |#4  
Senior Member
Flag Charlottesville
Thanks Meter: 56
 
More
Quote:
Originally Posted by Vertana

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?

I'm about to get it on my phone, will report on how it affects battery life later tomorrow.
3rd December 2012, 09:53 AM |#5  
Senior Member
Thanks Meter: 47
 
More
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?
3rd December 2012, 11:07 AM |#6  
Member
Thanks Meter: 4
 
More
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 by brium13; 3rd December 2012 at 11:10 AM.
3rd December 2012, 11:30 AM |#7  
Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by brium13

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 by G405T; 3rd December 2012 at 11:40 AM.
The Following User Says Thank You to G405T For This Useful Post: [ View ]
3rd December 2012, 01:24 PM |#8  
Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by G405T

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.
3rd December 2012, 02:06 PM |#9  
Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by brium13

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 by G405T; 3rd December 2012 at 02:33 PM.
The Following User Says Thank You to G405T For This Useful Post: [ View ]
3rd December 2012, 06:30 PM |#10  
Senior Member
Flag Charlottesville
Thanks Meter: 56
 
More
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.
The Following User Says Thank You to aznxk3vi17 For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
nfc
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes