diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index f0f7a9f86df..172582ab0b2 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -761,7 +761,6 @@ 8ECC674825C23A20000E2BF6 /* SentryTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ECC674425C23A1F000E2BF6 /* SentryTransaction.m */; }; 8ECC674925C23A20000E2BF6 /* SentrySpanId.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ECC674525C23A20000E2BF6 /* SentrySpanId.m */; }; 8ECC674A25C23A20000E2BF6 /* SentryTransactionContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8ECC674625C23A20000E2BF6 /* SentryTransactionContext.mm */; }; - 8ED2D28026A6581C00CA8329 /* NSURLProtocolSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ED2D27F26A6581C00CA8329 /* NSURLProtocolSwizzle.m */; }; 8ED3D306264DFE700049393B /* SwiftDescriptorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ED3D305264DFE700049393B /* SwiftDescriptorTests.swift */; }; 8EE017A126704CD500470616 /* SentryUIViewControllerPerformanceTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EA1ED0E2669152F00E62B98 /* SentryUIViewControllerPerformanceTrackerTests.swift */; }; 8F0D6AA22B04115A00D048B1 /* SentryInstallation+Test.h in Sources */ = {isa = PBXBuildFile; fileRef = 8F0D6AA12B040A0100D048B1 /* SentryInstallation+Test.h */; }; @@ -1818,8 +1817,6 @@ 8ECC674425C23A1F000E2BF6 /* SentryTransaction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentryTransaction.m; sourceTree = ""; }; 8ECC674525C23A20000E2BF6 /* SentrySpanId.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentrySpanId.m; sourceTree = ""; }; 8ECC674625C23A20000E2BF6 /* SentryTransactionContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryTransactionContext.mm; sourceTree = ""; }; - 8ED2D27E26A6581C00CA8329 /* NSURLProtocolSwizzle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSURLProtocolSwizzle.h; sourceTree = ""; }; - 8ED2D27F26A6581C00CA8329 /* NSURLProtocolSwizzle.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSURLProtocolSwizzle.m; sourceTree = ""; }; 8ED3D305264DFE700049393B /* SwiftDescriptorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptorTests.swift; sourceTree = ""; }; 8F0D6AA12B040A0100D048B1 /* SentryInstallation+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryInstallation+Test.h"; sourceTree = ""; }; 8F73BC302B02B87E00C3CEF4 /* SentryInstallationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryInstallationTests.swift; sourceTree = ""; }; @@ -3007,8 +3004,6 @@ 7BBD18A1244EE2FD00427C76 /* TestResponseFactory.swift */, 639FCF921EBC746F00778193 /* SentryDsnTests.m */, 7B4E23B5251A07BD00060D68 /* SentryDispatchQueueWrapperTests.swift */, - 8ED2D27E26A6581C00CA8329 /* NSURLProtocolSwizzle.h */, - 8ED2D27F26A6581C00CA8329 /* NSURLProtocolSwizzle.m */, 8E0551DF26A7A63C00400526 /* TestProtocolClient.swift */, 7B4D308926FC616B00C94DE9 /* SentryHttpTransportTests.swift */, 62A3C7BD2B7E2A6A00C75227 /* SentrySpotlightTransportTests.swift */, @@ -3601,7 +3596,6 @@ D861301B2BB5A267004C0F5E /* SentrySessionReplayTests.swift */, D8AFC0002BD252B900118BE1 /* SentryOnDemandReplayTests.swift */, D82DD1CC2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift */, - D82DD1CC2BEEB1A0001AB556 /* SentryBreadcrumbReplayConverterTests.swift */, D8DBE0C92C0E093000FAB1FD /* SentryTouchTrackerTests.swift */, D8DBE0D12C0EFFC300FAB1FD /* SentryReplayOptionsTests.swift */, ); @@ -4998,7 +4992,6 @@ 7BC6EC14255C415E0059822A /* SentryExceptionTests.swift in Sources */, 7B82722927A319E900F4BFF4 /* SentryAutoSessionTrackingIntegrationTests.swift in Sources */, D875ED0B276CC84700422FAC /* SentryNSDataTrackerTests.swift in Sources */, - 8ED2D28026A6581C00CA8329 /* NSURLProtocolSwizzle.m in Sources */, 62B86CFC29F052BB008F3947 /* SentryTestLogConfig.m in Sources */, D808FB92281BF6EC009A2A33 /* SentryUIEventTrackingIntegrationTests.swift in Sources */, 7BC6EC04255C235F0059822A /* SentryFrameTests.swift in Sources */, diff --git a/Tests/SentryTests/Networking/NSURLProtocolSwizzle.h b/Tests/SentryTests/Networking/NSURLProtocolSwizzle.h deleted file mode 100644 index 353c1e90c35..00000000000 --- a/Tests/SentryTests/Networking/NSURLProtocolSwizzle.h +++ /dev/null @@ -1,19 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSURLProtocolSwizzle : NSObject - -typedef void (^ClassCallback)(Class _Nullable callbackClass); - -@property (class, nonatomic, readonly) NSURLProtocolSwizzle *shared; - -@property (nullable, nonatomic, strong) ClassCallback registerCallback; - -@property (nullable, nonatomic, strong) ClassCallback unregisterCallback; - -+ (void)swizzleURLProtocol; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Tests/SentryTests/Networking/NSURLProtocolSwizzle.m b/Tests/SentryTests/Networking/NSURLProtocolSwizzle.m deleted file mode 100644 index 9a5f3287be5..00000000000 --- a/Tests/SentryTests/Networking/NSURLProtocolSwizzle.m +++ /dev/null @@ -1,33 +0,0 @@ -#import "NSURLProtocolSwizzle.h" -#import "SentrySwizzle.h" - -@implementation NSURLProtocolSwizzle - -+ (NSURLProtocolSwizzle *)shared -{ - static NSURLProtocolSwizzle *instance = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ instance = [[self alloc] init]; }); - return instance; -} - -+ (void)swizzleURLProtocol -{ - SentrySwizzleClassMethod(NSURLProtocol.class, NSSelectorFromString(@"registerClass:"), - SentrySWReturnType(BOOL), SentrySWArguments(Class class), SentrySWReplacement({ - if (NSURLProtocolSwizzle.shared.registerCallback != nil) - NSURLProtocolSwizzle.shared.registerCallback(class); - - return SentrySWCallOriginal(class); - })); - - SentrySwizzleClassMethod(NSURLProtocol.class, NSSelectorFromString(@"unregisterClass:"), - SentrySWReturnType(void), SentrySWArguments(Class class), SentrySWReplacement({ - if (NSURLProtocolSwizzle.shared.unregisterCallback != nil) - NSURLProtocolSwizzle.shared.unregisterCallback(class); - - SentrySWCallOriginal(class); - })); -} - -@end diff --git a/Tests/SentryTests/SentryTests-Bridging-Header.h b/Tests/SentryTests/SentryTests-Bridging-Header.h index 24ef63fe619..8c03b817d60 100644 --- a/Tests/SentryTests/SentryTests-Bridging-Header.h +++ b/Tests/SentryTests/SentryTests-Bridging-Header.h @@ -43,7 +43,6 @@ #import "NSLocale+Sentry.h" #import "NSMutableDictionary+Sentry.h" -#import "NSURLProtocolSwizzle.h" #import "PrivateSentrySDKOnly.h" #import "Sentry/Sentry-Swift.h" #import "SentryANRTracker.h"