diff --git a/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.h b/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.h index 22cc5878b72..be0cbddb67d 100644 --- a/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.h +++ b/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.h @@ -14,17 +14,12 @@ * limitations under the License. */ -#import - -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" - -// Currently DCAppAttestService is available on iOS only. -#if FIR_APP_ATTEST_SUPPORTED_TARGETS - #import #import "FirebaseAppCheck/Sources/AppAttestProvider/FIRAppAttestService.h" +#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" + NS_ASSUME_NONNULL_BEGIN FIR_APP_ATTEST_PROVIDER_AVAILABILITY @@ -33,5 +28,3 @@ FIR_APP_ATTEST_PROVIDER_AVAILABILITY @end NS_ASSUME_NONNULL_END - -#endif // FIR_APP_ATTEST_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.m b/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.m index df5f6902621..ac4feae689a 100644 --- a/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.m +++ b/FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.m @@ -16,11 +16,6 @@ #import "FirebaseAppCheck/Sources/AppAttestProvider/DCAppAttestService+FIRAppAttestService.h" -// Currently DCAppAttestService is available on iOS only. -#if FIR_APP_ATTEST_SUPPORTED_TARGETS - @implementation DCAppAttestService (FIRAppAttestService) @end - -#endif // FIR_APP_ATTEST_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Sources/AppAttestProvider/FIRAppAttestProvider.m b/FirebaseAppCheck/Sources/AppAttestProvider/FIRAppAttestProvider.m index e7ce51ae9f8..b59e8101009 100644 --- a/FirebaseAppCheck/Sources/AppAttestProvider/FIRAppAttestProvider.m +++ b/FirebaseAppCheck/Sources/AppAttestProvider/FIRAppAttestProvider.m @@ -136,7 +136,6 @@ - (instancetype)initWithAppAttestService:(id)appAttestServi } - (nullable instancetype)initWithApp:(FIRApp *)app { -#if FIR_APP_ATTEST_SUPPORTED_TARGETS NSURLSession *URLSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]]; @@ -166,9 +165,6 @@ - (nullable instancetype)initWithApp:(FIRApp *)app { keyIDStorage:keyIDStorage artifactStorage:artifactStorage backoffWrapper:backoffWrapper]; -#else // FIR_APP_ATTEST_SUPPORTED_TARGETS - return nil; -#endif // FIR_APP_ATTEST_SUPPORTED_TARGETS } #pragma mark - FIRAppCheckProvider diff --git a/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.h b/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.h index 20801f8c633..9b352dd617f 100644 --- a/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.h +++ b/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.h @@ -14,10 +14,6 @@ * limitations under the License. */ -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" - -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - #import #import "FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckTokenGenerator.h" @@ -29,5 +25,3 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END - -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.m b/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.m index eab3d07817c..c2c44312057 100644 --- a/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.m +++ b/FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.m @@ -16,10 +16,6 @@ #import "FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.h" -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - @implementation DCDevice (FIRDeviceCheckTokenGenerator) @end - -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m index 812f44faf67..b3dbb70141e 100644 --- a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m +++ b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m @@ -14,10 +14,6 @@ * limitations under the License. */ -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" - -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - #import #if __has_include() @@ -159,5 +155,3 @@ - (void)getTokenWithCompletion:(void (^)(FIRAppCheckToken *_Nullable token, @end NS_ASSUME_NONNULL_END - -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProviderFactory.m b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProviderFactory.m index 90f7dee88e7..908c0af2d19 100644 --- a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProviderFactory.m +++ b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProviderFactory.m @@ -14,10 +14,6 @@ * limitations under the License. */ -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" - -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheck.h" @@ -34,5 +30,3 @@ + (void)load { } @end - -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h index 44cdeaf6cdc..45f7457b010 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h @@ -22,6 +22,8 @@ #pragma mark - DeviceCheck // Targets where DeviceCheck framework is available to be used in preprocessor conditions. +// TODO: Remove this macro during a breaking change; it is no longer used in the codebase but is +// defined in the public API. #define FIR_DEVICE_CHECK_SUPPORTED_TARGETS \ TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_WATCH @@ -32,6 +34,8 @@ #pragma mark - App Attest // Targets where `DCAppAttestService` is available to be used in preprocessor conditions. +// TODO: Remove this macro during a breaking change; it is no longer used in the codebase but is +// defined in the public API. #define FIR_APP_ATTEST_SUPPORTED_TARGETS \ TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_WATCH diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h index 0a2823f7033..44ed77766bd 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h @@ -19,8 +19,6 @@ #import "FIRAppCheckAvailability.h" #import "FIRAppCheckProvider.h" -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - @class FIRApp; @protocol FIRDeviceCheckAPIServiceProtocol; @protocol FIRDeviceCheckTokenGenerator; @@ -46,5 +44,3 @@ NS_SWIFT_NAME(DeviceCheckProvider) @end NS_ASSUME_NONNULL_END - -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h index 0df8bf5b8cb..e20bb9869e7 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h @@ -14,12 +14,9 @@ * limitations under the License. */ -#import "FIRAppCheckAvailability.h" - -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - #import +#import "FIRAppCheckAvailability.h" #import "FIRAppCheckProviderFactory.h" NS_ASSUME_NONNULL_BEGIN @@ -37,5 +34,3 @@ NS_SWIFT_NAME(DeviceCheckProviderFactory) @end NS_ASSUME_NONNULL_END - -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Tests/Unit/AppAttestProvider/FIRAppAttestProviderTests.m b/FirebaseAppCheck/Tests/Unit/AppAttestProvider/FIRAppAttestProviderTests.m index 9bee32fcdd3..d20fb1d179b 100644 --- a/FirebaseAppCheck/Tests/Unit/AppAttestProvider/FIRAppAttestProviderTests.m +++ b/FirebaseAppCheck/Tests/Unit/AppAttestProvider/FIRAppAttestProviderTests.m @@ -23,22 +23,20 @@ #import "FirebaseAppCheck/Sources/AppAttestProvider/API/FIRAppAttestAPIService.h" #import "FirebaseAppCheck/Sources/AppAttestProvider/API/FIRAppAttestAttestationResponse.h" +#import "FirebaseAppCheck/Sources/AppAttestProvider/Errors/FIRAppAttestRejectionError.h" #import "FirebaseAppCheck/Sources/AppAttestProvider/FIRAppAttestService.h" #import "FirebaseAppCheck/Sources/AppAttestProvider/Storage/FIRAppAttestArtifactStorage.h" #import "FirebaseAppCheck/Sources/AppAttestProvider/Storage/FIRAppAttestKeyIDStorage.h" -#import "FirebaseAppCheck/Sources/Core/Utils/FIRAppCheckCryptoUtils.h" -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckToken.h" - -#import "FirebaseAppCheck/Sources/AppAttestProvider/Errors/FIRAppAttestRejectionError.h" #import "FirebaseAppCheck/Sources/Core/Errors/FIRAppCheckErrorUtil.h" #import "FirebaseAppCheck/Sources/Core/Errors/FIRAppCheckHTTPError.h" +#import "FirebaseAppCheck/Sources/Core/Utils/FIRAppCheckCryptoUtils.h" +#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" +#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckToken.h" #import "FirebaseCore/Extension/FirebaseCoreInternal.h" #import "SharedTestUtilities/AppCheckBackoffWrapperFake/FIRAppCheckBackoffWrapperFake.h" -#if FIR_APP_ATTEST_SUPPORTED_TARGETS - FIR_APP_ATTEST_PROVIDER_AVAILABILITY @interface FIRAppAttestProvider (Tests) - (instancetype)initWithAppAttestService:(id)appAttestService @@ -1089,5 +1087,3 @@ - (void)expectAttestationReset { } @end - -#endif // FIR_APP_ATTEST_SUPPORTED_TARGETS diff --git a/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckIntegrationTests.m b/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckIntegrationTests.m index e739c614b93..2f43cb6f07c 100644 --- a/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckIntegrationTests.m +++ b/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckIntegrationTests.m @@ -18,12 +18,11 @@ #import -#import - @import FirebaseAppCheckInterop; #import "FirebaseAppCheck/Sources/Core/TokenRefresh/FIRAppCheckTokenRefresher.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheck.h" +#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckProviderFactory.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckToken.h" @@ -34,8 +33,6 @@ NS_ASSUME_NONNULL_BEGIN -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - @interface DummyAppCheckProvider : NSObject @end @@ -226,6 +223,4 @@ - (void)disableTokenRefresher { @end -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS - NS_ASSUME_NONNULL_END diff --git a/FirebaseAppCheck/Tests/Unit/DeviceCheckProvider/FIRDeviceCheckProviderTests.m b/FirebaseAppCheck/Tests/Unit/DeviceCheckProvider/FIRDeviceCheckProviderTests.m index a9ed180d66e..976b631b5e2 100644 --- a/FirebaseAppCheck/Tests/Unit/DeviceCheckProvider/FIRDeviceCheckProviderTests.m +++ b/FirebaseAppCheck/Tests/Unit/DeviceCheckProvider/FIRDeviceCheckProviderTests.m @@ -23,14 +23,13 @@ #import "FirebaseAppCheck/Sources/Core/FIRAppCheckToken+Internal.h" #import "FirebaseAppCheck/Sources/DeviceCheckProvider/API/FIRDeviceCheckAPIService.h" #import "FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckTokenGenerator.h" +#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h" #import "FirebaseCore/Extension/FirebaseCoreInternal.h" #import "SharedTestUtilities/AppCheckBackoffWrapperFake/FIRAppCheckBackoffWrapperFake.h" -#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS - FIR_DEVICE_CHECK_PROVIDER_AVAILABILITY @interface FIRDeviceCheckProvider (Tests) @@ -326,5 +325,3 @@ - (void)testGetTokenBackoff { } @end - -#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS