Add scan progress indicator, payment card detection, and production cleanup
Features: - Add scanning progress indicator showing current detection step - Detect payment cards (Visa, Mastercard, Amex, etc.) via PPSE/EMV AIDs - Show "Payment Device Detected" instead of "Implant Detected" for payment cards - Hide compatible implants section for payment devices, show conversion instead - Add Spark 1/2 implant detection via vivokey.co NDEF URL - Hide conversion card when actual implant is detected Technical: - Add DetectionProgressCallback for real-time detection status - Add payment network AIDs to commands.ts - Configure babel to strip console.log/warn in production builds - Add logger utility for development-only logging Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
import {Platform} from 'react-native';
|
||||
import NfcManager, {NfcTech} from 'react-native-nfc-manager';
|
||||
|
||||
export {NfcTech};
|
||||
|
||||
/**
|
||||
* APDU response with status word
|
||||
*/
|
||||
@@ -130,6 +132,20 @@ export function iso15693ReadSingleBlock(blockNumber: number): number[] {
|
||||
return [0x02, 0x20, blockNumber];
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO 15693 READ_MULTIPLE_BLOCKS command (0x23)
|
||||
* Reads multiple consecutive blocks
|
||||
*/
|
||||
export function iso15693ReadMultipleBlocks(
|
||||
startBlock: number,
|
||||
numBlocks: number,
|
||||
): number[] {
|
||||
// Flags 0x02: unaddressed mode
|
||||
// Command 0x23: READ_MULTIPLE_BLOCKS
|
||||
// numBlocks is 0-indexed (0 = 1 block, so subtract 1)
|
||||
return [0x02, 0x23, startBlock, numBlocks - 1];
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Known AIDs
|
||||
// ============================================================================
|
||||
@@ -141,6 +157,42 @@ export const KNOWN_AIDS = {
|
||||
openPgp: [0xd2, 0x76, 0x00, 0x01, 0x24, 0x01],
|
||||
/** FIDO/U2F applet */
|
||||
fido: [0xa0, 0x00, 0x00, 0x06, 0x47, 0x2f, 0x00, 0x01],
|
||||
/** FIDO2/WebAuthn applet (CTAP2) */
|
||||
fido2: [0xa0, 0x00, 0x00, 0x06, 0x47, 0x2f, 0x00, 0x01],
|
||||
/** Fidesmo service discovery applet */
|
||||
fidesmo: [0xa0, 0x00, 0x00, 0x06, 0x17, 0x00],
|
||||
/** NFC Forum Type 4 Tag NDEF applet */
|
||||
ndefTag: [0xd2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01],
|
||||
/** VivoKey OTP applet */
|
||||
vivokeyOtp: [0xa0, 0x00, 0x00, 0x05, 0x27, 0x21, 0x01],
|
||||
/** PIV (Personal Identity Verification) */
|
||||
piv: [0xa0, 0x00, 0x00, 0x03, 0x08],
|
||||
/** OATH (OTP) applet */
|
||||
oath: [0xa0, 0x00, 0x00, 0x05, 0x27, 0x21, 0x01],
|
||||
/** JavaCard Memory Manager - present on Apex and flexSecure implants */
|
||||
javacardMemory: [
|
||||
0xa0, 0x00, 0x00, 0x08, 0x46, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x01,
|
||||
],
|
||||
|
||||
// Payment network AIDs (EMV)
|
||||
/** Visa Credit/Debit */
|
||||
visaCredit: [0xa0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10],
|
||||
/** Visa Electron */
|
||||
visaElectron: [0xa0, 0x00, 0x00, 0x00, 0x03, 0x20, 0x10],
|
||||
/** Mastercard Credit/Debit */
|
||||
mastercard: [0xa0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10],
|
||||
/** Mastercard Maestro */
|
||||
maestro: [0xa0, 0x00, 0x00, 0x00, 0x04, 0x30, 0x60],
|
||||
/** American Express */
|
||||
amex: [0xa0, 0x00, 0x00, 0x00, 0x25, 0x01, 0x08, 0x01],
|
||||
/** Discover */
|
||||
discover: [0xa0, 0x00, 0x00, 0x01, 0x52, 0x30, 0x10],
|
||||
/** JCB */
|
||||
jcb: [0xa0, 0x00, 0x00, 0x00, 0x65, 0x10, 0x10],
|
||||
/** UnionPay */
|
||||
unionpay: [0xa0, 0x00, 0x00, 0x03, 0x33, 0x01, 0x01, 0x01],
|
||||
/** PPSE (Proximity Payment System Environment) - present on all contactless payment cards */
|
||||
ppse: [0x32, 0x50, 0x41, 0x59, 0x2e, 0x53, 0x59, 0x53, 0x2e, 0x44, 0x44, 0x46, 0x30, 0x31], // "2PAY.SYS.DDF01"
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user