@onetokenfe/react-native-nfc-wallet-sdk 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,6 +9,8 @@ static const uint8_t kCla = 0x80;
|
|
|
9
9
|
@interface NfcWalletSession ()
|
|
10
10
|
@property (nonatomic, weak) id<NFCISO7816Tag> tag;
|
|
11
11
|
@property (nonatomic, copy, nullable) NfcWalletApduLogBlock apduLogBlock;
|
|
12
|
+
/** Applet SELECT once per tag connection. Re-SELECT clears PIN session (SW=6982). */
|
|
13
|
+
@property (nonatomic, assign) BOOL appletSelected;
|
|
12
14
|
@end
|
|
13
15
|
|
|
14
16
|
@implementation NfcWalletSession
|
|
@@ -19,6 +21,7 @@ static const uint8_t kCla = 0x80;
|
|
|
19
21
|
if (self) {
|
|
20
22
|
_tag = tag;
|
|
21
23
|
_apduLogBlock = apduLogBlock;
|
|
24
|
+
_appletSelected = NO;
|
|
22
25
|
}
|
|
23
26
|
return self;
|
|
24
27
|
}
|
|
@@ -979,6 +982,11 @@ static const uint8_t kCla = 0x80;
|
|
|
979
982
|
|
|
980
983
|
- (BOOL)selectApplet:(NSError **)error
|
|
981
984
|
{
|
|
985
|
+
// Match Android withWalletSession: SELECT once. Java Card deselect() clears PIN
|
|
986
|
+
// (PinService.onDeselect) — re-SELECT after VERIFY_PIN causes GET_PUBKEY SW=6982.
|
|
987
|
+
if (self.appletSelected) {
|
|
988
|
+
return YES;
|
|
989
|
+
}
|
|
982
990
|
NSData *aid = [NSData dataWithBytes:kWalletAppletAid length:sizeof(kWalletAppletAid)];
|
|
983
991
|
NFCISO7816APDU *apdu = [[NFCISO7816APDU alloc] initWithInstructionClass:0x00
|
|
984
992
|
instructionCode:0xA4
|
|
@@ -986,7 +994,11 @@ static const uint8_t kCla = 0x80;
|
|
|
986
994
|
p2Parameter:0x00
|
|
987
995
|
data:aid
|
|
988
996
|
expectedResponseLength:256];
|
|
989
|
-
|
|
997
|
+
if ([self sendAPDU:apdu error:error] == nil) {
|
|
998
|
+
return NO;
|
|
999
|
+
}
|
|
1000
|
+
self.appletSelected = YES;
|
|
1001
|
+
return YES;
|
|
990
1002
|
}
|
|
991
1003
|
|
|
992
1004
|
- (NSDictionary *)simpleCommand:(uint8_t)ins data:(NSData *_Nullable)data
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onetokenfe/react-native-nfc-wallet-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "React Native SDK for OneToken NFC Wallet card (instance 6F6E65746F6B656E02)",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|