diff options
-rw-r--r-- | app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt | 11 | ||||
-rw-r--r-- | app/src/main/res/xml/apduservice.xml | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt index b099b74..9134df4 100644 --- a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt +++ b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt @@ -1,11 +1,13 @@ package net.taler.wallet import android.content.* +import android.net.Uri import android.nfc.cardemulation.HostApduService import android.os.Bundle import android.util.Log import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream +import java.net.URI import java.util.concurrent.ConcurrentLinkedDeque fun makeApduSuccessResponse(payload: ByteArray): ByteArray { @@ -123,10 +125,11 @@ class HostCardEmulatorService: HostApduService() { val url = String(bodyBytes, Charsets.UTF_8) Log.v(TAG, "got URL: '$url'") - Intent().also { intent -> - intent.action = TRIGGER_PAYMENT_ACTION - intent.putExtra("contractUrl", url) - sendBroadcast(intent) + Intent(this, MainActivity::class.java).also { intent -> + intent.data = Uri.parse(url) + intent.action = Intent.ACTION_VIEW + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + startActivity(intent) } } 2 -> { diff --git a/app/src/main/res/xml/apduservice.xml b/app/src/main/res/xml/apduservice.xml index ac2aa32..4a48065 100644 --- a/app/src/main/res/xml/apduservice.xml +++ b/app/src/main/res/xml/apduservice.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android" android:description="@string/servicedesc" - android:requireDeviceUnlock="false"> + android:requireDeviceUnlock="true"> <aid-group android:description="@string/aiddescription" android:category="other"> <aid-filter android:name="F00054414C4552"/> |