@procivis/react-native-one-core 1.77931.0 → 1.81885.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.
Files changed (164) hide show
  1. package/README.md +15 -14
  2. package/android/build.gradle +0 -11
  3. package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +4 -4
  4. package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +128 -67
  5. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt +5 -8
  6. package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +17 -222
  7. package/core-sdk.json +6 -6
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +1 -0
  10. package/dist/src/config.d.ts +3 -2
  11. package/dist/src/config.js +5 -0
  12. package/dist/src/core.d.ts +5 -182
  13. package/dist/src/core.js +5 -19
  14. package/dist/src/nfc.d.ts +0 -5
  15. package/dist/src/one-core-uniffi-intf.d.ts +1773 -0
  16. package/dist/src/one-core-uniffi-intf.js +356 -0
  17. package/ios/ProcivisOneCoreModule.m +4 -4
  18. package/ios/ProcivisOneCoreModule.swift +10 -10
  19. package/ios/RSEKeyStorage.swift +17 -571
  20. package/ios/RSEPinPad.swift +3 -56
  21. package/ios/Serialize.swift +80 -27
  22. package/package.json +4 -2
  23. package/react-native-one-core.podspec +1 -1
  24. package/android/build.gradle_opensource +0 -122
  25. package/android/libs/core-reactnative-compatible-2025.0305.1.aar +0 -0
  26. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadRunner.kt +0 -123
  27. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt_opensource +0 -20
  28. package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadWrapper.kt +0 -396
  29. package/android/src/main/java/ch/procivis/one/core/ubiqu/RegistrationManager.kt +0 -59
  30. package/android/src/main/java/ch/procivis/one/core/ubiqu/TokenManager.kt +0 -48
  31. package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt_opensource +0 -63
  32. package/android/src/main/java/ch/procivis/one/core/ubiqu/Util.kt +0 -74
  33. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityRequest.kt +0 -9
  34. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityResponse.kt +0 -9
  35. package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/RegisterRSEResponse.kt +0 -10
  36. package/dist/src/backup.d.ts +0 -22
  37. package/dist/src/backup.js +0 -1
  38. package/dist/src/cache.d.ts +0 -11
  39. package/dist/src/cache.js +0 -12
  40. package/dist/src/credential.d.ts +0 -177
  41. package/dist/src/credential.js +0 -44
  42. package/dist/src/credentialSchema.d.ts +0 -135
  43. package/dist/src/credentialSchema.js +0 -34
  44. package/dist/src/did.d.ts +0 -63
  45. package/dist/src/did.js +0 -27
  46. package/dist/src/history.d.ts +0 -101
  47. package/dist/src/history.js +0 -63
  48. package/dist/src/identifier.d.ts +0 -133
  49. package/dist/src/identifier.js +0 -29
  50. package/dist/src/key.d.ts +0 -17
  51. package/dist/src/key.js +0 -1
  52. package/dist/src/list.d.ts +0 -14
  53. package/dist/src/list.js +0 -5
  54. package/dist/src/organisation.d.ts +0 -9
  55. package/dist/src/organisation.js +0 -1
  56. package/dist/src/proof.d.ts +0 -234
  57. package/dist/src/proof.js +0 -43
  58. package/dist/src/proofSchema.d.ts +0 -116
  59. package/dist/src/proofSchema.js +0 -9
  60. package/dist/src/trust.d.ts +0 -173
  61. package/dist/src/trust.js +0 -44
  62. package/dist/src/walletUnit.d.ts +0 -30
  63. package/dist/src/walletUnit.js +0 -11
  64. package/ios/RSEKeyStorage.swift_opensource +0 -61
  65. package/ios/RSEPinPad.swift_opensource +0 -21
  66. package/ios/UBQKit.xcframework/Info.plist +0 -44
  67. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Assets.car +0 -0
  68. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFCompatibilityMacros.h +0 -37
  69. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFHTTPSessionManager.h +0 -304
  70. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +0 -216
  71. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworking.h +0 -41
  72. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +0 -16
  73. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFSecurityPolicy.h +0 -156
  74. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLRequestSerialization.h +0 -479
  75. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLResponseSerialization.h +0 -310
  76. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLSessionManager.h +0 -501
  77. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/CardRequestProtocol.h +0 -72
  78. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Constants.h +0 -222
  79. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DeviceBindProtocol.h +0 -38
  80. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DomainSecurityModule.h +0 -43
  81. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ErrorDomains.h +0 -68
  82. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/FreeAssetProtocol.h +0 -40
  83. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/GDataXMLNode.h +0 -214
  84. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSDictionary+Utilities.h +0 -23
  85. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSFileManager+Utilities.h +0 -20
  86. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSString+Utilities.h +0 -23
  87. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSURL+Utilities.h +0 -12
  88. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ProtocolBase.h +0 -38
  89. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ResetPinProtocol.h +0 -45
  90. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Settings.h +0 -120
  91. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequest.h +0 -58
  92. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +0 -37
  93. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +0 -34
  94. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +0 -28
  95. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +0 -35
  96. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +0 -31
  97. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +0 -34
  98. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit-Swift.h +0 -761
  99. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit.h +0 -56
  100. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQPacket.h +0 -38
  101. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Info.plist +0 -0
  102. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.abi.json +0 -89006
  103. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.private.swiftinterface +0 -1099
  104. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  105. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftinterface +0 -1099
  106. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/module.modulemap +0 -11
  107. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/UBQKit +0 -0
  108. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/_CodeSignature/CodeResources +0 -597
  109. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/certs +0 -0
  110. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/checksums +0 -0
  111. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/pinning_pub +0 -0
  112. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/static +0 -0
  113. package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/stream +0 -0
  114. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Assets.car +0 -0
  115. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFCompatibilityMacros.h +0 -37
  116. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFHTTPSessionManager.h +0 -304
  117. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +0 -216
  118. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworking.h +0 -41
  119. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +0 -16
  120. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFSecurityPolicy.h +0 -156
  121. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLRequestSerialization.h +0 -479
  122. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLResponseSerialization.h +0 -310
  123. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLSessionManager.h +0 -501
  124. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/CardRequestProtocol.h +0 -72
  125. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Constants.h +0 -222
  126. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DeviceBindProtocol.h +0 -38
  127. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DomainSecurityModule.h +0 -43
  128. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ErrorDomains.h +0 -68
  129. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/FreeAssetProtocol.h +0 -40
  130. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/GDataXMLNode.h +0 -214
  131. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSDictionary+Utilities.h +0 -23
  132. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSFileManager+Utilities.h +0 -20
  133. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSString+Utilities.h +0 -23
  134. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSURL+Utilities.h +0 -12
  135. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ProtocolBase.h +0 -38
  136. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ResetPinProtocol.h +0 -45
  137. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Settings.h +0 -120
  138. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequest.h +0 -58
  139. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +0 -37
  140. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +0 -34
  141. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +0 -28
  142. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +0 -35
  143. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +0 -31
  144. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +0 -34
  145. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit-Swift.h +0 -1522
  146. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit.h +0 -56
  147. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQPacket.h +0 -38
  148. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Info.plist +0 -0
  149. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -89006
  150. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -1099
  151. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  152. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -1099
  153. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -89006
  154. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -1099
  155. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  156. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -1099
  157. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/module.modulemap +0 -11
  158. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/UBQKit +0 -0
  159. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/_CodeSignature/CodeResources +0 -652
  160. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/certs +0 -0
  161. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/checksums +0 -0
  162. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/pinning_pub +0 -0
  163. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/static +0 -0
  164. package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/stream +0 -0
@@ -1,74 +1,21 @@
1
1
  import UIKit
2
- import UBQKit
3
2
 
4
3
  @objc
5
4
  public class RSEPinPad: UIView {
6
5
 
7
6
  static let sharedPinPad: UBQPinPad = {
8
- let pinPad = UBQPinPad(biometricsButtonShown: false)
9
- fixSubviews(view: pinPad)
10
- return pinPad
7
+ fatalError("sharedPinPad() has not been implemented")
11
8
  }()
12
9
 
13
10
  override init(frame: CGRect) {
14
- super.init(frame: frame)
15
- let pinPad = RSEPinPad.self.sharedPinPad
16
- self.addSubview(pinPad)
17
- pinPad.frame = self.bounds
18
- pinPad.autoresizingMask = [.flexibleWidth, .flexibleHeight]
19
- pinPad.translatesAutoresizingMaskIntoConstraints = true
20
- pinPad.listener = self
11
+ fatalError("init(frame:) has not been implemented")
21
12
  }
22
13
 
23
14
  required init?(coder: NSCoder) {
24
15
  fatalError("init(coder:) has not been implemented")
25
16
  }
26
17
 
27
- public override func layoutSubviews() {
28
- super.layoutSubviews()
29
- RSEPinPad.fixSubviews(view: self)
30
- }
31
-
32
18
  public static func fixSubviews(view: UIView) {
33
- view.subviews.forEach { subview in
34
- if subview.isKind(of: UIStackView.self), let stackview = subview as? UIStackView {
35
- stackview.backgroundColor = .white
36
- stackview.layer.borderColor = .none
37
- }
38
- if subview.isKind(of: UIButton.self) {
39
- var constraintsToRemove: [NSLayoutConstraint] = []
40
- view.constraints.forEach { constraint in
41
- if constraint.firstAttribute == .width || constraint.firstAttribute == .height {
42
- constraintsToRemove.append(constraint)
43
- }
44
- }
45
- view.removeConstraints(constraintsToRemove)
46
- subview.autoresizingMask = []
47
- subview.translatesAutoresizingMaskIntoConstraints = false
48
- subview.removeConstraints(subview.constraints)
49
- subview.widthAnchor.constraint(equalToConstant: 72).isActive = true
50
- subview.heightAnchor.constraint(equalToConstant: 72).isActive = true
51
- subview.layer.cornerRadius = 36
52
- subview.backgroundColor = .systemGray5
53
- } else if subview.isKind(of: UILabel.self), let label = subview as? UILabel {
54
- label.textColor = .black
55
- label.highlightedTextColor = .black
56
- label.tintColor = .black
57
- } else {
58
- subview.backgroundColor = .clear
59
- subview.layer.borderColor = .none
60
- subview.layer.borderWidth = 0
61
- subview.tintColor = .black
62
- }
63
- fixSubviews(view: subview)
64
- }
65
- }
66
- }
67
-
68
- extension RSEPinPad: UBQPinPadReporting {
69
-
70
- public func amountOfDigitsDidChange(newAmount: Int) {
71
- ProcivisOneCoreEventEmitter.shared.sendDigitsEnteredEvent(amount: newAmount)
72
- RSEPinPad.fixSubviews(view: RSEPinPad.sharedPinPad)
19
+ fatalError("fixSubviews(view:) has not been implemented")
73
20
  }
74
21
  }
@@ -37,8 +37,8 @@ private func serializeSpecific(_ value: Encodable) throws -> Any? {
37
37
  return try serialize(proofRequestClaimValue: data)
38
38
  case let data as HandleInvitationResponseBindingEnum:
39
39
  return try serialize(invitationResponse: data)
40
- case let data as CredentialQueryResponseBindingDto:
41
- return try serialize(credentialQuery: data)
40
+ case let data as ApplicableCredentialOrFailureHintBindingEnum:
41
+ return try serialize(applicableCredentialQuery: data)
42
42
  case let data as PresentationDefinitionV2ClaimValueBindingDto:
43
43
  return try serialize(presentationDefinitionV2ClaimValue: data)
44
44
 
@@ -47,38 +47,68 @@ private func serializeSpecific(_ value: Encodable) throws -> Any? {
47
47
  }
48
48
  }
49
49
 
50
- private func serialize(historyMetadata: HistoryMetadataBinding) throws -> Any {
50
+ private func serialize(historyMetadata: HistoryMetadataBinding) throws -> NSDictionary {
51
51
  switch (historyMetadata) {
52
52
  case let .unexportableEntities(value):
53
- return try serializeAny(value);
53
+ return [
54
+ "type_": "UNEXPORTABLE_ENTITIES",
55
+ "value": try serializeAny(value)
56
+ ];
54
57
  case let .errorMetadata(value):
55
- return try serializeAny(value);
58
+ return [
59
+ "type_": "ERROR_METADATA",
60
+ "value": try serializeAny(value)
61
+ ];
56
62
  case let .walletUnitJwt(value):
57
- return ["jwt": value] as NSDictionary;
63
+ return [
64
+ "type_": "WALLET_UNIT_JWT",
65
+ "value": [value]
66
+ ];
58
67
  }
59
68
  }
60
69
 
61
- private func serialize(claimValue: ClaimValueBindingDto) throws -> Any {
70
+ private func serialize(claimValue: ClaimValueBindingDto) throws -> NSDictionary {
62
71
  switch (claimValue) {
63
72
  case let .boolean(value):
64
- return value;
73
+ return [
74
+ "type_": "BOOLEAN",
75
+ "value": value
76
+ ];
65
77
  case let .float(value):
66
- return value;
78
+ return [
79
+ "type_": "FLOAT",
80
+ "value": value
81
+ ];
67
82
  case let .integer(value):
68
- return NSNumber(value: value);
83
+ return [
84
+ "type_": "INTEGER",
85
+ "value": NSNumber(value: value)
86
+ ];
69
87
  case let .string(value):
70
- return value;
88
+ return [
89
+ "type_": "STRING",
90
+ "value": value
91
+ ];
71
92
  case .nested(value: let values):
72
- return try values.map { try serializeAny($0) }
93
+ return [
94
+ "type_": "NESTED",
95
+ "value": try values.map { try serializeAny($0) }
96
+ ];
73
97
  }
74
98
  }
75
99
 
76
- private func serialize(proofRequestClaimValue: ProofRequestClaimValueBindingDto) throws -> Any {
100
+ private func serialize(proofRequestClaimValue: ProofRequestClaimValueBindingDto) throws -> NSDictionary {
77
101
  switch (proofRequestClaimValue) {
78
102
  case let .value(value):
79
- return value;
103
+ return [
104
+ "type_": "VALUE",
105
+ "value": value
106
+ ];
80
107
  case .claims(value: let values):
81
- return try values.map { try serializeAny($0)}
108
+ return [
109
+ "type_": "CLAIMS",
110
+ "value": try values.map { try serializeAny($0)}
111
+ ];
82
112
  }
83
113
  }
84
114
 
@@ -86,6 +116,7 @@ private func serialize(invitationResponse: HandleInvitationResponseBindingEnum)
86
116
  switch (invitationResponse) {
87
117
  case let .credentialIssuance(interactionId, keyStorageSecurityLevels, keyAlgorithms, txCode):
88
118
  var result: [String: Any] = [
119
+ "type_": "CREDENTIAL_ISSUANCE",
89
120
  "interactionId": interactionId
90
121
  ];
91
122
  if let keyStorageSecurityLevels = keyStorageSecurityLevels {
@@ -101,40 +132,62 @@ private func serialize(invitationResponse: HandleInvitationResponseBindingEnum)
101
132
 
102
133
  case let .proofRequest(interactionId, proofId):
103
134
  return [
135
+ "type_": "PROOF_REQUEST",
104
136
  "interactionId": interactionId,
105
137
  "proofId": proofId
106
138
  ];
107
139
 
108
140
  case let .authorizationCodeFlow(interactionId, authorizationCodeFlowUrl):
109
141
  return [
142
+ "type_": "AUTHORIZATION_CODE_FLOW",
110
143
  "interactionId": interactionId,
111
144
  "authorizationCodeFlowUrl": authorizationCodeFlowUrl
112
145
  ];
113
146
  }
114
147
  }
115
148
 
116
- private func serialize(credentialQuery: CredentialQueryResponseBindingDto) throws -> Any {
117
- var result: [String: Any] = ["multiple": credentialQuery.multiple]
118
- switch (credentialQuery.credentialOrFailureHint) {
149
+ private func serialize(applicableCredentialQuery: ApplicableCredentialOrFailureHintBindingEnum) throws -> NSDictionary {
150
+ switch (applicableCredentialQuery) {
119
151
  case let .applicableCredentials(applicableCredentials: value):
120
- result["applicableCredentials"] = try serializeAny(value);
152
+ return [
153
+ "type_": "APPLICABLE_CREDENTIALS",
154
+ "applicableCredentials": try serializeAny(value)
155
+ ];
156
+
121
157
  case let .failureHint(failureHint: value):
122
- result["failureHint"] = try serializeAny(value);
158
+ return [
159
+ "type_": "FAILURE_HINT",
160
+ "failureHint": try serializeAny(value)
161
+ ];
123
162
  }
124
- return result as NSDictionary;
125
163
  }
126
164
 
127
- private func serialize(presentationDefinitionV2ClaimValue: PresentationDefinitionV2ClaimValueBindingDto) throws -> Any {
165
+ private func serialize(presentationDefinitionV2ClaimValue: PresentationDefinitionV2ClaimValueBindingDto) throws -> NSDictionary {
128
166
  switch (presentationDefinitionV2ClaimValue) {
129
167
  case let .boolean(value):
130
- return value;
168
+ return [
169
+ "type_": "BOOLEAN",
170
+ "value": value
171
+ ];
131
172
  case let .float(value):
132
- return value;
173
+ return [
174
+ "type_": "FLOAT",
175
+ "value": value
176
+ ];
133
177
  case let .integer(value):
134
- return NSNumber(value: value);
178
+ return [
179
+ "type_": "INTEGER",
180
+ "value": NSNumber(value: value)
181
+ ];
135
182
  case let .string(value):
136
- return value;
183
+ return [
184
+ "type_": "STRING",
185
+ "value": value
186
+ ];
137
187
  case .nested(value: let values):
138
- return try values.map { try serializeAny($0) }
188
+ return [
189
+ "type_": "NESTED",
190
+ "value": try values.map { try serializeAny($0) }
191
+ ];
139
192
  }
140
193
  }
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@procivis/react-native-one-core",
3
- "version": "1.77931.0",
3
+ "version": "1.81885.0",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "ONE core bindings for React Native",
7
- "repository": "https://github.com/procivis/react-native-one-core",
7
+ "repository": {
8
+ "url": "git+https://github.com/procivis/react-native-one-core"
9
+ },
8
10
  "homepage": "https://procivis.ch",
9
11
  "main": "dist/index.js",
10
12
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
  s.source = { :git => "https://gitlab.procivis.ch/procivis/one/react-native-one-core.git" }
17
17
  s.source_files = "ios/**/*.{h,m,swift}"
18
18
  s.requires_arc = true
19
- s.ios.vendored_frameworks = "ios/ProcivisOneCore.xcframework", "ios/ProcivisOneCoreFFI.xcframework", "ios/UBQKit.xcframework"
19
+ s.ios.vendored_frameworks = "ios/ProcivisOneCore.xcframework", "ios/ProcivisOneCoreFFI.xcframework"
20
20
  s.prepare_command = <<-CMD
21
21
  FRAMEWORK_URL=#{sdk['url']}
22
22
  SHA_1_CHECKSUM=#{sdk['sha1']}
@@ -1,122 +0,0 @@
1
- import java.security.MessageDigest
2
- class Checksum {
3
- static getChecksum(file, type) {
4
- def digest = MessageDigest.getInstance(type)
5
- def inputStream = file.newInputStream()
6
- def buffer = new byte[16384]
7
- def len
8
-
9
- while((len=inputStream.read(buffer)) > 0) {
10
- digest.update(buffer, 0, len)
11
- }
12
-
13
- def result = ""
14
- for(byte b : digest.digest()) {
15
- result += toHex(b)
16
- }
17
- return result
18
- }
19
- private static hexChr(int b) {
20
- return Integer.toHexString(b & 0xF)
21
- }
22
- private static toHex(int b) {
23
- return hexChr((b & 0xF0) >> 4) + hexChr(b & 0x0F)
24
- }
25
- }
26
-
27
- buildscript {
28
- repositories {
29
- gradlePluginPortal()
30
- }
31
- dependencies {
32
- classpath 'org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin:1.9.0'
33
- }
34
- }
35
-
36
- apply plugin: 'com.android.library'
37
- apply plugin: 'kotlin-android'
38
- apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
39
-
40
- def safeExtGet(prop, fallback) {
41
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
42
- }
43
-
44
- android {
45
- compileSdkVersion safeExtGet('compileSdkVersion', 33)
46
- buildToolsVersion = "30.0.2"
47
-
48
- defaultConfig {
49
- minSdkVersion safeExtGet('minSdkVersion', 26)
50
- targetSdkVersion safeExtGet('targetSdkVersion', 33)
51
- versionCode 1
52
- versionName "1.0.0"
53
-
54
- consumerProguardFiles 'proguard-rules.pro'
55
- }
56
- lintOptions {
57
- abortOnError false
58
- }
59
- buildFeatures {
60
- dataBinding true
61
- }
62
- }
63
-
64
- repositories {
65
- mavenCentral()
66
- }
67
-
68
- dependencies {
69
- implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.9.0')}")
70
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
71
- implementation 'com.facebook.react:react-native:+'
72
-
73
- releaseApi(name: 'onecore-release', ext: 'aar')
74
- debugApi(name: 'onecore-debug', ext: 'aar')
75
- implementation 'net.java.dev.jna:jna:5.17.0@aar'
76
- implementation 'org.greenrobot:eventbus:3.3.1'
77
- implementation("org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.9.0')}")
78
- }
79
-
80
- def downloadFile = { url, file ->
81
- new URL(url).withInputStream { downloadStream ->
82
- file.withOutputStream { fileOut ->
83
- fileOut << downloadStream
84
- }
85
- }
86
- }
87
-
88
- def coreUrlAAR = { buildType ->
89
- def name = "onecore-${buildType}"
90
- def coreSdkJsonFile = file("$projectDir/../core-sdk.json")
91
- def coreSdkJson = new groovy.json.JsonSlurper().parseText(coreSdkJsonFile.text)
92
- def sdk = coreSdkJson.android[buildType]
93
-
94
- def url = sdk.url
95
- File file = new File("$projectDir/libs/${name}.aar")
96
- file.parentFile.mkdirs()
97
-
98
- def sha1Expected = sdk.sha1
99
- if (file.exists()) {
100
- if (Checksum.getChecksum(file, "SHA1") == sha1Expected) {
101
- // all good
102
- return
103
- }
104
- // The file is most likely just stale -> delete and download again
105
- file.delete()
106
- }
107
-
108
- downloadFile(url, file)
109
- def sha1sum = Checksum.getChecksum(file, "SHA1")
110
- if (sha1sum != sha1Expected) {
111
- // if the file hash still does not match then something is off
112
- println "URL($name): $url"
113
- println "sha1 expected: $sha1Expected"
114
- println "sha1 actual: $sha1sum"
115
- throw new Error("AAR file SHA1 mismatch: " + name)
116
- }
117
- }
118
-
119
- afterEvaluate {
120
- coreUrlAAR('debug')
121
- coreUrlAAR('release')
122
- }
@@ -1,123 +0,0 @@
1
- package ch.procivis.one.core.ubiqu
2
-
3
- import android.content.Intent
4
- import ch.procivis.one.core.NativeKeyStorageException
5
- import com.facebook.react.bridge.Arguments
6
- import com.facebook.react.bridge.ReactContext
7
- import com.facebook.react.bridge.WritableMap
8
- import com.facebook.react.modules.core.DeviceEventManagerModule
9
- import com.ubiqu.eid.sdk.requests.UbqRequestFlow
10
-
11
- object PinPadRunner {
12
- enum class RequestType {
13
- SUBSCRIBE,
14
- TRANSACTION,
15
- ADD_BIOMETRICS,
16
- CHANGE_PIN
17
- }
18
-
19
- enum class RNEvent {
20
- RSE_SHOW_PIN,
21
- RSE_HIDE_PIN,
22
- RSE_DIGITS_ENTERED,
23
- RSE_PIN_STAGE,
24
- RSE_INCORRECT_PIN
25
- }
26
-
27
- enum class RNEventParam {
28
- flowType,
29
- digitsEntered,
30
- stage,
31
- attemptsLeft,
32
- }
33
-
34
- enum class RNEventStage {
35
- CHECK_CURRENT_PIN,
36
- NEW_FIRST_PIN,
37
- NEW_SECOND_PIN,
38
- }
39
-
40
- data class Flow(
41
- val flow: UbqRequestFlow,
42
- val promise: Util.Promise<String?>,
43
- val type: RequestType
44
- )
45
-
46
- @Volatile
47
- private var activeFlow: Flow? = null
48
-
49
- @Synchronized
50
- fun getActiveFlow(): Flow {
51
- return activeFlow ?: throw NativeKeyStorageException.Unknown("No active flow")
52
- }
53
-
54
- private fun sendRNEvent(context: ReactContext, eventName: String, params: WritableMap?) {
55
- context
56
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
57
- .emit(eventName, params)
58
- }
59
-
60
- // ==== called from UbiquKeyStorage
61
- @Synchronized
62
- fun startPinPadFlow(
63
- context: ReactContext,
64
- flow: UbqRequestFlow,
65
- requestType: RequestType,
66
- promise: Util.Promise<String?>
67
- ) {
68
- if (activeFlow != null) {
69
- throw NativeKeyStorageException.Unknown("Another PinPad flow in progress")
70
- }
71
-
72
- activeFlow = Flow(flow, promise, requestType)
73
-
74
- val params = Arguments.createMap()
75
- params.putString(RNEventParam.flowType.name, requestType.name)
76
-
77
- val initialStage = when (requestType) {
78
- RequestType.SUBSCRIBE -> RNEventStage.NEW_FIRST_PIN
79
- else -> RNEventStage.CHECK_CURRENT_PIN
80
- }
81
- params.putString(RNEventParam.stage.name, initialStage.name)
82
- sendRNEvent(context, RNEvent.RSE_SHOW_PIN.name, params)
83
- }
84
-
85
- @Synchronized
86
- fun cancelPinPadFlow() {
87
- activeFlow?.promise?.fail(NativeKeyStorageException.Unknown("Canceled by user"))
88
- activeFlow = null
89
- }
90
-
91
- // ==== called from PinPadWrapper
92
- @Synchronized
93
- fun finishPinPadFlowSuccess(context: ReactContext, data: String?) {
94
- activeFlow?.promise?.succeed(data)
95
- activeFlow = null
96
- sendRNEvent(context, RNEvent.RSE_HIDE_PIN.name, null)
97
- }
98
-
99
- @Synchronized
100
- fun finishPinPadFlowFailure(context: ReactContext, error: Throwable) {
101
- activeFlow?.promise?.fail(error)
102
- activeFlow = null
103
- sendRNEvent(context, RNEvent.RSE_HIDE_PIN.name, null)
104
- }
105
-
106
- fun digitsEntered(context: ReactContext, numPins: Int) {
107
- val params = Arguments.createMap()
108
- params.putInt(RNEventParam.digitsEntered.name, numPins)
109
- sendRNEvent(context, RNEvent.RSE_DIGITS_ENTERED.name, params)
110
- }
111
-
112
- fun pinStage(context: ReactContext, stage: RNEventStage) {
113
- val params = Arguments.createMap()
114
- params.putString(RNEventParam.stage.name, stage.name)
115
- sendRNEvent(context, RNEvent.RSE_PIN_STAGE.name, params)
116
- }
117
-
118
- fun incorrectPin(context: ReactContext, attemptsLeft: Int) {
119
- val params = Arguments.createMap()
120
- params.putInt(RNEventParam.attemptsLeft.name, attemptsLeft)
121
- sendRNEvent(context, RNEvent.RSE_INCORRECT_PIN.name, params)
122
- }
123
- }
@@ -1,20 +0,0 @@
1
- package ch.procivis.one.core.ubiqu
2
-
3
- import android.view.View
4
- import ch.procivis.one.core.NativeKeyStorageException
5
- import com.facebook.react.bridge.ReactApplicationContext
6
- import com.facebook.react.uimanager.SimpleViewManager
7
- import com.facebook.react.uimanager.ThemedReactContext
8
-
9
- class PinPadViewManager(private val callerContext: ReactApplicationContext) :
10
- SimpleViewManager<View>() {
11
- companion object {
12
- const val REACT_CLASS = "RCTProcivisRSEPinPad"
13
- }
14
-
15
- override fun getName() = REACT_CLASS
16
-
17
- override fun createViewInstance(context: ThemedReactContext): View {
18
- throw NativeKeyStorageException.Unsupported()
19
- }
20
- }