Skip to content

Commit

Permalink
feat(rn) update React Native to version 0.66
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Jan 20, 2022
1 parent 5315841 commit d121a63
Show file tree
Hide file tree
Showing 21 changed files with 3,497 additions and 4,165 deletions.
8 changes: 7 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
// https://github.com/facebook/react-native/issues/31572
// We can update past 1.4.0 on RN 0.68
implementation ('androidx.appcompat:appcompat:1.3.1') {
version {
strictly '1.3.1'
}
}

debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'

Expand Down
20 changes: 14 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import org.gradle.util.VersionNumber
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
}
}

Expand All @@ -22,6 +22,7 @@ ext {
minSdkVersion = 23
targetSdkVersion = 31
supportLibVersion = "28.0.0"
ndkVersion = "21.4.7075529"

// The Maven artifact groupdId of the third-party react-native modules which
// Jitsi Meet SDK for Android depends on and which are not available in
Expand All @@ -42,13 +43,20 @@ ext {

allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven { url 'https://www.jitpack.io' }
// React Native (JS, Obj-C sources, Android binaries) is installed from npm.
maven { url "$rootDir/../node_modules/react-native/android" }
// Android JSC is installed from npm.
maven { url("$rootDir/../node_modules/jsc-android/dist") }
maven { url 'https://www.jitpack.io' }
// https://github.com/react-native-video/react-native-video/issues/2454
//noinspection JcenterRepositoryObsolete
jcenter() {
content {
includeModule("com.yqritc", "android-scalablevideoview")
}
}
}

// Make sure we use the react-native version in node_modules and not the one
Expand Down
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Sep 23 11:48:00 EEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
2 changes: 2 additions & 0 deletions android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
22 changes: 4 additions & 18 deletions android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,28 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
11 changes: 9 additions & 2 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'maven-publish'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
ndkVersion rootProject.ext.ndkVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
Expand Down Expand Up @@ -34,8 +35,14 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.fragment:fragment:1.2.5'
// https://github.com/facebook/react-native/issues/31572
// We can update past 1.4.0 on RN 0.68
implementation ('androidx.appcompat:appcompat:1.3.1') {
version {
strictly '1.3.1'
}
}
implementation 'androidx.fragment:fragment:1.4.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

Expand Down
8 changes: 8 additions & 0 deletions android/sdk/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application android:usesCleartextTraffic="true">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
2 changes: 0 additions & 2 deletions android/sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
Expand All @@ -36,7 +35,6 @@
android:resizeableActivity="true"
android:supportsPictureInPicture="true"
android:windowSoftInputMode="adjustResize"/>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

<service
android:name=".ConnectionService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.jitsi.meet.sdk;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
Expand Down Expand Up @@ -54,6 +55,7 @@
* Before a call has started and after it has ended the
* {@code AudioModeModule.DEFAULT} mode should be used.
*/
@SuppressLint("AnnotateVersionCheck")
@ReactModule(name = AudioModeModule.NAME)
class AudioModeModule extends ReactContextBaseJavaModule {
public static final String NAME = "AudioMode";
Expand All @@ -79,7 +81,6 @@ class AudioModeModule extends ReactContextBaseJavaModule {
/**
* Whether or not the ConnectionService is used for selecting audio devices.
*/

private static final boolean supportsConnectionService = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
private static boolean useConnectionService_ = supportsConnectionService;

Expand Down Expand Up @@ -148,6 +149,16 @@ public AudioModeModule(ReactApplicationContext reactContext) {
audioManager = (AudioManager)reactContext.getSystemService(Context.AUDIO_SERVICE);
}

@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}

@ReactMethod
public void removeListeners(Integer count) {
// Keep: Required for RN built in Event Emitter Calls.
}

/**
* Gets a mapping with the constants this module is exporting.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
* Module implementing an API for sending events from JavaScript to native code.
*/
@ReactModule(name = ExternalAPIModule.NAME)
class ExternalAPIModule
extends ReactContextBaseJavaModule {
class ExternalAPIModule extends ReactContextBaseJavaModule {

public static final String NAME = "ExternalAPI";

Expand All @@ -57,6 +56,16 @@ public ExternalAPIModule(ReactApplicationContext reactContext) {
ParticipantsService.init(reactContext);
}

@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}

@ReactMethod
public void removeListeners(Integer count) {
// Keep: Required for RN built in Event Emitter Calls.
}

/**
* Gets the name of this module to be used in the React Native bridge.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ static void setAudioRoute(int audioRoute) {
super(reactContext);
}

@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}

@ReactMethod
public void removeListeners(Integer count) {
// Keep: Required for RN built in Event Emitter Calls.
}

/**
* Starts a new outgoing call.
*
Expand Down
6 changes: 5 additions & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ target 'JitsiMeetSDK' do
#

config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
use_react_native!(
:path => config["reactNativePath"],
:hermes_enabled => false
)

# Native pod dependencies
#
Expand All @@ -31,6 +34,7 @@ target 'JitsiMeetSDK' do
end

post_install do |installer|
react_native_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
Expand Down
Loading

0 comments on commit d121a63

Please sign in to comment.