@blueid/access-capacitor 0.88.0 → 0.90.0
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.
- package/dist/esm/BlueCore_pb.d.ts +4 -6
- package/dist/esm/BlueCore_pb.js +5 -6
- package/dist/esm/BlueCore_pb.js.map +1 -1
- package/dist/esm/interop.js +2 -1
- package/dist/esm/interop.js.map +1 -1
- package/dist/plugin.cjs.js +7 -7
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +7 -7
- package/dist/plugin.js.map +1 -1
- package/ios/CBlueIDAccess.xcframework/Info.plist +8 -8
- package/ios/CBlueIDAccess.xcframework/ios-arm64/Headers/core/BlueCore.pb.h +27 -26
- package/ios/CBlueIDAccess.xcframework/ios-arm64/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/Headers/core/BlueCore.pb.h +27 -26
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/Headers/core/BlueCore.pb.h +27 -26
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAccessAPIHelper.swift +9 -2
- package/ios/Plugin/BlueIDAccessSDK/BlueAccessSync.swift +1 -1
- package/ios/Plugin/BlueIDAccessSDK/BlueCore.pb.swift +4 -3
- package/ios/Plugin/BlueIDAccessSDK/BlueError.swift +5 -4
- package/ios/Plugin/BlueIDAccessSDK/BlueKeychain.swift +20 -2
- package/ios/Plugin/BlueIDAccessSDK/BlueNfc.swift +1 -1
- package/ios/Plugin/BlueIDAccessSDK/BlueOssSid.swift +3 -3
- package/ios/Plugin/BlueIDAccessSDK/BlueOssSo.swift +4 -4
- package/ios/Plugin/BlueIDAccessSDK/BlueUtils.swift +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
|
|
3
3
|
public final class BlueError: Error, LocalizedError, Equatable {
|
|
4
|
-
public static var timeoutMessage = "A timeout has occurred"
|
|
4
|
+
public static var timeoutMessage = "A timeout has occurred with return code %returnCode%"
|
|
5
5
|
public static var returnCodeMessage = "Error with return code %returnCode%"
|
|
6
6
|
public static var unknownErrorMessage = "Unknnown error has ocurred"
|
|
7
7
|
|
|
@@ -11,10 +11,11 @@ public final class BlueError: Error, LocalizedError, Equatable {
|
|
|
11
11
|
private let detail: String?
|
|
12
12
|
|
|
13
13
|
public var errorDescription: String? {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
var returnCodeStr = "\(returnCode.rawValue) (\(String(describing: returnCode)))"
|
|
15
|
+
|
|
16
|
+
if (returnCode == .timeout || returnCode == .sdkTimeout) {
|
|
17
|
+
return BlueError.timeoutMessage.replacingOccurrences(of: "%returnCode%", with: returnCodeStr)
|
|
16
18
|
} else {
|
|
17
|
-
var returnCodeStr = "\(returnCode.rawValue) (\(String(describing: returnCode)))"
|
|
18
19
|
if let cause = cause {
|
|
19
20
|
returnCodeStr += "\nCause: \(cause.localizedDescription)"
|
|
20
21
|
}
|
|
@@ -33,6 +33,22 @@ internal class BlueKeychain {
|
|
|
33
33
|
return nil
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/// Updates an entry with the specified ID using the provided data without purging it beforehand.
|
|
37
|
+
/// If the entry does not exist, a new one is created.
|
|
38
|
+
///
|
|
39
|
+
/// - parameter id: The ID of the entry to be updated.
|
|
40
|
+
/// - parameter data: The data to update the entry with.
|
|
41
|
+
/// - throws: Throws an error of type `BlueError(.invalidState)` in case the operation does not succeed.
|
|
42
|
+
func updateEntry(id: String, data: Data) throws {
|
|
43
|
+
return try BlueKeychain.storeEntry(attrService: attrService, attrAccessible: attrAccessible, id: id, data: data, purge: false)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// Stores an entry with the specified ID using the provided data.
|
|
47
|
+
/// If the entry already exists, it is first purged.
|
|
48
|
+
///
|
|
49
|
+
/// - parameter id: The ID of the entry to be updated.
|
|
50
|
+
/// - parameter data: The data to update the entry with.
|
|
51
|
+
/// - throws: Throws an error of type `BlueError(.invalidState)` in case the operation does not succeed.
|
|
36
52
|
func storeEntry(id: String, data: Data) throws {
|
|
37
53
|
return try BlueKeychain.storeEntry(attrService: attrService, attrAccessible: attrAccessible, id: id, data: data)
|
|
38
54
|
}
|
|
@@ -138,7 +154,7 @@ internal class BlueKeychain {
|
|
|
138
154
|
return try entryIds.compactMap{ try getEntry(attrService: attrService, attrAccessible: attrAccessible, id: $0) }
|
|
139
155
|
}
|
|
140
156
|
|
|
141
|
-
static func storeEntry(attrService: String, attrAccessible: String, id: String, data: Data) throws {
|
|
157
|
+
static func storeEntry(attrService: String, attrAccessible: String, id: String, data: Data, purge: Bool? = true) throws {
|
|
142
158
|
let query: [String: Any] = [
|
|
143
159
|
kSecClass as String: kSecClassGenericPassword,
|
|
144
160
|
kSecAttrService as String: attrService,
|
|
@@ -147,7 +163,9 @@ internal class BlueKeychain {
|
|
|
147
163
|
kSecValueData as String: data,
|
|
148
164
|
]
|
|
149
165
|
|
|
150
|
-
|
|
166
|
+
if (purge != false) {
|
|
167
|
+
SecItemDelete(query as CFDictionary)
|
|
168
|
+
}
|
|
151
169
|
|
|
152
170
|
let status = SecItemUpdate(query as CFDictionary, [kSecValueData as String: data] as CFDictionary)
|
|
153
171
|
|
|
@@ -170,7 +170,7 @@ internal func blueNfc_Transceive(_ pCommandApdu: UnsafePointer<UInt8>, _ command
|
|
|
170
170
|
let waitResponse = waitSemaphore.wait(timeout: DispatchTime.now() + 13.0)
|
|
171
171
|
|
|
172
172
|
if waitResponse != .success {
|
|
173
|
-
return blueAsClibReturnCode(.
|
|
173
|
+
return blueAsClibReturnCode(.sdkTimeout)
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
do {
|
|
@@ -36,7 +36,7 @@ public struct BlueOssSidCreateMobileCommand: BlueCommand {
|
|
|
36
36
|
|
|
37
37
|
ossSidMobileOutputSizeMutable.pointee = ossSidMobileOutputSize
|
|
38
38
|
|
|
39
|
-
_ = try blueClibErrorCheck(blueOssSid_GetStorage_Ext(BlueTransponderType_t(
|
|
39
|
+
_ = try blueClibErrorCheck(blueOssSid_GetStorage_Ext(BlueTransponderType_t(UInt8(BlueTransponderType.mobileTransponder.rawValue)), pStorage, nil, 0, ossSidMobileOutputPtr, ossSidMobileOutputSizeMutable))
|
|
40
40
|
|
|
41
41
|
// Clear configuration as we always want to use the default one for mobile
|
|
42
42
|
var usedProvisioningData = provisioningData
|
|
@@ -64,7 +64,7 @@ fileprivate func executeOssSidNfc<ResultType>(settings: BlueOssSidSettings?, suc
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
try blueClibFunctionIn(message: settingsInUse, { (dataPtr, dataSize) in
|
|
67
|
-
return blueOssSid_GetStorage_Ext(BlueTransponderType_t(
|
|
67
|
+
return blueOssSid_GetStorage_Ext(BlueTransponderType_t(UInt8(transponderType.rawValue)), pStorage, dataPtr, dataSize, nil, nil)
|
|
68
68
|
})
|
|
69
69
|
|
|
70
70
|
result = try handler(pStorage)
|
|
@@ -109,7 +109,7 @@ public struct BlueOssSidGetStorageProfileCommand: BlueCommand {
|
|
|
109
109
|
pStorage.deallocate()
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
_ = try blueClibErrorCheck(blueOssSid_GetStorage(BlueTransponderType_t(
|
|
112
|
+
_ = try blueClibErrorCheck(blueOssSid_GetStorage(BlueTransponderType_t(UInt8(transponderType.rawValue)), pStorage, nil, nil, nil))
|
|
113
113
|
|
|
114
114
|
if let provisioningConfig = provisioningConfig {
|
|
115
115
|
return try blueClibFunctionInOut(message: provisioningConfig, { (configDataPtr, configDataSize, dataPtr, dataSize) in
|
|
@@ -61,7 +61,7 @@ public struct BlueOssSoCreateMobileCommand: BlueCommand {
|
|
|
61
61
|
|
|
62
62
|
ossSoMobileOutputSizeMutable.pointee = ossSoMobileOutputSize
|
|
63
63
|
|
|
64
|
-
_ = try blueClibErrorCheck(blueOssSo_GetStorage_Ext(BlueTransponderType_t(
|
|
64
|
+
_ = try blueClibErrorCheck(blueOssSo_GetStorage_Ext(BlueTransponderType_t(UInt8(BlueTransponderType.mobileTransponder.rawValue)), pStorage, nil, 0, ossSoMobileOutputPtr, ossSoMobileOutputSizeMutable))
|
|
65
65
|
|
|
66
66
|
// Clear configuration as we always want to use the default one for mobile
|
|
67
67
|
var usedProvisioningData = provisioningData
|
|
@@ -100,7 +100,7 @@ fileprivate func executeOssSoNfc<ResultType>(
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
try blueClibFunctionIn(message: settingsInUse, { (dataPtr, dataSize) in
|
|
103
|
-
return blueOssSo_GetStorage_Ext(BlueTransponderType_t(
|
|
103
|
+
return blueOssSo_GetStorage_Ext(BlueTransponderType_t(UInt8(transponderType.rawValue)), pStorage, dataPtr, dataSize, nil, nil)
|
|
104
104
|
})
|
|
105
105
|
|
|
106
106
|
result = try handler(pStorage)
|
|
@@ -147,7 +147,7 @@ public struct BlueOssSoGetStorageProfileCommand: BlueCommand {
|
|
|
147
147
|
pStorage.deallocate()
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
_ = try blueClibErrorCheck(blueOssSo_GetStorage(BlueTransponderType_t(
|
|
150
|
+
_ = try blueClibErrorCheck(blueOssSo_GetStorage(BlueTransponderType_t(UInt8(transponderType.rawValue)), pStorage, nil, nil, nil))
|
|
151
151
|
|
|
152
152
|
if let provisioningConfig = provisioningConfig {
|
|
153
153
|
return try blueClibFunctionInOut(message: provisioningConfig, { (configDataPtr, configDataSize, dataPtr, dataSize) in
|
|
@@ -535,7 +535,7 @@ public class BlueRefreshOssSoCredentialsCommand: BlueAPIAsyncCommand {
|
|
|
535
535
|
let ossSoSettings = try blueGetOssSoSettings(credentialID: credential.credentialID.id)
|
|
536
536
|
|
|
537
537
|
try blueClibFunctionIn(message: ossSoSettings, { (dataPtr, dataSize) in
|
|
538
|
-
return blueOssSo_GetStorage_Ext(BlueTransponderType_t(
|
|
538
|
+
return blueOssSo_GetStorage_Ext(BlueTransponderType_t(UInt8(transponderType.rawValue)), pStorage, dataPtr, dataSize, nil, nil)
|
|
539
539
|
})
|
|
540
540
|
|
|
541
541
|
let isProvisioned = blueOssSo_IsProvisioned(pStorage) == BlueReturnCode_Ok
|
|
@@ -36,7 +36,7 @@ internal func blueExecuteWithTimeout(_ handler: @escaping () throws -> Void, tim
|
|
|
36
36
|
workItem.wait()
|
|
37
37
|
} else {
|
|
38
38
|
if workItem.wait(timeout: DispatchTime.now() + timeoutSeconds) == .timedOut {
|
|
39
|
-
throw BlueError(.
|
|
39
|
+
throw BlueError(.sdkTimeout)
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|