Skip to content

Weird intent action #11

Open
Open

Description

@markusbug

Hey!

When I have a device running the HCE and another one running "readnfcmessage", the reader is always pushing as the intent action "android.intent.action.MAIN" and nothing in there. Why is the intent action this (even though the app is already open) and the phone is vibrating because an NFC chip was found?

Thanks in advance!

Activity

  1. leonardosetiadi commented on Jan 22, 2024

    @leonardosetiadi

    Same to me, any solution for this? @markusbug did you find any other approach?

  2. kevin930321 commented on Jul 30, 2024

    @kevin930321

    @markusbug @leonardosetiadi I tried to build the the app but it keeps failing, Can you guys provide the apk file pls (in .zip), tks.

  3. galihif commented on Aug 28, 2024

    @galihif

    @markusbug it happens to me too

  4. albertoZurini commented on Sep 26, 2024

    @albertoZurini

    Same issue here even when I approach a NDEF-formatted NFC tag (which for instance I can read from NFC tools on the same device). I tried changing the manifest accordingly to what they say here, but with no success. Was any of you able to get it working?
    I also tried updating the nfc_tech_filter like this, but I'm still getting the same wrong intent...

    <resources >
        <tech-list>
            <tech>android.nfc.tech.IsoDep</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.NfcA</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.NfcB</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.NfcF</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.NfcV</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.Ndef</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.NdefFormatable</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.MifareClassic</tech>
        </tech-list>
        <tech-list>
            <tech>android.nfc.tech.MifareUltralight</tech>
        </tech-list>
    </resources>
    
  5. albertoZurini commented on Sep 28, 2024

    @albertoZurini

    I found this repository https://github.com/nguyencongtu2004/NFC-Demo that has a code able to read tags. I put the code from this repo there and I'm now able to read tags. Currently working on getting the HCE part of the code working.
    If anyone with more Android development experience can please tell me what's the difference between the two projects (I'm ignorant and I just checked the AndroidManifest and Gradle; they look more or less the same), it would be really cool!

  6. albertoZurini commented on Sep 28, 2024

    @albertoZurini

    @underwindfall, I have a question: I didn't understand how the reader is able to trigger the HCE app. I can see here

    <aid-filter android:name="D2760000850101"/>
    the AID is set, but I only saw it also being put here for the check
    private val APDU_SELECT = byteArrayOf(
    0x00.toByte(), // CLA - Class - Class of instruction
    0xA4.toByte(), // INS - Instruction - Instruction code
    0x04.toByte(), // P1 - Parameter 1 - Instruction parameter 1
    0x00.toByte(), // P2 - Parameter 2 - Instruction parameter 2
    0x07.toByte(), // Lc field - Number of bytes present in the data field of the command
    0xD2.toByte(),
    0x76.toByte(),
    0x00.toByte(),
    0x00.toByte(),
    0x85.toByte(),
    0x01.toByte(),
    0x01.toByte(), // NDEF Tag Application name
    0x00.toByte(), // Le field - Maximum number of bytes expected in the data field of the response to the command
    )
    . Why is it just on app and not on the readnfcmessage?

    I also read your comment on StackOverflow: https://stackoverflow.com/questions/29122848/ndef-message-with-hce-android, but i quite haven't understood. Were you able to emulate the first authentication code message to be processed by the HCE app, so that the reader should just send the binary read message or am I getting something wrong here?
    PS: If that's true, I haven't understood how you were able to skip the first authentication message to be processed by the HCE app.

  7. albertoZurini commented on Sep 28, 2024

    @albertoZurini

    I was able to get it working! Forked repo can be found here: https://github.com/albertoZurini/NFC-Demo, please send me pull requests if you found anything wrong!

  8. kevin930321 commented on Dec 26, 2024

    @kevin930321

    @albertoZurini Could you provide the APK file? Thanks.

  9. albertoZurini commented on Dec 27, 2024

    @albertoZurini

    @albertoZurini Could you provide the APK file? Thanks.

    @kevin930321 what do you mean by APK? If you go to my repo you can check the GIF. There's not much point in sharing the APK since it is useless (only transferring a string from a phone to the other). If you want it I can share it still, would you like to share an email/Telegram/whatever I can send the APK to?

  10. kevin930321 commented on Dec 27, 2024

    @kevin930321

    @albertoZurini Oh, I see, never mind then, thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions