From a50b26cf24e933cb0a549a9071dcea2cd5ff6dbf Mon Sep 17 00:00:00 2001 From: Lamparter Date: Sun, 14 Jul 2024 10:25:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B1=20Add=20SmartTapHCE=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 13 +++++++++++-- .../java/dev/riverside/credit/SmartTapHCE.kt | 18 ++++++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/apduservice.xml | 10 ++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/dev/riverside/credit/SmartTapHCE.kt create mode 100644 app/src/main/res/xml/apduservice.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d0b20c1..27e2353 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,16 +13,25 @@ android:supportsRtl="true" android:theme="@style/Theme.SmartTap" tools:targetApi="31"> + + + + + + - - \ No newline at end of file diff --git a/app/src/main/java/dev/riverside/credit/SmartTapHCE.kt b/app/src/main/java/dev/riverside/credit/SmartTapHCE.kt new file mode 100644 index 0000000..d037ddf --- /dev/null +++ b/app/src/main/java/dev/riverside/credit/SmartTapHCE.kt @@ -0,0 +1,18 @@ +package dev.riverside.credit + +import android.nfc.cardemulation.HostApduService +import android.os.Bundle + +class SmartTapHCE : HostApduService() { + override fun processCommandApdu(commandApdu: ByteArray, extras: Bundle): ByteArray { + // TODO: Handle the APDU command here + // (return a response APDU according to the commandApdu received) + return byteArrayOf() + } + + override fun onDeactivated(reason: Int) { + // TODO: Handle deactivation here + // (this method will be called whenever the NFC link is deactivated or lost) + } +} + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 63407bf..d31c575 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -43,4 +43,6 @@ libero vel nunc consequat, quis tincidunt nisl eleifend. Cras bibendum enim a justo luctus vestibulum. Fusce dictum libero quis erat maximus, vitae volutpat diam dignissim. + Smart Tap + Lorem Ipsum \ No newline at end of file diff --git a/app/src/main/res/xml/apduservice.xml b/app/src/main/res/xml/apduservice.xml new file mode 100644 index 0000000..8c4f3cf --- /dev/null +++ b/app/src/main/res/xml/apduservice.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file