Is it possible to declare a HostApduService?

Hi there,

I was wondering if it is possible to declare an Android HostApduService as part of a Fuse app? This requires a particular manifest config as per below:

<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
	android:description="@string/servicedesc"
	android:requireDeviceUnlock="false">
	<aid-group android:description="@string/aiddescription"
		android:category="other">
		<aid-filter android:name="F0010203040506"/>
		<aid-filter android:name="F0394148148100"/>
	</aid-group>
</host-apdu-service>

Is this something that can be added?

Many thanks.

It certainly is, though it does depend on where in the manifest you want it to be.

The following will add it to the application element:

<Extensions Backend="CPlusPlus" Condition="Android">
    <Require AndroidManifest.ApplicationElement><![CDATA[

        <host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
            android:description="@string/servicedesc"
            android:requireDeviceUnlock="false">
            <aid-group android:description="@string/aiddescription"
                android:category="other">
                <aid-filter android:name="F0010203040506"/>
                <aid-filter android:name="F0394148148100"/>
            </aid-group>
        </host-apdu-service>

    ]]></Require>
</Extensions>

Put this code inside a file with the extension uxl e.g. ManifestAdditions.uxl

If you want it added inside the activity element then change AndroidManifest.ApplicationElement to AndroidManifest.ActivityElement

I hope this helps :slight_smile:

1 Like

Awesome. Thank you.