Prepare for production build
- Downgrade react-native to 0.81.5 (matches Expo SDK 54) - Downgrade react to 19.1.0 and related @react-native packages - Disable New Architecture (react-native-nfc-manager untested) - Add expo install/doctor exclusions for version-locked deps - Configure babel to strip console.log/warn in production - Add logger utility for development-only logging - Add component and data module exports Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
209
src/data/chipInfo.ts
Normal file
209
src/data/chipInfo.ts
Normal file
@@ -0,0 +1,209 @@
|
||||
/**
|
||||
* Educational Chip Information
|
||||
*
|
||||
* Provides user-friendly explanations of NFC chip types
|
||||
*/
|
||||
|
||||
import {ChipType, ChipFamily} from '../types/detection';
|
||||
|
||||
export interface ChipInfo {
|
||||
/** Brief description of the chip */
|
||||
description: string;
|
||||
/** What this chip is commonly used for */
|
||||
commonUses: string[];
|
||||
/** Key capabilities */
|
||||
capabilities: string[];
|
||||
/** Security level indicator */
|
||||
securityLevel: 'low' | 'medium' | 'high';
|
||||
/** Memory capacity description */
|
||||
memoryNote?: string;
|
||||
}
|
||||
|
||||
export const CHIP_FAMILY_INFO: Record<ChipFamily, string> = {
|
||||
[ChipFamily.NTAG]:
|
||||
'NTAG chips are NXP-branded NFC Type 2 tags designed for consumer applications like sharing URLs, contact info, and app launches. This family includes MIFARE Ultralight variants.',
|
||||
[ChipFamily.MIFARE_CLASSIC]:
|
||||
'MIFARE Classic is a legacy contactless smart card technology commonly used in access control and transit systems.',
|
||||
[ChipFamily.MIFARE_DESFIRE]:
|
||||
'MIFARE DESFire is a high-security contactless smart card with advanced encryption, used in transit, access control, and payment applications.',
|
||||
[ChipFamily.MIFARE_PLUS]:
|
||||
'MIFARE Plus offers enhanced security over Classic, with optional AES encryption while maintaining backward compatibility.',
|
||||
[ChipFamily.ISO15693]:
|
||||
'ISO 15693 (NFC-V) tags operate at longer read distances than standard NFC, commonly used in library systems and industrial applications.',
|
||||
[ChipFamily.JAVACARD]:
|
||||
'JavaCard chips are programmable secure elements that can run multiple cryptographic applications, used in identity and payment systems.',
|
||||
[ChipFamily.UNKNOWN]:
|
||||
'This chip type could not be fully identified. It may be a less common or proprietary tag.',
|
||||
};
|
||||
|
||||
export const CHIP_INFO: Partial<Record<ChipType, ChipInfo>> = {
|
||||
// NTAG family
|
||||
[ChipType.NTAG213]: {
|
||||
description:
|
||||
'Entry-level NTAG with 144 bytes of user memory, ideal for simple NFC applications.',
|
||||
commonUses: ['URL sharing', 'Smart posters', 'Product authentication'],
|
||||
capabilities: ['NFC Forum Type 2', 'Password protection', 'Counter function'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '144 bytes user memory',
|
||||
},
|
||||
[ChipType.NTAG215]: {
|
||||
description:
|
||||
'Mid-range NTAG commonly used for amiibo and similar applications.',
|
||||
commonUses: ['Gaming (amiibo)', 'Access tokens', 'Loyalty cards'],
|
||||
capabilities: ['NFC Forum Type 2', 'Password protection', 'Counter function'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '504 bytes user memory',
|
||||
},
|
||||
[ChipType.NTAG216]: {
|
||||
description:
|
||||
'Largest standard NTAG with 888 bytes, popular for implants and data storage.',
|
||||
commonUses: ['NFC implants', 'vCards', 'Complex data storage'],
|
||||
capabilities: ['NFC Forum Type 2', 'Password protection', 'Counter function'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '888 bytes user memory',
|
||||
},
|
||||
[ChipType.NTAG_I2C_1K]: {
|
||||
description:
|
||||
'NTAG with I2C interface allowing microcontroller communication alongside NFC.',
|
||||
commonUses: ['IoT devices', 'Energy harvesting', 'Field detection'],
|
||||
capabilities: ['NFC + I2C interface', 'Energy harvesting', 'Field detection'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '888 bytes user memory',
|
||||
},
|
||||
[ChipType.NTAG_I2C_2K]: {
|
||||
description:
|
||||
'Extended memory NTAG I2C with 1904 bytes and dual interface capability.',
|
||||
commonUses: ['IoT devices', 'Data logging', 'Connected products'],
|
||||
capabilities: ['NFC + I2C interface', 'Energy harvesting', 'SRAM buffer'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '1904 bytes user memory',
|
||||
},
|
||||
|
||||
// MIFARE Classic
|
||||
[ChipType.MIFARE_CLASSIC_1K]: {
|
||||
description:
|
||||
'Classic 1K is the most common access card, using Crypto-1 encryption (now considered weak).',
|
||||
commonUses: ['Building access', 'Hotel keys', 'Transit cards'],
|
||||
capabilities: ['16 sectors', 'Key-based authentication', 'Sector permissions'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '1KB (752 bytes usable)',
|
||||
},
|
||||
[ChipType.MIFARE_CLASSIC_4K]: {
|
||||
description:
|
||||
'Extended capacity Classic card with 4KB memory, same security as 1K.',
|
||||
commonUses: ['Building access', 'Parking systems', 'Legacy transit'],
|
||||
capabilities: ['40 sectors', 'Key-based authentication', 'Sector permissions'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '4KB (3440 bytes usable)',
|
||||
},
|
||||
|
||||
// DESFire
|
||||
[ChipType.DESFIRE_EV1]: {
|
||||
description:
|
||||
'First generation DESFire with AES-128 encryption for secure applications.',
|
||||
commonUses: ['Secure access control', 'Transit systems', 'Campus cards'],
|
||||
capabilities: ['AES-128/3DES', 'Multiple applications', 'Flexible file system'],
|
||||
securityLevel: 'high',
|
||||
memoryNote: '2KB, 4KB, or 8KB options',
|
||||
},
|
||||
[ChipType.DESFIRE_EV2]: {
|
||||
description:
|
||||
'Enhanced DESFire with improved security features and proximity check.',
|
||||
commonUses: ['High-security access', 'Payment cards', 'Government ID'],
|
||||
capabilities: [
|
||||
'AES-128',
|
||||
'Proximity check',
|
||||
'Transaction MAC',
|
||||
'Virtual Card Architecture',
|
||||
],
|
||||
securityLevel: 'high',
|
||||
memoryNote: '2KB, 4KB, 8KB, 16KB, or 32KB options',
|
||||
},
|
||||
[ChipType.DESFIRE_EV3]: {
|
||||
description:
|
||||
'Latest DESFire generation with enhanced cryptography and secure messaging.',
|
||||
commonUses: ['Transit', 'Access control', 'Micropayment', 'Loyalty'],
|
||||
capabilities: [
|
||||
'AES-128',
|
||||
'Secure Dynamic Messaging',
|
||||
'Transaction MAC',
|
||||
'Sun authentication',
|
||||
],
|
||||
securityLevel: 'high',
|
||||
memoryNote: '2KB, 4KB, 8KB, 16KB, or 32KB options',
|
||||
},
|
||||
|
||||
// ISO 15693
|
||||
[ChipType.SLIX]: {
|
||||
description:
|
||||
'Basic ISO 15693 (NFC-V) tag with longer read range than standard NFC.',
|
||||
commonUses: ['Library systems', 'Inventory tracking', 'Industrial tags'],
|
||||
capabilities: ['Long range', 'Anti-collision', 'AFI/DSFID support'],
|
||||
securityLevel: 'low',
|
||||
memoryNote: '128 bytes',
|
||||
},
|
||||
[ChipType.SLIX2]: {
|
||||
description:
|
||||
'Enhanced SLIX with more memory and improved security features.',
|
||||
commonUses: ['Asset tracking', 'Brand protection', 'Library systems'],
|
||||
capabilities: ['Long range', 'Password protection', 'Originality signature'],
|
||||
securityLevel: 'medium',
|
||||
memoryNote: '316 bytes',
|
||||
},
|
||||
[ChipType.ICODE_DNA]: {
|
||||
description:
|
||||
'Cryptographically secured NFC-V tag for brand protection and authentication.',
|
||||
commonUses: ['Brand protection', 'Anti-counterfeiting', 'Secure supply chain'],
|
||||
capabilities: [
|
||||
'Cryptographic authentication',
|
||||
'Rolling code',
|
||||
'Originality check',
|
||||
],
|
||||
securityLevel: 'high',
|
||||
memoryNote: '256 bytes',
|
||||
},
|
||||
|
||||
// JavaCard
|
||||
[ChipType.JCOP4]: {
|
||||
description:
|
||||
'Programmable secure element supporting Java Card applets for cryptographic applications.',
|
||||
commonUses: ['Identity cards', 'Digital signatures', 'Secure authentication'],
|
||||
capabilities: [
|
||||
'Java Card OS',
|
||||
'Multiple applets',
|
||||
'FIDO2/WebAuthn',
|
||||
'OpenPGP',
|
||||
],
|
||||
securityLevel: 'high',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Get educational info for a chip type
|
||||
*/
|
||||
export function getChipInfo(chipType: ChipType): ChipInfo | undefined {
|
||||
return CHIP_INFO[chipType];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get family description for a chip family
|
||||
*/
|
||||
export function getChipFamilyInfo(family: ChipFamily): string {
|
||||
return CHIP_FAMILY_INFO[family];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get security level description
|
||||
*/
|
||||
export function getSecurityLevelDescription(
|
||||
level: 'low' | 'medium' | 'high',
|
||||
): string {
|
||||
switch (level) {
|
||||
case 'low':
|
||||
return 'Basic security - data can be read/written with standard tools';
|
||||
case 'medium':
|
||||
return 'Moderate security - some protection against casual attacks';
|
||||
case 'high':
|
||||
return 'Strong security - cryptographic protection against cloning';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user