@onekeyfe/react-native-network-info 1.1.60 → 3.0.7
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/README.md +31 -0
- package/ios/NetworkInfo.mm +1 -1
- package/ios/getgateway.c +36 -2
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @onekeyfe/react-native-network-info
|
|
2
|
+
|
|
3
|
+
First, a sincere thank-you to the
|
|
4
|
+
`react-native-network-info` maintainers for their excellent work 🙏
|
|
5
|
+
|
|
6
|
+
This package is built on, and inspired by,
|
|
7
|
+
[pusherman/react-native-network-info](https://github.com/pusherman/react-native-network-info).
|
|
8
|
+
|
|
9
|
+
Our original plan was to keep our customizations as patches on top of upstream
|
|
10
|
+
`react-native-network-info`.
|
|
11
|
+
|
|
12
|
+
As our product requirements evolved, the scope of those changes outgrew what we
|
|
13
|
+
could reasonably maintain as an upstream patch set. We regret that we were
|
|
14
|
+
unable to keep this work in patch form.
|
|
15
|
+
|
|
16
|
+
As the gap grew, we ultimately forked `react-native-network-info` to keep
|
|
17
|
+
development and delivery stable.
|
|
18
|
+
|
|
19
|
+
## Upstream Project
|
|
20
|
+
|
|
21
|
+
- Repository: [pusherman/react-native-network-info](https://github.com/pusherman/react-native-network-info)
|
|
22
|
+
- License: MIT
|
|
23
|
+
|
|
24
|
+
## Notes
|
|
25
|
+
|
|
26
|
+
- This fork includes OneKey-specific adaptations for our product requirements.
|
|
27
|
+
- If you are looking for original behavior and full documentation, please refer
|
|
28
|
+
to the upstream repository.
|
|
29
|
+
|
|
30
|
+
Thank you again to everyone who contributes to
|
|
31
|
+
`react-native-network-info` 💙
|
package/ios/NetworkInfo.mm
CHANGED
package/ios/getgateway.c
CHANGED
|
@@ -12,14 +12,48 @@
|
|
|
12
12
|
|
|
13
13
|
#include "TargetConditionals.h"
|
|
14
14
|
#if TARGET_IPHONE_SIMULATOR
|
|
15
|
-
#include <net/route.h>
|
|
16
15
|
#define TypeEN "en1"
|
|
17
16
|
#else
|
|
18
|
-
#include <net/route.h>
|
|
19
17
|
#define TypeEN "en0"
|
|
20
18
|
#endif
|
|
21
19
|
|
|
22
20
|
#include <net/if.h>
|
|
21
|
+
|
|
22
|
+
// Inline route.h definitions (not available in iOS SDK)
|
|
23
|
+
#define RTF_GATEWAY 0x2
|
|
24
|
+
#define NET_RT_FLAGS 2
|
|
25
|
+
#define RTAX_MAX 8
|
|
26
|
+
#define RTAX_DST 0
|
|
27
|
+
#define RTAX_GATEWAY 1
|
|
28
|
+
#define RTA_DST 0x1
|
|
29
|
+
#define RTA_GATEWAY 0x2
|
|
30
|
+
|
|
31
|
+
struct rt_msghdr {
|
|
32
|
+
u_short rtm_msglen;
|
|
33
|
+
u_char rtm_version;
|
|
34
|
+
u_char rtm_type;
|
|
35
|
+
u_short rtm_index;
|
|
36
|
+
int rtm_flags;
|
|
37
|
+
int rtm_addrs;
|
|
38
|
+
pid_t rtm_pid;
|
|
39
|
+
int rtm_seq;
|
|
40
|
+
int rtm_errno;
|
|
41
|
+
int rtm_use;
|
|
42
|
+
u_long rtm_inits;
|
|
43
|
+
struct rt_metrics {
|
|
44
|
+
u_long rmx_locks;
|
|
45
|
+
u_long rmx_mtu;
|
|
46
|
+
u_long rmx_hopcount;
|
|
47
|
+
u_long rmx_expire;
|
|
48
|
+
u_long rmx_recvpipe;
|
|
49
|
+
u_long rmx_sendpipe;
|
|
50
|
+
u_long rmx_ssthresh;
|
|
51
|
+
u_long rmx_rtt;
|
|
52
|
+
u_long rmx_rttvar;
|
|
53
|
+
u_long rmx_pksent;
|
|
54
|
+
u_long rmx_filler[4];
|
|
55
|
+
} rtm_rmx;
|
|
56
|
+
};
|
|
23
57
|
#include <string.h>
|
|
24
58
|
|
|
25
59
|
#define CTL_NET 4 /* network, see socket.h */
|