peachsim 0.1.2369 → 0.1.2370
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +173 -76
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +172 -75
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +173 -76
- package/dist-lib/host/fetch-proxy-handler.cjs +7 -5
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +7 -5
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +7 -5
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +178 -81
- package/dist-lib/swift-compile.cjs +32 -13
- package/dist-lib/swift-compile.mjs +32 -13
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +151 -72
- package/dist-lib/vite.cjs +7 -5
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +14 -0
- package/node-runtime.json +1 -1
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/DeviceCheck.framework/Headers/DCAppAttestService.h +223 -0
- package/sdk/ios/System/Library/Frameworks/DeviceCheck.framework/Headers/DCDevice.h +90 -0
- package/sdk/ios/System/Library/Frameworks/DeviceCheck.framework/Headers/DCError.h +52 -0
- package/sdk/ios/System/Library/Frameworks/DeviceCheck.framework/Headers/DeviceCheck.h +13 -0
- package/sdk/ios/System/Library/Frameworks/DeviceCheck.framework/Modules/module.modulemap +6 -0
- package/sdk/ios/usr/include/_modules/_Availability.h +33 -0
- package/sdk/ios/usr/include/_modules/_os_availability.h +33 -0
- package/sdk/ios/usr/include/availability.modulemap +50 -0
- package/sdk/ios/usr/include/module.modulemap +4 -0
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +77 -0
- package/sdk/ios/usr/lib/swift/StoreKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -0
- package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +23 -0
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
- package/src/native-static-libraries.ts +16 -16
- package/src/podspec-sources.ts +19 -1
- package/src/swift-compile.ts +38 -24
- package/src/swift-objc-standin.ts +11 -5
- package/src/swift-packages.ts +40 -28
- package/src/swift-shipped-binaries.ts +6 -2
- package/src/swift-standin-emit.ts +65 -11
- package/src/swift-standins.ts +30 -4
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DCAppAttestService.h
|
|
3
|
+
// DeviceCheck
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2020 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#import <DeviceCheck/DeviceCheck.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
_DC_EXPORT
|
|
14
|
+
API_AVAILABLE(macos(11.0), ios(14.0), tvos(15.0), watchos(9.0))
|
|
15
|
+
/// A service that you use to validate the instance of your app running on a
|
|
16
|
+
/// device.
|
|
17
|
+
///
|
|
18
|
+
/// Use the ``DeviceCheck/DCAppAttestService/sharedService`` instance of the
|
|
19
|
+
/// ``DeviceCheck/DCAppAttestService`` class to assert the legitimacy of a
|
|
20
|
+
/// particular instance of your app to your server. After ensuring service
|
|
21
|
+
/// availability by reading the ``DeviceCheck/DCAppAttestService/supported``
|
|
22
|
+
/// property, you use the service to:
|
|
23
|
+
///
|
|
24
|
+
/// - Create a cryptographic key in the Secure Enclave by calling the
|
|
25
|
+
/// ``DeviceCheck/DCAppAttestService/generateKeyWithCompletionHandler:`` method.
|
|
26
|
+
/// - Ask Apple to certify the key by calling the
|
|
27
|
+
/// ``DeviceCheck/DCAppAttestService/attestKey:clientDataHash:completionHandler:``
|
|
28
|
+
/// method. - Prepare an assertion of your app’s integrity to accompany any or
|
|
29
|
+
/// all server requests using the
|
|
30
|
+
/// ``DeviceCheck/DCAppAttestService/generateAssertion:clientDataHash:completionHandler:``
|
|
31
|
+
/// method.
|
|
32
|
+
///
|
|
33
|
+
/// For more information about how to support App Attest in your app, see
|
|
34
|
+
/// <doc:establishing-your-app-s-integrity>. For information about the
|
|
35
|
+
/// complementary procedures you implement on your server, see
|
|
36
|
+
/// <doc:validating-apps-that-connect-to-your-server>.
|
|
37
|
+
///
|
|
38
|
+
/// - Note: To use the App Attest service, your app must have an app ID that you
|
|
39
|
+
/// register on the [Apple Developer](https://developer.apple.com/account/)
|
|
40
|
+
/// website.
|
|
41
|
+
@interface DCAppAttestService : NSObject
|
|
42
|
+
|
|
43
|
+
/// The shared App Attest service that you use to validate your app.
|
|
44
|
+
///
|
|
45
|
+
/// Use the shared instance of the service to generate and to certify a
|
|
46
|
+
/// cryptographic key, and then to assert your app’s validity using that key.
|
|
47
|
+
@property (class, readonly) DCAppAttestService *sharedService;
|
|
48
|
+
|
|
49
|
+
/// A Boolean value that indicates whether a particular device provides the App
|
|
50
|
+
/// Attest service.
|
|
51
|
+
///
|
|
52
|
+
/// > Important: Not all device types support the App Attest service, so check
|
|
53
|
+
/// > for support before using the service.
|
|
54
|
+
/// >
|
|
55
|
+
/// > If you read ``DeviceCheck/DCAppAttestService/supported`` from an app running
|
|
56
|
+
/// > on a Mac device, the value is
|
|
57
|
+
/// > <doc://com.apple.documentation/documentation/swift/false>. This includes
|
|
58
|
+
/// > Mac Catalyst apps, and iOS or iPadOS apps running on Apple silicon.
|
|
59
|
+
///
|
|
60
|
+
/// If you read ``DeviceCheck/DCAppAttestService/supported`` from within an app
|
|
61
|
+
/// extension, the value might be
|
|
62
|
+
/// <doc://com.apple.documentation/documentation/swift/true> or
|
|
63
|
+
/// <doc://com.apple.documentation/documentation/swift/false>, depending on
|
|
64
|
+
/// the extension type. However, most extensions don’t support App Attest. The
|
|
65
|
+
/// ``DeviceCheck/DCAppAttestService/generateKeyWithCompletionHandler:`` method
|
|
66
|
+
/// fails when you call it from an app extension, regardless of the value of
|
|
67
|
+
/// ``DeviceCheck/DCAppAttestService/supported``.
|
|
68
|
+
///
|
|
69
|
+
/// The only app extensions that support App Attest are watchOS extensions in
|
|
70
|
+
/// watchOS 9 or later. For these extensions, you can use the results from
|
|
71
|
+
/// ``DeviceCheck/DCAppAttestService/supported`` to indicate whether your
|
|
72
|
+
/// WatchKit extension bypasses attestation.
|
|
73
|
+
@property (getter=isSupported, readonly) BOOL supported;
|
|
74
|
+
|
|
75
|
+
/// Creates a new cryptographic key for use with the App Attest service.
|
|
76
|
+
///
|
|
77
|
+
/// > Concurrency Note: You can call this method from synchronous code using a completion handler,
|
|
78
|
+
/// > as shown on this page, or you can call it as an asynchronous method that has the
|
|
79
|
+
/// > following declaration:
|
|
80
|
+
/// >
|
|
81
|
+
/// > ```swift
|
|
82
|
+
/// > func generateKey() async throws -> String
|
|
83
|
+
/// > ```
|
|
84
|
+
/// > For example:
|
|
85
|
+
/// > ```swift
|
|
86
|
+
/// > let keyIdentifier = try await generateKey()
|
|
87
|
+
/// > ```
|
|
88
|
+
/// > For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/swift/calling-objective-c-apis-asynchronously>.
|
|
89
|
+
///
|
|
90
|
+
/// Call this method to request the creation of a secure, unattested key pair on
|
|
91
|
+
/// a device for a specific user. On success, the method provides your app with
|
|
92
|
+
/// an identifier that represents the key pair stored in the Secure Enclave.
|
|
93
|
+
/// Because there’s no way to use or retrieve the key without the identifier,
|
|
94
|
+
/// you’ll want to either record it in your app or on your server right away. If
|
|
95
|
+
/// key generation fails, the closure provides a ``DeviceCheck/DCError-swift.struct`` that
|
|
96
|
+
/// indicates the reason for the failure.
|
|
97
|
+
///
|
|
98
|
+
/// Create a unique key for each user account on a device. Otherwise it’s hard
|
|
99
|
+
/// to detect an attack that uses a single compromised device to serve multiple
|
|
100
|
+
/// remote users running a compromised version of your app. For more
|
|
101
|
+
/// information, see <doc:assessing-fraud-risk>.
|
|
102
|
+
///
|
|
103
|
+
/// After you get the identifier, you call the
|
|
104
|
+
/// ``DeviceCheck/DCAppAttestService/attestKey:clientDataHash:completionHandler:``
|
|
105
|
+
/// method with the key identifier to ask Apple to attest to the validity of the
|
|
106
|
+
/// associated key. Later, you call the
|
|
107
|
+
/// ``DeviceCheck/DCAppAttestService/generateAssertion:clientDataHash:completionHandler:``
|
|
108
|
+
/// method with the key identifier to answer a challenge from your server, and
|
|
109
|
+
/// establish the legitimacy of this instance of your app.
|
|
110
|
+
///
|
|
111
|
+
/// - Parameters:
|
|
112
|
+
/// - completionHandler: A closure that the method calls upon completion with
|
|
113
|
+
/// the following parameters:
|
|
114
|
+
/// - `keyId`: An identifier that you use to refer to the key. The framework securely
|
|
115
|
+
/// stores the key in the Secure Enclave.
|
|
116
|
+
/// - `error`: A ``DeviceCheck/DCError-swift.struct`` instance that indicates the
|
|
117
|
+
/// reason for failure, or `nil` on success.
|
|
118
|
+
- (void)generateKeyWithCompletionHandler:(void (^)(NSString * _Nullable keyId, NSError * _Nullable error))completionHandler;
|
|
119
|
+
|
|
120
|
+
/// Asks Apple to attest to the validity of a generated cryptographic key.
|
|
121
|
+
///
|
|
122
|
+
/// > Concurrency Note: You can call this method from synchronous code using a completion handler,
|
|
123
|
+
/// > as shown on this page, or you can call it as an asynchronous method that has the
|
|
124
|
+
/// > following declaration:
|
|
125
|
+
/// >
|
|
126
|
+
/// > ```swift
|
|
127
|
+
/// > func attestKey(_ keyId: String, clientDataHash: Data) async throws -> Data
|
|
128
|
+
/// > ```
|
|
129
|
+
/// >
|
|
130
|
+
/// > For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/swift/calling-objective-c-apis-asynchronously>.
|
|
131
|
+
///
|
|
132
|
+
/// This method asks Apple to attest to the validity of a key that you
|
|
133
|
+
/// previously generated with a call to the
|
|
134
|
+
/// ``DeviceCheck/DCAppAttestService/generateKeyWithCompletionHandler:`` method.
|
|
135
|
+
/// Provide the method with both the key identifier and a computed hash of a
|
|
136
|
+
/// data block that includes a one-time challenge from your server to prevent
|
|
137
|
+
/// replay attacks. For example, you can use CryptoKit to create a
|
|
138
|
+
/// <doc://com.apple.documentation/documentation/cryptokit/sha256> hash of
|
|
139
|
+
/// challenge data:
|
|
140
|
+
///
|
|
141
|
+
/// ```swift
|
|
142
|
+
/// import CryptoKit let hash = Data(SHA256.hash(data: challenge)) // A
|
|
143
|
+
/// challenge from your server.
|
|
144
|
+
/// ```
|
|
145
|
+
/// The attest method calls its completion handler to return an attestation
|
|
146
|
+
/// object to you, which you must send to your server for verification. A
|
|
147
|
+
/// compromised version of your app could falsify the verification result, thus
|
|
148
|
+
/// circumventing App Attest.
|
|
149
|
+
///
|
|
150
|
+
/// If you successfully verify the attestation object on your server, as
|
|
151
|
+
/// described in <doc:validating-apps-that-connect-to-your-server>, then you can
|
|
152
|
+
/// associate the key identifier with the user on the device for future
|
|
153
|
+
/// reference. You’ll need the identifier to generate assertions with calls to
|
|
154
|
+
/// ``DeviceCheck/DCAppAttestService/generateAssertion:clientDataHash:completionHandler:``.
|
|
155
|
+
/// If your server fails to verify the attestation object, discard the key
|
|
156
|
+
/// identifier.
|
|
157
|
+
///
|
|
158
|
+
/// If the method’s completion handler returns the
|
|
159
|
+
/// ``DeviceCheck/DCError-swift.struct/serverUnavailable`` error — typically due to network
|
|
160
|
+
/// connectivity issues — it means that the framework failed to reach the App
|
|
161
|
+
/// Attest service to complete the attestation. In this case, retry attestation
|
|
162
|
+
/// again using the same key and client data hash later to avoid unnecessarily
|
|
163
|
+
/// generating new keys. Retrying with the same inputs helps to preserve the
|
|
164
|
+
/// risk metric for a given device.
|
|
165
|
+
///
|
|
166
|
+
/// - Parameters:
|
|
167
|
+
/// - keyId: The identifier you received when generating a cryptographic key by
|
|
168
|
+
/// calling the
|
|
169
|
+
/// ``DeviceCheck/DCAppAttestService/generateKeyWithCompletionHandler:`` method.
|
|
170
|
+
/// - clientDataHash: A SHA256 hash of a unique, single-use data block that
|
|
171
|
+
/// embeds a challenge from your server. Should be at least 16 bytes in length.
|
|
172
|
+
/// - completionHandler: A closure that the method calls upon completion with
|
|
173
|
+
/// the following parameters:
|
|
174
|
+
/// - `attestationObject`: A statement from Apple about the validity of the key
|
|
175
|
+
/// associated with `keyId`. Send this to your server for processing.
|
|
176
|
+
/// - `error`: A ``DeviceCheck/DCError-swift.struct`` instance that indicates the reason for
|
|
177
|
+
/// failure, or `nil` on success.
|
|
178
|
+
- (void)attestKey:(NSString *)keyId clientDataHash:(NSData *)clientDataHash completionHandler:(void (^)(NSData * _Nullable attestationObject, NSError * _Nullable error))completionHandler;
|
|
179
|
+
|
|
180
|
+
/// Creates a block of data that demonstrates the legitimacy of an instance of
|
|
181
|
+
/// your app running on a device.
|
|
182
|
+
///
|
|
183
|
+
/// > Concurrency Note: You can call this method from synchronous code using a completion handler,
|
|
184
|
+
/// > as shown on this page, or you can call it as an asynchronous method that has the
|
|
185
|
+
/// > following declaration:
|
|
186
|
+
/// >
|
|
187
|
+
/// > ```swift
|
|
188
|
+
/// > func generateAssertion(_ keyId: String, clientDataHash: Data) async throws -> Data
|
|
189
|
+
/// > ```
|
|
190
|
+
/// >
|
|
191
|
+
/// > For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/swift/calling-objective-c-apis-asynchronously>.
|
|
192
|
+
///
|
|
193
|
+
/// After generating a key with the
|
|
194
|
+
/// ``DeviceCheck/DCAppAttestService/generateKeyWithCompletionHandler:`` method
|
|
195
|
+
/// and validating it with the
|
|
196
|
+
/// ``DeviceCheck/DCAppAttestService/attestKey:clientDataHash:completionHandler:``
|
|
197
|
+
/// method, you can use the key at critical moments in your app’s life cycle —
|
|
198
|
+
/// like when a user tries to access premium content — to reaffirm the
|
|
199
|
+
/// legitimacy of a given instance of your app. Do this by using the
|
|
200
|
+
/// ``DeviceCheck/DCAppAttestService/generateAssertion:clientDataHash:completionHandler:``
|
|
201
|
+
/// method to sign server requests with your attested key.
|
|
202
|
+
///
|
|
203
|
+
/// You provide the key identifier and a hash of the request that includes a
|
|
204
|
+
/// challenge from your server to prevent replay attacks, where an attacker
|
|
205
|
+
/// reuses captured network traffic to pose as someone else. The method returns
|
|
206
|
+
/// an assertion object in its completion handler that you send to your server
|
|
207
|
+
/// for verification, as described in <doc:establishing-your-app-s-integrity>.
|
|
208
|
+
///
|
|
209
|
+
/// - Parameters:
|
|
210
|
+
/// - keyId: The identifier you received when generating a cryptographic key by
|
|
211
|
+
/// calling the
|
|
212
|
+
/// ``DeviceCheck/DCAppAttestService/generateKeyWithCompletionHandler:`` method.
|
|
213
|
+
/// - clientDataHash: A SHA256 hash of a unique, single-use data block that
|
|
214
|
+
/// represents the client data to be signed with the attested private key. Should be at least 16 bytes in length.
|
|
215
|
+
/// - completionHandler: A closure that the method calls upon completion with
|
|
216
|
+
/// the following parameters:
|
|
217
|
+
/// - `assertionObject`: A data structure that you send to your server for processing.
|
|
218
|
+
/// - `error` : A ``DeviceCheck/DCError-swift.struct`` instance that indicates the reason for failure, or `nil` on success.
|
|
219
|
+
- (void)generateAssertion:(NSString *)keyId clientDataHash:(NSData *)clientDataHash completionHandler:(void (^)(NSData * _Nullable assertionObject, NSError * _Nullable error))completionHandler;
|
|
220
|
+
|
|
221
|
+
@end
|
|
222
|
+
|
|
223
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DCDevice.h
|
|
3
|
+
// DeviceCheck
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2017 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <DeviceCheck/DeviceCheck.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
_DC_EXPORT
|
|
13
|
+
API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0), watchos(9.0))
|
|
14
|
+
/// A representation of a device that provides a unique, authenticated token.
|
|
15
|
+
///
|
|
16
|
+
/// Use the shared instance of the `DCDevice` class to generate a
|
|
17
|
+
/// token that identifies a device. Call the
|
|
18
|
+
/// ``DeviceCheck/DCDevice/generateTokenWithCompletionHandler:`` method to get
|
|
19
|
+
/// the token, and then send it to your server:
|
|
20
|
+
///
|
|
21
|
+
/// ```swift
|
|
22
|
+
/// if DCDevice.current.isSupported { // Always test for availability.
|
|
23
|
+
/// DCDevice.current.generateToken { token, error in
|
|
24
|
+
/// guard error == nil else { /* Handle the error. */ }
|
|
25
|
+
///
|
|
26
|
+
/// // Send the token to your server.
|
|
27
|
+
/// }
|
|
28
|
+
/// }
|
|
29
|
+
/// ```
|
|
30
|
+
///
|
|
31
|
+
/// On your server, combine the token with an authentication key that you obtain
|
|
32
|
+
/// from Apple, and use the result to request access to two per-device binary
|
|
33
|
+
/// digits (bits). After authenticating the device, Apple passes the current
|
|
34
|
+
/// values of the bits, along with the date they were last modified, to your
|
|
35
|
+
/// server. Your server applies its business logic to this information and
|
|
36
|
+
/// communicates the results to your app. For more information about server-side
|
|
37
|
+
/// procedures, see <doc:accessing-and-modifying-per-device-data>.
|
|
38
|
+
///
|
|
39
|
+
/// - Note: To use the `DCDevice` class, your app must have an app
|
|
40
|
+
/// ID that you register on the [Apple
|
|
41
|
+
/// Developer](https://developer.apple.com/account/) website.
|
|
42
|
+
///
|
|
43
|
+
/// Apple records the bits for you, and reports the bits back to you, but you’re
|
|
44
|
+
/// responsible for keeping track of what the bits mean. You’re also responsible
|
|
45
|
+
/// for determining when to reset the bits for a given device; for example, when
|
|
46
|
+
/// a user sells the device to someone else.
|
|
47
|
+
@interface DCDevice : NSObject
|
|
48
|
+
|
|
49
|
+
/// A representation of the device for which you want to query the two bits of
|
|
50
|
+
/// data.
|
|
51
|
+
@property (class, readonly) DCDevice *currentDevice;
|
|
52
|
+
|
|
53
|
+
/// A Boolean value that indicates whether the device supports the DeviceCheck
|
|
54
|
+
/// API.
|
|
55
|
+
@property (getter=isSupported, readonly) BOOL supported;
|
|
56
|
+
|
|
57
|
+
/// Generates a token that identifies the current device.
|
|
58
|
+
///
|
|
59
|
+
/// > Concurrency Note: You can call this method from synchronous code using a completion handler,
|
|
60
|
+
/// > as shown on this page, or you can call it as an asynchronous method that has the
|
|
61
|
+
/// > following declaration:
|
|
62
|
+
/// >
|
|
63
|
+
/// > ```swift
|
|
64
|
+
/// > func generateToken() async throws -> Data
|
|
65
|
+
/// > ```
|
|
66
|
+
/// > For example:
|
|
67
|
+
/// > ```swift
|
|
68
|
+
/// > let token = try await generateToken()
|
|
69
|
+
/// > ```
|
|
70
|
+
/// > For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/swift/calling-objective-c-apis-asynchronously>.
|
|
71
|
+
///
|
|
72
|
+
/// Your server uses the generated token in its requests to get or set the
|
|
73
|
+
/// persistent bits for the current device. You should treat the token you
|
|
74
|
+
/// receive in the completion block as single-use. Although the token remains
|
|
75
|
+
/// valid long enough for your server to retry a specific request if necessary,
|
|
76
|
+
/// you should not use a token multiple times. Instead, use this method to
|
|
77
|
+
/// generate a new token.
|
|
78
|
+
///
|
|
79
|
+
/// - Note: The app you use to generate the token must be associated with your
|
|
80
|
+
/// developer account; otherwise, the generation request fails.
|
|
81
|
+
///
|
|
82
|
+
/// - Parameters:
|
|
83
|
+
/// - completion: A completion block that includes the following parameters:
|
|
84
|
+
/// - `token`: An ephemeral token that identifies the current device.
|
|
85
|
+
/// - `error`: The error that occurred, if any.
|
|
86
|
+
- (void)generateTokenWithCompletionHandler:(void(^)(NSData * _Nullable token, NSError * _Nullable error))completion;
|
|
87
|
+
|
|
88
|
+
@end
|
|
89
|
+
|
|
90
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DCError.h
|
|
3
|
+
// DeviceCheck
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2017 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <DeviceCheck/DeviceCheck.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
/// The error domain for errors associated with DeviceCheck APIs.
|
|
13
|
+
extern NSErrorDomain const DCErrorDomain API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0), watchos(9.0));
|
|
14
|
+
/// DeviceCheck error codes.
|
|
15
|
+
|
|
16
|
+
typedef NS_ERROR_ENUM(DCErrorDomain, DCError) {
|
|
17
|
+
/// A failure has occurred, such as the failure to generate a token.
|
|
18
|
+
DCErrorUnknownSystemFailure,
|
|
19
|
+
/// DeviceCheck is unavailable on this device.
|
|
20
|
+
DCErrorFeatureUnsupported,
|
|
21
|
+
/// An error code that indicates when your app provides data that isn’t
|
|
22
|
+
/// formatted correctly.
|
|
23
|
+
DCErrorInvalidInput,
|
|
24
|
+
/// An error caused by a failed attempt to use the App Attest key.
|
|
25
|
+
///
|
|
26
|
+
/// You receive this error if something goes wrong with generating,
|
|
27
|
+
/// retrieving, or using an App Attest cryptographic key, when:
|
|
28
|
+
///
|
|
29
|
+
/// - You call
|
|
30
|
+
/// ``DeviceCheck/DCAppAttestService/attestKey:clientDataHash:completionHandler:``
|
|
31
|
+
/// for a key that’s already been attested.
|
|
32
|
+
/// - You call
|
|
33
|
+
/// ``DeviceCheck/DCAppAttestService/generateAssertion:clientDataHash:completionHandler:``
|
|
34
|
+
/// with an unattested key.
|
|
35
|
+
/// - The App Attest service cannot enforce the key access control policy on macOS.
|
|
36
|
+
/// - The App Attest service rejects the key.
|
|
37
|
+
DCErrorInvalidKey,
|
|
38
|
+
/// An error that indicates a failed attempt to contact the App Attest service
|
|
39
|
+
/// during an attestation.
|
|
40
|
+
///
|
|
41
|
+
/// You receive this error when you call
|
|
42
|
+
/// ``DeviceCheck/DCAppAttestService/attestKey:clientDataHash:completionHandler:``
|
|
43
|
+
/// and the framework isn’t able to complete the attestation. If you receive
|
|
44
|
+
/// this error, try the attestation again later using the same key and the same
|
|
45
|
+
/// value for the `clientDataHash` parameter. Retrying with the same inputs
|
|
46
|
+
/// helps to preserve the risk metric for a given device.
|
|
47
|
+
DCErrorServerUnavailable,
|
|
48
|
+
|
|
49
|
+
} API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0), watchos(9.0));
|
|
50
|
+
|
|
51
|
+
NS_ASSUME_NONNULL_END
|
|
52
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DeviceCheck.h
|
|
3
|
+
// DeviceCheck
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2017 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#define _DC_EXPORT __attribute__((visibility("default")))
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import <DeviceCheck/DCDevice.h>
|
|
12
|
+
#import <DeviceCheck/DCAppAttestService.h>
|
|
13
|
+
#import <DeviceCheck/DCError.h>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Apple Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* @APPLE_LICENSE_HEADER_START@
|
|
5
|
+
*
|
|
6
|
+
* This file contains Original Code and/or Modifications of Original Code
|
|
7
|
+
* as defined in and that are subject to the Apple Public Source License
|
|
8
|
+
* Version 2.0 (the 'License'). You may not use this file except in
|
|
9
|
+
* compliance with the License. Please obtain a copy of the License at
|
|
10
|
+
* http://www.opensource.apple.com/apsl/ and read it before using this
|
|
11
|
+
* file.
|
|
12
|
+
*
|
|
13
|
+
* The Original Code and all software distributed under the License are
|
|
14
|
+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
|
15
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
|
16
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
|
18
|
+
* Please see the License for the specific language governing rights and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*
|
|
21
|
+
* @APPLE_LICENSE_HEADER_END@
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
#ifndef __AVAILABILITY_H_
|
|
25
|
+
#define __AVAILABILITY_H_
|
|
26
|
+
|
|
27
|
+
#if !__building_module(os_availability)
|
|
28
|
+
#error "Do not include this header directly, include <Availability.h> instead"
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#include <Availability.h>
|
|
32
|
+
|
|
33
|
+
#endif /* __AVAILABILITY_H_ */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Apple Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* @APPLE_LICENSE_HEADER_START@
|
|
5
|
+
*
|
|
6
|
+
* This file contains Original Code and/or Modifications of Original Code
|
|
7
|
+
* as defined in and that are subject to the Apple Public Source License
|
|
8
|
+
* Version 2.0 (the 'License'). You may not use this file except in
|
|
9
|
+
* compliance with the License. Please obtain a copy of the License at
|
|
10
|
+
* http://www.opensource.apple.com/apsl/ and read it before using this
|
|
11
|
+
* file.
|
|
12
|
+
*
|
|
13
|
+
* The Original Code and all software distributed under the License are
|
|
14
|
+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
|
15
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
|
16
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
|
18
|
+
* Please see the License for the specific language governing rights and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*
|
|
21
|
+
* @APPLE_LICENSE_HEADER_END@
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
#ifndef __OS_AVAILABILITY_H_
|
|
25
|
+
#define __OS_AVAILABILITY_H_
|
|
26
|
+
|
|
27
|
+
#if !__building_module(os_availability)
|
|
28
|
+
#error "Do not include this header directly, include <os/availability.h> instead"
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#include <os/availability.h>
|
|
32
|
+
|
|
33
|
+
#endif /* __OS_AVAILABILITY_H_ */
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module os_availability [system] {
|
|
2
|
+
// General purpose API.
|
|
3
|
+
header "_modules/_os_availability.h"
|
|
4
|
+
export *
|
|
5
|
+
|
|
6
|
+
// Alternative API where os/availability.h can't
|
|
7
|
+
// be used, such as in POSIX headers.
|
|
8
|
+
explicit module Availability {
|
|
9
|
+
header "_modules/_Availability.h"
|
|
10
|
+
export *
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module _DarwinFoundation1 [system] {
|
|
15
|
+
explicit module availability {
|
|
16
|
+
// General purpose API.
|
|
17
|
+
header "os/availability.h"
|
|
18
|
+
export *
|
|
19
|
+
|
|
20
|
+
// Alternative API where os/availability.h can't
|
|
21
|
+
// be used, such as in POSIX headers.
|
|
22
|
+
explicit module Availability {
|
|
23
|
+
header "Availability.h"
|
|
24
|
+
export *
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Deprecated, use <os/availability.h> or <Availability.h> instead.
|
|
28
|
+
explicit module AvailabilityMacros {
|
|
29
|
+
header "AvailabilityMacros.h"
|
|
30
|
+
export *
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module _AvailabilityInternal [system] {
|
|
37
|
+
header "AvailabilityInternal.h"
|
|
38
|
+
export *
|
|
39
|
+
|
|
40
|
+
explicit module AvailabilityInternalLegacy {
|
|
41
|
+
header "AvailabilityInternalLegacy.h"
|
|
42
|
+
export *
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
explicit module AvailabilityVersions {
|
|
46
|
+
header "AvailabilityVersions.h"
|
|
47
|
+
export *
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -19,3 +19,7 @@ extern module Dispatch "dispatch.modulemap"
|
|
|
19
19
|
extern module dnssd "dnssd.modulemap"
|
|
20
20
|
extern module notify "notify.modulemap"
|
|
21
21
|
extern module Darwin "darwin.modulemap"
|
|
22
|
+
|
|
23
|
+
extern module os_availability "availability.modulemap"
|
|
24
|
+
extern module _DarwinFoundation1 "availability.modulemap"
|
|
25
|
+
extern module _AvailabilityInternal "availability.modulemap"
|
package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface
CHANGED
|
@@ -456,3 +456,80 @@ extension Foundation.Data : Swift.Hashable, Swift.Codable, Foundation.Contiguous
|
|
|
456
456
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
457
457
|
public func withUnsafeBytes<R>(_ body: (Swift.UnsafeRawBufferPointer) throws -> R) rethrows -> R
|
|
458
458
|
}
|
|
459
|
+
|
|
460
|
+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
|
|
461
|
+
public protocol ReferenceConvertible : Swift.CustomDebugStringConvertible, Swift.CustomStringConvertible, Swift.Hashable, Swift._ObjectiveCBridgeable {
|
|
462
|
+
associatedtype ReferenceType : ObjectiveC.NSObject, Foundation.NSCopying
|
|
463
|
+
}
|
|
464
|
+
@available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
|
|
465
|
+
public struct PersonNameComponents : Foundation.ReferenceConvertible, Swift.Hashable, Swift.Equatable, Swift.Sendable {
|
|
466
|
+
public typealias ReferenceType = Foundation.NSPersonNameComponents
|
|
467
|
+
public init()
|
|
468
|
+
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
|
469
|
+
public init(namePrefix: Swift.String? = nil, givenName: Swift.String? = nil, middleName: Swift.String? = nil, familyName: Swift.String? = nil, nameSuffix: Swift.String? = nil, nickname: Swift.String? = nil, phoneticRepresentation: Foundation.PersonNameComponents? = nil)
|
|
470
|
+
public var namePrefix: Swift.String? {
|
|
471
|
+
get
|
|
472
|
+
set
|
|
473
|
+
}
|
|
474
|
+
public var givenName: Swift.String? {
|
|
475
|
+
get
|
|
476
|
+
set
|
|
477
|
+
}
|
|
478
|
+
public var middleName: Swift.String? {
|
|
479
|
+
get
|
|
480
|
+
set
|
|
481
|
+
}
|
|
482
|
+
public var familyName: Swift.String? {
|
|
483
|
+
get
|
|
484
|
+
set
|
|
485
|
+
}
|
|
486
|
+
public var nameSuffix: Swift.String? {
|
|
487
|
+
get
|
|
488
|
+
set
|
|
489
|
+
}
|
|
490
|
+
public var nickname: Swift.String? {
|
|
491
|
+
get
|
|
492
|
+
set
|
|
493
|
+
}
|
|
494
|
+
public var phoneticRepresentation: Foundation.PersonNameComponents? {
|
|
495
|
+
get
|
|
496
|
+
set
|
|
497
|
+
}
|
|
498
|
+
public func hash(into hasher: inout Swift.Hasher)
|
|
499
|
+
@available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
|
|
500
|
+
public static func == (lhs: Foundation.PersonNameComponents, rhs: Foundation.PersonNameComponents) -> Swift.Bool
|
|
501
|
+
public var hashValue: Swift.Int {
|
|
502
|
+
get
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
@available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
|
|
506
|
+
extension Foundation.PersonNameComponents : Swift.CustomStringConvertible, Swift.CustomDebugStringConvertible, Swift.CustomReflectable {
|
|
507
|
+
public var description: Swift.String {
|
|
508
|
+
get
|
|
509
|
+
}
|
|
510
|
+
public var debugDescription: Swift.String {
|
|
511
|
+
get
|
|
512
|
+
}
|
|
513
|
+
public var customMirror: Swift.Mirror {
|
|
514
|
+
get
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
@available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
|
|
518
|
+
extension Foundation.PersonNameComponents : Swift._ObjectiveCBridgeable {
|
|
519
|
+
public static func _getObjectiveCType() -> any Any.Type
|
|
520
|
+
@_semantics("convertToObjectiveC") public func _bridgeToObjectiveC() -> Foundation.NSPersonNameComponents
|
|
521
|
+
public static func _forceBridgeFromObjectiveC(_ personNameComponents: Foundation.NSPersonNameComponents, result: inout Foundation.PersonNameComponents?)
|
|
522
|
+
public static func _conditionallyBridgeFromObjectiveC(_ personNameComponents: Foundation.NSPersonNameComponents, result: inout Foundation.PersonNameComponents?) -> Swift.Bool
|
|
523
|
+
@_effects(readonly) public static func _unconditionallyBridgeFromObjectiveC(_ source: Foundation.NSPersonNameComponents?) -> Foundation.PersonNameComponents
|
|
524
|
+
@available(macOS 10.11, iOS 9.0, tvOS 9.0, watchOS 2.0, *)
|
|
525
|
+
public typealias _ObjectiveCType = Foundation.NSPersonNameComponents
|
|
526
|
+
}
|
|
527
|
+
@available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
|
|
528
|
+
extension Foundation.NSPersonNameComponents : Swift._HasCustomAnyHashableRepresentation {
|
|
529
|
+
@nonobjc public func _toCustomAnyHashable() -> Swift.AnyHashable?
|
|
530
|
+
}
|
|
531
|
+
@available(macOS 10.11, iOS 9.0, watchOS 2.0, tvOS 9.0, *)
|
|
532
|
+
extension Foundation.PersonNameComponents : Swift.Codable {
|
|
533
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
534
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
535
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-module-flags: -target arm64-apple-ios16.0-simulator -enable-objc-interop -enable-library-evolution -module-name StoreKit
|
|
3
|
+
import Swift
|
|
4
|
+
public struct Transaction : Swift.Identifiable, Swift.Sendable {
|
|
5
|
+
public let id: Swift.UInt64
|
|
6
|
+
public typealias ID = Swift.UInt64
|
|
7
|
+
}
|
package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface
CHANGED
|
@@ -18,3 +18,26 @@ public struct AnyView : SwiftUICore.View {
|
|
|
18
18
|
public typealias Body = Swift.Never
|
|
19
19
|
public var body: Swift.Never { get }
|
|
20
20
|
}
|
|
21
|
+
public struct _DynamicPropertyBuffer {}
|
|
22
|
+
public struct _GraphInputs {}
|
|
23
|
+
public struct _GraphValue<Value> : Swift.Equatable {
|
|
24
|
+
public subscript<U>(keyPath: Swift.KeyPath<Value, U>) -> SwiftUICore._GraphValue<U> { get }
|
|
25
|
+
public static func == (a: SwiftUICore._GraphValue<Value>, b: SwiftUICore._GraphValue<Value>) -> Swift.Bool
|
|
26
|
+
}
|
|
27
|
+
public protocol DynamicProperty {
|
|
28
|
+
static func _makeProperty<V>(in buffer: inout SwiftUICore._DynamicPropertyBuffer, container: SwiftUICore._GraphValue<V>, fieldOffset: Swift.Int, inputs: inout SwiftUICore._GraphInputs)
|
|
29
|
+
static var _propertyBehaviors: Swift.UInt32 { get }
|
|
30
|
+
@available(iOS 27.0, macOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0, *)
|
|
31
|
+
static var _propertyStorageSize: Swift.Int? { get }
|
|
32
|
+
mutating func update()
|
|
33
|
+
}
|
|
34
|
+
extension SwiftUICore.DynamicProperty {
|
|
35
|
+
public static func _makeProperty<V>(in buffer: inout SwiftUICore._DynamicPropertyBuffer, container: SwiftUICore._GraphValue<V>, fieldOffset: Swift.Int, inputs: inout SwiftUICore._GraphInputs)
|
|
36
|
+
public static var _propertyBehaviors: Swift.UInt32 { get }
|
|
37
|
+
@available(iOS 27.0, macOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0, *)
|
|
38
|
+
public static var _propertyStorageSize: Swift.Int? { get }
|
|
39
|
+
public mutating func update()
|
|
40
|
+
}
|
|
41
|
+
public struct Animation : Swift.Equatable, Swift.Sendable {
|
|
42
|
+
public static func == (lhs: SwiftUICore.Animation, rhs: SwiftUICore.Animation) -> Swift.Bool
|
|
43
|
+
}
|
|
@@ -5,6 +5,8 @@ import Swift
|
|
|
5
5
|
import _Concurrency
|
|
6
6
|
extension UIKit.UIApplication {
|
|
7
7
|
public typealias State = UIKit.UIApplicationState
|
|
8
|
+
public typealias LaunchOptionsKey = UIKit.UIApplicationLaunchOptionsKey
|
|
9
|
+
public typealias OpenURLOptionsKey = UIKit.UIApplicationOpenURLOptionsKey
|
|
8
10
|
}
|
|
9
11
|
extension UIKit.UIWindow {
|
|
10
12
|
public typealias Level = UIKit.UIWindowLevel
|