react-native 0.60.4 → 0.60.5
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/Libraries/Components/TextInput/TextInput.js +7 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/WebSocket/RCTReconnectingWebSocket.m +0 -82
- package/Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj +0 -165
- package/Libraries/WebSocket/React-RCTWebSocket.podspec +1 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/Modules/RCTRedBox.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/hermes/unicode/AndroidUnicodeUtils.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +9 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +24 -24
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5-javadoc.jar +0 -0
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5-javadoc.jar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5-javadoc.jar.sha1 +1 -0
- package/android/com/facebook/react/react-native/{0.60.4/react-native-0.60.4-sources.jar → 0.60.5/react-native-0.60.5-sources.jar} +0 -0
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5-sources.jar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5-sources.jar.sha1 +1 -0
- package/android/com/facebook/react/react-native/{0.60.4/react-native-0.60.4.aar → 0.60.5/react-native-0.60.5.aar} +0 -0
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5.aar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5.aar.sha1 +1 -0
- package/android/com/facebook/react/react-native/{0.60.4/react-native-0.60.4.pom → 0.60.5/react-native-0.60.5.pom} +1 -1
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5.pom.md5 +1 -0
- package/android/com/facebook/react/react-native/0.60.5/react-native-0.60.5.pom.sha1 +1 -0
- package/android/com/facebook/react/react-native/maven-metadata.xml +3 -3
- package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
- package/package.json +4 -4
- package/scripts/launchPackager.bat +2 -1
- package/template/_prettierrc.js +6 -0
- package/template/ios/Podfile +0 -1
- package/template/package.json +2 -2
- package/Libraries/fishhook/LICENSE +0 -22
- package/Libraries/fishhook/README.md +0 -75
- package/Libraries/fishhook/React-fishhook.podspec +0 -31
- package/Libraries/fishhook/fishhook.c +0 -210
- package/Libraries/fishhook/fishhook.h +0 -76
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4-javadoc.jar +0 -0
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4-javadoc.jar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4-javadoc.jar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4-sources.jar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4-sources.jar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4.aar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4.aar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4.pom.md5 +0 -1
- package/android/com/facebook/react/react-native/0.60.4/react-native-0.60.4.pom.sha1 +0 -1
|
@@ -252,6 +252,7 @@ type AndroidProps = $ReadOnly<{|
|
|
|
252
252
|
| 'yes'
|
|
253
253
|
| 'yesExcludeDescendants'
|
|
254
254
|
),
|
|
255
|
+
showSoftInputOnFocus?: ?boolean,
|
|
255
256
|
|}>;
|
|
256
257
|
|
|
257
258
|
type Props = $ReadOnly<{|
|
|
@@ -925,6 +926,12 @@ const TextInput = createReactClass({
|
|
|
925
926
|
'newPassword',
|
|
926
927
|
'oneTimeCode',
|
|
927
928
|
]),
|
|
929
|
+
/**
|
|
930
|
+
* When `false`, it will prevent the soft keyboard from showing when the field is focused.
|
|
931
|
+
* Defaults to `true`.
|
|
932
|
+
* @platform android
|
|
933
|
+
*/
|
|
934
|
+
showSoftInputOnFocus: PropTypes.bool,
|
|
928
935
|
},
|
|
929
936
|
getDefaultProps() {
|
|
930
937
|
return {
|
|
@@ -10,72 +10,10 @@
|
|
|
10
10
|
#import <React/RCTConvert.h>
|
|
11
11
|
#import <React/RCTDefines.h>
|
|
12
12
|
|
|
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
|
-
|
|
23
13
|
#import "RCTSRWebSocket.h"
|
|
24
14
|
|
|
25
15
|
#if RCT_DEV // Only supported in dev mode
|
|
26
16
|
|
|
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
|
-
|
|
79
17
|
@interface RCTReconnectingWebSocket () <RCTSRWebSocketDelegate>
|
|
80
18
|
@end
|
|
81
19
|
|
|
@@ -84,26 +22,6 @@ static void my_os_log_error_impl(void *dso, os_log_t log, os_log_type_t type, co
|
|
|
84
22
|
RCTSRWebSocket *_socket;
|
|
85
23
|
}
|
|
86
24
|
|
|
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
|
-
|
|
107
25
|
- (instancetype)initWithURL:(NSURL *)url queue:(dispatch_queue_t)queue
|
|
108
26
|
{
|
|
109
27
|
if (self = [super init]) {
|
|
@@ -9,113 +9,31 @@
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
10
|
1338BBE01B04ACC80064A9C9 /* RCTSRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */; };
|
|
11
11
|
1338BBE11B04ACC80064A9C9 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */; };
|
|
12
|
-
2D3ABDC220C7206E00DF56E9 /* libfishhook.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DBE0D001F3B181A0099AA32 /* libfishhook.a */; };
|
|
13
12
|
2D3B5F3D1D9B165B00451313 /* RCTSRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */; };
|
|
14
13
|
2D3B5F3E1D9B165B00451313 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */; };
|
|
15
14
|
2D3B5F401D9B165B00451313 /* RCTWebSocketModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */; };
|
|
16
15
|
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 */; };
|
|
21
16
|
A12E9E2E1E5DEC4E0029001B /* RCTReconnectingWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */; };
|
|
22
17
|
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 */; };
|
|
24
18
|
/* End PBXBuildFile section */
|
|
25
19
|
|
|
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
|
-
|
|
66
20
|
/* Begin PBXFileReference section */
|
|
67
21
|
1338BBDC1B04ACC80064A9C9 /* RCTSRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSRWebSocket.h; sourceTree = "<group>"; };
|
|
68
22
|
1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSRWebSocket.m; sourceTree = "<group>"; };
|
|
69
23
|
1338BBDE1B04ACC80064A9C9 /* RCTWebSocketExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketExecutor.h; sourceTree = "<group>"; };
|
|
70
24
|
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>"; };
|
|
72
25
|
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>"; };
|
|
74
26
|
3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebSocket.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
75
27
|
3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketModule.h; sourceTree = "<group>"; };
|
|
76
28
|
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>"; };
|
|
81
29
|
A12E9E2C1E5DEC4E0029001B /* RCTReconnectingWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTReconnectingWebSocket.h; sourceTree = "<group>"; };
|
|
82
30
|
A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTReconnectingWebSocket.m; sourceTree = "<group>"; };
|
|
83
31
|
/* End PBXFileReference section */
|
|
84
32
|
|
|
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
|
-
|
|
104
33
|
/* 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
|
-
};
|
|
114
34
|
3C86DF3D1ADF2C930047B81A = {
|
|
115
35
|
isa = PBXGroup;
|
|
116
36
|
children = (
|
|
117
|
-
3DBE0D121F3B185A0099AA32 /* fishhook.c */,
|
|
118
|
-
3DBE0D131F3B185A0099AA32 /* fishhook.h */,
|
|
119
37
|
A12E9E2C1E5DEC4E0029001B /* RCTReconnectingWebSocket.h */,
|
|
120
38
|
A12E9E2D1E5DEC4E0029001B /* RCTReconnectingWebSocket.m */,
|
|
121
39
|
1338BBDC1B04ACC80064A9C9 /* RCTSRWebSocket.h */,
|
|
@@ -137,8 +55,6 @@
|
|
|
137
55
|
children = (
|
|
138
56
|
3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */,
|
|
139
57
|
2D2A28881D9B049200D4039D /* libRCTWebSocket-tvOS.a */,
|
|
140
|
-
3DBE0D001F3B181A0099AA32 /* libfishhook.a */,
|
|
141
|
-
3DBE0D0D1F3B181C0099AA32 /* libfishhook-tvOS.a */,
|
|
142
58
|
);
|
|
143
59
|
name = Products;
|
|
144
60
|
sourceTree = "<group>";
|
|
@@ -180,38 +96,6 @@
|
|
|
180
96
|
productReference = 3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */;
|
|
181
97
|
productType = "com.apple.product-type.library.static";
|
|
182
98
|
};
|
|
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
|
-
};
|
|
215
99
|
/* End PBXNativeTarget section */
|
|
216
100
|
|
|
217
101
|
/* Begin PBXProject section */
|
|
@@ -244,8 +128,6 @@
|
|
|
244
128
|
targets = (
|
|
245
129
|
3C86DF451ADF2C930047B81A /* RCTWebSocket */,
|
|
246
130
|
2D2A28871D9B049200D4039D /* RCTWebSocket-tvOS */,
|
|
247
|
-
3DBE0CF41F3B181A0099AA32 /* fishhook */,
|
|
248
|
-
3DBE0D011F3B181C0099AA32 /* fishhook-tvOS */,
|
|
249
131
|
);
|
|
250
132
|
};
|
|
251
133
|
/* End PBXProject section */
|
|
@@ -273,37 +155,8 @@
|
|
|
273
155
|
);
|
|
274
156
|
runOnlyForDeploymentPostprocessing = 0;
|
|
275
157
|
};
|
|
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
|
-
};
|
|
292
158
|
/* End PBXSourcesBuildPhase section */
|
|
293
159
|
|
|
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
|
-
|
|
307
160
|
/* Begin XCBuildConfiguration section */
|
|
308
161
|
2D2A288E1D9B049200D4039D /* Debug */ = {
|
|
309
162
|
isa = XCBuildConfiguration;
|
|
@@ -554,24 +407,6 @@
|
|
|
554
407
|
defaultConfigurationIsVisible = 0;
|
|
555
408
|
defaultConfigurationName = Release;
|
|
556
409
|
};
|
|
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
|
-
};
|
|
575
410
|
/* End XCConfigurationList section */
|
|
576
411
|
};
|
|
577
412
|
rootObject = 3C86DF3E1ADF2C930047B81A /* Project object */;
|
|
@@ -27,11 +27,9 @@ Pod::Spec.new do |s|
|
|
|
27
27
|
s.author = "Facebook, Inc. and its affiliates"
|
|
28
28
|
s.platforms = { :ios => "9.0", :tvos => "9.2" }
|
|
29
29
|
s.source = source
|
|
30
|
-
s.source_files = "*.{h,m}"
|
|
31
|
-
"Libraries/fishhook/*.{h,c}"
|
|
30
|
+
s.source_files = "*.{h,m}"
|
|
32
31
|
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
|
|
33
32
|
s.header_dir = "React"
|
|
34
33
|
|
|
35
34
|
s.dependency "React-Core", version
|
|
36
|
-
s.dependency "React-fishhook", version
|
|
37
35
|
end
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
- (NSInteger)bottomSafeViewHeight
|
|
162
162
|
{
|
|
163
163
|
if (@available(iOS 11.0, *)) {
|
|
164
|
-
return
|
|
164
|
+
return RCTSharedApplication().delegate.window.safeAreaInsets.bottom;
|
|
165
165
|
} else {
|
|
166
166
|
return 0;
|
|
167
167
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
package com.facebook.hermes.unicode;
|
|
8
8
|
|
|
9
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
9
10
|
import java.text.Collator;
|
|
10
11
|
import java.text.DateFormat;
|
|
11
12
|
import java.text.Normalizer;
|
|
@@ -14,12 +15,15 @@ import java.util.Locale;
|
|
|
14
15
|
// TODO: use com.facebook.common.locale.Locales.getApplicationLocale() as the current locale,
|
|
15
16
|
// rather than the device locale. This is challenging because getApplicationLocale() is only
|
|
16
17
|
// available via DI.
|
|
18
|
+
@DoNotStrip
|
|
17
19
|
public class AndroidUnicodeUtils {
|
|
20
|
+
@DoNotStrip
|
|
18
21
|
public static int localeCompare(String left, String right) {
|
|
19
22
|
Collator collator = Collator.getInstance();
|
|
20
23
|
return collator.compare(left, right);
|
|
21
24
|
}
|
|
22
25
|
|
|
26
|
+
@DoNotStrip
|
|
23
27
|
public static String dateFormat(double unixtimeMs, boolean formatDate, boolean formatTime) {
|
|
24
28
|
DateFormat format;
|
|
25
29
|
if (formatDate && formatTime) {
|
|
@@ -34,6 +38,7 @@ public class AndroidUnicodeUtils {
|
|
|
34
38
|
return format.format((long) unixtimeMs).toString();
|
|
35
39
|
}
|
|
36
40
|
|
|
41
|
+
@DoNotStrip
|
|
37
42
|
public static String convertToCase(String input, int targetCase, boolean useCurrentLocale) {
|
|
38
43
|
// These values must match CaseConversion in PlatformUnicode.h
|
|
39
44
|
final int targetUppercase = 0;
|
|
@@ -52,6 +57,7 @@ public class AndroidUnicodeUtils {
|
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
|
|
60
|
+
@DoNotStrip
|
|
55
61
|
public static String normalize(String input, int form) {
|
|
56
62
|
// Values must match NormalizationForm in PlatformUnicode.h.
|
|
57
63
|
final int formC = 0;
|
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
package com.facebook.react.uimanager;
|
|
7
7
|
|
|
8
8
|
import android.graphics.Color;
|
|
9
|
+
import android.text.TextUtils;
|
|
9
10
|
import android.view.View;
|
|
10
11
|
import android.view.ViewParent;
|
|
11
12
|
import androidx.core.view.ViewCompat;
|
|
12
13
|
|
|
14
|
+
import java.util.ArrayList;
|
|
13
15
|
import java.util.HashMap;
|
|
16
|
+
import java.util.List;
|
|
14
17
|
|
|
15
18
|
import com.facebook.react.R;
|
|
16
19
|
import com.facebook.react.bridge.ReadableArray;
|
|
@@ -173,23 +176,23 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
|
|
|
173
176
|
final String accessibilityLabel = (String) view.getTag(R.id.accessibility_label);
|
|
174
177
|
final ReadableArray accessibilityStates = (ReadableArray) view.getTag(R.id.accessibility_states);
|
|
175
178
|
final String accessibilityHint = (String) view.getTag(R.id.accessibility_hint);
|
|
176
|
-
|
|
179
|
+
final List<String> contentDescription = new ArrayList<>();
|
|
177
180
|
if (accessibilityLabel != null) {
|
|
178
|
-
contentDescription.
|
|
181
|
+
contentDescription.add(accessibilityLabel);
|
|
179
182
|
}
|
|
180
183
|
if (accessibilityStates != null) {
|
|
181
184
|
for (int i = 0; i < accessibilityStates.size(); i++) {
|
|
182
185
|
String state = accessibilityStates.getString(i);
|
|
183
186
|
if (sStateDescription.containsKey(state)) {
|
|
184
|
-
contentDescription.
|
|
187
|
+
contentDescription.add(view.getContext().getString(sStateDescription.get(state)));
|
|
185
188
|
}
|
|
186
189
|
}
|
|
187
190
|
}
|
|
188
191
|
if (accessibilityHint != null) {
|
|
189
|
-
contentDescription.
|
|
192
|
+
contentDescription.add(accessibilityHint);
|
|
190
193
|
}
|
|
191
|
-
if (contentDescription.
|
|
192
|
-
view.setContentDescription(
|
|
194
|
+
if (contentDescription.size() > 0) {
|
|
195
|
+
view.setContentDescription(TextUtils.join(", ", contentDescription));
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
198
|
|
|
@@ -213,7 +213,9 @@ public class ReactEditText extends EditText {
|
|
|
213
213
|
}
|
|
214
214
|
setFocusableInTouchMode(true);
|
|
215
215
|
boolean focused = super.requestFocus(direction, previouslyFocusedRect);
|
|
216
|
-
|
|
216
|
+
if (getShowSoftInputOnFocus()) {
|
|
217
|
+
showSoftKeyboard();
|
|
218
|
+
}
|
|
217
219
|
return focused;
|
|
218
220
|
}
|
|
219
221
|
|
package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java
CHANGED
|
@@ -715,6 +715,12 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
|
|
715
715
|
view.setBorderStyle(borderStyle);
|
|
716
716
|
}
|
|
717
717
|
|
|
718
|
+
@ReactProp(name = "showSoftInputOnFocus", defaultBoolean = true)
|
|
719
|
+
public void showKeyboardOnFocus(ReactEditText view, boolean showKeyboardOnFocus) {
|
|
720
|
+
view.setShowSoftInputOnFocus(showKeyboardOnFocus);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
|
|
718
724
|
@ReactPropGroup(names = {
|
|
719
725
|
ViewProps.BORDER_WIDTH,
|
|
720
726
|
ViewProps.BORDER_LEFT_WIDTH,
|
package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
CHANGED
|
@@ -646,32 +646,32 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
|
|
646
646
|
}
|
|
647
647
|
|
|
648
648
|
mPathForBorderRadiusOutline.addRoundRect(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
649
|
+
mTempRectForBorderRadiusOutline,
|
|
650
|
+
new float[] {
|
|
651
|
+
topLeftRadius + extraRadiusForOutline,
|
|
652
|
+
topLeftRadius + extraRadiusForOutline,
|
|
653
|
+
topRightRadius + extraRadiusForOutline,
|
|
654
|
+
topRightRadius + extraRadiusForOutline,
|
|
655
|
+
bottomRightRadius + extraRadiusForOutline,
|
|
656
|
+
bottomRightRadius + extraRadiusForOutline,
|
|
657
|
+
bottomLeftRadius + extraRadiusForOutline,
|
|
658
|
+
bottomLeftRadius + extraRadiusForOutline
|
|
659
|
+
},
|
|
660
|
+
Path.Direction.CW);
|
|
661
661
|
|
|
662
662
|
mCenterDrawPath.addRoundRect(
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
663
|
+
mTempRectForCenterDrawPath,
|
|
664
|
+
new float[] {
|
|
665
|
+
innerTopLeftRadiusX + (topLeftRadius > 0 ? extraRadiusForOutline : 0),
|
|
666
|
+
innerTopLeftRadiusY + (topLeftRadius > 0 ? extraRadiusForOutline : 0),
|
|
667
|
+
innerTopRightRadiusX + (topRightRadius > 0 ? extraRadiusForOutline : 0),
|
|
668
|
+
innerTopRightRadiusY + (topRightRadius > 0 ? extraRadiusForOutline : 0),
|
|
669
|
+
innerBottomRightRadiusX + (bottomRightRadius > 0 ? extraRadiusForOutline : 0),
|
|
670
|
+
innerBottomRightRadiusY + (bottomRightRadius > 0 ? extraRadiusForOutline : 0),
|
|
671
|
+
innerBottomLeftRadiusX + (bottomLeftRadius > 0 ? extraRadiusForOutline : 0),
|
|
672
|
+
innerBottomLeftRadiusY + (bottomLeftRadius > 0 ? extraRadiusForOutline : 0)
|
|
673
|
+
},
|
|
674
|
+
Path.Direction.CW);
|
|
675
675
|
|
|
676
676
|
/**
|
|
677
677
|
* Rounded Multi-Colored Border Algorithm:
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4ca96aa48a90430c0db348b10d2c0c2c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7294ac6b01cff14ca0651ff23861dd2d97fcab92
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d89ff34b6415d18a686ed859a2cf85e5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
635fabaefff2d6cd4f36ef62fe41c7d7ee991df3
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8409c91445b6ec9c6cb46bb34329eea8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
326ba9370bddd10ad2c3d73ff7c70235e1c09cd9
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<modelVersion>4.0.0</modelVersion>
|
|
5
5
|
<groupId>com.facebook.react</groupId>
|
|
6
6
|
<artifactId>react-native</artifactId>
|
|
7
|
-
<version>0.60.
|
|
7
|
+
<version>0.60.5</version>
|
|
8
8
|
<packaging>aar</packaging>
|
|
9
9
|
<name>ReactNative</name>
|
|
10
10
|
<description>A framework for building native apps with React</description>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8830d738e28370e6724dbeaa85355d18
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
61d3f816dc0a84aecadf04de2f145f53b41a5a0a
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
<groupId>com.facebook.react</groupId>
|
|
4
4
|
<artifactId>react-native</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<release>0.60.
|
|
6
|
+
<release>0.60.5</release>
|
|
7
7
|
<versions>
|
|
8
|
-
<version>0.60.
|
|
8
|
+
<version>0.60.5</version>
|
|
9
9
|
</versions>
|
|
10
|
-
<lastUpdated>
|
|
10
|
+
<lastUpdated>20190813172609</lastUpdated>
|
|
11
11
|
</versioning>
|
|
12
12
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e78377e13304ef88649c33e3c4584ab8
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
071489cffd23c2b186e5414e9651789b75f09d78
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.5",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@babel/runtime": "^7.0.0",
|
|
84
|
-
"@react-native-community/cli": "^2.0
|
|
85
|
-
"@react-native-community/cli-platform-android": "^2.0
|
|
86
|
-
"@react-native-community/cli-platform-ios": "^2.
|
|
84
|
+
"@react-native-community/cli": "^2.6.0",
|
|
85
|
+
"@react-native-community/cli-platform-android": "^2.6.0",
|
|
86
|
+
"@react-native-community/cli-platform-ios": "^2.4.1",
|
|
87
87
|
"abort-controller": "^3.0.0",
|
|
88
88
|
"art": "^0.10.0",
|
|
89
89
|
"base64-js": "^1.1.2",
|
package/template/ios/Podfile
CHANGED
|
@@ -6,7 +6,6 @@ target 'HelloWorld' do
|
|
|
6
6
|
pod 'React', :path => '../node_modules/react-native/'
|
|
7
7
|
pod 'React-Core', :path => '../node_modules/react-native/React'
|
|
8
8
|
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
|
|
9
|
-
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
|
|
10
9
|
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
|
|
11
10
|
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
|
|
12
11
|
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
|
package/template/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "16.8.6",
|
|
11
|
-
"react-native": "0.60.
|
|
11
|
+
"react-native": "0.60.5"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@babel/core": "^7.5.0",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@react-native-community/eslint-config": "^0.0.3",
|
|
17
17
|
"babel-jest": "^24.1.0",
|
|
18
18
|
"jest": "^24.1.0",
|
|
19
|
-
"metro-react-native-babel-preset": "
|
|
19
|
+
"metro-react-native-babel-preset": "0.54.1",
|
|
20
20
|
"react-test-renderer": "16.8.6"
|
|
21
21
|
},
|
|
22
22
|
"jest": {
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2013, Facebook, Inc.
|
|
2
|
-
// All rights reserved.
|
|
3
|
-
// Redistribution and use in source and binary forms, with or without
|
|
4
|
-
// modification, are permitted provided that the following conditions are met:
|
|
5
|
-
// * Redistributions of source code must retain the above copyright notice,
|
|
6
|
-
// this list of conditions and the following disclaimer.
|
|
7
|
-
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
8
|
-
// this list of conditions and the following disclaimer in the documentation
|
|
9
|
-
// and/or other materials provided with the distribution.
|
|
10
|
-
// * Neither the name Facebook nor the names of its contributors may be used to
|
|
11
|
-
// endorse or promote products derived from this software without specific
|
|
12
|
-
// prior written permission.
|
|
13
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
14
|
-
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15
|
-
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
-
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
17
|
-
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
18
|
-
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
19
|
-
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
20
|
-
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
21
|
-
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
22
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# fishhook
|
|
2
|
-
|
|
3
|
-
__fishhook__ is a very simple library that enables dynamically rebinding symbols in Mach-O binaries running on iOS in the simulator and on device. This provides functionality that is similar to using [`DYLD_INTERPOSE`][interpose] on OS X. At Facebook, we've found it useful as a way to hook calls in libSystem for debugging/tracing purposes (for example, auditing for double-close issues with file descriptors).
|
|
4
|
-
|
|
5
|
-
[interpose]: http://opensource.apple.com/source/dyld/dyld-210.2.3/include/mach-o/dyld-interposing.h "<mach-o/dyld-interposing.h>"
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
8
|
-
|
|
9
|
-
Once you add `fishhook.h`/`fishhook.c` to your project, you can rebind symbols as follows:
|
|
10
|
-
```Objective-C
|
|
11
|
-
#import <dlfcn.h>
|
|
12
|
-
|
|
13
|
-
#import <UIKit/UIKit.h>
|
|
14
|
-
|
|
15
|
-
#import "AppDelegate.h"
|
|
16
|
-
#import "fishhook.h"
|
|
17
|
-
|
|
18
|
-
static int (*orig_close)(int);
|
|
19
|
-
static int (*orig_open)(const char *, int, ...);
|
|
20
|
-
|
|
21
|
-
int my_close(int fd) {
|
|
22
|
-
printf("Calling real close(%d)\n", fd);
|
|
23
|
-
return orig_close(fd);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
int my_open(const char *path, int oflag, ...) {
|
|
27
|
-
va_list ap = {0};
|
|
28
|
-
mode_t mode = 0;
|
|
29
|
-
|
|
30
|
-
if ((oflag & O_CREAT) != 0) {
|
|
31
|
-
// mode only applies to O_CREAT
|
|
32
|
-
va_start(ap, oflag);
|
|
33
|
-
mode = va_arg(ap, int);
|
|
34
|
-
va_end(ap);
|
|
35
|
-
printf("Calling real open('%s', %d, %d)\n", path, oflag, mode);
|
|
36
|
-
return orig_open(path, oflag, mode);
|
|
37
|
-
} else {
|
|
38
|
-
printf("Calling real open('%s', %d)\n", path, oflag);
|
|
39
|
-
return orig_open(path, oflag, mode);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
int main(int argc, char * argv[])
|
|
44
|
-
{
|
|
45
|
-
@autoreleasepool {
|
|
46
|
-
rebind_symbols((struct rebinding[2]){{"close", my_close, (void *)&orig_close}, {"open", my_open, (void *)&orig_open}}, 2);
|
|
47
|
-
|
|
48
|
-
// Open our own binary and print out first 4 bytes (which is the same
|
|
49
|
-
// for all Mach-O binaries on a given architecture)
|
|
50
|
-
int fd = open(argv[0], O_RDONLY);
|
|
51
|
-
uint32_t magic_number = 0;
|
|
52
|
-
read(fd, &magic_number, 4);
|
|
53
|
-
printf("Mach-O Magic Number: %x \n", magic_number);
|
|
54
|
-
close(fd);
|
|
55
|
-
|
|
56
|
-
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
### Sample output
|
|
61
|
-
```
|
|
62
|
-
Calling real open('/var/mobile/Applications/161DA598-5B83-41F5-8A44-675491AF6A2C/Test.app/Test', 0)
|
|
63
|
-
Mach-O Magic Number: feedface
|
|
64
|
-
Calling real close(3)
|
|
65
|
-
...
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## How it works
|
|
69
|
-
|
|
70
|
-
`dyld` binds lazy and non-lazy symbols by updating pointers in particular sections of the `__DATA` segment of a Mach-O binary. __fishhook__ re-binds these symbols by determining the locations to update for each of the symbol names passed to `rebind_symbols` and then writing out the corresponding replacements.
|
|
71
|
-
|
|
72
|
-
For a given image, the `__DATA` segment may contain two sections that are relevant for dynamic symbol bindings: `__nl_symbol_ptr` and `__la_symbol_ptr`. `__nl_symbol_ptr` is an array of pointers to non-lazily bound data (these are bound at the time a library is loaded) and `__la_symbol_ptr` is an array of pointers to imported functions that is generally filled by a routine called `dyld_stub_binder` during the first call to that symbol (it's also possible to tell `dyld` to bind these at launch). In order to find the name of the symbol that corresponds to a particular location in one of these sections, we have to jump through several layers of indirection. For the two relevant sections, the section headers (`struct section`s from `<mach-o/loader.h>`) provide an offset (in the `reserved1` field) into what is known as the indirect symbol table. The indirect symbol table, which is located in the `__LINKEDIT` segment of the binary, is just an array of indexes into the symbol table (also in `__LINKEDIT`) whose order is identical to that of the pointers in the non-lazy and lazy symbol sections. So, given `struct section nl_symbol_ptr`, the corresponding index in the symbol table of the first address in that section is `indirect_symbol_table[nl_symbol_ptr->reserved1]`. The symbol table itself is an array of `struct nlist`s (see `<mach-o/nlist.h>`), and each `nlist` contains an index into the string table in `__LINKEDIT` which where the actual symbol names are stored. So, for each pointer `__nl_symbol_ptr` and `__la_symbol_ptr`, we are able to find the corresponding symbol and then the corresponding string to compare against the requested symbol names, and if there is a match, we replace the pointer in the section with the replacement.
|
|
73
|
-
|
|
74
|
-
The process of looking up the name of a given entry in the lazy or non-lazy pointer tables looks like this:
|
|
75
|
-

|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
#
|
|
4
|
-
# This source code is licensed under the MIT license found in the
|
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
|
6
|
-
|
|
7
|
-
require "json"
|
|
8
|
-
|
|
9
|
-
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
|
|
10
|
-
version = package['version']
|
|
11
|
-
|
|
12
|
-
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
13
|
-
if version == '1000.0.0'
|
|
14
|
-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
15
|
-
source[:commit] = `git rev-parse HEAD`.strip
|
|
16
|
-
else
|
|
17
|
-
source[:tag] = "v#{version}"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
Pod::Spec.new do |s|
|
|
21
|
-
s.name = "React-fishhook"
|
|
22
|
-
s.version = version
|
|
23
|
-
s.summary = "A very simple library that enables dynamically rebinding symbols in Mach-O binaries running on iOS in the simulator and on device."
|
|
24
|
-
s.homepage = "http://facebook.github.io/react-native/"
|
|
25
|
-
s.license = package["license"]
|
|
26
|
-
s.author = "Facebook, Inc. and its affiliates"
|
|
27
|
-
s.platforms = { :ios => "9.0", :tvos => "9.2" }
|
|
28
|
-
s.source = source
|
|
29
|
-
s.source_files = "*.{c,h}"
|
|
30
|
-
s.header_dir = "fishhook"
|
|
31
|
-
end
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2013, Facebook, Inc.
|
|
2
|
-
// All rights reserved.
|
|
3
|
-
// Redistribution and use in source and binary forms, with or without
|
|
4
|
-
// modification, are permitted provided that the following conditions are met:
|
|
5
|
-
// * Redistributions of source code must retain the above copyright notice,
|
|
6
|
-
// this list of conditions and the following disclaimer.
|
|
7
|
-
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
8
|
-
// this list of conditions and the following disclaimer in the documentation
|
|
9
|
-
// and/or other materials provided with the distribution.
|
|
10
|
-
// * Neither the name Facebook nor the names of its contributors may be used to
|
|
11
|
-
// endorse or promote products derived from this software without specific
|
|
12
|
-
// prior written permission.
|
|
13
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
14
|
-
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15
|
-
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
-
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
17
|
-
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
18
|
-
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
19
|
-
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
20
|
-
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
21
|
-
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
22
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
-
|
|
24
|
-
#import "fishhook.h"
|
|
25
|
-
|
|
26
|
-
#import <dlfcn.h>
|
|
27
|
-
#import <stdlib.h>
|
|
28
|
-
#import <string.h>
|
|
29
|
-
#import <sys/types.h>
|
|
30
|
-
#import <mach-o/dyld.h>
|
|
31
|
-
#import <mach-o/loader.h>
|
|
32
|
-
#import <mach-o/nlist.h>
|
|
33
|
-
|
|
34
|
-
#ifdef __LP64__
|
|
35
|
-
typedef struct mach_header_64 mach_header_t;
|
|
36
|
-
typedef struct segment_command_64 segment_command_t;
|
|
37
|
-
typedef struct section_64 section_t;
|
|
38
|
-
typedef struct nlist_64 nlist_t;
|
|
39
|
-
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT_64
|
|
40
|
-
#else
|
|
41
|
-
typedef struct mach_header mach_header_t;
|
|
42
|
-
typedef struct segment_command segment_command_t;
|
|
43
|
-
typedef struct section section_t;
|
|
44
|
-
typedef struct nlist nlist_t;
|
|
45
|
-
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT
|
|
46
|
-
#endif
|
|
47
|
-
|
|
48
|
-
#ifndef SEG_DATA_CONST
|
|
49
|
-
#define SEG_DATA_CONST "__DATA_CONST"
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
|
-
struct rebindings_entry {
|
|
53
|
-
struct rebinding *rebindings;
|
|
54
|
-
size_t rebindings_nel;
|
|
55
|
-
struct rebindings_entry *next;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
static struct rebindings_entry *_rebindings_head;
|
|
59
|
-
|
|
60
|
-
static int prepend_rebindings(struct rebindings_entry **rebindings_head,
|
|
61
|
-
struct rebinding rebindings[],
|
|
62
|
-
size_t nel) {
|
|
63
|
-
struct rebindings_entry *new_entry = (struct rebindings_entry *) malloc(sizeof(struct rebindings_entry));
|
|
64
|
-
if (!new_entry) {
|
|
65
|
-
return -1;
|
|
66
|
-
}
|
|
67
|
-
new_entry->rebindings = (struct rebinding *) malloc(sizeof(struct rebinding) * nel);
|
|
68
|
-
if (!new_entry->rebindings) {
|
|
69
|
-
free(new_entry);
|
|
70
|
-
return -1;
|
|
71
|
-
}
|
|
72
|
-
memcpy(new_entry->rebindings, rebindings, sizeof(struct rebinding) * nel);
|
|
73
|
-
new_entry->rebindings_nel = nel;
|
|
74
|
-
new_entry->next = *rebindings_head;
|
|
75
|
-
*rebindings_head = new_entry;
|
|
76
|
-
return 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static void perform_rebinding_with_section(struct rebindings_entry *rebindings,
|
|
80
|
-
section_t *section,
|
|
81
|
-
intptr_t slide,
|
|
82
|
-
nlist_t *symtab,
|
|
83
|
-
char *strtab,
|
|
84
|
-
uint32_t *indirect_symtab) {
|
|
85
|
-
uint32_t *indirect_symbol_indices = indirect_symtab + section->reserved1;
|
|
86
|
-
void **indirect_symbol_bindings = (void **)((uintptr_t)slide + section->addr);
|
|
87
|
-
for (uint i = 0; i < section->size / sizeof(void *); i++) {
|
|
88
|
-
uint32_t symtab_index = indirect_symbol_indices[i];
|
|
89
|
-
if (symtab_index == INDIRECT_SYMBOL_ABS || symtab_index == INDIRECT_SYMBOL_LOCAL ||
|
|
90
|
-
symtab_index == (INDIRECT_SYMBOL_LOCAL | INDIRECT_SYMBOL_ABS)) {
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
uint32_t strtab_offset = symtab[symtab_index].n_un.n_strx;
|
|
94
|
-
char *symbol_name = strtab + strtab_offset;
|
|
95
|
-
if (strnlen(symbol_name, 2) < 2) {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
struct rebindings_entry *cur = rebindings;
|
|
99
|
-
while (cur) {
|
|
100
|
-
for (uint j = 0; j < cur->rebindings_nel; j++) {
|
|
101
|
-
if (strcmp(&symbol_name[1], cur->rebindings[j].name) == 0) {
|
|
102
|
-
if (cur->rebindings[j].replaced != NULL &&
|
|
103
|
-
indirect_symbol_bindings[i] != cur->rebindings[j].replacement) {
|
|
104
|
-
*(cur->rebindings[j].replaced) = indirect_symbol_bindings[i];
|
|
105
|
-
}
|
|
106
|
-
indirect_symbol_bindings[i] = cur->rebindings[j].replacement;
|
|
107
|
-
goto symbol_loop;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
cur = cur->next;
|
|
111
|
-
}
|
|
112
|
-
symbol_loop:;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
static void rebind_symbols_for_image(struct rebindings_entry *rebindings,
|
|
117
|
-
const struct mach_header *header,
|
|
118
|
-
intptr_t slide) {
|
|
119
|
-
Dl_info info;
|
|
120
|
-
if (dladdr(header, &info) == 0) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
segment_command_t *cur_seg_cmd;
|
|
125
|
-
segment_command_t *linkedit_segment = NULL;
|
|
126
|
-
struct symtab_command* symtab_cmd = NULL;
|
|
127
|
-
struct dysymtab_command* dysymtab_cmd = NULL;
|
|
128
|
-
|
|
129
|
-
uintptr_t cur = (uintptr_t)header + sizeof(mach_header_t);
|
|
130
|
-
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
|
131
|
-
cur_seg_cmd = (segment_command_t *)cur;
|
|
132
|
-
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
|
133
|
-
if (strcmp(cur_seg_cmd->segname, SEG_LINKEDIT) == 0) {
|
|
134
|
-
linkedit_segment = cur_seg_cmd;
|
|
135
|
-
}
|
|
136
|
-
} else if (cur_seg_cmd->cmd == LC_SYMTAB) {
|
|
137
|
-
symtab_cmd = (struct symtab_command*)cur_seg_cmd;
|
|
138
|
-
} else if (cur_seg_cmd->cmd == LC_DYSYMTAB) {
|
|
139
|
-
dysymtab_cmd = (struct dysymtab_command*)cur_seg_cmd;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (!symtab_cmd || !dysymtab_cmd || !linkedit_segment ||
|
|
144
|
-
!dysymtab_cmd->nindirectsyms) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Find base symbol/string table addresses
|
|
149
|
-
uintptr_t linkedit_base = (uintptr_t)slide + linkedit_segment->vmaddr - linkedit_segment->fileoff;
|
|
150
|
-
nlist_t *symtab = (nlist_t *)(linkedit_base + symtab_cmd->symoff);
|
|
151
|
-
char *strtab = (char *)(linkedit_base + symtab_cmd->stroff);
|
|
152
|
-
|
|
153
|
-
// Get indirect symbol table (array of uint32_t indices into symbol table)
|
|
154
|
-
uint32_t *indirect_symtab = (uint32_t *)(linkedit_base + dysymtab_cmd->indirectsymoff);
|
|
155
|
-
|
|
156
|
-
cur = (uintptr_t)header + sizeof(mach_header_t);
|
|
157
|
-
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
|
158
|
-
cur_seg_cmd = (segment_command_t *)cur;
|
|
159
|
-
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
|
160
|
-
if (strcmp(cur_seg_cmd->segname, SEG_DATA) != 0 &&
|
|
161
|
-
strcmp(cur_seg_cmd->segname, SEG_DATA_CONST) != 0) {
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
for (uint j = 0; j < cur_seg_cmd->nsects; j++) {
|
|
165
|
-
section_t *sect =
|
|
166
|
-
(section_t *)(cur + sizeof(segment_command_t)) + j;
|
|
167
|
-
if ((sect->flags & SECTION_TYPE) == S_LAZY_SYMBOL_POINTERS) {
|
|
168
|
-
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
|
169
|
-
}
|
|
170
|
-
if ((sect->flags & SECTION_TYPE) == S_NON_LAZY_SYMBOL_POINTERS) {
|
|
171
|
-
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
static void _rebind_symbols_for_image(const struct mach_header *header,
|
|
179
|
-
intptr_t slide) {
|
|
180
|
-
rebind_symbols_for_image(_rebindings_head, header, slide);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
int rebind_symbols_image(void *header,
|
|
184
|
-
intptr_t slide,
|
|
185
|
-
struct rebinding rebindings[],
|
|
186
|
-
size_t rebindings_nel) {
|
|
187
|
-
struct rebindings_entry *rebindings_head = NULL;
|
|
188
|
-
int retval = prepend_rebindings(&rebindings_head, rebindings, rebindings_nel);
|
|
189
|
-
rebind_symbols_for_image(rebindings_head, (const struct mach_header *) header, slide);
|
|
190
|
-
free(rebindings_head);
|
|
191
|
-
return retval;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel) {
|
|
195
|
-
int retval = prepend_rebindings(&_rebindings_head, rebindings, rebindings_nel);
|
|
196
|
-
if (retval < 0) {
|
|
197
|
-
return retval;
|
|
198
|
-
}
|
|
199
|
-
// If this was the first call, register callback for image additions (which is also invoked for
|
|
200
|
-
// existing images, otherwise, just run on existing images
|
|
201
|
-
if (!_rebindings_head->next) {
|
|
202
|
-
_dyld_register_func_for_add_image(_rebind_symbols_for_image);
|
|
203
|
-
} else {
|
|
204
|
-
uint32_t c = _dyld_image_count();
|
|
205
|
-
for (uint32_t i = 0; i < c; i++) {
|
|
206
|
-
_rebind_symbols_for_image(_dyld_get_image_header(i), _dyld_get_image_vmaddr_slide(i));
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return retval;
|
|
210
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2013, Facebook, Inc.
|
|
2
|
-
// All rights reserved.
|
|
3
|
-
// Redistribution and use in source and binary forms, with or without
|
|
4
|
-
// modification, are permitted provided that the following conditions are met:
|
|
5
|
-
// * Redistributions of source code must retain the above copyright notice,
|
|
6
|
-
// this list of conditions and the following disclaimer.
|
|
7
|
-
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
8
|
-
// this list of conditions and the following disclaimer in the documentation
|
|
9
|
-
// and/or other materials provided with the distribution.
|
|
10
|
-
// * Neither the name Facebook nor the names of its contributors may be used to
|
|
11
|
-
// endorse or promote products derived from this software without specific
|
|
12
|
-
// prior written permission.
|
|
13
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
14
|
-
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15
|
-
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
-
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
17
|
-
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
18
|
-
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
19
|
-
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
20
|
-
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
21
|
-
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
22
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
-
|
|
24
|
-
#ifndef fishhook_h
|
|
25
|
-
#define fishhook_h
|
|
26
|
-
|
|
27
|
-
#include <stddef.h>
|
|
28
|
-
#include <stdint.h>
|
|
29
|
-
|
|
30
|
-
#if !defined(FISHHOOK_EXPORT)
|
|
31
|
-
#define FISHHOOK_VISIBILITY __attribute__((visibility("hidden")))
|
|
32
|
-
#else
|
|
33
|
-
#define FISHHOOK_VISIBILITY __attribute__((visibility("default")))
|
|
34
|
-
#endif
|
|
35
|
-
|
|
36
|
-
#ifdef __cplusplus
|
|
37
|
-
extern "C" {
|
|
38
|
-
#endif //__cplusplus
|
|
39
|
-
|
|
40
|
-
/*
|
|
41
|
-
* A structure representing a particular intended rebinding from a symbol
|
|
42
|
-
* name to its replacement
|
|
43
|
-
*/
|
|
44
|
-
struct rebinding {
|
|
45
|
-
const char *name;
|
|
46
|
-
void *replacement;
|
|
47
|
-
void **replaced;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/*
|
|
51
|
-
* For each rebinding in rebindings, rebinds references to external, indirect
|
|
52
|
-
* symbols with the specified name to instead point at replacement for each
|
|
53
|
-
* image in the calling process as well as for all future images that are loaded
|
|
54
|
-
* by the process. If rebind_functions is called more than once, the symbols to
|
|
55
|
-
* rebind are added to the existing list of rebindings, and if a given symbol
|
|
56
|
-
* is rebound more than once, the later rebinding will take precedence.
|
|
57
|
-
*/
|
|
58
|
-
FISHHOOK_VISIBILITY
|
|
59
|
-
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel);
|
|
60
|
-
|
|
61
|
-
/*
|
|
62
|
-
* Rebinds as above, but only in the specified image. The header should point
|
|
63
|
-
* to the mach-o header, the slide should be the slide offset. Others as above.
|
|
64
|
-
*/
|
|
65
|
-
FISHHOOK_VISIBILITY
|
|
66
|
-
int rebind_symbols_image(void *header,
|
|
67
|
-
intptr_t slide,
|
|
68
|
-
struct rebinding rebindings[],
|
|
69
|
-
size_t rebindings_nel);
|
|
70
|
-
|
|
71
|
-
#ifdef __cplusplus
|
|
72
|
-
}
|
|
73
|
-
#endif //__cplusplus
|
|
74
|
-
|
|
75
|
-
#endif //fishhook_h
|
|
76
|
-
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c6944d83e1a32f78af86441949a1a9a4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e6103cbbd58ccb5da7988da5f9a1781d6f272908
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7945b806fbb4754b8268dccd72bd9ea2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4bb98cabaac00706284707b81d778df120747c5f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7f602e0ee0ede5b7928d66d13dc80d85
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
89171b7e4edef5f67770b794eb93a92ab06289a0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
aea3916d8fa4b602fba4bc158c78bb7d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f0f76e144f9789caa2637709a969f049e399d603
|