@procivis/react-native-one-core 1.33398.0 → 1.43299.1
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/README.md +8 -26
- package/android/build.gradle +27 -3
- package/android/build.gradle_opensource +121 -0
- package/android/libs/core-reactnative-compatible-2025.0305.1.aar +0 -0
- package/android/src/main/AndroidManifest.xml +5 -2
- package/android/src/main/java/ch/procivis/one/core/Deserialize.kt +5 -5
- package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +4 -3
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +136 -16
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCorePackage.kt +3 -4
- package/android/src/main/java/ch/procivis/one/core/Serialize.kt +3 -1
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +19 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadRunner.kt +123 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt +23 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt_opensource +20 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadWrapper.kt +396 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/RegistrationManager.kt +59 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/TokenManager.kt +48 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +256 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt_opensource +51 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/Util.kt +74 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityRequest.kt +9 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityResponse.kt +9 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/RegisterRSEResponse.kt +10 -0
- package/core-sdk.json +6 -6
- package/dist/index.d.ts +7 -0
- package/dist/index.js +10 -4
- package/dist/src/cache.d.ts +0 -4
- package/dist/src/cache.js +0 -5
- package/dist/src/config.d.ts +14 -4
- package/dist/src/core.d.ts +16 -6
- package/dist/src/core.js +72 -0
- package/dist/src/credential.d.ts +7 -2
- package/dist/src/credentialSchema.d.ts +5 -2
- package/dist/src/credentialSchema.js +2 -0
- package/dist/src/history.d.ts +23 -5
- package/dist/src/history.js +13 -1
- package/dist/src/identifier.d.ts +132 -0
- package/dist/src/identifier.js +29 -0
- package/dist/src/organisation.d.ts +8 -0
- package/dist/src/organisation.js +1 -0
- package/dist/src/proof.d.ts +26 -6
- package/dist/src/proof.js +13 -5
- package/dist/src/trust.d.ts +1 -1
- package/dist/src/ubiqu.d.ts +49 -0
- package/dist/src/ubiqu.js +69 -0
- package/ios/Deserialize.swift +141 -776
- package/ios/EventEmitter.swift +91 -0
- package/ios/ProcivisOneCoreModule.m +49 -5
- package/ios/ProcivisOneCoreModule.swift +994 -687
- package/ios/ProcivisRNOneCore.xcodeproj/project.pbxproj +37 -27
- package/ios/RNDecoder/RNDecoder.swift +191 -0
- package/ios/RNDecoder/RNDecodingStorage.swift +33 -0
- package/ios/RNDecoder/RNKeyedDecodingContainer.swift +133 -0
- package/ios/RNDecoder/RNUnkeyedDecodingContainer.swift +175 -0
- package/ios/RNEncoder/RNAnyCodingKey.swift +31 -0
- package/ios/RNEncoder/RNEncoder.swift +95 -0
- package/ios/RNEncoder/RNKeyedEncodingContainer.swift +81 -0
- package/ios/RNEncoder/RNSingleValueEncodingContainer.swift +78 -0
- package/ios/RNEncoder/RNUnkeyedEncodingContainer.swift +84 -0
- package/ios/RSEKeyStorage.swift +587 -0
- package/ios/RSEKeyStorage.swift_opensource +49 -0
- package/ios/RSEPinPad.swift +74 -0
- package/ios/RSEPinPad.swift_opensource +21 -0
- package/ios/RSEPinPadManager.m +19 -0
- package/ios/Serialize.swift +46 -596
- package/ios/UBQKit.xcframework/Info.plist +44 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Assets.car +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFCompatibilityMacros.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFHTTPSessionManager.h +304 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +216 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworking.h +41 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +16 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFSecurityPolicy.h +156 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLRequestSerialization.h +479 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLResponseSerialization.h +310 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLSessionManager.h +501 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/CardRequestProtocol.h +72 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Constants.h +222 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DeviceBindProtocol.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DomainSecurityModule.h +43 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ErrorDomains.h +68 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/FreeAssetProtocol.h +40 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/GDataXMLNode.h +214 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSDictionary+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSFileManager+Utilities.h +20 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSString+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSURL+Utilities.h +12 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ProtocolBase.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ResetPinProtocol.h +45 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Settings.h +120 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequest.h +58 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +28 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +35 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +31 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit-Swift.h +761 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit.h +56 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQPacket.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Info.plist +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.abi.json +89006 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.private.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/module.modulemap +11 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/UBQKit +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/_CodeSignature/CodeResources +597 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/certs +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/checksums +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/pinning_pub +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/static +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/stream +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Assets.car +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFCompatibilityMacros.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFHTTPSessionManager.h +304 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +216 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworking.h +41 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +16 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFSecurityPolicy.h +156 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLRequestSerialization.h +479 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLResponseSerialization.h +310 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLSessionManager.h +501 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/CardRequestProtocol.h +72 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Constants.h +222 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DeviceBindProtocol.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DomainSecurityModule.h +43 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ErrorDomains.h +68 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/FreeAssetProtocol.h +40 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/GDataXMLNode.h +214 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSDictionary+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSFileManager+Utilities.h +20 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSString+Utilities.h +23 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSURL+Utilities.h +12 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ProtocolBase.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ResetPinProtocol.h +45 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Settings.h +120 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequest.h +58 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +37 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +28 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +35 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +31 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +34 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit-Swift.h +1522 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit.h +56 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQPacket.h +38 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Info.plist +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.abi.json +89006 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +89006 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1099 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/module.modulemap +11 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/UBQKit +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/_CodeSignature/CodeResources +652 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/certs +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/checksums +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/pinning_pub +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/static +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/stream +0 -0
- package/ios/Util.swift +36 -25
- package/package.json +5 -4
- package/react-native-one-core.podspec +4 -5
package/README.md
CHANGED
|
@@ -63,27 +63,6 @@ allprojects {
|
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
Add following to your app `android/app/build.gradle` to remove unsupported architectures:
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
...
|
|
70
|
-
android {
|
|
71
|
-
defaultConfig {
|
|
72
|
-
...
|
|
73
|
-
|
|
74
|
-
ndk {
|
|
75
|
-
abiFilters "armeabi-v7a", "arm64-v8a", "x86"
|
|
76
|
-
}
|
|
77
|
-
packagingOptions {
|
|
78
|
-
exclude 'lib/mips/**'
|
|
79
|
-
exclude 'lib/mips64/**'
|
|
80
|
-
exclude 'lib/armeabi/**'
|
|
81
|
-
exclude 'lib/x86_64/**'
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
66
|
## Usage
|
|
88
67
|
|
|
89
68
|
```javascript
|
|
@@ -156,7 +135,7 @@ Support for the recently published [FIPS-204][fips] is planned for the near futu
|
|
|
156
135
|
|
|
157
136
|
#### ISO mdoc
|
|
158
137
|
|
|
159
|
-
- [ISO/IEC 18013-5:2021][
|
|
138
|
+
- [ISO/IEC 18013-5:2021][iso5] standard for mdoc credentials.
|
|
160
139
|
- [COSE][cose] proofs
|
|
161
140
|
- ECDSA [ES256][es2]
|
|
162
141
|
- EdDSA [Ed25519][ed255]
|
|
@@ -176,7 +155,7 @@ Support for the recently published [FIPS-204][fips] is planned for the near futu
|
|
|
176
155
|
|
|
177
156
|
- OpenID for Verifiable Credentials
|
|
178
157
|
- [OID4VCI][vci]; ID-1
|
|
179
|
-
-
|
|
158
|
+
- OID4VP; [ID-2][vp20] (Draft 20) & [Draft 25][vp25]
|
|
180
159
|
- [OID4VP over BLE][ble]; optimized version of Draft 00
|
|
181
160
|
- OID4VP over MQTT; proprietary adaptation of "OID4VP over BLE" via MQTT channel
|
|
182
161
|
- ISO/IEC 18013
|
|
@@ -216,6 +195,8 @@ Version 2.0](./LICENSE).
|
|
|
216
195
|
[bbs2023]: https://www.w3.org/TR/vc-di-bbs/#bbs-2023
|
|
217
196
|
[ble]: https://openid.net/specs/openid-4-verifiable-presentations-over-ble-1_0.html
|
|
218
197
|
[canivc]: https://canivc.com/implementations/procivis-one-core/
|
|
198
|
+
[comp]: https://github.com/procivis/one-react-native-components
|
|
199
|
+
[core]: https://github.com/procivis/one-core
|
|
219
200
|
[cose]: https://www.rfc-editor.org/rfc/rfc9052
|
|
220
201
|
[crydi3]: https://datatracker.ietf.org/doc/html/draft-ietf-cose-dilithium-01
|
|
221
202
|
[docs]: https://docs.procivis.ch/
|
|
@@ -241,11 +222,12 @@ Version 2.0](./LICENSE).
|
|
|
241
222
|
[rncore]: https://github.com/procivis/react-native-one-core
|
|
242
223
|
[sdjwt]: https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-12.html
|
|
243
224
|
[sdjwtvc]: https://www.ietf.org/archive/id/draft-ietf-oauth-sd-jwt-vc-05.html
|
|
244
|
-
[sdkref]: https://docs.procivis.ch/sdk
|
|
225
|
+
[sdkref]: https://docs.procivis.ch/sdk
|
|
245
226
|
[sl]: https://www.w3.org/TR/vc-bitstring-status-list/
|
|
246
|
-
[trial]: https://docs.procivis.ch/trial
|
|
227
|
+
[trial]: https://docs.procivis.ch/trial
|
|
247
228
|
[tsl]: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-status-list-03
|
|
248
229
|
[vcdi]: https://www.w3.org/TR/vc-data-integrity/
|
|
249
230
|
[vcdm]: https://www.w3.org/TR/vc-data-model-2.0/
|
|
250
231
|
[vci]: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-ID1.html
|
|
251
|
-
[
|
|
232
|
+
[vp20]: https://openid.net/specs/openid-4-verifiable-presentations-1_0-20.html
|
|
233
|
+
[vp25]: https://openid.net/specs/openid-4-verifiable-presentations-1_0-25.html
|
package/android/build.gradle
CHANGED
|
@@ -24,8 +24,18 @@ class Checksum {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
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
|
+
|
|
27
36
|
apply plugin: 'com.android.library'
|
|
28
37
|
apply plugin: 'kotlin-android'
|
|
38
|
+
apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
|
|
29
39
|
|
|
30
40
|
def safeExtGet(prop, fallback) {
|
|
31
41
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
@@ -36,7 +46,7 @@ android {
|
|
|
36
46
|
buildToolsVersion = "30.0.2"
|
|
37
47
|
|
|
38
48
|
defaultConfig {
|
|
39
|
-
minSdkVersion safeExtGet('minSdkVersion',
|
|
49
|
+
minSdkVersion safeExtGet('minSdkVersion', 26)
|
|
40
50
|
targetSdkVersion safeExtGet('targetSdkVersion', 33)
|
|
41
51
|
versionCode 1
|
|
42
52
|
versionName "1.0.0"
|
|
@@ -46,6 +56,9 @@ android {
|
|
|
46
56
|
lintOptions {
|
|
47
57
|
abortOnError false
|
|
48
58
|
}
|
|
59
|
+
buildFeatures {
|
|
60
|
+
dataBinding true
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
repositories {
|
|
@@ -53,14 +66,25 @@ repositories {
|
|
|
53
66
|
}
|
|
54
67
|
|
|
55
68
|
dependencies {
|
|
56
|
-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.
|
|
69
|
+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.9.0')}")
|
|
57
70
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
|
|
58
71
|
implementation 'com.facebook.react:react-native:+'
|
|
59
72
|
|
|
60
73
|
releaseImplementation(name: 'onecore-release', ext: 'aar')
|
|
61
74
|
debugImplementation(name: 'onecore-debug', ext: 'aar')
|
|
62
75
|
implementation 'net.java.dev.jna:jna:5.13.0@aar'
|
|
63
|
-
implementation("org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.
|
|
76
|
+
implementation("org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.9.0')}")
|
|
77
|
+
|
|
78
|
+
implementation(name: 'core-reactnative-compatible-2025.0305.1', ext: 'aar')
|
|
79
|
+
implementation("com.google.android.material:material:1.9.0")
|
|
80
|
+
implementation("com.squareup.retrofit2:retrofit:2.11.0")
|
|
81
|
+
implementation("com.squareup.retrofit2:converter-scalars:2.11.0")
|
|
82
|
+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
|
|
83
|
+
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
|
|
84
|
+
implementation("com.jakewharton.timber:timber:5.0.1")
|
|
85
|
+
implementation("org.apache.commons:commons-math3:3.6.1")
|
|
86
|
+
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
87
|
+
implementation 'androidx.biometric:biometric:1.1.0'
|
|
64
88
|
}
|
|
65
89
|
|
|
66
90
|
def downloadFile = { url, file ->
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
releaseImplementation(name: 'onecore-release', ext: 'aar')
|
|
74
|
+
debugImplementation(name: 'onecore-debug', ext: 'aar')
|
|
75
|
+
implementation 'net.java.dev.jna:jna:5.13.0@aar'
|
|
76
|
+
implementation("org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.9.0')}")
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
def downloadFile = { url, file ->
|
|
80
|
+
new URL(url).withInputStream { downloadStream ->
|
|
81
|
+
file.withOutputStream { fileOut ->
|
|
82
|
+
fileOut << downloadStream
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
def coreUrlAAR = { buildType ->
|
|
88
|
+
def name = "onecore-${buildType}"
|
|
89
|
+
def coreSdkJsonFile = file("$projectDir/../core-sdk.json")
|
|
90
|
+
def coreSdkJson = new groovy.json.JsonSlurper().parseText(coreSdkJsonFile.text)
|
|
91
|
+
def sdk = coreSdkJson.android[buildType]
|
|
92
|
+
|
|
93
|
+
def url = sdk.url
|
|
94
|
+
File file = new File("$projectDir/libs/${name}.aar")
|
|
95
|
+
file.parentFile.mkdirs()
|
|
96
|
+
|
|
97
|
+
def sha1Expected = sdk.sha1
|
|
98
|
+
if (file.exists()) {
|
|
99
|
+
if (Checksum.getChecksum(file, "SHA1") == sha1Expected) {
|
|
100
|
+
// all good
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
// The file is most likely just stale -> delete and download again
|
|
104
|
+
file.delete()
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
downloadFile(url, file)
|
|
108
|
+
def sha1sum = Checksum.getChecksum(file, "SHA1")
|
|
109
|
+
if (sha1sum != sha1Expected) {
|
|
110
|
+
// if the file hash still does not match then something is off
|
|
111
|
+
println "URL($name): $url"
|
|
112
|
+
println "sha1 expected: $sha1Expected"
|
|
113
|
+
println "sha1 actual: $sha1sum"
|
|
114
|
+
throw new Error("AAR file SHA1 mismatch: " + name)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
afterEvaluate {
|
|
119
|
+
coreUrlAAR('debug')
|
|
120
|
+
coreUrlAAR('release')
|
|
121
|
+
}
|
|
Binary file
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
package="ch.procivis.one.core">
|
|
4
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
5
|
+
</manifest>
|
|
@@ -11,11 +11,11 @@ object Deserialize {
|
|
|
11
11
|
return constructObjectWithMembers(T::class, data) as T
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
private fun extractArrayItem(kType: KType, data: ReadableArray, index: Int): Any {
|
|
14
|
+
private fun extractArrayItem(kType: KType, data: ReadableArray, index: Int): Any? {
|
|
15
15
|
val kClass = kType.classifier as KClass<*>
|
|
16
16
|
|
|
17
17
|
if (kClass.java.isEnum) {
|
|
18
|
-
return constructEnumValue(kClass, data.getString(index))
|
|
18
|
+
return constructEnumValue(kClass, data.getString(index)!!)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
return when (kClass) {
|
|
@@ -26,15 +26,15 @@ object Deserialize {
|
|
|
26
26
|
List::class -> {
|
|
27
27
|
val itemType = kType.arguments.first().type
|
|
28
28
|
val values = data.getArray(index)
|
|
29
|
-
return extractArrayItems(itemType!!, values)
|
|
29
|
+
return extractArrayItems(itemType!!, values!!)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
Map::class -> {
|
|
33
33
|
val values = data.getMap(index)
|
|
34
|
-
return extractMapItems(kType, values)
|
|
34
|
+
return extractMapItems(kType, values!!)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
else -> constructObjectWithMembers(kClass, data.getMap(index))
|
|
37
|
+
else -> constructObjectWithMembers(kClass, data.getMap(index)!!)
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -38,6 +38,7 @@ object DeserializeSpecific {
|
|
|
38
38
|
"PROCIVIS_ONE_SCHEMA2024" -> CredentialSchemaTypeBindingEnum.ProcivisOneSchema2024
|
|
39
39
|
"FALLBACK_SCHEMA2024" -> CredentialSchemaTypeBindingEnum.FallbackSchema2024
|
|
40
40
|
"MDOC" -> CredentialSchemaTypeBindingEnum.Mdoc
|
|
41
|
+
"SD_JWT_VC" -> CredentialSchemaTypeBindingEnum.SdJwtVc
|
|
41
42
|
else -> CredentialSchemaTypeBindingEnum.Other(credentialSchemaType)
|
|
42
43
|
}
|
|
43
44
|
}
|
|
@@ -45,7 +46,7 @@ object DeserializeSpecific {
|
|
|
45
46
|
fun ids(ids: ReadableArray): List<String> {
|
|
46
47
|
val result = mutableListOf<String>()
|
|
47
48
|
for (n in 0 until ids.size()) {
|
|
48
|
-
result.add(ids.getString(n))
|
|
49
|
+
result.add(ids.getString(n)!!)
|
|
49
50
|
}
|
|
50
51
|
return result
|
|
51
52
|
}
|
|
@@ -62,7 +63,7 @@ object DeserializeSpecific {
|
|
|
62
63
|
},
|
|
63
64
|
createdDateFrom = query.getString("createdDateFrom"),
|
|
64
65
|
createdDateTo = query.getString("createdDateTo"),
|
|
65
|
-
|
|
66
|
+
identifierId = query.getString("identifierId"),
|
|
66
67
|
credentialId = query.getString("credentialId"),
|
|
67
68
|
credentialSchemaId = query.getString("credentialSchemaId"),
|
|
68
69
|
search = historySearch(
|
|
@@ -94,7 +95,7 @@ object DeserializeSpecific {
|
|
|
94
95
|
fun <T> enumList(entries: ReadableArray, fn: (String) -> T): List<T> {
|
|
95
96
|
val result = mutableListOf<T>()
|
|
96
97
|
for (n in 0 until entries.size()) {
|
|
97
|
-
result.add(fn(entries.getString(n)))
|
|
98
|
+
result.add(fn(entries.getString(n)!!))
|
|
98
99
|
}
|
|
99
100
|
return result
|
|
100
101
|
}
|
|
@@ -5,6 +5,7 @@ import ch.procivis.one.core.DeserializeSpecific.enumList
|
|
|
5
5
|
import ch.procivis.one.core.Serialize.convertToRN
|
|
6
6
|
import ch.procivis.one.core.Util.asyncCall
|
|
7
7
|
import ch.procivis.one.core.Util.syncCall
|
|
8
|
+
import ch.procivis.one.core.ubiqu.UbiquKeyStorage
|
|
8
9
|
import com.facebook.react.bridge.Promise
|
|
9
10
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
10
11
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
@@ -31,17 +32,30 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
31
32
|
)
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
private var ubiqu: UbiquKeyStorage? = null
|
|
36
|
+
private fun getUbiqu(): UbiquKeyStorage {
|
|
37
|
+
return ubiqu ?: throw BindingException.ErrorResponse(
|
|
38
|
+
ErrorResponseBindingDto(
|
|
39
|
+
"BR_0184",
|
|
40
|
+
"ubiqu not initialized",
|
|
41
|
+
null
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
34
46
|
@ReactMethod
|
|
35
47
|
fun initialize(configJson: String, promise: Promise) {
|
|
36
48
|
syncCall(promise) {
|
|
37
49
|
val dataDirPath = this.reactApplicationContext.filesDir.absolutePath
|
|
50
|
+
ubiqu = ubiqu ?: UbiquKeyStorage(this.reactApplicationContext)
|
|
38
51
|
oneCore =
|
|
39
52
|
initializeCore(
|
|
40
|
-
configJson,
|
|
41
|
-
dataDirPath,
|
|
42
|
-
AndroidKeyStoreKeyStorage(this.reactApplicationContext),
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
configJson = configJson,
|
|
54
|
+
dataDirPath = dataDirPath,
|
|
55
|
+
nativeSecureElement = AndroidKeyStoreKeyStorage(this.reactApplicationContext),
|
|
56
|
+
remoteSecureElement = ubiqu,
|
|
57
|
+
bleCentral = AndroidBLECentral(this.reactApplicationContext),
|
|
58
|
+
blePeripheral = AndroidBLEPeripheral(this.reactApplicationContext)
|
|
45
59
|
)
|
|
46
60
|
return@syncCall null
|
|
47
61
|
}
|
|
@@ -103,9 +117,17 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
103
117
|
}
|
|
104
118
|
|
|
105
119
|
@ReactMethod
|
|
106
|
-
fun createOrganisation(
|
|
120
|
+
fun createOrganisation(request: ReadableMap, promise: Promise) {
|
|
121
|
+
asyncCall(promise, scope) {
|
|
122
|
+
return@asyncCall getCore().createOrganisation(construct(request))
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@ReactMethod
|
|
127
|
+
fun upsertOrganisation(request: ReadableMap, promise: Promise) {
|
|
107
128
|
asyncCall(promise, scope) {
|
|
108
|
-
|
|
129
|
+
getCore().upsertOrganisation(construct(request))
|
|
130
|
+
return@asyncCall null
|
|
109
131
|
}
|
|
110
132
|
}
|
|
111
133
|
|
|
@@ -131,6 +153,37 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
131
153
|
}
|
|
132
154
|
}
|
|
133
155
|
|
|
156
|
+
@ReactMethod
|
|
157
|
+
fun createIdentifier(identifierRequest: ReadableMap, promise: Promise) {
|
|
158
|
+
asyncCall(promise, scope) {
|
|
159
|
+
return@asyncCall getCore().createIdentifier(construct(identifierRequest))
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@ReactMethod
|
|
164
|
+
fun getIdentifiers(query: ReadableMap, promise: Promise) {
|
|
165
|
+
asyncCall(promise, scope) {
|
|
166
|
+
val identifiers = getCore().listIdentifiers(construct(query))
|
|
167
|
+
return@asyncCall convertToRN(identifiers)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@ReactMethod
|
|
172
|
+
fun getIdentifier(identifierId: String, promise: Promise) {
|
|
173
|
+
asyncCall(promise, scope) {
|
|
174
|
+
val identifier = getCore().getIdentifier(identifierId)
|
|
175
|
+
return@asyncCall convertToRN(identifier)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@ReactMethod
|
|
180
|
+
fun deleteIdentifier(identifierId: String, promise: Promise) {
|
|
181
|
+
asyncCall(promise, scope) {
|
|
182
|
+
getCore().deleteIdentifier(identifierId)
|
|
183
|
+
return@asyncCall null
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
134
187
|
@ReactMethod
|
|
135
188
|
fun handleInvitation(
|
|
136
189
|
url: String,
|
|
@@ -148,13 +201,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
148
201
|
@ReactMethod
|
|
149
202
|
fun holderAcceptCredential(
|
|
150
203
|
interactionId: String,
|
|
151
|
-
didId: String
|
|
204
|
+
didId: String?,
|
|
205
|
+
identifierId: String?,
|
|
152
206
|
keyId: String?,
|
|
153
207
|
txCode: String?,
|
|
154
208
|
promise: Promise
|
|
155
209
|
) {
|
|
156
210
|
asyncCall(promise, scope) {
|
|
157
|
-
getCore().holderAcceptCredential(interactionId, didId, keyId, txCode)
|
|
211
|
+
getCore().holderAcceptCredential(interactionId, didId, identifierId, keyId, txCode)
|
|
158
212
|
return@asyncCall null
|
|
159
213
|
}
|
|
160
214
|
}
|
|
@@ -187,7 +241,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
187
241
|
fun holderSubmitProof(
|
|
188
242
|
interactionId: String,
|
|
189
243
|
credentials: ReadableMap,
|
|
190
|
-
didId: String
|
|
244
|
+
didId: String?,
|
|
245
|
+
identifierId: String?,
|
|
191
246
|
keyId: String?,
|
|
192
247
|
promise: Promise
|
|
193
248
|
) {
|
|
@@ -198,7 +253,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
198
253
|
val credential = entry.value as ReadableMap
|
|
199
254
|
submitCredentials[entry.key] = construct(credential)
|
|
200
255
|
}
|
|
201
|
-
getCore().holderSubmitProof(interactionId, submitCredentials, didId, keyId)
|
|
256
|
+
getCore().holderSubmitProof(interactionId, submitCredentials, didId, identifierId, keyId)
|
|
202
257
|
return@asyncCall null
|
|
203
258
|
}
|
|
204
259
|
}
|
|
@@ -290,9 +345,10 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
290
345
|
}
|
|
291
346
|
|
|
292
347
|
@ReactMethod
|
|
293
|
-
fun
|
|
348
|
+
fun deleteProof(proofId: String, promise: Promise) {
|
|
294
349
|
asyncCall(promise, scope) {
|
|
295
|
-
|
|
350
|
+
getCore().deleteProof(proofId)
|
|
351
|
+
return@asyncCall null
|
|
296
352
|
}
|
|
297
353
|
}
|
|
298
354
|
|
|
@@ -345,13 +401,12 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
345
401
|
@ReactMethod
|
|
346
402
|
fun checkRevocation(
|
|
347
403
|
credentialIds: ReadableArray,
|
|
348
|
-
|
|
404
|
+
forceRefresh: Boolean,
|
|
349
405
|
promise: Promise
|
|
350
406
|
) {
|
|
351
407
|
asyncCall(promise, scope) {
|
|
352
408
|
val ids = DeserializeSpecific.ids(credentialIds)
|
|
353
|
-
val
|
|
354
|
-
val results = getCore().checkRevocation(ids, bypass)
|
|
409
|
+
val results = getCore().checkRevocation(ids, forceRefresh)
|
|
355
410
|
return@asyncCall convertToRN(results)
|
|
356
411
|
}
|
|
357
412
|
}
|
|
@@ -523,7 +578,72 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
523
578
|
asyncCall(promise, scope) {
|
|
524
579
|
getCore().uninitialize(deleteData)
|
|
525
580
|
oneCore = null
|
|
581
|
+
if (deleteData) {
|
|
582
|
+
ubiqu?.reset()
|
|
583
|
+
}
|
|
526
584
|
return@asyncCall null
|
|
527
585
|
}
|
|
528
586
|
}
|
|
587
|
+
|
|
588
|
+
// ===== Ubiqu specific methods
|
|
589
|
+
@ReactMethod
|
|
590
|
+
fun changeRSEPin(promise: Promise) {
|
|
591
|
+
asyncCall(promise, scope) {
|
|
592
|
+
getUbiqu().changePin()
|
|
593
|
+
return@asyncCall null
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
@ReactMethod
|
|
598
|
+
fun areRSEBiometricsSupported(promise: Promise) {
|
|
599
|
+
asyncCall(promise, scope) {
|
|
600
|
+
return@asyncCall getUbiqu().getBiometricsSupported()
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
@ReactMethod
|
|
605
|
+
fun areRSEBiometricsEnabled(promise: Promise) {
|
|
606
|
+
asyncCall(promise, scope) {
|
|
607
|
+
return@asyncCall getUbiqu().getBiometricsEnabled()
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
@ReactMethod
|
|
612
|
+
fun setRSEBiometrics(enabled: Boolean, promise: Promise) {
|
|
613
|
+
asyncCall(promise, scope) {
|
|
614
|
+
if (enabled) {
|
|
615
|
+
getUbiqu().enableBiometrics(true)
|
|
616
|
+
} else {
|
|
617
|
+
getUbiqu().disableBiometrics()
|
|
618
|
+
}
|
|
619
|
+
return@asyncCall null
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
@ReactMethod
|
|
624
|
+
fun resetRSE(promise: Promise) {
|
|
625
|
+
asyncCall(promise, scope) {
|
|
626
|
+
ubiqu?.reset()
|
|
627
|
+
return@asyncCall null
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
@ReactMethod
|
|
632
|
+
fun resetRSEPinFlow(promise: Promise) {
|
|
633
|
+
asyncCall(promise, scope) {
|
|
634
|
+
ubiqu?.resetPinFlow()
|
|
635
|
+
return@asyncCall null
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// handling RN event emitter
|
|
640
|
+
@ReactMethod
|
|
641
|
+
fun addListener(eventName: String) {
|
|
642
|
+
UbiquKeyStorage.listenerCount++
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
@ReactMethod
|
|
646
|
+
fun removeListeners(count: Int) {
|
|
647
|
+
UbiquKeyStorage.listenerCount -= count
|
|
648
|
+
}
|
|
529
649
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
package ch.procivis.one.core
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ch.procivis.one.core.ubiqu.PinPadViewManager
|
|
4
4
|
import com.facebook.react.ReactPackage
|
|
5
5
|
import com.facebook.react.bridge.NativeModule
|
|
6
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
-
import com.facebook.react.uimanager.ReactShadowNode
|
|
8
7
|
import com.facebook.react.uimanager.ViewManager
|
|
9
8
|
|
|
10
9
|
class ProcivisOneCorePackage : ReactPackage {
|
|
11
10
|
|
|
12
11
|
override fun createViewManagers(
|
|
13
12
|
reactContext: ReactApplicationContext
|
|
14
|
-
): MutableList<ViewManager
|
|
13
|
+
): MutableList<ViewManager<*, *>> = mutableListOf(PinPadViewManager(reactContext))
|
|
15
14
|
|
|
16
15
|
override fun createNativeModules(
|
|
17
16
|
reactContext: ReactApplicationContext
|
|
18
|
-
): MutableList<NativeModule> =
|
|
17
|
+
): MutableList<NativeModule> = mutableListOf(ProcivisOneCoreModule(reactContext))
|
|
19
18
|
}
|
|
@@ -43,7 +43,7 @@ object Serialize {
|
|
|
43
43
|
} else if (type == Int::class.java || type == java.lang.Integer::class.java) {
|
|
44
44
|
return Pair(RNType.INT, input as Int)
|
|
45
45
|
} else if (type == Byte::class.java || type == java.lang.Byte::class.java) {
|
|
46
|
-
return Pair(RNType.INT, (input as Byte).toInt())
|
|
46
|
+
return Pair(RNType.INT, (input as Byte).toUByte().toInt())
|
|
47
47
|
} else if (type == Short::class.java || type == java.lang.Short::class.java) {
|
|
48
48
|
return Pair(RNType.INT, (input as Short).toInt())
|
|
49
49
|
} else if (type == Long::class.java || type == java.lang.Long::class.java) {
|
|
@@ -56,6 +56,8 @@ object Serialize {
|
|
|
56
56
|
return Pair(RNType.STRING, (input as Char).toString())
|
|
57
57
|
} else if (SerializeSpecific.Str.isCustomConversionType(input)) {
|
|
58
58
|
return Pair(RNType.STRING, SerializeSpecific.Str.convertCustom(input))
|
|
59
|
+
} else if (SerializeSpecific.Arr.isCustomConversionType(input)) {
|
|
60
|
+
return Pair(RNType.ARRAY, SerializeSpecific.Arr.convertCustom(input))
|
|
59
61
|
} else {
|
|
60
62
|
return Pair(RNType.MAP, input)
|
|
61
63
|
}
|
|
@@ -40,6 +40,9 @@ object SerializeSpecific {
|
|
|
40
40
|
when (metadata) {
|
|
41
41
|
is HistoryMetadataBinding.UnexportableEntities ->
|
|
42
42
|
return convertToRN(metadata.value) as ReadableMap
|
|
43
|
+
|
|
44
|
+
is HistoryMetadataBinding.ErrorMetadata ->
|
|
45
|
+
return convertToRN(metadata.value) as ReadableMap
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -119,9 +122,25 @@ object SerializeSpecific {
|
|
|
119
122
|
is CredentialSchemaTypeBindingEnum.Mdoc ->
|
|
120
123
|
"MDOC"
|
|
121
124
|
|
|
125
|
+
is CredentialSchemaTypeBindingEnum.SdJwtVc ->
|
|
126
|
+
"SD_JWT_VC"
|
|
127
|
+
|
|
122
128
|
is CredentialSchemaTypeBindingEnum.Other ->
|
|
123
129
|
type.value
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
132
|
}
|
|
133
|
+
|
|
134
|
+
object Arr {
|
|
135
|
+
fun isCustomConversionType(input: Any?): Boolean {
|
|
136
|
+
return ByteArray::class.isInstance(input)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
fun convertCustom(input: Any): List<*> {
|
|
140
|
+
if (input is ByteArray) {
|
|
141
|
+
return input.toList()
|
|
142
|
+
}
|
|
143
|
+
throw IllegalArgumentException("Invalid array conversion: $input")
|
|
144
|
+
}
|
|
145
|
+
}
|
|
127
146
|
}
|