- This package is for build LCA43 only (can be seen in Settings->About)
- Can screw up boot if you install this on a different build and/or customized system
- Future OTA updates can also corrupt your sytem. Restore to a stock ROM before installing them.
- Make backups of system and boot partitions before installing
- Uses insecure kernel (with SElinux disabled) and disables signature checks in services.jar
- Preview/development purposes only, it disables initial tag (used for quick pairing) and causes moderate power consumption when NFC is active and screen is turned on.
Currently this is more of a proof-of-concept work and security was a big problem when developing. NfcService requires several permissions declared as system|signed which means it has to be signed with the same certificates used to sign the remaining system. I did not manage to do that, so I patched services.jar to ignore bad certificates.
(This paragraph is deprecated) When device boots even if NFC adapter is active, it does not get full power right away. Instead, it sets up a BroadcastReceiver to catch ACTION_SCREEN_ON and ACTION_SCREEN_OFF events to power the module only when screen is lit. However, power manager service on SmartWatch 3 never sends these broadcasts, so the module never gets a signal to turn on. I am yet to figure out why, in the meantime I patched NfcService to turn the module regardless of current screen state. It does not start consuming power until a tag is first detected, after which the battery can be drained with rate up to 50% per hour.
- Full NFC support (tag reading, writing, HCE (card emulation) and P2P (Android Beam))
- Configuration app to turn NFC module on and off
- Watchface to monitor current NFC module state
The package does not include apps to read and write tags, emulate cards and use Android Beam.
- If you need to omit certain components (like watchface), feel free to remove them from the package files
- Boot into recovery (I am using TWRP found here)
- Back up your system and boot partitions in case something goes wrong or you want to remove the package
- Push the package using adb: Code:
adb push nfc.zip /sdcard/nfc.zip
- Tap "Install" on the screen
- Locate nfc.zip
- Install it
- Boot into system
- Restore system and boot partitions from your backup
- You can control your NFC module using NFC Configuration app
- If you want to monitor NFC module state all the time, use NFC Status watchface (long tap on the screen to set up)
- To view a tag install tag editing app via adb
Example code to check NFC:
NfcManager nfcManager = (NfcManager)this.getBaseContext().getSystemService(Context.NFC_SERVICE); NfcAdapter nfcAdapter = nfcManager.getDefaultAdapter(); boolean isAdapterEnabled = (nfcAdapter != null) && nfcAdapter.isEnabled();
- 08.10.2015 0.2 Fixed constant battery drain. Reduced tag polling rate.
- 07.10.2015 First release