Skip to content

Commit 46bdb41

Browse files
Mehdi Mulanifacebook-github-bot
Mehdi Mulani
authored andcommitted
Delete fishhook
Summary: Fishhook was used to try to hide the log messages from RCTReconnectingWebSocket but that doesn't really work anymore. Deleting it now to unblock people trying to build for iOS 13. Reviewed By: cpojer Differential Revision: D15779390 fbshipit-source-id: ef18575d5d92ac374e189b1267dee3a9befc3551
1 parent 5b72ec3 commit 46bdb41

File tree

11 files changed

+1
-696
lines changed

11 files changed

+1
-696
lines changed

Libraries/WebSocket/RCTReconnectingWebSocket.m

-82
Original file line numberDiff line numberDiff line change
@@ -10,72 +10,10 @@
1010
#import <React/RCTConvert.h>
1111
#import <React/RCTDefines.h>
1212

13-
#if __has_include(<React/fishhook.h>)
14-
#import <React/fishhook.h>
15-
#else
16-
#import <fishhook/fishhook.h>
17-
#endif
18-
19-
#if __has_include(<os/log.h>) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100300 /* __IPHONE_10_3 */
20-
#import <os/log.h>
21-
#endif /* __IPHONE_10_3 */
22-
2313
#import "RCTSRWebSocket.h"
2414

2515
#if RCT_DEV // Only supported in dev mode
2616

27-
#if __has_include(<os/log.h>) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100300 /* __IPHONE_10_3 */
28-
29-
// From https://github.com/apple/swift/blob/ad40c770bfe372f879b530443a3d94761fe258a6/stdlib/public/SDK/os/os_log.m
30-
typedef struct os_log_pack_s {
31-
uint64_t olp_continuous_time;
32-
struct timespec olp_wall_time;
33-
const void *olp_mh;
34-
const void *olp_pc;
35-
const char *olp_format;
36-
uint8_t olp_data[0];
37-
} os_log_pack_s, *os_log_pack_t;
38-
39-
static void (*orig__nwlog_pack)(os_log_pack_t pack, os_log_type_t logType);
40-
41-
static void my__nwlog_pack(os_log_pack_t pack, os_log_type_t logType)
42-
{
43-
if (logType == OS_LOG_TYPE_ERROR && strstr(pack->olp_format, "Connection has no connected handler") == NULL) {
44-
orig__nwlog_pack(pack, logType);
45-
}
46-
}
47-
48-
#endif /* __IPHONE_10_3 */
49-
50-
static void (*orig_nwlog_legacy_v)(int, char*, va_list);
51-
52-
static void my_nwlog_legacy_v(int level, char *format, va_list args) {
53-
static const uint buffer_size = 256;
54-
static char buffer[buffer_size];
55-
va_list copy;
56-
va_copy(copy, args);
57-
vsnprintf(buffer, buffer_size, format, copy);
58-
va_end(copy);
59-
60-
if (strstr(buffer, "nw_connection_get_connected_socket_block_invoke") == NULL &&
61-
strstr(buffer, "Connection has no connected handler") == NULL) {
62-
orig_nwlog_legacy_v(level, format, args);
63-
}
64-
}
65-
66-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
67-
68-
static void (*orig_os_log_error_impl)(void *dso, os_log_t log, os_log_type_t type, const char *format, uint8_t *buf, uint32_t size);
69-
70-
static void my_os_log_error_impl(void *dso, os_log_t log, os_log_type_t type, const char *format, uint8_t *buf, uint32_t size)
71-
{
72-
if (strstr(format, "TCP Conn %p Failed : error %ld:%d") == NULL) {
73-
orig_os_log_error_impl(dso, log, type, format, buf, size);
74-
}
75-
}
76-
77-
#endif /* __IPHONE_11_0 */
78-
7917
@interface RCTReconnectingWebSocket () <RCTSRWebSocketDelegate>
8018
@end
8119

@@ -84,26 +22,6 @@ @implementation RCTReconnectingWebSocket {
8422
RCTSRWebSocket *_socket;
8523
}
8624

87-
+ (void)load
88-
{
89-
static dispatch_once_t onceToken;
90-
dispatch_once(&onceToken, ^{
91-
rebind_symbols((struct rebinding[1]){
92-
{"nwlog_legacy_v", my_nwlog_legacy_v, (void *)&orig_nwlog_legacy_v}
93-
}, 1);
94-
#if __has_include(<os/log.h>) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100300 /* __IPHONE_10_3 */
95-
rebind_symbols((struct rebinding[1]){
96-
{"__nwlog_pack", my__nwlog_pack, (void *)&orig__nwlog_pack}
97-
}, 1);
98-
#endif /* __IPHONE_10_3 */
99-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
100-
rebind_symbols((struct rebinding[1]){
101-
{"_os_log_error_impl", my_os_log_error_impl, (void *)&orig_os_log_error_impl}
102-
}, 1);
103-
#endif /* __IPHONE_11_0 */
104-
});
105-
}
106-
10725
- (instancetype)initWithURL:(NSURL *)url queue:(dispatch_queue_t)queue
10826
{
10927
if (self = [super init]) {

Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj

-165
Original file line numberDiff line numberDiff line change
@@ -9,113 +9,31 @@
99
/* Begin PBXBuildFile section */
1010
1338BBE01B04ACC80064A9C9 /* RCTSRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */; };
1111
1338BBE11B04ACC80064A9C9 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */; };
12-
2D3ABDC220C7206E00DF56E9 /* libfishhook.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DBE0D001F3B181A0099AA32 /* libfishhook.a */; };
1312
2D3B5F3D1D9B165B00451313 /* RCTSRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */; };
1413
2D3B5F3E1D9B165B00451313 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */; };
1514
2D3B5F401D9B165B00451313 /* RCTWebSocketModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */; };
1615
3C86DF7C1ADF695F0047B81A /* RCTWebSocketModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */; };
17-
3DBE0D141F3B185A0099AA32 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DBE0D121F3B185A0099AA32 /* fishhook.c */; };
18-
3DBE0D151F3B185A0099AA32 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DBE0D121F3B185A0099AA32 /* fishhook.c */; };
19-
3DBE0D801F3B1AF00099AA32 /* fishhook.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DBE0D131F3B185A0099AA32 /* fishhook.h */; };
20-
3DBE0D821F3B1B0C0099AA32 /* fishhook.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DBE0D131F3B185A0099AA32 /* fishhook.h */; };
2116
A12E9E2E1E5DEC4E0029001B /* RCTReconnectingWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */; };
2217
A12E9E2F1E5DEC550029001B /* RCTReconnectingWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */; };
23-
ED297176215062BA00B7C4FE /* libfishhook-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */; };
2418
/* End PBXBuildFile section */
2519

26-
/* Begin PBXContainerItemProxy section */
27-
3DBE0D0E1F3B18490099AA32 /* PBXContainerItemProxy */ = {
28-
isa = PBXContainerItemProxy;
29-
containerPortal = 3C86DF3E1ADF2C930047B81A /* Project object */;
30-
proxyType = 1;
31-
remoteGlobalIDString = 3DBE0CF41F3B181A0099AA32;
32-
remoteInfo = fishhook;
33-
};
34-
3DBE0D101F3B184D0099AA32 /* PBXContainerItemProxy */ = {
35-
isa = PBXContainerItemProxy;
36-
containerPortal = 3C86DF3E1ADF2C930047B81A /* Project object */;
37-
proxyType = 1;
38-
remoteGlobalIDString = 3DBE0D011F3B181C0099AA32;
39-
remoteInfo = "fishhook-tvOS";
40-
};
41-
/* End PBXContainerItemProxy section */
42-
43-
/* Begin PBXCopyFilesBuildPhase section */
44-
3DBE0D7F1F3B1AEC0099AA32 /* CopyFiles */ = {
45-
isa = PBXCopyFilesBuildPhase;
46-
buildActionMask = 2147483647;
47-
dstPath = include/fishhook;
48-
dstSubfolderSpec = 16;
49-
files = (
50-
3DBE0D801F3B1AF00099AA32 /* fishhook.h in CopyFiles */,
51-
);
52-
runOnlyForDeploymentPostprocessing = 0;
53-
};
54-
3DBE0D811F3B1B010099AA32 /* CopyFiles */ = {
55-
isa = PBXCopyFilesBuildPhase;
56-
buildActionMask = 2147483647;
57-
dstPath = include/fishhook;
58-
dstSubfolderSpec = 16;
59-
files = (
60-
3DBE0D821F3B1B0C0099AA32 /* fishhook.h in CopyFiles */,
61-
);
62-
runOnlyForDeploymentPostprocessing = 0;
63-
};
64-
/* End PBXCopyFilesBuildPhase section */
65-
6620
/* Begin PBXFileReference section */
6721
1338BBDC1B04ACC80064A9C9 /* RCTSRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSRWebSocket.h; sourceTree = "<group>"; };
6822
1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSRWebSocket.m; sourceTree = "<group>"; };
6923
1338BBDE1B04ACC80064A9C9 /* RCTWebSocketExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketExecutor.h; sourceTree = "<group>"; };
7024
1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketExecutor.m; sourceTree = "<group>"; };
71-
13526A511F362F7F0008EF00 /* libfishhook.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfishhook.a; sourceTree = "<group>"; };
7225
2D2A28881D9B049200D4039D /* libRCTWebSocket-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTWebSocket-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
73-
2DC5E5271F3A6CFD000EE84B /* libfishhook-tvOS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfishhook-tvOS.a"; path = "../fishhook/build/Debug-appletvos/libfishhook-tvOS.a"; sourceTree = "<group>"; };
7426
3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebSocket.a; sourceTree = BUILT_PRODUCTS_DIR; };
7527
3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketModule.h; sourceTree = "<group>"; };
7628
3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketModule.m; sourceTree = "<group>"; tabWidth = 2; };
77-
3DBE0D001F3B181A0099AA32 /* libfishhook.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libfishhook.a; sourceTree = BUILT_PRODUCTS_DIR; };
78-
3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libfishhook-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
79-
3DBE0D121F3B185A0099AA32 /* fishhook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fishhook.c; path = ../fishhook/fishhook.c; sourceTree = "<group>"; };
80-
3DBE0D131F3B185A0099AA32 /* fishhook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fishhook.h; path = ../fishhook/fishhook.h; sourceTree = "<group>"; };
8129
A12E9E2C1E5DEC4E0029001B /* RCTReconnectingWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTReconnectingWebSocket.h; sourceTree = "<group>"; };
8230
A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTReconnectingWebSocket.m; sourceTree = "<group>"; };
8331
/* End PBXFileReference section */
8432

85-
/* Begin PBXFrameworksBuildPhase section */
86-
13526A4F1F362F770008EF00 /* Frameworks */ = {
87-
isa = PBXFrameworksBuildPhase;
88-
buildActionMask = 2147483647;
89-
files = (
90-
2D3ABDC220C7206E00DF56E9 /* libfishhook.a in Frameworks */,
91-
);
92-
runOnlyForDeploymentPostprocessing = 0;
93-
};
94-
2DC5E5151F3A6C39000EE84B /* Frameworks */ = {
95-
isa = PBXFrameworksBuildPhase;
96-
buildActionMask = 2147483647;
97-
files = (
98-
ED297176215062BA00B7C4FE /* libfishhook-tvOS.a in Frameworks */,
99-
);
100-
runOnlyForDeploymentPostprocessing = 0;
101-
};
102-
/* End PBXFrameworksBuildPhase section */
103-
10433
/* Begin PBXGroup section */
105-
13526A501F362F7F0008EF00 /* Frameworks */ = {
106-
isa = PBXGroup;
107-
children = (
108-
2DC5E5271F3A6CFD000EE84B /* libfishhook-tvOS.a */,
109-
13526A511F362F7F0008EF00 /* libfishhook.a */,
110-
);
111-
name = Frameworks;
112-
sourceTree = "<group>";
113-
};
11434
3C86DF3D1ADF2C930047B81A = {
11535
isa = PBXGroup;
11636
children = (
117-
3DBE0D121F3B185A0099AA32 /* fishhook.c */,
118-
3DBE0D131F3B185A0099AA32 /* fishhook.h */,
11937
A12E9E2C1E5DEC4E0029001B /* RCTReconnectingWebSocket.h */,
12038
A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */,
12139
1338BBDC1B04ACC80064A9C9 /* RCTSRWebSocket.h */,
@@ -137,8 +55,6 @@
13755
children = (
13856
3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */,
13957
2D2A28881D9B049200D4039D /* libRCTWebSocket-tvOS.a */,
140-
3DBE0D001F3B181A0099AA32 /* libfishhook.a */,
141-
3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */,
14258
);
14359
name = Products;
14460
sourceTree = "<group>";
@@ -180,38 +96,6 @@
18096
productReference = 3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */;
18197
productType = "com.apple.product-type.library.static";
18298
};
183-
3DBE0CF41F3B181A0099AA32 /* fishhook */ = {
184-
isa = PBXNativeTarget;
185-
buildConfigurationList = 3DBE0CFD1F3B181A0099AA32 /* Build configuration list for PBXNativeTarget "fishhook" */;
186-
buildPhases = (
187-
3DBE0D7F1F3B1AEC0099AA32 /* CopyFiles */,
188-
3DBE0CF51F3B181A0099AA32 /* Sources */,
189-
);
190-
buildRules = (
191-
);
192-
dependencies = (
193-
);
194-
name = fishhook;
195-
productName = WebSocket;
196-
productReference = 3DBE0D001F3B181A0099AA32 /* libfishhook.a */;
197-
productType = "com.apple.product-type.library.static";
198-
};
199-
3DBE0D011F3B181C0099AA32 /* fishhook-tvOS */ = {
200-
isa = PBXNativeTarget;
201-
buildConfigurationList = 3DBE0D0A1F3B181C0099AA32 /* Build configuration list for PBXNativeTarget "fishhook-tvOS" */;
202-
buildPhases = (
203-
3DBE0D811F3B1B010099AA32 /* CopyFiles */,
204-
3DBE0D021F3B181C0099AA32 /* Sources */,
205-
);
206-
buildRules = (
207-
);
208-
dependencies = (
209-
);
210-
name = "fishhook-tvOS";
211-
productName = "RCTWebSocket-tvOS";
212-
productReference = 3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */;
213-
productType = "com.apple.product-type.library.static";
214-
};
21599
/* End PBXNativeTarget section */
216100

217101
/* Begin PBXProject section */
@@ -244,8 +128,6 @@
244128
targets = (
245129
3C86DF451ADF2C930047B81A /* RCTWebSocket */,
246130
2D2A28871D9B049200D4039D /* RCTWebSocket-tvOS */,
247-
3DBE0CF41F3B181A0099AA32 /* fishhook */,
248-
3DBE0D011F3B181C0099AA32 /* fishhook-tvOS */,
249131
);
250132
};
251133
/* End PBXProject section */
@@ -273,37 +155,8 @@
273155
);
274156
runOnlyForDeploymentPostprocessing = 0;
275157
};
276-
3DBE0CF51F3B181A0099AA32 /* Sources */ = {
277-
isa = PBXSourcesBuildPhase;
278-
buildActionMask = 2147483647;
279-
files = (
280-
3DBE0D141F3B185A0099AA32 /* fishhook.c in Sources */,
281-
);
282-
runOnlyForDeploymentPostprocessing = 0;
283-
};
284-
3DBE0D021F3B181C0099AA32 /* Sources */ = {
285-
isa = PBXSourcesBuildPhase;
286-
buildActionMask = 2147483647;
287-
files = (
288-
3DBE0D151F3B185A0099AA32 /* fishhook.c in Sources */,
289-
);
290-
runOnlyForDeploymentPostprocessing = 0;
291-
};
292158
/* End PBXSourcesBuildPhase section */
293159

294-
/* Begin PBXTargetDependency section */
295-
3DBE0D0F1F3B18490099AA32 /* PBXTargetDependency */ = {
296-
isa = PBXTargetDependency;
297-
target = 3DBE0CF41F3B181A0099AA32 /* fishhook */;
298-
targetProxy = 3DBE0D0E1F3B18490099AA32 /* PBXContainerItemProxy */;
299-
};
300-
3DBE0D111F3B184D0099AA32 /* PBXTargetDependency */ = {
301-
isa = PBXTargetDependency;
302-
target = 3DBE0D011F3B181C0099AA32 /* fishhook-tvOS */;
303-
targetProxy = 3DBE0D101F3B184D0099AA32 /* PBXContainerItemProxy */;
304-
};
305-
/* End PBXTargetDependency section */
306-
307160
/* Begin XCBuildConfiguration section */
308161
2D2A288E1D9B049200D4039D /* Debug */ = {
309162
isa = XCBuildConfiguration;
@@ -554,24 +407,6 @@
554407
defaultConfigurationIsVisible = 0;
555408
defaultConfigurationName = Release;
556409
};
557-
3DBE0CFD1F3B181A0099AA32 /* Build configuration list for PBXNativeTarget "fishhook" */ = {
558-
isa = XCConfigurationList;
559-
buildConfigurations = (
560-
3DBE0CFE1F3B181A0099AA32 /* Debug */,
561-
3DBE0CFF1F3B181A0099AA32 /* Release */,
562-
);
563-
defaultConfigurationIsVisible = 0;
564-
defaultConfigurationName = Release;
565-
};
566-
3DBE0D0A1F3B181C0099AA32 /* Build configuration list for PBXNativeTarget "fishhook-tvOS" */ = {
567-
isa = XCConfigurationList;
568-
buildConfigurations = (
569-
3DBE0D0B1F3B181C0099AA32 /* Debug */,
570-
3DBE0D0C1F3B181C0099AA32 /* Release */,
571-
);
572-
defaultConfigurationIsVisible = 0;
573-
defaultConfigurationName = Release;
574-
};
575410
/* End XCConfigurationList section */
576411
};
577412
rootObject = 3C86DF3E1ADF2C930047B81A /* Project object */;

Libraries/WebSocket/React-RCTWebSocket.podspec

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ Pod::Spec.new do |s|
2727
s.author = "Facebook, Inc. and its affiliates"
2828
s.platforms = { :ios => "9.0", :tvos => "9.2" }
2929
s.source = source
30-
s.source_files = "*.{h,m}",
31-
"Libraries/fishhook/*.{h,c}"
30+
s.source_files = "*.{h,m}"
3231
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
3332
s.header_dir = "React"
3433

3534
s.dependency "React-Core", version
36-
s.dependency "React-fishhook", version
3735
end

Libraries/fishhook/LICENSE

-22
This file was deleted.

0 commit comments

Comments
 (0)