How to get an Android application registered in OS

I am looking for Android source code because I want to understand when the AndroidManifest.xml file of the application is parsed.

those. if the application registers an NFC service

<service
        android:name=".demo.service.ApduService"
        android:exported="true"
        android:permission="android.permission.BIND_NFC_SERVICE">

        <intent-filter>
            <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" />
        </intent-filter>

        <meta-data
            android:name="android.nfc.cardemulation.host_apdu_service"
            android:resource="@xml/apduservice" />
    </service>

with the following apduservice.xml

<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/servicedesc"
android:requireDeviceUnlock="false" >

<aid-group
    android:category="other"
    android:description="@string/aiddescription" >
    <aid-filter android:name="23498234098234098" />
</aid-group>

When and where does the Android OS read the helper filter and register the ID?

(I know where it will be saved and how, but I cannot find an event in which the actual identifier will be fetched and redirected to the NFC stack)

+4
source share
1 answer

When is the list of CE services for the host and off-host updated?

APDU (HCE SE-based CE) , , , , .. com.android.nfc.cardemulation.RegisteredServicesCache. :

  • ACTION_PACKAGE_ADDED
  • ACTION_PACKAGE_CHANGED
  • ACTION_PACKAGE_REMOVED
  • ACTION_PACKAGE_REPLACED
  • ACTION_PACKAGE_FIRST_LAUNCH
  • ACTION_PACKAGE_RESTARTED
  • ACTION_EXTERNAL_APPLICATIONS_AVAILABLE
  • ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE

, AID , NFC.

?

, android.nfc.cardemulation.action.HOST_APDU_SERVICE android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE. , NFC, BIND_NFC_SERVICE. .

AID?

APDU andoid.nfc.cardemulation.ApduServiceInfo. , <service>, AID.

?

, , com.android.nfc.cardemulation.RegisteredAidCache. AID AID .

+6

Source: https://habr.com/ru/post/1539603/


All Articles