Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

chore(rn): remove IPv6 address synthesis for remote SDP

Saúl Ibarra Corretgé1d86b5db47dc
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactHostHolder.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactHostHolder.java
index d0e6ab975d..19dd6cbe73 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactHostHolder.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactHostHolder.java
@@ -66,8 +66,7 @@ class ReactHostHolder {
new LocaleDetector(reactContext),
new LogBridgeModule(reactContext),
new PictureInPictureModule(reactContext),
- new ProximityModule(reactContext),
- new org.jitsi.meet.sdk.net.NAT64AddrInfoModule(reactContext)));
+ new ProximityModule(reactContext)));
if (AudioModeModule.useConnectionService()) {
nativeModules.add(new RNConnectionService(reactContext));
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/net/NAT64AddrInfo.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/net/NAT64AddrInfo.java
deleted file mode 100644
index 389ab9d4c5..0000000000
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/net/NAT64AddrInfo.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright @ 2018-present Atlassian Pty Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jitsi.meet.sdk.net;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * Constructs IPv6 addresses for IPv4 addresses in the NAT64 environment.
- *
- * NAT64 translates IPv4 to IPv6 addresses by adding "well known" prefix and
- * suffix configured by the administrator. Those are figured out by discovering
- * both IPv6 and IPv4 addresses of a host and then trying to find a place where
- * the IPv4 address fits into the format described here:
- * https://tools.ietf.org/html/rfc6052#section-2.2
- */
-public class NAT64AddrInfo {
- /**
- * Coverts bytes array to upper case HEX string.
- *
- * @param bytes an array of bytes to be converted
- * @return ex. "010AFF" for an array of {1, 10, 255}.
- */
- static String bytesToHexString(byte[] bytes) {
- StringBuilder hexStr = new StringBuilder();
-
- for (byte b : bytes) {
- hexStr.append(String.format("%02X", b));
- }
-
- return hexStr.toString();
- }
-
- /**
- * Tries to discover the NAT64 prefix/suffix based on the IPv4 and IPv6
- * addresses resolved for given {@code host}.
- *
- * @param host the host for which the code will try to discover IPv4 and
- * IPv6 addresses which then will be used to figure out the NAT64 prefix.
- * @return {@link NAT64AddrInfo} instance if the NAT64 prefix/suffix was
- * successfully discovered or {@code null} if it failed for any reason.
- * @throws UnknownHostException thrown by {@link InetAddress#getAllByName}.
- */
- public static NAT64AddrInfo discover(String host)
- throws UnknownHostException {
- InetAddress ipv4 = null;
- InetAddress ipv6 = null;
-
- for(InetAddress addr : InetAddress.getAllByName(host)) {
- byte[] bytes = addr.getAddress();
-
- if (bytes.length == 4) {
- ipv4 = addr;
- } else if (bytes.length == 16) {
- ipv6 = addr;
- }
- }
-
- if (ipv4 != null && ipv6 != null) {
- return figureOutNAT64AddrInfo(ipv4.getAddress(), ipv6.getAddress());
- }
-
- return null;
- }
-
- /**
- * Based on IPv4 and IPv6 addresses of the same host, the method will make
- * an attempt to figure out what are the NAT64 prefix and suffix.
- *
- * @param ipv4AddrBytes the IPv4 address of the same host in NAT64 network,
- * as returned by {@link InetAddress#getAddress()}.
- * @param ipv6AddrBytes the IPv6 address of the same host in NAT64 network,
- * as returned by {@link InetAddress#getAddress()}.
- * @return {@link NAT64AddrInfo} instance which contains the prefix/suffix
- * of the current NAT64 network or {@code null} if the prefix could not be
- * found.
- */
- static NAT64AddrInfo figureOutNAT64AddrInfo(
- byte[] ipv4AddrBytes,
- byte[] ipv6AddrBytes) {
- String ipv6Str = bytesToHexString(ipv6AddrBytes);
- String ipv4Str = bytesToHexString(ipv4AddrBytes);
-
- // NAT64 address format:
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- // |PL| 0-------------32--40--48--56--64--72--80--88--96--104---------|
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- // |32| prefix |v4(32) | u | suffix |
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- // |40| prefix |v4(24) | u |(8)| suffix |
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- // |48| prefix |v4(16) | u | (16) | suffix |
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- // |56| prefix |(8)| u | v4(24) | suffix |
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- // |64| prefix | u | v4(32) | suffix |
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- // |96| prefix | v4(32) |
- // +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- int prefixLength = 96;
- int suffixLength = 0;
- String prefix = null;
- String suffix = null;
-
- if (ipv4Str.equalsIgnoreCase(ipv6Str.substring(prefixLength / 4))) {
- prefix = ipv6Str.substring(0, prefixLength / 4);
- } else {
- // Cut out the 'u' octet
- ipv6Str = ipv6Str.substring(0, 16) + ipv6Str.substring(18);
-
- for (prefixLength = 64, suffixLength = 6; prefixLength >= 32; ) {
- if (ipv4Str.equalsIgnoreCase(
- ipv6Str.substring(
- prefixLength / 4, prefixLength / 4 + 8))) {
- prefix = ipv6Str.substring(0, prefixLength / 4);
- suffix = ipv6Str.substring(ipv6Str.length() - suffixLength);
- break;
- }
-
- prefixLength -= 8;
- suffixLength += 2;
- }
- }
-
- return prefix != null ? new NAT64AddrInfo(prefix, suffix) : null;
- }
-
- /**
- * An overload for {@link #hexStringToIPv6String(StringBuilder)}.
- *
- * @param hexStr a hex representation of IPv6 address bytes.
- * @return an IPv6 address string.
- */
- static String hexStringToIPv6String(String hexStr) {
- return hexStringToIPv6String(new StringBuilder(hexStr));
- }
-
- /**
- * Converts from HEX representation of IPv6 address bytes into IPv6 address
- * string which includes the ':' signs.
- *
- * @param str a hex representation of IPv6 address bytes.
- * @return eg. FE80:CD00:0000:0CDA:1357:0000:212F:749C
- */
- static String hexStringToIPv6String(StringBuilder str) {
- for (int i = 32 - 4; i > 0; i -= 4) {
- str.insert(i, ":");
- }
-
- return str.toString().toUpperCase();
- }
-
- /**
- * Parses an IPv4 address string and returns it's byte array representation.
- *
- * @param ipv4Address eg. '192.168.3.23'
- * @return byte representation of given IPv4 address string.
- * @throws IllegalArgumentException if the address is not in valid format.
- */
- static byte[] ipv4AddressStringToBytes(String ipv4Address) {
- InetAddress address;
-
- try {
- address = InetAddress.getByName(ipv4Address);
- } catch (UnknownHostException e) {
- throw new IllegalArgumentException(
- "Invalid IP address: " + ipv4Address, e);
- }
-
- byte[] bytes = address.getAddress();
-
- if (bytes.length != 4) {
- throw new IllegalArgumentException(
- "Not an IPv4 address: " + ipv4Address);
- }
-
- return bytes;
- }
-
- /**
- * The NAT64 prefix added to construct IPv6 from an IPv4 address.
- */
- private final String prefix;
-
- /**
- * The NAT64 suffix (if any) used to construct IPv6 from an IPv4 address.
- */
- private final String suffix;
-
- /**
- * Creates new instance of {@link NAT64AddrInfo}.
- *
- * @param prefix the NAT64 prefix.
- * @param suffix the NAT64 suffix.
- */
- private NAT64AddrInfo(String prefix, String suffix) {
- this.prefix = prefix;
- this.suffix = suffix;
- }
-
- /**
- * Based on the NAT64 prefix and suffix will create an IPv6 representation
- * of the given IPv4 address.
- *
- * @param ipv4Address eg. '192.34.2.3'
- * @return IPv6 address string eg. FE80:CD00:0000:0CDA:1357:0000:212F:749C
- * @throws IllegalArgumentException if given string is not a valid IPv4
- * address.
- */
- public String getIPv6Address(String ipv4Address) {
- byte[] ipv4AddressBytes = ipv4AddressStringToBytes(ipv4Address);
- StringBuilder newIPv6Str = new StringBuilder();
-
- newIPv6Str.append(prefix);
- newIPv6Str.append(bytesToHexString(ipv4AddressBytes));
-
- if (suffix != null) {
- // Insert the 'u' octet.
- newIPv6Str.insert(16, "00");
- newIPv6Str.append(suffix);
- }
-
- return hexStringToIPv6String(newIPv6Str);
- }
-}
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/net/NAT64AddrInfoModule.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/net/NAT64AddrInfoModule.java
deleted file mode 100644
index d88872fb6d..0000000000
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/net/NAT64AddrInfoModule.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright @ 2018-present Atlassian Pty Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jitsi.meet.sdk.net;
-
-import com.facebook.react.bridge.Promise;
-import com.facebook.react.bridge.ReactApplicationContext;
-import com.facebook.react.bridge.ReactContextBaseJavaModule;
-import com.facebook.react.bridge.ReactMethod;
-import com.facebook.react.module.annotations.ReactModule;
-
-import org.jitsi.meet.sdk.log.JitsiMeetLogger;
-
-import java.net.UnknownHostException;
-
-/**
- * This module exposes the functionality of creating an IPv6 representation
- * of IPv4 addresses in NAT64 environment.
- *
- * See[1] and [2] for more info on what NAT64 is.
- * [1]: https://tools.ietf.org/html/rfc6146
- * [2]: https://tools.ietf.org/html/rfc6052
- */
-@ReactModule(name = NAT64AddrInfoModule.NAME)
-public class NAT64AddrInfoModule
- extends ReactContextBaseJavaModule {
-
- public final static String NAME = "NAT64AddrInfo";
-
- /**
- * The host for which the module wil try to resolve both IPv4 and IPv6
- * addresses in order to figure out the NAT64 prefix.
- */
- private final static String HOST = "ipv4only.arpa";
-
- /**
- * How long is the {@link NAT64AddrInfo} instance valid.
- */
- private final static long INFO_LIFETIME = 60 * 1000;
-
- /**
- * The {@code Log} tag {@code NAT64AddrInfoModule} is to log messages with.
- */
- private final static String TAG = NAME;
-
- /**
- * The {@link NAT64AddrInfo} instance which holds NAT64 prefix/suffix.
- */
- private NAT64AddrInfo info;
-
- /**
- * When {@link #info} was created.
- */
- private long infoTimestamp;
-
- /**
- * Creates new {@link NAT64AddrInfoModule}.
- *
- * @param reactContext the react context to be used by the new module
- * instance.
- */
- public NAT64AddrInfoModule(ReactApplicationContext reactContext) {
- super(reactContext);
- }
-
- /**
- * Tries to obtain IPv6 address for given IPv4 address in NAT64 environment.
- *
- * @param ipv4Address IPv4 address string.
- * @param promise a {@link Promise} which will be resolved either with IPv6
- * address for given IPv4 address or with {@code null} if no
- * {@link NAT64AddrInfo} was resolved for the current network. Will be
- * rejected if given {@code ipv4Address} is not a valid IPv4 address.
- */
- @ReactMethod
- public void getIPv6Address(String ipv4Address, final Promise promise) {
- // Reset if cached for too long.
- if (System.currentTimeMillis() - infoTimestamp > INFO_LIFETIME) {
- info = null;
- }
-
- if (info == null) {
- String host = HOST;
-
- try {
- info = NAT64AddrInfo.discover(host);
- } catch (UnknownHostException e) {
- JitsiMeetLogger.e(e, TAG + " NAT64AddrInfo.discover: " + host);
- }
- infoTimestamp = System.currentTimeMillis();
- }
-
- String result;
-
- try {
- result = info == null ? null : info.getIPv6Address(ipv4Address);
- } catch (IllegalArgumentException exc) {
- JitsiMeetLogger.e(exc, TAG + " Failed to get IPv6 address for: " + ipv4Address);
-
- // We don't want to reject. It's not a big deal if there's no IPv6
- // address resolved.
- result = null;
- }
- promise.resolve(result);
- }
-
- @Override
- public String getName() {
- return NAME;
- }
-}
diff --git a/android/sdk/src/test/java/org/jitsi/meet/sdk/net/NAT64AddrInfoTest.java b/android/sdk/src/test/java/org/jitsi/meet/sdk/net/NAT64AddrInfoTest.java
deleted file mode 100644
index c01ecafc8a..0000000000
--- a/android/sdk/src/test/java/org/jitsi/meet/sdk/net/NAT64AddrInfoTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright @ 2017-present Atlassian Pty Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jitsi.meet.sdk.net;
-
-import org.junit.Test;
-
-import java.math.BigInteger;
-import java.net.UnknownHostException;
-
-import static org.junit.Assert.*;
-
-/**
- * Tests for {@link NAT64AddrInfo} class.
- */
-public class NAT64AddrInfoTest {
- /**
- * Test case for the 96 prefix length.
- */
- @Test
- public void test96Prefix() {
- testPrefixSuffix(
- "260777000000000400000000", "", "203.0.113.1", "23.17.23.3");
- }
-
- /**
- * Test case for the 64 prefix length.
- */
- @Test
- public void test64Prefix() {
- String prefix = "1FF2A227B3AAF3D2";
- String suffix = "BB87C8";
-
- testPrefixSuffix(prefix, suffix, "48.46.87.34", "23.87.145.4");
- }
-
- /**
- * Test case for the 56 prefix length.
- */
- @Test
- public void test56Prefix() {
- String prefix = "1FF2A227B3AAF3";
- String suffix = "A2BB87C8";
-
- testPrefixSuffix(prefix, suffix, "34.72.234.255", "1.235.3.65");
- }
-
- /**
- * Test case for the 48 prefix length.
- */
- @Test
- public void test48Prefix() {
- String prefix = "1FF2A227B3AA";
- String suffix = "72A2BB87C8";
-
- testPrefixSuffix(prefix, suffix, "97.54.3.23", "77.49.0.33");
- }
-
- /**
- * Test case for the 40 prefix length.
- */
- @Test
- public void test40Prefix() {
- String prefix = "1FF2A227B3";
- String suffix = "D972A2BB87C8";
-
- testPrefixSuffix(prefix, suffix, "10.23.56.121", "97.65.32.21");
- }
-
- /**
- * Test case for the 32 prefix length.
- */
- @Test
- public void test32Prefix()
- throws UnknownHostException {
- String prefix = "1FF2A227";
- String suffix = "20D972A2BB87C8";
-
- testPrefixSuffix(prefix, suffix, "162.63.65.189", "135.222.84.206");
- }
-
- private static String buildIPv6Addr(
- String prefix, String suffix, String ipv4Hex) {
- String ipv6Str = prefix + ipv4Hex + suffix;
-
- if (suffix.length() > 0) {
- ipv6Str = new StringBuilder(ipv6Str).insert(16, "00").toString();
- }
-
- return ipv6Str;
- }
-
- private void testPrefixSuffix(
- String prefix, String suffix, String ipv4, String otherIPv4) {
- byte[] ipv4Bytes = NAT64AddrInfo.ipv4AddressStringToBytes(ipv4);
- String ipv4String = NAT64AddrInfo.bytesToHexString(ipv4Bytes);
- String ipv6Str = buildIPv6Addr(prefix, suffix, ipv4String);
-
- BigInteger ipv6Address = new BigInteger(ipv6Str, 16);
-
- NAT64AddrInfo nat64AddrInfo
- = NAT64AddrInfo.figureOutNAT64AddrInfo(
- ipv4Bytes, ipv6Address.toByteArray());
-
- assertNotNull("Failed to figure out NAT64 info", nat64AddrInfo);
-
- String newIPv6 = nat64AddrInfo.getIPv6Address(ipv4);
-
- assertEquals(
- NAT64AddrInfo.hexStringToIPv6String(ipv6Address.toString(16)),
- newIPv6);
-
- byte[] ipv4Addr2 = NAT64AddrInfo.ipv4AddressStringToBytes(otherIPv4);
- String ipv4Addr2Hex = NAT64AddrInfo.bytesToHexString(ipv4Addr2);
-
- newIPv6 = nat64AddrInfo.getIPv6Address(otherIPv4);
-
- assertEquals(
- NAT64AddrInfo.hexStringToIPv6String(
- buildIPv6Addr(prefix, suffix, ipv4Addr2Hex)),
- newIPv6);
- }
-
- @Test
- public void testInvalidIPv4Format() {
- testInvalidIPv4Format("256.1.2.3");
- testInvalidIPv4Format("FE80:CD00:0000:0CDA:1357:0000:212F:749C");
- }
-
- private void testInvalidIPv4Format(String ipv4Str) {
- try {
- NAT64AddrInfo.ipv4AddressStringToBytes(ipv4Str);
- fail("Did not throw IllegalArgumentException");
- } catch (IllegalArgumentException exc) {
- /* OK */
- }
- }
-}
diff --git a/ios/sdk/sdk.xcodeproj/project.pbxproj b/ios/sdk/sdk.xcodeproj/project.pbxproj
index 210ed55b22..a50187197c 100644
--- a/ios/sdk/sdk.xcodeproj/project.pbxproj
+++ b/ios/sdk/sdk.xcodeproj/project.pbxproj
@@ -17,7 +17,6 @@
0BB9AD7D1F60356D001C08DB /* AppInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BB9AD7C1F60356D001C08DB /* AppInfo.m */; };
0BC4B8691F8C03A700CE8B21 /* CallKitIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0BC4B8681F8C01E100CE8B21 /* CallKitIcon.png */; };
0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495C1EC4B6C600B793EE /* AudioMode.m */; };
- 0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495D1EC4B6C600B793EE /* POSIX.m */; };
0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495E1EC4B6C600B793EE /* Proximity.m */; };
0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */; settings = {ATTRIBUTES = (Public, ); }; };
3453F4A32680898C4A40E821 /* libPods-JitsiMeetSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 927ED7DF018DE5E12C4C3404 /* libPods-JitsiMeetSDK.a */; };
@@ -80,7 +79,6 @@
DE9A014A289A9A9A00E41CBB /* JitsiMeetUserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DE762DB522AFDE8D000DEBD6 /* JitsiMeetUserInfo.m */; };
DE9A014B289A9A9A00E41CBB /* JitsiMeetConferenceOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = DEAD3225220C497000E93636 /* JitsiMeetConferenceOptions.m */; };
DE9A014D289A9A9A00E41CBB /* ExternalAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BA13D301EE83FF8007BEF7F /* ExternalAPI.m */; };
- DE9A014E289A9A9A00E41CBB /* POSIX.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495D1EC4B6C600B793EE /* POSIX.m */; };
DE9A014F289A9A9A00E41CBB /* InfoPlistUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C8AFD27E2462C613000293D2 /* InfoPlistUtil.m */; };
DE9A0150289A9A9A00E41CBB /* PiPViewCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6CC49AE207412CF000DFA42 /* PiPViewCoordinator.swift */; };
DE9A0151289A9A9A00E41CBB /* LocaleDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFC743D21B178FA00E4DD96 /* LocaleDetector.m */; };
@@ -120,7 +118,6 @@
0BB9AD7C1F60356D001C08DB /* AppInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppInfo.m; sourceTree = "<group>"; };
0BC4B8681F8C01E100CE8B21 /* CallKitIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CallKitIcon.png; path = "../../react/features/mobile/call-integration/CallKitIcon.png"; sourceTree = "<group>"; };
0BCA495C1EC4B6C600B793EE /* AudioMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioMode.m; sourceTree = "<group>"; };
- 0BCA495D1EC4B6C600B793EE /* POSIX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = POSIX.m; sourceTree = "<group>"; };
0BCA495E1EC4B6C600B793EE /* Proximity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Proximity.m; sourceTree = "<group>"; };
0BD906E51EC0C00300C8C18E /* JitsiMeetSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JitsiMeetSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0BD906E81EC0C00300C8C18E /* JitsiMeet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeet.h; sourceTree = "<group>"; };
@@ -270,7 +267,6 @@
0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */,
DEFC743D21B178FA00E4DD96 /* LocaleDetector.m */,
C6A3426B204F127900E062DD /* picture-in-picture */,
- 0BCA495D1EC4B6C600B793EE /* POSIX.m */,
0BCA495E1EC4B6C600B793EE /* Proximity.m */,
DEFE535721FB2E9E00011A3A /* ReactUtils.h */,
DEFE535521FB2E8300011A3A /* ReactUtils.m */,
@@ -651,7 +647,6 @@
DE762DB622AFDE8D000DEBD6 /* JitsiMeetUserInfo.m in Sources */,
DEAD3227220C497000E93636 /* JitsiMeetConferenceOptions.m in Sources */,
0BA13D311EE83FF8007BEF7F /* ExternalAPI.m in Sources */,
- 0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */,
C8AFD2802462C613000293D2 /* InfoPlistUtil.m in Sources */,
C6CC49AF207412CF000DFA42 /* PiPViewCoordinator.swift in Sources */,
DEFC743F21B178FA00E4DD96 /* LocaleDetector.m in Sources */,
@@ -682,7 +677,6 @@
DE9A014A289A9A9A00E41CBB /* JitsiMeetUserInfo.m in Sources */,
DE9A014B289A9A9A00E41CBB /* JitsiMeetConferenceOptions.m in Sources */,
DE9A014D289A9A9A00E41CBB /* ExternalAPI.m in Sources */,
- DE9A014E289A9A9A00E41CBB /* POSIX.m in Sources */,
DE9A014F289A9A9A00E41CBB /* InfoPlistUtil.m in Sources */,
DE9A0150289A9A9A00E41CBB /* PiPViewCoordinator.swift in Sources */,
DE9A0151289A9A9A00E41CBB /* LocaleDetector.m in Sources */,
diff --git a/ios/sdk/src/POSIX.m b/ios/sdk/src/POSIX.m
deleted file mode 100644
index 0780866493..0000000000
--- a/ios/sdk/src/POSIX.m
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright @ 2017-present Atlassian Pty Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import <React/RCTBridgeModule.h>
-
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-@interface POSIX : NSObject<RCTBridgeModule>
-@end
-
-@implementation POSIX
-
-RCT_EXPORT_MODULE();
-
-RCT_EXPORT_METHOD(getaddrinfo:(NSString *)hostname
- servname:(NSString *)servname
- resolve:(RCTPromiseResolveBlock)resolve
- reject:(RCTPromiseRejectBlock)reject) {
- int err;
- const char *hostname_ = hostname ? hostname.UTF8String : NULL;
- const char *servname_ = servname ? servname.UTF8String : NULL;
- struct addrinfo hints;
- struct addrinfo *res;
- NSString *rejectCode;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_UNSPEC;
- hints.ai_flags = AI_DEFAULT;
- if (0 == (err = getaddrinfo(hostname_, servname_, &hints, &res))) {
- char addr_[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN)];
- NSMutableArray *res_ = [[NSMutableArray alloc] init];
-
- for (struct addrinfo *ai = res; ai; ai = ai->ai_next) {
- int af = ai->ai_family;
- struct sockaddr *sa = ai->ai_addr;
- void *addr;
-
- switch (af) {
- case AF_INET:
- addr = &(((struct sockaddr_in *) sa)->sin_addr);
- break;
- case AF_INET6:
- addr = &(((struct sockaddr_in6 *) sa)->sin6_addr);
- break;
- default:
- addr = NULL;
- break;
- }
- if (addr) {
- if (inet_ntop(af, addr, addr_, sizeof(addr_))) {
- [res_ addObject:@{
- @"ai_addr": [NSString stringWithUTF8String:addr_],
- @"ai_family": [NSNumber numberWithInt:af],
- @"ai_protocol":
- [NSNumber numberWithInt:ai->ai_protocol],
- @"ai_socktype": [NSNumber numberWithInt:ai->ai_socktype]
- }];
- } else {
- err = errno;
- rejectCode = @"inet_ntop";
- }
- } else {
- err = EAFNOSUPPORT;
- rejectCode = @"EAFNOSUPPORT";
- }
- }
-
- freeaddrinfo(res);
-
- // resolve
- if (res_.count) {
- resolve(res_);
- return;
- }
-
- if (!err) {
- err = ERANGE;
- rejectCode = @"ERANGE";
- }
- } else {
- rejectCode = @"getaddrinfo";
- }
-
- // reject
- NSError *error
- = [NSError errorWithDomain:NSPOSIXErrorDomain
- code:err
- userInfo:nil];
-
- reject(rejectCode, error.localizedDescription, error);
-}
-
-@end
diff --git a/react-native-sdk/prepare_sdk.js b/react-native-sdk/prepare_sdk.js
index cc6ab78f39..1064332615 100644
--- a/react-native-sdk/prepare_sdk.js
+++ b/react-native-sdk/prepare_sdk.js
@@ -116,10 +116,6 @@ fs.copyFileSync(
`${iosSrcPath}/LocaleDetector.m`,
`${iosDestPath}/LocaleDetector.m`
);
-fs.copyFileSync(
- `${iosSrcPath}/POSIX.m`,
- `${iosDestPath}/POSIX.m`
-);
fs.copyFileSync(
`${iosSrcPath}/Proximity.m`,
`${iosDestPath}/Proximity.m`
@@ -152,10 +148,6 @@ copyFolderRecursiveSync(
`${androidMainSourcePath}/drawable-xxxhdpi`,
`${androidMainTargetPath}`
);
-copyFolderRecursiveSync(
- `${androidSourcePath}/net`,
- `${androidTargetPath}/log`
-);
fs.copyFileSync(
`${androidSourcePath}/AndroidSettingsModule.java`,
`${androidTargetPath}/AndroidSettingsModule.java`
diff --git a/react/features/mobile/polyfills/RTCPeerConnection.js b/react/features/mobile/polyfills/RTCPeerConnection.js
deleted file mode 100644
index ee9bfcbc08..0000000000
--- a/react/features/mobile/polyfills/RTCPeerConnection.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import { RTCPeerConnection as PC } from 'react-native-webrtc';
-
-import { synthesizeIPv6Addresses } from './ipv6utils';
-
-/**
- * Override PeerConnection to synthesize IPv6 addresses.
- */
-export default class RTCPeerConnection extends PC {
-
- /**
- * Synthesize IPv6 addresses before calling the underlying setRemoteDescription.
- *
- * @param {Object} description - SDP.
- * @returns {Promise<undefined>} A promise which is resolved once the operation is complete.
- */
- async setRemoteDescription(description) {
- return super.setRemoteDescription(await synthesizeIPv6Addresses(description));
- }
-}
diff --git a/react/features/mobile/polyfills/ipv6utils.js b/react/features/mobile/polyfills/ipv6utils.js
deleted file mode 100644
index ca108e29ca..0000000000
--- a/react/features/mobile/polyfills/ipv6utils.js
+++ /dev/null
@@ -1,197 +0,0 @@
-import { NativeModules } from 'react-native';
-import { RTCSessionDescription } from 'react-native-webrtc';
-
-/**
- * Synthesizes IPv6 addresses on iOS in order to support IPv6 NAT64 networks.
- *
- * @param {RTCSessionDescription} sdp - The RTCSessionDescription which
- * specifies the configuration of the remote end of the connection.
- * @private
- * @returns {Promise}
- */
-export function synthesizeIPv6Addresses(sdp) {
- return (
- new Promise(resolve => resolve(_synthesizeIPv6Addresses0(sdp)))
- .then(({ ips, lines }) =>
- Promise.all(Array.from(ips.values()))
- .then(() => _synthesizeIPv6Addresses1(sdp, ips, lines))
- ));
-}
-
-/* eslint-disable max-depth */
-
-/**
- * Synthesizes an IPv6 address from a specific IPv4 address.
- *
- * @param {string} ipv4 - The IPv4 address from which an IPv6 address is to be
- * synthesized.
- * @returns {Promise<?string>} A {@code Promise} which gets resolved with the
- * IPv6 address synthesized from the specified {@code ipv4} or a falsy value to
- * be treated as inability to synthesize an IPv6 address from the specified
- * {@code ipv4}.
- */
-const _synthesizeIPv6FromIPv4Address = (function() {
- // POSIX.getaddrinfo
- const { POSIX } = NativeModules;
-
- if (POSIX) {
- const { getaddrinfo } = POSIX;
-
- if (typeof getaddrinfo === 'function') {
- return ipv4 =>
- getaddrinfo(/* hostname */ ipv4, /* servname */ undefined)
- .then(([ { ai_addr: ipv6 } ]) => ipv6);
- }
- }
-
- // NAT64AddrInfo.getIPv6Address
- const { NAT64AddrInfo } = NativeModules;
-
- if (NAT64AddrInfo) {
- const { getIPv6Address } = NAT64AddrInfo;
-
- if (typeof getIPv6Address === 'function') {
- return getIPv6Address;
- }
- }
-
- // There's no POSIX.getaddrinfo or NAT64AddrInfo.getIPv6Address.
- return ip => Promise.resolve(ip);
-})();
-
-/**
- * Begins the asynchronous synthesis of IPv6 addresses.
- *
- * @param {RTCSessionDescription} sessionDescription - The RTCSessionDescription
- * for which IPv6 addresses will be synthesized.
- * @private
- * @returns {{
- * ips: Map,
- * lines: Array
- * }}
- */
-function _synthesizeIPv6Addresses0(sessionDescription) {
- const sdp = sessionDescription.sdp;
- let start = 0;
- const lines = [];
- const ips = new Map();
-
- do {
- const end = sdp.indexOf('\r\n', start);
- let line;
-
- if (end === -1) {
- line = sdp.substring(start);
-
- // Break out of the loop at the end of the iteration.
- start = undefined;
- } else {
- line = sdp.substring(start, end);
- start = end + 2;
- }
-
- if (line.startsWith('a=candidate:')) {
- const candidate = line.split(' ');
-
- if (candidate.length >= 10 && candidate[6] === 'typ') {
- const ip4s = [ candidate[4] ];
- let abort = false;
-
- for (let i = 8; i < candidate.length; ++i) {
- if (candidate[i] === 'raddr') {
- ip4s.push(candidate[++i]);
- break;
- }
- }
-
- for (const ip of ip4s) {
- if (ip.indexOf(':') === -1) {
- ips.has(ip)
- || ips.set(ip, new Promise((resolve, reject) => {
- const v = ips.get(ip);
-
- if (v && typeof v === 'string') {
- resolve(v);
- } else {
- _synthesizeIPv6FromIPv4Address(ip).then(
- value => {
- if (!value
- || value.indexOf(':') === -1
- || value === ips.get(ip)) {
- ips.delete(ip);
- } else {
- ips.set(ip, value);
- }
- resolve(value);
- },
- reject);
- }
- }));
- } else {
- abort = true;
- break;
- }
- }
- if (abort) {
- ips.clear();
- break;
- }
-
- line = candidate;
- }
- }
-
- lines.push(line);
- } while (start);
-
- return {
- ips,
- lines
- };
-}
-
-/* eslint-enable max-depth */
-
-/**
- * Completes the asynchronous synthesis of IPv6 addresses.
- *
- * @param {RTCSessionDescription} sessionDescription - The RTCSessionDescription
- * for which IPv6 addresses are being synthesized.
- * @param {Map} ips - A Map of IPv4 addresses found in the specified
- * sessionDescription to synthesized IPv6 addresses.
- * @param {Array} lines - The lines of the specified sessionDescription.
- * @private
- * @returns {RTCSessionDescription} A RTCSessionDescription that represents the
- * result of the synthesis of IPv6 addresses.
- */
-function _synthesizeIPv6Addresses1(sessionDescription, ips, lines) {
- if (ips.size === 0) {
- return sessionDescription;
- }
-
- for (let l = 0; l < lines.length; ++l) {
- const candidate = lines[l];
-
- if (typeof candidate !== 'string') {
- let ip4 = candidate[4];
- let ip6 = ips.get(ip4);
-
- ip6 && (candidate[4] = ip6);
-
- for (let i = 8; i < candidate.length; ++i) {
- if (candidate[i] === 'raddr') {
- ip4 = candidate[++i];
- (ip6 = ips.get(ip4)) && (candidate[i] = ip6);
- break;
- }
- }
-
- lines[l] = candidate.join(' ');
- }
- }
-
- return new RTCSessionDescription({
- sdp: lines.join('\r\n'),
- type: sessionDescription.type
- });
-}
diff --git a/react/features/mobile/polyfills/webrtc.js b/react/features/mobile/polyfills/webrtc.js
index 41721ed94d..9502840e09 100644
--- a/react/features/mobile/polyfills/webrtc.js
+++ b/react/features/mobile/polyfills/webrtc.js
@@ -1,11 +1,3 @@
import { registerGlobals } from 'react-native-webrtc';
-import RTCPeerConnection from './RTCPeerConnection';
-
registerGlobals();
-
-(global => {
- // Override with ours.
- // TODO: consider dropping our override.
- global.RTCPeerConnection = RTCPeerConnection;
-})(global || window || this); // eslint-disable-line no-invalid-this