The two patches got bounced due to being over 40k message size limit.

Nathaniel: Will you accept those messages to the list or should I try to cut them up further? Since the changes are on a quite fundamental level, it was hard cutting up the commits while still keeping the App in working order. I can possibly cut them up, but with the intermediate commits being "unusable".

Br,
Petter

On Tue, Nov 11, 2014 at 1:52 PM, Petter Arvidsson <petter.arvidsson@fidesmo.com> wrote:
Hi everyone,

My name is Petter and I am working for the Swedish company Fidesm
AB. We are building a platform for managing Secure Elements (such as
NFC cards) via the network. One of the first services that can be
deliverd via our paltform is an OTP application developed by Yubico
(https://github.com/Yubico/ykneo-oath). To enable us to use this
application to store our OTP credentials we wanted to integrate it
into a good OTP Android App. This patch enables any supported external
NFC token to be used with FreeOTP. Currently the only two tokens using
ths protocol that we know of are the Fidesmo Card and the Yubico
Yubikey. I am more than willing to add support for any other device
which is using the same protocol.

The strategy taken to integrate this into FreeOTP was first to
generalize the TokenPersistence and Token classes to accomodate both
internal and external tokens. This is the first commit/patch. On top
of this the NFC functionality was built. To manage the NFC tag
efficiently (i.e. not to have the user tap it more than neccessary),
we decided to handle it only in the main activity. This required the
other activities to return their results rather than manage the
TokenPersistence directly. This is a very common pattern in Android
and we believe that end result was actually quite nice, clearly
separating managing the tokens from the other activities.

If you want to try it out you will require an external NFC
token. Please let me know if you want a Fidesmo Card and I can provide
instructions on how to get one for free. As earlier stated it can also
be tested with a Yubikey from Yubico.

I hope you like the implementation and that you have some good feedack
for me on what needs to be changed and improved!

Please beware that I am a bit new to git send-email, so let me know if
you want any changes to how the patches were generated.

Best regards,
Petter

Petter Arvidsson (2):
  Create interfaces for tokens
  Extend with NFC support

 app/build.gradle                                   |   6 +
 app/src/main/AndroidManifest.xml                   |   9 +-
 .../freeotp/BaseReorderableAdapter.java            |  97 ++++---
 .../fedorahosted/freeotp/ExternalMainActivity.java | 142 +++++++++
 .../org/fedorahosted/freeotp/ExternalToken.java    | 130 +++++++++
 .../freeotp/ExternalTokenPersistence.java          | 129 +++++++++
 .../fedorahosted/freeotp/InternalMainActivity.java | 126 ++++++++
 .../org/fedorahosted/freeotp/InternalToken.java    | 318 +++++++++++++++++++++
 .../freeotp/InternalTokenPersistence.java          | 140 +++++++++
 .../org/fedorahosted/freeotp/MainActivity.java     |  83 +++---
 .../java/org/fedorahosted/freeotp/NfcHelpers.java  |  60 ++++
 .../main/java/org/fedorahosted/freeotp/Token.java  | 277 +-----------------
 .../org/fedorahosted/freeotp/TokenAdapter.java     |  61 ++--
 .../org/fedorahosted/freeotp/TokenPersistence.java | 130 ++-------
 .../org/fedorahosted/freeotp/add/AddActivity.java  |  10 +-
 .../org/fedorahosted/freeotp/add/BaseActivity.java |   7 +
 .../org/fedorahosted/freeotp/add/ScanActivity.java |  23 +-
 .../fedorahosted/freeotp/edit/BaseActivity.java    |  22 --
 .../fedorahosted/freeotp/edit/DeleteActivity.java  |  19 +-
 .../fedorahosted/freeotp/edit/EditActivity.java    |  47 +--
 app/src/main/res/layout/main.xml                   |   4 +-
 app/src/main/res/menu/editable_token.xml           |  33 +++
 app/src/main/res/menu/token.xml                    |   6 -
 app/src/main/res/values/strings.xml                |  15 +-
 24 files changed, 1336 insertions(+), 558 deletions(-)
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/ExternalMainActivity.java
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/ExternalToken.java
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/ExternalTokenPersistence.java
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/InternalMainActivity.java
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/InternalToken.java
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/InternalTokenPersistence.java
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/NfcHelpers.java
 create mode 100644 app/src/main/java/org/fedorahosted/freeotp/add/BaseActivity.java
 delete mode 100644 app/src/main/java/org/fedorahosted/freeotp/edit/BaseActivity.java
 create mode 100644 app/src/main/res/menu/editable_token.xml

--
1.9.1