Before Android 4.4
What you are trying to do is simply not possible from the application (at least on an unrouted / unmodified device). The message "NFC tag type is not supported" is displayed by the Android system (or rather, the NFC system service) before and instead of sending the tag to your application. This means that the NFC system service filters the MIFARE Classic tags and never notifies any application about them. Therefore, your application cannot detect MIFARE Classic tags or bypass this pop-up message.
On a rooted device, you can bypass the message using
- Xposed to change the behavior of the NFC service, or
CSC function configuration files (consumer software settings) in the system partition (see / system / csc /. The NFC system service disables the pop-up window and sends MIFARE Classic tags to applications if the CSC function <CscFeature_NFC_EnableSecurityPromptPopup>
is set to any value but "mifareclassic "or" all ". For example, you can use:
<CscFeature_NFC_EnableSecurityPromptPopup>NONE</CscFeature_NFC_EnableSecurityPromptPopup>
You can add this entry, for example, to the file "/system/csc/others.xml" (in the <FeatureSet>... </FeatureSet>
that already exists in this file).
Since then, you asked about the Galaxy S6 (the question you related ): I tested this method on S4 when it came out. I did not check if this works in the latest firmware version or on other devices (for example, S6).
Starting with Android 4.4
This is pure speculation, but according to this (the link is no longer available), it seems that some applications (for example, NXP TagInfo) are able to detect MIFARE Classic tags on vulnerable Samsung devices starting with Android 4.4. This may mean that foreground applications are able to bypass this popup using the read-mode API ( see NfcAdapter.enableReaderMode
), possibly in combination with NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK
.
source share