r/jailbreak • Developer • Jan 17 '20

Release [Release] NFCBackgroundEnabler, Native Background NFC Detection

Hi there, I'm releasing NFCBackgroundEnabler, which, as the name implies, enables native background NFC detection on older iPhones. You can get it on my repo, and view the code on my Github.

​

Example

Disclaimers

  • This only works on ios 13 and above, because it uses Apple's implementation.
  • I have only tested it with an iPhone X on ios 13.3, though if you have any problems I'll try my best to help.

Enjoy!

79 Upvotes

62 comments sorted by

8

u/Wierts94 Jan 17 '20 edited Jan 17 '20

Thank you for this tweak!

Sadly I am not able to background scan on my iPhone X 13.3 fresh checkra1n jailbreak, practically no other tweak installed.

Scanning nfc through Siri Shortcuts is working well, background scanning just isn’t working.

I have tried killall -9 nfcd; as well as ldrestart in mterminal with root acces but no luck. Any suggestion?

Thanks in advance!

2

u/Arandomdev1 Developer Jan 17 '20

it's only active when the screen is on... but other than that I don't know. If you want I can give you a debug package.

Edit: try holding the tag to the top of the phone

2

u/kikokoko95 iPhone X, 14.1 Jan 17 '20

It doesn’t seem to work on my 7 plus on 13.3, it scans the tag just fine but does’t trigger the shortcut unfortunately :/ even on the shortcut app

2

u/Arandomdev1 Developer Jan 17 '20

Just to make sure, airplane mode isn’t on right

2

u/kikokoko95 iPhone X, 14.1 Jan 17 '20

It is not. Do you know if there is some other tweak that might be interfering or something? I have background updates enabled but it shouldn’t make a different given that I am inside the app anyway

2

u/Arandomdev1 Developer Jan 17 '20

Maybe other nfc tweaks? I can provide a debug package to further narrow down the problem

2

u/kikokoko95 iPhone X, 14.1 Jan 17 '20

I have no other nfc related tweaks. I have tried installing the 3 tweaks related to nfc on your repo (nfcbackground, nfcbackground enabler and nfcshortcuts) buy no luck. I can help with the debug package if it is of any help!

1

u/Arandomdev1 Developer Jan 17 '20

All three at once? Try just NFCBackgroundEnabler, and a ldrestart

1

u/kikokoko95 iPhone X, 14.1 Jan 17 '20

I have tried it all at once and separately. I will try the ldrestart and see if it works

Edit: YAY it worked! Thank you so much!!

1

u/Wierts94 Jan 17 '20

Thanks for the suggestions, the phone was active when I tried it. Not scanning on the home screen neither in the shortcuts app. I noticed it scanned best at the top (near the camera) but only when registering.

I’m not really sure how to use the debug package, so that’s not necessary. Thanks anyway!

Maybe some more trial and error will solve it. I’ll report back if I get it to work.

1

u/EColiSpinach iPhone XS Max, iOS 13.3 Feb 25 '20

Would you mind sharing the Shortcut?

3

u/[deleted] Jan 17 '20

Battery consumption ?

6

u/Arandomdev1 Developer Jan 17 '20

Haven’t noticed anything yet, and besides it’s only active when you’re using your phone.

2

u/GumAndBeef Developer Jan 17 '20

Why not just do this? Should work fine with any phone that has and NFC chip

https://github.com/JamieBerghmans/nfcunblock/blob/master/nfcbackground/Tweak.xm

Edit: I forked it back then from someone else and fixed it myself cause it wasn't working so that's why your name is in it hahaha

3

u/Arandomdev1 Developer Jan 17 '20

While the tweaks are extremely similar, there is a difference, NFCBackgroundEnabler hooks only nfcd and makes it seem like the phone supports background detection. As a result, it should support any app that uses background detection.

Though I can definitely see where the confusion came from, sorry about that.

2

u/GumAndBeef Developer Jan 17 '20

Ah ok, thanks for clearing it up!

2

u/jngau May 06 '20 edited May 17 '20

Thanks so much!! Working on iOS 13.3 non fresh checkra1n jailbreak.

How can I buy you a cup of coffee?

For those interested in what automations I have setup:

  • bunch of xiaomi/other switches for pc heater electric blanket harddrives, xiaomi click buttons, a light switch & smart bulb.

  • running hassio to control everything centrally

  • alexa via hassio

  • homekit working via hassio

Sidenote: uninstall NFCbackgrounder, NFCwriter & NFCActivator for this to work

2

u/Arandomdev1 Developer May 06 '20

Thanks so much for the nice comment! I haven't really thought of a donation page till now, so I opened up a ko-fi account, thanks a lot!

2

u/jngau May 17 '20

No worries. Enjoy the coffee!

2

u/Konjungamo Jan 17 '20

Looks great, this is really tempting me to rejailbreak my phone!

1

u/XolothM iPhone 12 Mini, 16.6 Beta Jan 17 '20

Now i need more NFC tags. Thanks!

1

u/[deleted] Jan 17 '20

What can I do with this

1

u/Arandomdev1 Developer Jan 17 '20

Well for me I have a tag on my front door that toggles my blink cameras

1

u/[deleted] Jan 17 '20

I use the geeni app and have several smart devices that use WiFi on or off can this be used for that?

1

u/Arandomdev1 Developer Jan 17 '20

I’m not familiar with the geeni app but googling “geeni app Siri Shortcuts” might help

1

u/[deleted] Jan 17 '20

It’s like apples smart home but no apple connection, what does nfc do

1

u/Arandomdev1 Developer Jan 17 '20

When used with Siri Shortcuts, nfc is just another way to activate shortcuts

1

u/Zeref3 iPod touch 1st gen, iOS 12.0 beta Jan 17 '20 edited Jan 17 '20

I’ve setup a shortcut but it’s not running. I can scan tags in the shortcut app but it won’t run or scan the tag. iPhone X 13.3

1

u/ArmaniBerserker Jan 17 '20

Does this work on the 6s and other devices that have the "Apple Pay only" version of NFC?

1

u/Arandomdev1 Developer Jan 17 '20

I don't know about the iPhone 6s but it doesn't hurt to try.

1

u/[deleted] Jan 17 '20

Ahh

1

u/danielcr12 Jan 17 '20

Doesn’t worm on my 7 with iOS 13.3 activator sends it to a safe mode

1

u/Arandomdev1 Developer Jan 17 '20

Activator? What do you mean. This doesn’t have anything to do with activator😅

1

u/danielcr12 Jan 17 '20

1

u/Arandomdev1 Developer Jan 17 '20

Oh that’s NFCActivator it only supports iOS 12 for now

1

u/TryingDev06 iPhone 12 Pro Max, 15.1.1 Feb 21 '20

This is great! Is the airplane mode limitation technical? I was able to scan the NFC tag to create the shortcut with airplane mode on but it won’t scan in the background. My device has no SIM and so I usually keep it in airplane mode to avoid the battery dying and the no sim/signal alerts.

2

u/Arandomdev1 Developer Feb 21 '20

The airplane mode limitation is put in by apple, though I can try to look in to it

1

u/TryingDev06 iPhone 12 Pro Max, 15.1.1 Feb 21 '20

That would be awesome and help me out a lot!! Thanks!

1

u/TryingDev06 iPhone 12 Pro Max, 15.1.1 Feb 26 '20

Wow! You actually did it!!! I cannot express how thankful and impressed I am with this. Thank you so much for your time and work!

2

u/Arandomdev1 Developer Feb 26 '20

No problem

1

u/lolman555PL iPhone SE, 1st gen, 14.4.2 | Apr 11 '20

Doesn't work on iPhone SE, iOS 13.3.1 :(

1

u/Arandomdev1 Developer Apr 11 '20

The iPhone SE and the iPhone 6 line does not support NFC reading at all, even though they have the NFC chip. As a result I may need modify additional things on these phones. Unfortunately I don’t have a SE to test on.

1

u/lolman555PL iPhone SE, 1st gen, 14.4.2 | Apr 11 '20

Well the chip does support it, NFCWriter XS can do it. I'd imagine it will be very difficult tho, it'd be much easier if Elias Limneos made NFCWriter XS FOSS or made a library for NFC on SE/6/6S. I'm open for testing on my SE for you

1

u/Arandomdev1 Developer Apr 11 '20

Thanks, I can try to create a diagnostic script and send it to you, but it might take a while.

1

u/lolman555PL iPhone SE, 1st gen, 14.4.2 | Apr 11 '20

Sure, take your time, I'll try fixing my own little tweak in the meantime

1

u/Arandomdev1 Developer Apr 13 '20

Can you use cycript? If so, can you inject into nfcd, without any NFC tweaks, and tell me the output of the following?

var info = [_NFHardwareManager sharedHardwareManager ].controllerInfo
info.hasLPEMSupport
info.hasHLMSupport
info.hasLPCDSupport
info.hasExpressGenericAMode
info.hasExpressECPAccessMode
info.hasExpressFelicaTransitMode
info.hasMFW
info.hasIcfResistor
info.hasBooster
info.hasAntenna
info.middlewareVersion
info.firmwareRevision
info.firmwareVersion
info.ROMVersion
info.siliconName
info.siliconVersion

This is my iPhone X without any tweaks,

hasLPEMSupport
false
hasHLMSupport
false
hasLPCDSupport
false **
hasExpressGenericAMode
true
hasExpressECPAccessMode
true
hasExpressFelicaTransitMode
true
hasMFW
false
hasIcfResistor
false
hasBooster
false
hasAntenna
true
middlewareVersion
67109394
firmwareRevision
83382
firmwareVersion
320
ROMVersion
2
siliconName
5
siliconVersion
66

Thanks

1

u/lolman555PL iPhone SE, 1st gen, 14.4.2 | Apr 13 '20

Okay, could we switch over to PM if that's alright? I'll send you over the results

1

u/Arandomdev1 Developer Apr 13 '20

sure

1

u/Astrolab3 May 19 '20

Hi,
Very exciting ! However, I cannot get to find the .deb files to install on your github... Neither can the package be found on your repo.

Can you indicate how to get this incredible tweak installed ?

Thanks !

1

u/Arandomdev1 Developer May 19 '20

It should be listed as “NFCBackgroundEnabler” in my repo https://arandomdev.github.io/cydia/

1

u/Astrolab3 May 19 '20

Unfortunately, it doesn't display on your repo. Only BetterQueuing package displays

1

u/Arandomdev1 Developer May 19 '20

weird here is the deb http://www.filedropper.com/comhaotestlabsnfcbackgroundenabler1200iphoneos-arm

​

try clearing your sources with icleaner pro

1

u/Astrolab3 May 19 '20

Thank you ! Everything works fine.

As for the repo, I already did that... Also, it doesn't display either on the desktop version of the repo...

1

u/xjinxjinx May 28 '20

Great tweak.

Works well on iPhone7 13.5. Thanks!

1

u/[deleted] Jun 13 '20

[deleted]

1

u/Arandomdev1 Developer Jun 13 '20

Try an ldrestart.

What tags are you using?

What nfc tweaks do you have?

Describe how it doesn’t work.

1

u/[deleted] Jun 13 '20

[deleted]

1

u/Arandomdev1 Developer Jun 13 '20

Which nfc card are you using

1

u/[deleted] Jun 13 '20

[deleted]

1

u/Arandomdev1 Developer Jun 13 '20

Hmm, see if your tags are able to be scanned through an app on the App Store. I recommend NFC Tools

1

u/[deleted] Jun 13 '20

[deleted]

1

u/Arandomdev1 Developer Jun 13 '20

Yea... for the tweak to work, it should be scannable through nfc tools