yashsingh1/xdaforums huggingface dataset:
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
If you're totally stock, you'd be odexed & not deodexed like most of the custom roms. But.... There have been a few people in the Verizon thread who have gotten this fix working on odexed too. Look at the last line in my OP for one change you'll need to do after. Of course, as always, make a nandroid backup first.
[AT&T Samsung Galaxy S 4 Themes and Apps] loserskater:
The reason those errors are popping up is because you're using an aosp based NfcNci.apk. It's calling code that either doesn't exist or is different in the TW framework.

The problem with 4.3 is what I had menitioned before, /system/etc/security_nfc_profile.dat. NfcNci.apk uses that file to check the sha-1 on files like NfcNci.odex, libnfc-nci.so, etc. and if it doesn't match it marks the system as tampered and will prevent any apps from using the secure element. So what I did was modify a Sprint Nfc.apk (or NfcNci.apk in your case) to just report true whenever it checks security_nfc_profile.dat. There were a couple lines that needed to be changed/added to /system/csc/features.xml as well. The only files I replaced were:

/system/app/Nfc.apk (NfcNci.apk for you)
/system/etc/nfcee_access.xml
/system/lib/libnfc.so (libnfc-nci.so for you)
/system/app/SmartcardService.apk (Not positive this one is necessary but there were quite a few code differences)

All other files that might be related to nfc were identical between AT&T and Sprint so there is no need to replace them.

Will this rom not work to pull files from? http://xdaforums.com/showthread.php?t=2505025
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
For the GS3 test patch I had pulled from a true AOSP. Wasnt sure it'd work, but for this working fix for the GS4 I had actually pulled from a GPe ROM..... and those are TW based.

LOL. Yes....thats the first one I tried with. Didnt work, but I didnt edit the NfcNci.apk or the features.xml as you suggested.

Still.... If the 4.3 on the GS4 wasnt different, why does my fix work then (without editing)? And why are there no errors on US based roms or on Omega (i9505) which has the Euro NYC payment removed? :confused:
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
[MENTION=674617]KryptosXLayer2[/MENTION] [MENTION=4374678]ssn713[/MENTION] [MENTION=4571949]MikeC4510[/MENTION] or anyone else running an International deodexed ROM (like Bobcat, GoldenEye, FoxHound, etc..).....

I think I found the fix for the 'NFC Payment and NFC Service' errors you guys reported thanks to [MENTION=2576548]::indie::[/MENTION] and his Omega Rom (which it works perfectly with)

Simply remove the system\app\SecWalletManager.apk file and you should be good to go. Im currently running a 4.4 ROM and cant test until later.
[AT&T Samsung Galaxy S 4 Themes and Apps] KryptosXLayer2:
Interesting.... Renamed (instead of deleted) system\app\SecWalletManager.apk to SecWalletManager.apk.bak, rebooted, and have already had one NFC service FC.... Will keep testing to see if that was a fluke, but it isn't "gone for good" just yet at least

Sent from my Samsung Galaxy S 4 using the XDA app
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
I just got a chance to test & here are my results....

Working fine on Omega v16 Rom (SecWalletManager removed in the ROM)

Working fine on Bobcat Rom v10 (SecWalletManager removed in the ROM -- which is interesting because the previous versions of Bobcat all had it in there)

Working fine on 3 USA based ROM (i tried all t-mobile but im sure it'd be the same for att or verizon too) as they don't have SecWalletManager (only European builds do)

So, now i decided to try GoldenEye v15. My steps....

1. Wiped dalvik, cache, data and system in TWRP 2.6.3.1

2. Flashed GE-i9505-XXUEMKE-15.zip (International GoldenEye -- which is same as ATT just with different kernel)

3. Reboot system and did inital setup

4. Installed Root Explorer and removed /system/app/SecWalletManager.apk

5. Rebooted

6. Flashed my mod, fixed permissions & rebooted.

7. Setup wallet completely.

8. Rebooted

After doing so, simply get the one NFC Service has stopped error on boot, but a fully functional wallet. Been on it for an hour and have made a transaction successfully with no other error messages.

Still not sure why the other two roms, as well as ALL the USA Roms dont get the error and GE does the single time on startup????
[AT&T Samsung Galaxy S 4 Themes and Apps] loserskater:
Have wallet working perfectly on the s3, I'll attempt the s4 tonight.

Sent from my SAMSUNG-SGH-I747
[AT&T Samsung Galaxy S 4 Themes and Apps] loserskater:
Can anybody test this?

It will work on both odexed and deodexed roms.

Make sure you don't have any other nfc fix applied (basically just flash your rom again).

Open /system/csc/features.xml and look for <!-- NFC -->

Replace that section with this:

<!-- NFC -->
<CscFeature_NFC_SetSecureEventType>GOOGLE</CscFeature_NFC_SetSecureEventType>
<CscFeature_SmartcardSvc_SetAccessControlType>NONE</CscFeature_SmartcardSvc_SetAccessControlType>
<CscFeature_NFC_DefaultCardModeConfig>ESE</CscFeature_NFC_DefaultCardModeConfig>
<CscFeature_NFC_SetOnAsDefault>TRUE</CscFeature_NFC_SetOnAsDefault>
<CscFeature_NFC_EmbeddedSEType>TypeA</CscFeature_NFC_EmbeddedSEType>

Then flash this in recovery:

SGS4_4.3_TW_nfc_fix.zip
[AT&T Samsung Galaxy S 4 Themes and Apps] chadrick.7:
Any love for note 2 4.3 tw roms by any chance? Not having tap and pay is killing me

Sent from my SAMSUNG SGH-I317 running 4.3
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
I gave this a try using GoldenEye v15, and here are my observations....

1. We dont have a /system/csc/features.xml. No problem as the file is /system/etc/feature_default.xml

2. The 'NFC Service has stopped' popup is no longer present. Good job!!!!

3. Still getting the 'NFC Payment has stopped' error. Simply deleting the /system/app/SecWallet/Manager.apk gets rid of that error

4. In settings, tapping NFC, then NFC payment (with or without the above file) causes 'Settings has stopped' error.

And tap & pay (using your modded wallet apk) sets up perfectly. No more NFC services has stopped error. Havent had a chance to try a transaction yet, but sure that'll be a go too.

Good job!!
[AT&T Samsung Galaxy S 4 Themes and Apps] Anonymoose2:
Would this work on the official TW 4.3?
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
Yes.
[AT&T Samsung Galaxy S 4 Themes and Apps] thachosenone:
Tap and pay works here. TMO US M919 with Isis SIM running omega v16(9505).

Thank you! Missed being able to pay with my phone since I switched away from my GNex.
[AT&T Samsung Galaxy S 4 Themes and Apps] ssn713:
So if I remove the wallet installed from the OP then install the zip from loserskater's post, I'll be good to go with no more "NFC services has stopped" error?
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
No.... You'll need to start over. Not only removing the modded wallet but also the previous lib_fix.

Better complete instructions are HERE
[AT&T Samsung Galaxy S 4 Themes and Apps] ssn713:
And we're back to where we were before you pulled the files from the google play edition. Set up goes fine (including tap and pay), no FCs of nfc services or nfc payment but... it doesn't initialize when trying to make a purchase. Definitely appreciate you guys still working on it but unless I'm doing something wrong it looks like we have to put up with sporadic error messages for the time being if we want a working wallet.

I'll be happy to keep testing if you have anymore ideas.
[AT&T Samsung Galaxy S 4 Themes and Apps] sirooga:
MDOB

I can report that we no longer get the errors on the latest MDOB. Grabbed the wallet apk out of the OP's zip and put into your zip. Made your changes to /system/csc/feature.xml and flashed the zip. There is no SecWalletManarger.apk in this rom to freeze. I will go try a purchase with it today. You are all awesome. Thanks [MENTION=1016795]loserskater[/MENTION] I have been using your wallet hacks since I had my S3 with you. Thank you [MENTION=4073507]dannyben[/MENTION] for the lib fixes.
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
Damn! I thought [MENTION=1016795]loserskater[/MENTION] had it figured out.

But yes, for some reason pulling the files from anywhere but from a GE Rom doesnt seem to work. As you wrote, the reader doesnt detect otherwise.

Whats weird with my fix (the working one in the OP) is that I've tried it on Omega Rom (which has SecWalletManager pre-removed) and it's working fine (NO error messages at all). Tried with BoBCaT Rom 10.1 and manually removed the SecWalletManager.apk from system/app and also worked fine with NO error messages. The people who've tried it on USA based Roms also report no error messages at all. But for whatever reason the GoldenEye Rom (which is based on a i9505 build) is giving the NFC service error. Only thing i can think is [MENTION=1380660]iB4STiD[/MENTION] must have some other type of NFC Payment fix added in thats giving the problem???

Edit: Actually.... the issue could be with the broken Euro NFC Payment itself. Omega had pulled it completely because he couldnt get it to work. Bobcat fixed it (but we still need to pull the SecWalletManager). Perhaps iB4STiD just left it alone????

What might work on GoldenEye is to use my fix as it is. Remove the /system/app/SecWalletManager.apk. And then modify the /system/csc/feature.xml (or depending on the rom it could be /system/etc/feature_default.xml) as per loserskater's code. If it doesnt help you could just change it back.
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
MDOB is a USA based (ATT) rom i believe??? Did you flash the lib_fix from the OP (mine) or the one that [MENTION=1016795]loserskater[/MENTION] provided? [MENTION=4374678]ssn713[/MENTION] just reported that loserskater's will setup fine but NOT be detected by the reader -- has something to do with the sprint libs not working properly. My zip should work fine for you on that rom without any of the errors. But if you still get the 'service' error, perhaps the combo of my zip along with loserskater's editing of the xml file will fix.
[AT&T Samsung Galaxy S 4 Themes and Apps] sirooga:
Zip

First I edited the file per [MENTION=1016795]loserskater[/MENTION]. I put your wallet.apk into [MENTION=1016795]loserskater[/MENTION] zip file and flashed that. It set up and I have no errors all day but have yet to be able to try it out. Hopefully tonight. His ROM is MK6 based. I think that is t-mobile US but not sure.
[AT&T Samsung Galaxy S 4 Themes and Apps] loserskater:
Does nfc work normally? Not just for purchases but tags or other devices?

You're using GoldenEye correct? Can you post me your NfcNci.apk?
[AT&T Samsung Galaxy S 4 Themes and Apps] sirooga:
No go :(

Well it turns out it borks the NFC. Tried it at a known working store and also tried to beam a file to my Nexus 7. Did not work for either.

I guess I should have backed up the original db file. haha now to fix that.
[AT&T Samsung Galaxy S 4 Themes and Apps] ssn713:
[MENTION=1016795]loserskater[/MENTION] NFC still working. Confirmed with tags and superbeam.

Yes I'm running Golden Eye. Even tried editing the csc file (/system/etc/feature_default.xml) with no effect.

nfcnci: https://dl.dropboxusercontent.com/u/52432442/NfcNci.apk
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
From what I can see, loserskater's fix doesnt include some necessary files..... like framework, bin and a few libs. But, as you saw, when I tried using the Sprint files, could get a transaction to go through successfully.

Its weird though, that using my fix, the only reported problems (NFC service popup) are with iB4STiD's Roms???? Did you try editing the xml file but using my fix?
[AT&T Samsung Galaxy S 4 Themes and Apps] sirooga:
I will try that today. NFC may not have been borked completely as I said. I did a clean install of MDOB and I still can't beam to my Nexus 7, but it works fine beaming to my wife's S4. I love samsung *cough*
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
As much as we all love Samsung *cough*, thi is more of the carriers blocking and "forcing" us to use ISIS. My fix should be OK for you on MDOB and at worst, just live with the single 'NFC service has stopped' popup. But Im thinking (hoping) that loserskaters xml script will get rid of that for you. Dont want you to switch to a different rom if you dont want to just to lose the popup error, but as ive seen, it doesnt occur on other roms. And..... this should all become irrelevant in just a few more weeks -- if TW 4.4 is released as per the leaks of January.
[AT&T Samsung Galaxy S 4 Themes and Apps] loserskater:
The framework files are identical across devices, and why do you need to replace secure storage files?

That popup is more than the features.xml. The NfcNci.apk is trying to call methods that don't exist.

Anybody that's getting those errors, can you grab a logcat for me?

Sent from my SAMSUNG-SGH-I747
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
Thats the only way it ended up working and being able to use tap & pay successfully.

Also, for whatever reason, using the same exact files from a Spring build (as apposed to a GPe) didnt allow the tap and pay.

Was hoping your xml code would have worked. Its weird to point out that the file is a different name & different location then yours though. And NO ONE using my mod on Verizon or T-mobile deodexed roms have any issue (I have thread in those sections too). From what I see, it's only AT&T and only iB4STiD's Roms.
[AT&T Samsung Galaxy S 4 Themes and Apps] silrosriv:
How do I flash the zip without a custom recovery on AT&T MK2?
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
Unzip. Copy system files over with root explorer or similar (to the same directories that's in the zip) and change permissions (rw-r--r--).
[AT&T Samsung Galaxy S 4 Themes and Apps] KryptosXLayer2:
I hate to ask this [MENTION=4073507]dannyben[/MENTION], but I think we're going to need a refresher on what needs to be edited, flashed, and screwed with for each ROM, because I'm having a hard time following who has what ROM and has what problems associated with it in order to get this working.... I have made the edit in the XML file with Root Explorer so that saves a copy of the original, but I haven't flashed the fix [MENTION=1016795]loserskater[/MENTION] has made nor have I flashed the modded APK again (or is this one different?) from the post you made, [MENTION=4073507]dannyben[/MENTION]....

Just need to separate this all out in the OP I think and have it broken down for each ROM because it just isn't clear enough to see the steps necessary to fix the NFC Services FCs and what not that the Goldeneye ROM is still having.... You guys are definitely on the right track with all this though, so congrats!!! I'm sure we're right around the corner from having it all fixed and straightened out, I'm just having trouble following everything that needs to be done here!
[AT&T Samsung Galaxy S 4 Themes and Apps] silrosriv:
I did this. And I'm no longer getting the nfc fc, but now my wifi won't turn on. It just hangs on Turning On.
[AT&T Samsung Galaxy S 4 Themes and Apps] ssn713:
Dannyben suggested editing the xml file and flashing the files posted by Loserskater along with his modded wallet apk. I tried the above approach and was able to get wallet to set up but it doesn't still doesn't initilize for purchases. This is apparently due to some incompatibility with some of the nfc files baked into the Golden Eye rom which is based on the latest international release.

This is unfortunate not only because I prefer to run GE myself but because it seems to be one of the most popular TW based roms in the AT&T development section. For the time being, the only working option for those of us on GE that I'm aware of means having to put up with the occasional nfc services fc.

[MENTION=4073507]dannyben[/MENTION] & [MENTION=1016795]loserskater[/MENTION] have either of you tried to reach out to [MENTION=1380660]iB4STiD[/MENTION]? Not that you haven't done enough already but it sure would be nice to get this resolved once and for all.
[AT&T Samsung Galaxy S 4 Themes and Apps] silrosriv:
Ok the feature.xml file is the only one I forgot to back up and that's what's causing the wifi issue. Can anyone tell me what the stock sgh-i337 4.3 mk2 has in the <!--NFC--> section? Pretty please?
[AT&T Samsung Galaxy S 4 Themes and Apps] ssn713:
Error message is easily reproducible by uninstalling an app in the playstore.

[MENTION=1016795]loserskater[/MENTION] here's a logcat: https://www.dropbox.com/s/rs8o15bvvua22o1/2013-12-10-22-24-35.txt

Let me know if that's what you need.
[AT&T Samsung Galaxy S 4 Themes and Apps] sirooga:
Ok I flashed [MENTION=4073507]dannyben[/MENTION] zip file and did [MENTION=1016795]loserskater[/MENTION] changes to feature.xml and wallet works for purchases and beam sends and receives files with no force close error's. Thanks :)
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
It appears that loserskater's nfclib_fix does not work properly. It allows the setting up of t&p but its either breaking nfc completely or simply just not permitting transactions to go through. I know he's using Sprint's libs, but i've had no luck trying to get those to work and was only able to using the libs from the Google Play Edition.

So..... do NOT flash loserskaters nfc_fix file. I havent seen one person report that its actually working.

Post below from [MENTION=484490]sirooga[/MENTION] confirms what I was hoping..... that using my fix (the one working and posted in the OP) along with using loserkater's xml file edit appears to work in removing the NFC service error. The NFC Payment error (for those who get that) is directly associated with the i9505 European Roms and a file we dont use here -- /system/app/SecWalletManager.apk. Simply deleting that useless file will remove that error.

As I wrote previously, Im not really sure to the reasoning behind the necessary xml edit for you guys. Loserskater didnt think it along with my fix would work, but it looks like it does. The problem only seems to occur on AT&T and only on iB4STiD's Roms (I have this same thread in Verizon & t-mobile and no reported errors). Since Im on t-mobile and use either iB4STiD's 4.4 Rom (Wallet integrated and working out of the box with kitkat) or i9505 Roms -- none have the service error (not even needing to edit the xml), it appears to simply be an issue with his Roms and something thats put or left in there that shouldnt be????

I havent edited the OP..... yet, because as of now, this is the only libfix that appear to be working. We do have the one confirmed no more fc's below, but Im not sure which ROM [MENTION=484490]sirooga[/MENTION] is using? If I can get a confirmation from someone who was getting the 'services' fc before and now doesnt I will add that file edit to the OP.

Hope that clears it up.
[AT&T Samsung Galaxy S 4 Themes and Apps] silrosriv:
So I reverted back to my stock files but it looks like I completely blew out my stock recovery. :(
[AT&T Samsung Galaxy S 4 Themes and Apps] ssn713:
Still getting nfc services fc on Golden Eye after editing the xml file and rebooting. I believe [MENTION=484490]sirooga[/MENTION] mentioned earlier in the thread that he was running MDOB.
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
right.... Im thinking [MENTION=484490]sirooga[/MENTION] wouldnt be getting the FC on MDOB even without editing the xml.

The problem seems to be linked specifically to European i9505 based roms -- Which GoldenEye is and MDOB isnt. I cant imagine this working flawlessly on my tmobile and on verizon too, but not on at&t. Im convinced its just some bad code in the GE Rom that iB4STiD didnt remove.

Easiest way to confirm this is if someone on AT&T who is having the FC doesnt mind flashing an AT&T based rom or Omega or Bobcat from the i9505's (two that Ive personally confirmed working -- although in bobcat you need to remove the SecWalletManager.apk -- Omega has it pre-removed), I'll bet there'd be no more error after flashing my mod (no need for xml edit)
[AT&T Samsung Galaxy S 4 Themes and Apps] sirooga:
I am running mdob and get the fc without editing the xml. As soon as the edit goes in the errors stop.
[AT&T Samsung Galaxy S 4 Themes and Apps] jayb082:
Just to chime in on my experiences...I switched from GE 15 to MDOB last night and installed the Wallet zip. After that, I still got NFC Service FC. I checked the feature.xml and noticed the NFC section was configured for ISIS. I'm guessing this is why. If it helps any, I included the stock NFC section (from MDOB) below. Then I replaced the NFC section with the one from loserskater and no more FC errors. :) Can't wait to try it out!

<!-- NFC -->

<CscFeature_NFC_SetSecureEventType>ISIS</CscFeature_NFC_SetSecureEventType>

<CscFeature_NFC_StatusBarIconType>Att</CscFeature_NFC_StatusBarIconType>

<CscFeature_SmartcardSvc_SetAccessControlType>GPAC, MODE1</CscFeature_SmartcardSvc_SetAccessControlType>

<CscFeature_SmartcardSvc_HideTerminalCapability>eSE</CscFeature_SmartcardSvc_HideTerminalCapability>

<CscFeature_NFC_DefStatus>ON</CscFeature_NFC_DefStatus>
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
GREAT!!!! And Thanks for the confirmation.

Sneaky AT&T for throwing in that ISIS crap (which they own!) as its completely blank on TMobile & Verizon.

Sounds like the new code might not be needed as much as actually DELETING whats there.

Still not sure what the issue is with the NFC 'services' error on GoldenEye Rom guys. It's now the ONLY Rom with the reported error. The only thing I can possibly imagine is that it relates to the broken NFC payment in the i9505 firmware (for which it's based). As I previously posted, rather then fix it Omega Rom removed it. BoBCat Rom fixed it (but still get the NFC 'Payment' error unless you remove the SecWalletManager.apk).

Anyway.... I will update the OP to help AT&T users who are getting the error so they dont need to search through this entire thread.
[AT&T Samsung Galaxy S 4 Themes and Apps] jayb082:
I just tried removing the contents of the NFC section, so it would be blank - got the NFC service error again after reboot. I added it back in, and it's gone - so it seems to be required to eliminate the error, at least on MDOB.
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
GolenEye Users....

I think I just found the issue with GoldenEye....

There doesnt seem to be a /system/csc/feature.xml file -- which therefore, when the app calls for it. causes the NFC service error.

Will have something for you to try in a minute....
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
Did you still keep the line saying <!-- NFC --> just deleting the code beneath it?
[AT&T Samsung Galaxy S 4 Themes and Apps] jayb082:
Yep - exactly
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
Goldeneye Users ***ONLY***

For Goldeneye Users ***ONLY***

Download and UNZIP the below file.

Copy it to your /system/csc folder

change permissions to (rw-r--r--)

reboot.

You should no longer get the error popup!

Edit: Confirmed Working and the fix needed for Goldeneye users *ONLY*
[AT&T Samsung Galaxy S 4 Themes and Apps] KryptosXLayer2:
I've been running your original mod from the OP, but have not reconfigured it as you recently said to do with the combination of the XML edit and doing your mod again.... That being said, done as instructed, rebooted to NO FCs, will update if there are any throughout the day
[AT&T Samsung Galaxy S 4 Themes and Apps] dannyben:
Perfect!!!

Yes, my original mod is correct with the proper libfixes. No need to reflash or re-setup anything.

Goldeneye is based on an international i9505 rom. There are 2 issues with it.

1. There is still the European payment system app in it. Just delete the /system/app/SecWalletManager.apk and you'll no longer get the 'NFC Payment' has stopped error.

2. For whatever reason, ib4stid has no feature.xml in the /system/csc folder. My file above simply adds the NFC lines required. Adding the file to /system/csc will get rid of the 'NFC service' has stopped error.

Glad it's finally figured out for you guys. Will update the OP again to reflect the changes needed on Goldeneye.
[AT&T Samsung Galaxy S 4 Themes and Apps] KryptosXLayer2:
Just hit thanks THREE times for ya because of this, great job and will report back if there are any issues!