@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/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Constants.h
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Constants.h
|
|
3
|
+
// Authenticate
|
|
4
|
+
//
|
|
5
|
+
// Created by Rogier van de Pol on 22-01-15.
|
|
6
|
+
// Copyright (c) 2015 Ubiqu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef Constants_h
|
|
10
|
+
#define Constants_h
|
|
11
|
+
|
|
12
|
+
#import <Foundation/Foundation.h>
|
|
13
|
+
|
|
14
|
+
typedef NS_ENUM(NSUInteger, UBQCommandType) {
|
|
15
|
+
UBQCommandTypeGeneralError = 0x00000003,
|
|
16
|
+
UBQCommandTypeUnknownError = 0x00000099,
|
|
17
|
+
|
|
18
|
+
UBQCommandTypeAckAck = 0x00000005,
|
|
19
|
+
UBQCommandTypeServerMessage = 0x00000001,
|
|
20
|
+
|
|
21
|
+
UBQCommandTypePing = 0x0000000E,
|
|
22
|
+
UBQCommandTypePingAck = 0x0000000F,
|
|
23
|
+
UBQCommandTypeAPIVersionError = 0x0000000070020001,
|
|
24
|
+
UBQCommandTypeAppVersionError = 0x0000000070020002,
|
|
25
|
+
UBQCommandTypeConfigUpdate = 0x0000001F,
|
|
26
|
+
UBQCommandTypeConfigIsUptodate = 0x0000002F,
|
|
27
|
+
|
|
28
|
+
UBQCommandTypeDeviceTokenSend = 0x00000B00,
|
|
29
|
+
UBQCommandTypeDeviceTokenSendAck = 0x00000B01,
|
|
30
|
+
UBQCommandTypeDeviceTokenSendError = 0x00000B02,
|
|
31
|
+
|
|
32
|
+
UBQCommandTypeReqActivate = 0x7FFFFFFF,
|
|
33
|
+
UBQCommandTypeRespActivate = 0x6FFFFFFF,
|
|
34
|
+
UBQCommandTypeActivateAck = 0x7FFFFFFE,
|
|
35
|
+
UBQCommandTypeCachedDevices = 0x00000011,
|
|
36
|
+
|
|
37
|
+
UBQCommandTypeRegister = 0x00000D00,
|
|
38
|
+
UBQCommandTypeRegisterResp = 0x00000D01,
|
|
39
|
+
UBQCommandTypeRegisterAck = 0x00000D02,
|
|
40
|
+
UBQCommandTypeRegisterAckResp = 0x00000D03,
|
|
41
|
+
UBQCommandTypeRegisterUnknownNonce = 0x00000D04,
|
|
42
|
+
UBQCommandTypeDeviceInfoPost = 0x00000D05, // part of device bind protocol (register)
|
|
43
|
+
UBQCommandTypeDeviceInfoPostAck = 0x00000D06,
|
|
44
|
+
UBQCommandTypeDeviceInfoPostFailed = 0x00000D07,
|
|
45
|
+
UBQCommandTypeRegisterInvalidNonce = 0x0000000070030001,
|
|
46
|
+
|
|
47
|
+
UBQCommandTypeLogin = 0x000000300,
|
|
48
|
+
UBQCommandTypeLoginAck = 0x000000305,
|
|
49
|
+
UBQCommandTypeLoginNotFound = 0x000000306,
|
|
50
|
+
UBQCommandTypeLoginInvalidNonce = 0x0000000070030001, // NOTE: same value as UBQCommandTypeRegisterInvalidNonce
|
|
51
|
+
|
|
52
|
+
UBQCommandTypeRequestIdp = 0x000013100,
|
|
53
|
+
UBQCommandTypeRequestIdpAck = 0x000013101,
|
|
54
|
+
UBQCommandTypeRequestIdpErr = 0x00001310F,
|
|
55
|
+
|
|
56
|
+
UBQCommandTypeSmartcardIssue = 0x00000C00,
|
|
57
|
+
UBQCommandTypeSmartcardIssueAck = 0x00000C01,
|
|
58
|
+
|
|
59
|
+
UBQCommandTypeCommError = 0x00000307,
|
|
60
|
+
UBQCommandTypeError = 0x00000308,
|
|
61
|
+
|
|
62
|
+
UBQCommandTypeResetPin = 0x00000400,
|
|
63
|
+
UBQCommandTypeResetPinAck = 0x00000401,
|
|
64
|
+
UBQCommandTypeResetPinFailed = 0x00000410,
|
|
65
|
+
UBQCommandTypeResetPinWithPUK = 0x00000420,
|
|
66
|
+
|
|
67
|
+
UBQCommandTypeCardReqGet = 0x00000900,
|
|
68
|
+
UBQCommandTypeCardReq = 0x000000901,
|
|
69
|
+
UBQCommandTypeCardReqExpired = 0x00000090F,
|
|
70
|
+
|
|
71
|
+
UBQCommandTypeCardRequestUpdate = 0x00000A00,
|
|
72
|
+
UBQCommandTypeCardRequestAuthAck = 0x00000A01,
|
|
73
|
+
UBQCommandTypeCardRequestAuthError = 0x00000A02,
|
|
74
|
+
UBQCommandTypeCardRequestAuthNext = 0x00000A03,
|
|
75
|
+
UBQCommandTypeCardRequestAuthPayload = 0x00000A04,
|
|
76
|
+
UBQCommandTypeCardRequestAuthExpired = 0x00000A06,
|
|
77
|
+
|
|
78
|
+
UBQCommandTypeCardRequestAuthMessage = 0x00000A10,
|
|
79
|
+
UBQCommandTypeCardRequestAuthLocked = 0x00000A21,
|
|
80
|
+
UBQCommandTypeCardRequestAuthDestroyed = 0x00000A22,
|
|
81
|
+
|
|
82
|
+
UBQCommandTypeActivateRequestMessage = 0x00000A40,
|
|
83
|
+
UBQCommandTypeActivateRequestAck = 0x00000A41,
|
|
84
|
+
UBQCommandTypeActivateRequestError = 0x00000A42,
|
|
85
|
+
|
|
86
|
+
UBQCommandTypeLog = 0x00000007,
|
|
87
|
+
UBQCommandTypeLogAck = 0x00000008,
|
|
88
|
+
|
|
89
|
+
UBQCommandTypeResendPush = 0x00000910,
|
|
90
|
+
UBQCommandTypeResendPushSuccess = 0x00000911,
|
|
91
|
+
UBQCommandTypeResendPushFailed = 0x00000912,
|
|
92
|
+
UBQCommandTypeResendPushAssetReq = 0x00000913,
|
|
93
|
+
|
|
94
|
+
UBQCommandTypeResendFirstPush = 0x00000920,
|
|
95
|
+
|
|
96
|
+
UBQCommandTypeResendSpecificPush = 0x00000925,
|
|
97
|
+
|
|
98
|
+
UBQCommandTypeGetPush = 0x00000926,
|
|
99
|
+
UBQCommandTypeGetPushAck = 0x00000927,
|
|
100
|
+
UBQCommandTypeGetPushError = 0x00000928,
|
|
101
|
+
|
|
102
|
+
UBQCommandTypeGetOpen = 0x00000930,
|
|
103
|
+
UBQCommandTypeGetOpenAck = 0x00000931,
|
|
104
|
+
UBQCommandTypeGetOpenFailed = 0x00000939,
|
|
105
|
+
|
|
106
|
+
UBQCommandTypeRequestTransaction = 0x00000940,
|
|
107
|
+
UBQCommandTypeRequestTransactionAck = 0x00000941,
|
|
108
|
+
UBQCommandTypeRequestTransactionError = 0x00000949,
|
|
109
|
+
|
|
110
|
+
UBQCommandTypeImageGet = 0x00000200,
|
|
111
|
+
UBQCommandTypeImageGetSuccess = 0x00000201,
|
|
112
|
+
UBQCommandTypeImageNotFound = 0x00000202,
|
|
113
|
+
UBQCommandTypeImageSizeInvalid = 0x00000203,
|
|
114
|
+
UBQCommandTypeImageGetFailed = 0x00000209,
|
|
115
|
+
|
|
116
|
+
UBQCommandTypeMessageChainReset = 0x00000D20,
|
|
117
|
+
UBQCommandTypeMessageChainResetAck = 0x00000D21,
|
|
118
|
+
UBQCommandTypeMessageChainBroken = 0x0000000070010001,
|
|
119
|
+
|
|
120
|
+
UBQCommandTypeUpdateKeys = 0x00001000,
|
|
121
|
+
UBQCommandTypeUpdateKeysResponse = 0x00001001,
|
|
122
|
+
UBQCommandTypeUpdateKeysFailed = 0x00001002,
|
|
123
|
+
|
|
124
|
+
UBQCommandTypeDeviceBind = 0x00002000,
|
|
125
|
+
UBQCommandTypeDeviceBindSuccess = 0x00002001,
|
|
126
|
+
UBQCommandTypeDeviceBindRejected = 0x00002002,
|
|
127
|
+
UBQCommandTypeDeviceBindBlocked = 0x00002003,
|
|
128
|
+
|
|
129
|
+
UBQCommandTypeDeviceIdentifyRequest = 0x00003000,
|
|
130
|
+
UBQCommandTypeDeviceIdentifyResponse = 0x00003001,
|
|
131
|
+
UBQCommandTypeDeviceIdentifyFailed = 0x0000300F,
|
|
132
|
+
|
|
133
|
+
UBQCommandTypeAssetRevoked = 0x70020003,
|
|
134
|
+
|
|
135
|
+
UBQCommandTypeAssetRevoke = 0x00000800,
|
|
136
|
+
UBQCommandTypeAssetRevokeSuccess = 0x00000801,
|
|
137
|
+
UBQCommandTypeAssetRevokeFail = 0x00000802,
|
|
138
|
+
UBQCommandTypeAssetRevokeAck = 0x00000803,
|
|
139
|
+
UBQCommandTypeAssetRevokeAckSuccess = 0x00000804,
|
|
140
|
+
UBQCommandTypeAssetRevokeAckFail = 0x00000805,
|
|
141
|
+
|
|
142
|
+
UBQCommandTypeAssetPINTimeout = 0x70040002,
|
|
143
|
+
UBQCommandTypeAssetPUKTimeout = 0x70040003,
|
|
144
|
+
|
|
145
|
+
UBQCommandTypeAutoActivateRequest = 0x0000C000,
|
|
146
|
+
UBQCommandTypeAutoActivateResponse = 0x0000C001,
|
|
147
|
+
UBQCommandTypeAutoActivateFailed = 0x0000C002,
|
|
148
|
+
|
|
149
|
+
UBQCommandTypeAddECCKeyRequest = 0x00004000,
|
|
150
|
+
UBQCommandTypeAddECCKeyAck = 0x00004001,
|
|
151
|
+
UBQCommandTypeAddECCKeyFailed = 0x0000400f,
|
|
152
|
+
|
|
153
|
+
UBQCommandTypeAddDeviceKeyRequest = 0x00004100,
|
|
154
|
+
UBQCommandTypeAddDeviceKeyAck = 0x00004101,
|
|
155
|
+
UBQCommandTypeAddDeviceKeyFailed = 0x0000410f,
|
|
156
|
+
|
|
157
|
+
UBQCommandTypeAssetKeyUpgradeRequest = 0x00006000,
|
|
158
|
+
UBQCommandTypeAssetKeyUpgradeAck = 0x00006001,
|
|
159
|
+
UBQCommandTypeAssetKeyUpgradeFailed = 0x0000600F,
|
|
160
|
+
|
|
161
|
+
UBQCommandTypeAesRequest = 0x00006100,
|
|
162
|
+
UBQCommandTypeAesRequestAck = 0x00006101,
|
|
163
|
+
UBQCommandTypeAesRequestFailed = 0x0000610F,
|
|
164
|
+
|
|
165
|
+
UBQCommandTypeAssetCreateDa = 0x00006200,
|
|
166
|
+
UBQCommandTypeAssetCreateDaAck = 0x00006201,
|
|
167
|
+
UBQCommandTypeAssetCreateDaAckFailed = 0x0000620F,
|
|
168
|
+
|
|
169
|
+
UBQCommandTypeAssetListDa = 0x00006300,
|
|
170
|
+
UBQCommandTypeAssetListDaAck = 0x00006301,
|
|
171
|
+
UBQCommandTypeAssetListDaFailed = 0x0000630F,
|
|
172
|
+
|
|
173
|
+
UBQCommandTypeAssetUseDa = 0x00006400,
|
|
174
|
+
UBQCommandTypeAssetUseDaAck = 0x00006401,
|
|
175
|
+
UBQCommandTypeAssetUseDaFailed = 0x0000640F,
|
|
176
|
+
|
|
177
|
+
UBQCommandTypeAssetDecryptDa = 0x00006600,
|
|
178
|
+
UBQCommandTypeAssetDecryptAck = 0x00006601,
|
|
179
|
+
UBQCommandTypeAssetDecryptFailed = 0x0000660F,
|
|
180
|
+
|
|
181
|
+
UBQCommandTypeAssetUseDaResult = 0x00006500,
|
|
182
|
+
UBQCommandTypeAssetUseDaResultAck = 0x00006501,
|
|
183
|
+
UBQCommandTypeAssetUseDaResultFailed = 0x0000650F
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
typedef NS_ENUM(NSInteger, UBQAppLaunchType) {
|
|
188
|
+
UBQAppLaunchTypeNone = 0,
|
|
189
|
+
UBQAppLaunchTypeURLScheme = 1,
|
|
190
|
+
UBQAppLaunchTypePushNotification = 2
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
typedef NS_ENUM(NSInteger, AppState) {
|
|
194
|
+
AppStateNormal = 0,
|
|
195
|
+
AppStateAllowPush = 1,
|
|
196
|
+
AppStateLaunchedWithPush = 2,
|
|
197
|
+
AppStateBlocked = 3,
|
|
198
|
+
AppStatePushReceivedInApp = 4,
|
|
199
|
+
AppSubscribeWithPuk = 5,
|
|
200
|
+
AppStatePermissionRequest = 6,
|
|
201
|
+
AppStateWaitForPush = 7
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
typedef NS_ENUM(NSInteger, AssetAction) {
|
|
205
|
+
AssetActionNone = -1,
|
|
206
|
+
AssetActionBind = 0,
|
|
207
|
+
AssetActionAuthorizeCSR = 1,
|
|
208
|
+
AssetActionAuthenticate = 2,
|
|
209
|
+
AssetActionAuthenticateWithPIN = 3,
|
|
210
|
+
AssetActionSignWithPIN = 7,
|
|
211
|
+
AssetActionDecryptWithPIN = 9,
|
|
212
|
+
AssetActionUnlock = 10,
|
|
213
|
+
AssetActionResetPIN = 11
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
typedef NS_ENUM(NSInteger, PushMessageAction) {
|
|
217
|
+
PushMessageActionNone = 0,
|
|
218
|
+
PushMessageActionRevoke = 1,
|
|
219
|
+
PushMessageActionReverseIdentify = 2
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
#endif /* Constants_h */
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DeviceBindProtocol.h
|
|
3
|
+
// Authenticate
|
|
4
|
+
//
|
|
5
|
+
// Created by Rogier van de Pol on 03-03-15.
|
|
6
|
+
// Copyright © 2019 Ubiqu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "ProtocolBase.h"
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@interface DeviceBindProtocol : ProtocolBase
|
|
14
|
+
|
|
15
|
+
typedef NS_ENUM(NSInteger, DeviceBindProtocolError) {
|
|
16
|
+
DeviceBindProtocolErrorUnknown = -1,
|
|
17
|
+
DeviceBindProtocolErrorUnexpectedCommand = -2000,
|
|
18
|
+
DeviceBindProtocolErrorRejected = -2001,
|
|
19
|
+
DeviceBindProtocolErrorBlocked = -2002
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
Designated initializer.
|
|
24
|
+
|
|
25
|
+
@param asset The asset for which to perform a server ping.
|
|
26
|
+
*/
|
|
27
|
+
- (id _Nullable)initWithAsset:(Asset * _Nullable)asset;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
Sends a ping message to the server.
|
|
31
|
+
|
|
32
|
+
@param completion Completion block to be executed upon receiving a response to the Ping message (or if an error occurs).
|
|
33
|
+
*/
|
|
34
|
+
- (void)doDeviceBind:(BOOL)invalidate completion:(void (^)(BOOL, NSError *))completion;
|
|
35
|
+
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
@class ChannelState;
|
|
4
|
+
|
|
5
|
+
#import "UBQPacket.h"
|
|
6
|
+
|
|
7
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
8
|
+
|
|
9
|
+
@interface DomainSecurityModule : NSObject
|
|
10
|
+
|
|
11
|
+
/// Verifies the message authentication code (MAC) on a packet using the specified (wrapped) key.
|
|
12
|
+
- (BOOL)verifyUbiquPacket:(UBQPacket *)packet withWrappedKey:(NSData *)wrappedKey;
|
|
13
|
+
|
|
14
|
+
/// Verifies the message authentication code (MAC) on a packet.
|
|
15
|
+
- (BOOL)verifyUbiquPacket:(UBQPacket *)packet withChannelState:(ChannelState *)channelState;
|
|
16
|
+
|
|
17
|
+
/// Signs a packet with the currently active key
|
|
18
|
+
- (UBQPacket *)signUbiquPacket:(UBQPacket *)packet withChannelState:(ChannelState *)channelState;
|
|
19
|
+
|
|
20
|
+
/// Compute the key (used for UBQ protocol) from a device nonce and a server nonce.
|
|
21
|
+
- (NSData *)computeKeyFromDeviceNonce:(NSData *)deviceNonce andServerNonce:(NSData *)serverNonce;
|
|
22
|
+
|
|
23
|
+
/// Returns the key to be used to sign and verify the serialized channeld states.
|
|
24
|
+
- (NSData *)keyForChannelStateMac:(BOOL)overwrite;
|
|
25
|
+
|
|
26
|
+
/// Encrypts data using the channelState's master key if present, or otherwise the currently active key
|
|
27
|
+
- (NSData *)encrypt:(NSData *)data overwrite:(BOOL)overwrite withChannelState:(ChannelState *)channelState;
|
|
28
|
+
- (NSData *)encryptWithIv:(NSData *)data overwrite:(BOOL)overwrite withChannelState:(ChannelState *)channelState;
|
|
29
|
+
- (NSData *)encryptBiometrics:(NSData *)data overwrite:(BOOL)overwrite withChannelState:(ChannelState *)channelState;
|
|
30
|
+
|
|
31
|
+
/// Decrypts data using the channelState's master key if persent, or otherwise the currently active key
|
|
32
|
+
- (NSData *)decrypt:(NSData *)data overwrite:(BOOL)overwrite withChannelState:(ChannelState *)channelState;
|
|
33
|
+
|
|
34
|
+
- (NSData *)decryptNoPadding:(NSData *)data overwrite:(BOOL)overwrite withChannelState:(ChannelState *)channelState;
|
|
35
|
+
- (void)repackKeys:(ChannelState *)channelState;
|
|
36
|
+
- (NSData *)unwrapSvmFromChannelState:(ChannelState *)channelState;
|
|
37
|
+
- (NSData *)wrapSvm:(NSData *)svm;
|
|
38
|
+
|
|
39
|
+
- (NSData *)keyForChannelStateMacOld:(BOOL)overwrite;
|
|
40
|
+
|
|
41
|
+
@end
|
|
42
|
+
|
|
43
|
+
NS_ASSUME_NONNULL_END
|
package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ErrorDomains.h
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ErrorDomains.h
|
|
3
|
+
// Authenticate
|
|
4
|
+
//
|
|
5
|
+
// Created by Rogier van de Pol on 14-01-15.
|
|
6
|
+
// Copyright (c) 2015 Ubiqu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
/*** Communication Error Domain ***/
|
|
12
|
+
extern NSString * const kCommunicationErrorDomain;
|
|
13
|
+
|
|
14
|
+
typedef NS_ENUM(NSInteger, CommunicationError) {
|
|
15
|
+
CommunicationErrorUnknown = -1,
|
|
16
|
+
CommunicationErrorNoInternet = -201,
|
|
17
|
+
CommunicationErrorNoWiFi = -202,
|
|
18
|
+
CommunicationErrorNoWWAN = -203,
|
|
19
|
+
CommunicationErrorNoInternetWifiDisabled = -204
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/*** Security Error Domain ***/
|
|
23
|
+
extern NSString * const kSecurityErrorDomain;
|
|
24
|
+
|
|
25
|
+
typedef NS_ENUM(NSInteger, SecurityError) {
|
|
26
|
+
SecurityErrorUnknown = -1,
|
|
27
|
+
SecurityErrorSecureStateFileDoesNotExist = -1000,
|
|
28
|
+
SecurityErrorPersistedStateDoesNotValidate = -1001,
|
|
29
|
+
SecurityErrorValueHasWrongLength = -1002,
|
|
30
|
+
SecurityErrorSecureStateUninitialized = -1003,
|
|
31
|
+
SecurityErrorAttemptingOverwrite = -1004,
|
|
32
|
+
SecurityErrorIllegalAccess = -1005,
|
|
33
|
+
SecurityErrorCouldNotGenerateMasterKey = -1006,
|
|
34
|
+
SecurityErrorWrapKeyFailed = -1007,
|
|
35
|
+
SecurityErrorUnwrapKeyFailed = -1008,
|
|
36
|
+
SecurityErrorInvalidMAC = -1009,
|
|
37
|
+
SecurityErrorInvalidReceiver = -1010,
|
|
38
|
+
SecurityErrorAESError = -1011,
|
|
39
|
+
SecurityErrorInvalidKeyData = -1012,
|
|
40
|
+
SecurityErrorInvalidDeviceIdentifier = -1013,
|
|
41
|
+
SecurityErrorDeviceCompromised = -1014,
|
|
42
|
+
SecurityErrorPackageIntegrityCompromised = -1015
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/*** Ubiqu Protocol Error Domain ***/
|
|
46
|
+
extern NSString * const kUbiquProtocolErrorDomain;
|
|
47
|
+
|
|
48
|
+
typedef NS_ENUM(NSInteger, UbiquProtocolError) {
|
|
49
|
+
UbiquProtocolErrorUnknown = -1,
|
|
50
|
+
UbiquProtocolErrorNoHexString = -1000,
|
|
51
|
+
UbiquProtocolErrorHexStringTooShort = -1001,
|
|
52
|
+
UbiquProtocolErrorInvalidVersion = -1002,
|
|
53
|
+
UbiquProtocolErrorInvalidLength = -1003,
|
|
54
|
+
UbiquProtocolErrorAssetRevoked = -6001,
|
|
55
|
+
UbiquProtocolErrorDeviceChanged = -6002
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Key in userInfo. A standard way to embed ApplicationMessages.
|
|
59
|
+
extern NSString * const kApplicationMessageKey;
|
|
60
|
+
|
|
61
|
+
// Key in userInfo. A standard way to embed a byte array. The value of this key should be an NSData.
|
|
62
|
+
extern NSString * const kDataKey;
|
|
63
|
+
|
|
64
|
+
// Key in userInfo. A standard way to embed a CardRequest.
|
|
65
|
+
extern NSString * const kCardRequestKey;
|
|
66
|
+
|
|
67
|
+
extern NSString * const kAssetKey; // Key in userInfo. A standard way to embed an Asset.
|
|
68
|
+
extern NSString * const kAssetRequestTokenKey; // Key in userInfo. A standard way to embed an AssetRequest token.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FreeAssetProtocol.h
|
|
3
|
+
// Authenticate
|
|
4
|
+
//
|
|
5
|
+
// Created by Rogier van de Pol on 05-02-15.
|
|
6
|
+
// Copyright (c) 2015 Ubiqu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "ProtocolBase.h"
|
|
10
|
+
|
|
11
|
+
/*** FreeAssetProtocol Error Domain ***/
|
|
12
|
+
|
|
13
|
+
extern NSString * const kFreeAssetProtocolErrorDomain;
|
|
14
|
+
|
|
15
|
+
typedef NS_ENUM(NSInteger, FreeAssetProtocolError)
|
|
16
|
+
{
|
|
17
|
+
FreeAssetProtocolErrorUnknown = -1,
|
|
18
|
+
FreeAssetProtocolErrorUnexpectedCommand = -1000,
|
|
19
|
+
FreeAssetProtocolErrorInvalidSubscriptionNonce = -1001,
|
|
20
|
+
FreeAssetProtocolErrorSubscriptionNonceNotFound = -1002,
|
|
21
|
+
FreeAssetProtocolErrorNoDeviceNonce = -1003,
|
|
22
|
+
FreeAssetProtocolErrorNoEphemeralKey = -1004,
|
|
23
|
+
FreeAssetProtocolErrorInvalidRegistrationResponse = -1005,
|
|
24
|
+
FreeAssetProtocolErrorDeviceNonceDidNotMatch = -1006,
|
|
25
|
+
FreeAssetProtocolErrorInvalidIDPToken = 1007
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
extern NSString * const kSubscriptionNonceKey;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@interface FreeAssetProtocol : ProtocolBase
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
@brief Sends a Registration request to the server (along with a subscription nonce).
|
|
35
|
+
|
|
36
|
+
@param completion Completion block to be executed upon completion of the registration request (or if an error occurs)
|
|
37
|
+
*/
|
|
38
|
+
- (void)doFreeAssetWithCompletionBlock:(void (^)(BOOL, NSData *, NSData *, NSError *))completion;
|
|
39
|
+
|
|
40
|
+
@end
|
package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/GDataXMLNode.h
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/* Copyright (c) 2008 Google Inc.
|
|
2
|
+
*
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// These node, element, and document classes implement a subset of the methods
|
|
17
|
+
// provided by NSXML. While NSXML behavior is mimicked as much as possible,
|
|
18
|
+
// there are important differences.
|
|
19
|
+
//
|
|
20
|
+
// The biggest difference is that, since this is based on libxml2, there
|
|
21
|
+
// is no retain model for the underlying node data. Rather than copy every
|
|
22
|
+
// node obtained from a parse tree (which would have a substantial memory
|
|
23
|
+
// impact), we rely on weak references, and it is up to the code that
|
|
24
|
+
// created a document to retain it for as long as any
|
|
25
|
+
// references rely on nodes inside that document tree.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#import <Foundation/Foundation.h>
|
|
29
|
+
// libxml includes require that the target Header Search Paths contain
|
|
30
|
+
//
|
|
31
|
+
// /usr/include/libxml2
|
|
32
|
+
//
|
|
33
|
+
// and Other Linker Flags contain
|
|
34
|
+
//
|
|
35
|
+
// -lxml2
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#import <libxml/tree.h>
|
|
39
|
+
#import <libxml/parser.h>
|
|
40
|
+
#import <libxml/xmlstring.h>
|
|
41
|
+
#import <libxml/xpath.h>
|
|
42
|
+
#import <libxml/xpathInternals.h>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) || defined(GDATA_TARGET_NAMESPACE)
|
|
46
|
+
// we need NSInteger for the 10.4 SDK, or we're using target namespace macros
|
|
47
|
+
#import "GDataDefines.h"
|
|
48
|
+
#endif
|
|
49
|
+
|
|
50
|
+
#undef _EXTERN
|
|
51
|
+
#undef _INITIALIZE_AS
|
|
52
|
+
#ifdef GDATAXMLNODE_DEFINE_GLOBALS
|
|
53
|
+
#define _EXTERN
|
|
54
|
+
#define _INITIALIZE_AS(x) =x
|
|
55
|
+
#else
|
|
56
|
+
#define _EXTERN extern
|
|
57
|
+
#define _INITIALIZE_AS(x)
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
// when no namespace dictionary is supplied for XPath, the default namespace
|
|
61
|
+
// for the evaluated tree is registered with the prefix _def_ns
|
|
62
|
+
_EXTERN const char* kGDataXMLXPathDefaultNamespacePrefix _INITIALIZE_AS("_def_ns");
|
|
63
|
+
|
|
64
|
+
// Nomenclature for method names:
|
|
65
|
+
//
|
|
66
|
+
// Node = GData node
|
|
67
|
+
// XMLNode = xmlNodePtr
|
|
68
|
+
//
|
|
69
|
+
// So, for example:
|
|
70
|
+
// + (id)nodeConsumingXMLNode:(xmlNodePtr)theXMLNode;
|
|
71
|
+
|
|
72
|
+
@class NSArray, NSDictionary, NSError, NSString, NSURL;
|
|
73
|
+
@class GDataXMLElement, GDataXMLDocument;
|
|
74
|
+
|
|
75
|
+
enum {
|
|
76
|
+
GDataXMLInvalidKind = 0,
|
|
77
|
+
GDataXMLDocumentKind,
|
|
78
|
+
GDataXMLElementKind,
|
|
79
|
+
GDataXMLAttributeKind,
|
|
80
|
+
GDataXMLNamespaceKind,
|
|
81
|
+
GDataXMLProcessingInstructionKind,
|
|
82
|
+
GDataXMLCommentKind,
|
|
83
|
+
GDataXMLTextKind,
|
|
84
|
+
GDataXMLDTDKind,
|
|
85
|
+
GDataXMLEntityDeclarationKind,
|
|
86
|
+
GDataXMLAttributeDeclarationKind,
|
|
87
|
+
GDataXMLElementDeclarationKind,
|
|
88
|
+
GDataXMLNotationDeclarationKind
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
typedef NSUInteger GDataXMLNodeKind;
|
|
92
|
+
|
|
93
|
+
@interface GDataXMLNode : NSObject {
|
|
94
|
+
@protected
|
|
95
|
+
// NSXMLNodes can have a namespace URI or prefix even if not part
|
|
96
|
+
// of a tree; xmlNodes cannot. When we create nodes apart from
|
|
97
|
+
// a tree, we'll store the dangling prefix or URI in the xmlNode's name,
|
|
98
|
+
// like
|
|
99
|
+
// "prefix:name"
|
|
100
|
+
// or
|
|
101
|
+
// "{http://uri}:name"
|
|
102
|
+
//
|
|
103
|
+
// We will fix up the node's namespace and name (and those of any children)
|
|
104
|
+
// later when adding the node to a tree with addChild: or addAttribute:.
|
|
105
|
+
// See fixUpNamespacesForNode:.
|
|
106
|
+
|
|
107
|
+
xmlNodePtr xmlNode_; // may also be an xmlAttrPtr or xmlNsPtr
|
|
108
|
+
BOOL shouldFreeXMLNode_; // if yes, xmlNode_ will be free'd in dealloc
|
|
109
|
+
|
|
110
|
+
// cached values
|
|
111
|
+
NSString *cachedName_;
|
|
112
|
+
NSArray *cachedChildren_;
|
|
113
|
+
NSArray *cachedAttributes_;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
+ (GDataXMLElement *)elementWithName:(NSString *)name;
|
|
117
|
+
+ (GDataXMLElement *)elementWithName:(NSString *)name stringValue:(NSString *)value;
|
|
118
|
+
+ (GDataXMLElement *)elementWithName:(NSString *)name URI:(NSString *)value;
|
|
119
|
+
|
|
120
|
+
+ (id)attributeWithName:(NSString *)name stringValue:(NSString *)value;
|
|
121
|
+
+ (id)attributeWithName:(NSString *)name URI:(NSString *)attributeURI stringValue:(NSString *)value;
|
|
122
|
+
|
|
123
|
+
+ (id)namespaceWithName:(NSString *)name stringValue:(NSString *)value;
|
|
124
|
+
|
|
125
|
+
+ (id)textWithStringValue:(NSString *)value;
|
|
126
|
+
|
|
127
|
+
- (NSString *)stringValue;
|
|
128
|
+
- (void)setStringValue:(NSString *)str;
|
|
129
|
+
|
|
130
|
+
- (NSUInteger)childCount;
|
|
131
|
+
- (NSArray *)children;
|
|
132
|
+
- (GDataXMLNode *)childAtIndex:(unsigned)index;
|
|
133
|
+
|
|
134
|
+
- (NSString *)localName;
|
|
135
|
+
- (NSString *)name;
|
|
136
|
+
- (NSString *)prefix;
|
|
137
|
+
- (NSString *)URI;
|
|
138
|
+
|
|
139
|
+
- (GDataXMLNodeKind)kind;
|
|
140
|
+
|
|
141
|
+
- (NSString *)XMLString;
|
|
142
|
+
|
|
143
|
+
+ (NSString *)localNameForName:(NSString *)name;
|
|
144
|
+
+ (NSString *)prefixForName:(NSString *)name;
|
|
145
|
+
|
|
146
|
+
// This is the preferred entry point for nodesForXPath. This takes an explicit
|
|
147
|
+
// namespace dictionary (keys are prefixes, values are URIs).
|
|
148
|
+
- (NSArray *)nodesForXPath:(NSString *)xpath namespaces:(NSDictionary *)namespaces error:(NSError **)error;
|
|
149
|
+
|
|
150
|
+
// This implementation of nodesForXPath registers namespaces only from the
|
|
151
|
+
// document's root node. _def_ns may be used as a prefix for the default
|
|
152
|
+
// namespace, though there's no guarantee that the default namespace will
|
|
153
|
+
// be consistenly the same namespace in server responses.
|
|
154
|
+
- (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error;
|
|
155
|
+
|
|
156
|
+
// access to the underlying libxml node; be sure to release the cached values
|
|
157
|
+
// if you change the underlying tree at all
|
|
158
|
+
- (xmlNodePtr)XMLNode;
|
|
159
|
+
- (void)releaseCachedValues;
|
|
160
|
+
|
|
161
|
+
@end
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
@interface GDataXMLElement : GDataXMLNode
|
|
165
|
+
|
|
166
|
+
- (id)initWithXMLString:(NSString *)str error:(NSError **)error;
|
|
167
|
+
|
|
168
|
+
- (NSArray *)namespaces;
|
|
169
|
+
- (void)setNamespaces:(NSArray *)namespaces;
|
|
170
|
+
- (void)addNamespace:(GDataXMLNode *)aNamespace;
|
|
171
|
+
|
|
172
|
+
- (void)addChild:(GDataXMLNode *)child;
|
|
173
|
+
- (void)removeChild:(GDataXMLNode *)child;
|
|
174
|
+
|
|
175
|
+
- (NSArray *)elementsForName:(NSString *)name;
|
|
176
|
+
- (NSArray *)elementsForLocalName:(NSString *)localName URI:(NSString *)URI;
|
|
177
|
+
|
|
178
|
+
- (NSArray *)attributes;
|
|
179
|
+
- (GDataXMLNode *)attributeForName:(NSString *)name;
|
|
180
|
+
- (GDataXMLNode *)attributeForLocalName:(NSString *)name URI:(NSString *)attributeURI;
|
|
181
|
+
- (void)addAttribute:(GDataXMLNode *)attribute;
|
|
182
|
+
|
|
183
|
+
- (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI;
|
|
184
|
+
|
|
185
|
+
@end
|
|
186
|
+
|
|
187
|
+
@interface GDataXMLDocument : NSObject {
|
|
188
|
+
@protected
|
|
189
|
+
xmlDoc* xmlDoc_; // strong; always free'd in dealloc
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
- (id)initWithXMLString:(NSString *)str options:(unsigned int)mask error:(NSError **)error;
|
|
193
|
+
- (id)initWithData:(NSData *)data options:(unsigned int)mask error:(NSError **)error;
|
|
194
|
+
- (id)initWithRootElement:(GDataXMLElement *)element;
|
|
195
|
+
|
|
196
|
+
- (GDataXMLElement *)rootElement;
|
|
197
|
+
|
|
198
|
+
- (NSData *)XMLData;
|
|
199
|
+
|
|
200
|
+
- (void)setVersion:(NSString *)version;
|
|
201
|
+
- (void)setCharacterEncoding:(NSString *)encoding;
|
|
202
|
+
|
|
203
|
+
// This is the preferred entry point for nodesForXPath. This takes an explicit
|
|
204
|
+
// namespace dictionary (keys are prefixes, values are URIs).
|
|
205
|
+
- (NSArray *)nodesForXPath:(NSString *)xpath namespaces:(NSDictionary *)namespaces error:(NSError **)error;
|
|
206
|
+
|
|
207
|
+
// This implementation of nodesForXPath registers namespaces only from the
|
|
208
|
+
// document's root node. _def_ns may be used as a prefix for the default
|
|
209
|
+
// namespace, though there's no guarantee that the default namespace will
|
|
210
|
+
// be consistenly the same namespace in server responses.
|
|
211
|
+
- (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error;
|
|
212
|
+
|
|
213
|
+
- (NSString *)description;
|
|
214
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSDictionary+Utilities.h
|
|
3
|
+
// Authenticate
|
|
4
|
+
//
|
|
5
|
+
// Created by Rogier van de Pol on 07-10-14.
|
|
6
|
+
// Copyright (c) 2014 Ubiqu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@interface NSDictionary (Utilities)
|
|
14
|
+
|
|
15
|
+
+ (NSDictionary *)dictionaryBySplittingQueryString:(NSString *)query keysLowerCase:(BOOL)lowerCase;
|
|
16
|
+
+ (NSDictionary *)dictionaryBySplittingQueryString:(NSString *)query;
|
|
17
|
+
|
|
18
|
+
- (NSString *)queryString;
|
|
19
|
+
- (NSString *)queryStringWithoutKeys:(NSArray * _Nullable)skipKeys;
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSFileManager+Utilities.h
|
|
3
|
+
// Authenticate
|
|
4
|
+
//
|
|
5
|
+
// Created by Rogier van de Pol on 14-01-15.
|
|
6
|
+
// Copyright (c) 2015 Ubiqu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@interface NSFileManager (Utilities)
|
|
14
|
+
|
|
15
|
+
+ (NSString *)pathForUserFile:(NSString *)fileName;
|
|
16
|
+
+ (NSString * _Nullable)pathForStateFile:(NSString *)fileName;
|
|
17
|
+
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
NS_ASSUME_NONNULL_END
|