-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve test bench for bluetooth, some refactorings
- Loading branch information
Showing
42 changed files
with
1,554 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
|
||
|
||
# External NFC Service (native style) for Android | ||
Library for interaction with ACS NFC readers over USB; external NFC support Android devices. | ||
|
||
Features: | ||
- External NFC reader management and interaction | ||
- Parallell use of external and/or internal NFC (i.e. in the same activity, both enabled at the same time) | ||
- Support for both tags and Android devices (Host Card Emulation), simultaneously | ||
- Use of forked `android.nfc` classes ([Ndef], [MifareUltralight], [IsoDep], etc). | ||
- Use of forked `android.nfc` classes ([Ndef], [MifareUltralight], [IsoDep], etc) for Android 10+ support. | ||
|
||
As this project very much simplifies implementation for use-cases requiring external NFC readers, it saves a lot of development time (2-8 weeks depending on use-case and previous knowledge). | ||
|
||
Bugs, feature suggestions and help requests can be filed with the [issue-tracker]. | ||
Bugs, feature suggestions and help requests can be filed with the [issue-tracker]. __DO NOT send me emails unless you're prepared to pay for my time.__ | ||
|
||
## License | ||
[Apache 2.0] | ||
|
@@ -22,21 +20,21 @@ This repository contains source code for | |
* [A server library](externalNFCCore); services for interaction with the readers & tags | ||
* [A client library](externalNFCAPI) (i.e. API), receiving NFC-related intents | ||
* [An NFC library](externalNFCTools) - Android adaptation of NFC Tools | ||
* Demo apps | ||
* [Basic server app](externalNFCService) | ||
* [Basic client app](externalNFCClient) | ||
* Demonstration apps | ||
* [Basic server app](externalNFCService) for activation of the USB and/or bluetooth NFC background service. The rest of the examples interacts with the services exported by this app. | ||
* [Basic client app](externalNFCClient). | ||
* [NXP API client](externalNFCNxpClient) for [MIFARE SDK](http://www.mifare.net/en/products/mifare-sdk/). Deprecated for version 2.0.0 of the library; due to Android security for hidden classes in Android 9+. | ||
* [Web Kiosk client](externalNFCWebKiosk) with javascript bindings | ||
|
||
There is also a [Host Card Emulation client app](externalNFCHostCardEmulationClient) for use with the [Basic client app](externalNFCClient). | ||
There is also a [Host Card Emulation client app](externalNFCHostCardEmulationClient) for use with the [Basic client app](externalNFCClient) as well as Android-to-Android communication. | ||
|
||
# External NFC reader API | ||
The API defines | ||
* broadcast actions | ||
* service start / stop and status | ||
* reader open / close and status | ||
* tag connect / disconnect | ||
* 'extras' objects for interaction with readers | ||
* `extras` objects for interaction with readers | ||
* disable beeps | ||
* display text | ||
* configure NFC tech types (PICC) | ||
|
@@ -77,17 +75,14 @@ The readers can for the __most part can be enabled for all tag types at the same | |
Please note: | ||
- Some readers only support a subset of the above tags | ||
- For ACR 122U the Mifare Classic does not work well. | ||
- No built-in NDEF support for Desfire EV1 cards (let me know it this is interesting to you). | ||
- No built-in NDEF support for Desfire EV1 cards | ||
|
||
Configuration options | ||
- assume all NTAG21x Mifare Ultralight targets. This improves read speed, particullary for the tags which have legacy equivalents, like NTAG 210 and 213 | ||
- read only tag UIDs, ignore other tag data. This improves read speed. | ||
- read NDEF data automatically | ||
- read UID for Desfire EV1 targets automatically | ||
|
||
# Troubleshooting | ||
Please report any issues to [email protected]. | ||
|
||
### Reader connection | ||
Note that not all Android devices actually have an USB hub, in which case no USB devices work. | ||
|
||
|
@@ -116,24 +111,6 @@ This project contains adapted code from | |
* NFC Tools for Java | ||
* SMARTRAC SDK for Android NFC NTAG | ||
|
||
# Support | ||
If you need professional, cost-efficient assistance with an NFC project, get in touch. I also do | ||
|
||
* Desfire EV1 tech (with encryption) - [example app](https://play.google.com/store/apps/details?id=com.github.skjolber.nfc.skjolberg.mifare.desfiretool) | ||
* WebView-based apps, either visiting ULRs and/or interaction over Javascript. | ||
* NFC-initiated [wifi connectivity](https://play.google.com/store/apps/details?id=w.i) | ||
* More advanced Host Card Emulation (HCE) for Android | ||
* NFC development tools (some are a bit outdatet now) | ||
* [NFC Developer](https://play.google.com/store/apps/details?id=com.antares.nfc) | ||
* [NDEF Tools for Android](https://play.google.com/store/apps/details?id=org.ndeftools.boilerplate&hl=no) | ||
* [Mifare Classic refactor](https://play.google.com/store/apps/details?id=com.github.skjolber.nfc.mifareclassic) | ||
* NFC supplimented with QR codes | ||
* Smartcard-related workflows and integrations over [ESB](http://camel.apache.org/) or [BPM](https://camunda.com/) modelling | ||
* Custom binary formats for NDEF or raw tag data - fit your data for __minimal read/write time and best form factor selection__ | ||
* [Apache Cordova] plugins for Android | ||
|
||
Feel free to connect with me on [LinkedIn](http://lnkd.in/r7PWDz), see also my [Github page](https://skjolber.github.io). | ||
|
||
# History | ||
- 2.0.0: Moved to wrapped `android.nfc` NFC android classes + various refactorings. | ||
- 1.0.0: Library using native NFC android classes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ android { | |
} | ||
|
||
defaultConfig { | ||
minSdkVersion 19 | ||
minSdkVersion 24 | ||
targetSdkVersion 28 | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,6 @@ interface IAcr1255UReaderControl { | |
|
||
byte[] setAutomaticPolling(boolean on); | ||
|
||
byte[] getBatteryLevel(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# core | ||
|
||
## Usage | ||
|
||
### USB background service | ||
Launch the service __BackgroundUsbService__. If started without a connected reader, the service remains alive and looks for a reader. If there is no USB permission granted already, the app will ask for such a permission whenever a reader is connected. | ||
|
||
For some Android devices the reader permission is not saved via the `request usb permission` operation in the service. To stop the 'permission box' from reappearing, add an activity which triggers on the right filter | ||
|
||
``` | ||
<intent-filter> | ||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> | ||
</intent-filter> | ||
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/accessory_filter" /> | ||
with accessory_filter | ||
<resources> | ||
<usb-device vendor-id="1839" /> | ||
</resources> | ||
``` | ||
|
||
where 1839 is ACS. | ||
|
||
### Bluetooth background service | ||
Launch the service __BluetoothBackgroundService__. | ||
|
||
## Configuration options | ||
The service has some configuration options, loaded from shared preferences. These are listed in the top of the service class. | ||
|
||
## Bluetooth | ||
There is a basic implementation of bluetooth reader support | ||
|
||
Note on bluetooth: See the docs folder for info how to reset the devices. The tool can also be using via a Windows virtual machine. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.