Skip to content

Commit 61d5470

Browse files
authored
Merge pull request #22 from boltcard/ios-update
Use APDU commands to allow card programming to work on iOS as well as android
2 parents e0baf6a + cca5ac2 commit 61d5470

14 files changed

+2480
-413
lines changed

class/Ntag424.js

+907
Large diffs are not rendered by default.

constants/ErrorCodes.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
export default errorCodes = {
2+
'6700': 'Wrong or inconsistent APDU length.',
3+
'6985': 'Wrapped chained command or multiple pass command ongoing.',
4+
'6a82': 'Application or file not found, currently selected application remains selected.',
5+
'6a86': 'Wrong parameter P1 and/or P2',
6+
'6a87': 'Wrong parameter Lc inconsistent with P1-P2',
7+
'6e00': 'Wrong CLA',
8+
'6581': 'Memory failure',
9+
'6982': 'Security status not satisfied',
10+
'91ca': 'COMMAND_ABORTED',
11+
'917e': 'LENGTH_ERROR',
12+
'919e': 'PARAMETER_ERROR',
13+
'9140': 'NO_SUCH_KEY',
14+
'919d': 'PERMISSION_DENIED',
15+
'91ad': 'AUTHENTICATION_DELAY',
16+
'911e': 'INTEGRITY_ERROR',
17+
'91f0': 'FILE_NOT_FOUND',
18+
'91ae': 'AUTHENTICATION_ERROR',
19+
'91ee': 'MEMORY_ERROR',
20+
'91be': 'BOUNDARY_ERROR'
21+
};
22+
23+
//NOTE: when new APDU command gets added make sure the error codes are added here
24+
25+
26+
export const isoSelectErrorCodes = {
27+
'6700' : 'Wrong or inconsistent APDU length.',
28+
'6985' : 'Wrapped chained command or multiple pass command ongoing.',
29+
'6a82' : 'Application or file not found, currently selected application remains selected.',
30+
'6a86' : 'Wrong parameter P1 and/or P2',
31+
'6a87' : 'Wrong parameter Lc inconsistent with P1-P2',
32+
'6e00' : 'Wrong CLA',
33+
};
34+
35+
36+
export const changeKeyErrorCodes = {
37+
'91ca' : 'COMMAND_ABORTED Chained command or multiple pass command ongoing.',
38+
'911e' : 'INTEGRITY_ERROR Integrity error in cryptogram or Invalid Secure Messaging MAC (only).',
39+
'917e' : 'LENGTH_ERROR Command size not allowed.',
40+
'919e' : 'PARAMETER_ERROR Parameter value not allowed',
41+
'919d' : 'PERMISSION_DENIED PICC level (MF) is selected. access right Change of targeted file has access conditions set to Fh. Enabling Secure Dynamic Messaging (FileOption Bit 6 set to 1b) is only allowed for FileNo 02h.',
42+
'91ae' : 'AUTHENTICATION_ERROR At application level, missing active authentication with AppMasterKey while targeting any AppKey.',
43+
'91ee' : 'MEMORY_ERROR Failure when reading or writing to non-volatile memory.',
44+
};
45+
46+
47+
export const changeFileSettingsErrorCodes = {
48+
'91ca' : 'COMMAND_ABORTED chained command or multiple pass command ongoing.',
49+
'911e' : 'INTEGRITY_ERROR Integrity error in cryptogram. Invalid Secure Messaging MAC (only).',
50+
'917e' : 'LENGTH_ERROR Command size not allowed.',
51+
'919e' : 'PARAMETER_ERROR Parameter value not allowed',
52+
'919d' : 'PERMISSION_DENIED PICC level (MF) is selected. access right Change of targeted file has access conditions set to Fh. Enabling Secure Dynamic Messaging (FileOption Bit 6 set to 1b) is only allowed for FileNo 02h.',
53+
'91f0' : 'FILE_NOT_FOUND F0h File with targeted FileNo does not exist for the targeted application. ',
54+
'91ae' : 'AUTHENTICATION_ERROR AEh File access right Change of targeted file not granted as there is no active authentication with the required key while the access conditions is different from Fh.',
55+
'91ee' : 'MEMORY_ERROR EEh Failure when reading or writing to non-volatile memory.',
56+
};

img/bolt-card-link_black.png

12.5 KB
Loading

ios/BoltCardWallet.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@
11311131
CODE_SIGN_ENTITLEMENTS = BoltCardWallet/BoltCardWallet.entitlements;
11321132
CODE_SIGN_IDENTITY = "Apple Development";
11331133
CODE_SIGN_STYLE = Automatic;
1134-
CURRENT_PROJECT_VERSION = 6;
1134+
CURRENT_PROJECT_VERSION = 1;
11351135
DEAD_CODE_STRIPPING = NO;
11361136
DEVELOPMENT_TEAM = G2LFSW78NA;
11371137
ENABLE_BITCODE = NO;
@@ -1154,7 +1154,7 @@
11541154
"$(inherited)",
11551155
"$(PROJECT_DIR)",
11561156
);
1157-
MARKETING_VERSION = 0.1.1;
1157+
MARKETING_VERSION = 0.2.1;
11581158
OTHER_LDFLAGS = (
11591159
"$(inherited)",
11601160
"-ObjC",
@@ -1185,7 +1185,7 @@
11851185
CODE_SIGN_IDENTITY = "Apple Development";
11861186
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
11871187
CODE_SIGN_STYLE = Automatic;
1188-
CURRENT_PROJECT_VERSION = 6;
1188+
CURRENT_PROJECT_VERSION = 1;
11891189
DEVELOPMENT_TEAM = G2LFSW78NA;
11901190
ENABLE_BITCODE = NO;
11911191
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
@@ -1202,7 +1202,7 @@
12021202
"$(inherited)",
12031203
"$(PROJECT_DIR)",
12041204
);
1205-
MARKETING_VERSION = 0.1.1;
1205+
MARKETING_VERSION = 0.2.1;
12061206
OTHER_LDFLAGS = (
12071207
"$(inherited)",
12081208
"-ObjC",

ios/BoltCardWallet/BoltCardWallet.entitlements

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<dict>
55
<key>aps-environment</key>
66
<string>development</string>
7+
<key>com.apple.developer.nfc.readersession.formats</key>
8+
<array>
9+
<string>TAG</string>
10+
<string>NDEF</string>
11+
</array>
712
<key>com.apple.security.app-sandbox</key>
813
<true/>
914
<key>com.apple.security.application-groups</key>

ios/BoltCardWallet/BoltCardWalletRelease.entitlements

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<dict>
55
<key>aps-environment</key>
66
<string>development</string>
7+
<key>com.apple.developer.nfc.readersession.formats</key>
8+
<array>
9+
<string>TAG</string>
10+
<string>NDEF</string>
11+
</array>
712
<key>com.apple.security.app-sandbox</key>
813
<true/>
914
<key>com.apple.security.application-groups</key>

ios/BoltCardWallet/Info.plist

+7
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
<true/>
104104
<key>LSSupportsOpeningDocumentsInPlace</key>
105105
<true/>
106+
<key>NFCReaderUsageDescription</key>
107+
<string>NFC scanning is used to read/program your boltcard</string>
106108
<key>NSAppTransportSecurity</key>
107109
<dict>
108110
<key>NSAllowsArbitraryLoads</key>
@@ -316,5 +318,10 @@
316318
<key>apiKey</key>
317319
<string>736dc945917207ed3993518c9110bbd9</string>
318320
</dict>
321+
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
322+
<array>
323+
<string>D2760000850100</string>
324+
<string>D2760000850101</string>
325+
</array>
319326
</dict>
320327
</plist>

ios/Podfile

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ target 'BoltCardWallet' do
1111
# to enable hermes on iOS, change `false` to `true` and then install pods
1212
:hermes_enabled => false
1313
)
14+
15+
pod 'RNFS', :path => '../node_modules/react-native-fs'
1416

1517
# Enables Flipper.
1618
#

ios/Podfile.lock

+7-1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ PODS:
323323
- React-Core
324324
- react-native-ios-context-menu (1.15.3):
325325
- React-Core
326+
- react-native-nfc-manager (3.14.5):
327+
- React-Core
326328
- react-native-qrcode-local-image (1.0.4):
327329
- React
328330
- react-native-randombytes (3.6.1):
@@ -555,6 +557,7 @@ DEPENDENCIES:
555557
- react-native-idle-timer (from `../node_modules/react-native-idle-timer`)
556558
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
557559
- react-native-ios-context-menu (from `../node_modules/react-native-ios-context-menu`)
560+
- react-native-nfc-manager (from `../node_modules/react-native-nfc-manager`)
558561
- "react-native-qrcode-local-image (from `../node_modules/@remobile/react-native-qrcode-local-image`)"
559562
- react-native-randombytes (from `../node_modules/react-native-randombytes`)
560563
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
@@ -683,6 +686,8 @@ EXTERNAL SOURCES:
683686
:path: "../node_modules/react-native-image-picker"
684687
react-native-ios-context-menu:
685688
:path: "../node_modules/react-native-ios-context-menu"
689+
react-native-nfc-manager:
690+
:path: "../node_modules/react-native-nfc-manager"
686691
react-native-qrcode-local-image:
687692
:path: "../node_modules/@remobile/react-native-qrcode-local-image"
688693
react-native-randombytes:
@@ -827,6 +832,7 @@ SPEC CHECKSUMS:
827832
react-native-idle-timer: 97b8283237d45146a7a5c25bdebe9e1e85f3687b
828833
react-native-image-picker: 24a36044140202085113ce99b57bf52c62dc339e
829834
react-native-ios-context-menu: b522377ce20e859c96d4d508703483f028ae1844
835+
react-native-nfc-manager: 00700a5cd081bf78e2f33fbf84b8610aef4a832c
830836
react-native-qrcode-local-image: 35ccb306e4265bc5545f813e54cc830b5d75bcfc
831837
react-native-randombytes: 5fc412efe7b5c55b9002c0004d75fe5fabcaa507
832838
react-native-safe-area-context: 5b8a418400eb3d8364aa87300e865c0262cc17b9
@@ -876,6 +882,6 @@ SPEC CHECKSUMS:
876882
Yoga: 5ed1699acbba8863755998a4245daa200ff3817b
877883
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
878884

879-
PODFILE CHECKSUM: 18cca50594797cb5feb4d92634ca0f147993b45b
885+
PODFILE CHECKSUM: a0db116dd5af0f09d150a5ce801116d7fdaf48a6
880886

881887
COCOAPODS: 1.10.2

0 commit comments

Comments
 (0)