Skip to content

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

android: switch to the Hermes JavaScript engine

Saúl Ibarra Corretgé960ffa7e789e
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
index 261aca42ab..73775479c7 100644
--- a/android/app/proguard-rules.pro
+++ b/android/app/proguard-rules.pro
@@ -85,4 +85,8 @@
# ^^^ We added the above when we switched minifyEnabled on.
# Rule to avoid build errors related to SVGs.
--keep public class com.horcrux.svg.** {*;}
\ No newline at end of file
+-keep public class com.horcrux.svg.** {*;}
+
+# Hermes
+-keep class com.facebook.hermes.unicode.** { *; }
+
diff --git a/android/build.gradle b/android/build.gradle
index 5213719ba5..8d5babf296 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -27,8 +27,6 @@ allprojects {
jcenter()
// 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") }
}
// Make sure we use the react-native version in node_modules and not the one
diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle
index 4de94a6111..3adfe82cfb 100644
--- a/android/sdk/build.gradle
+++ b/android/sdk/build.gradle
@@ -42,8 +42,11 @@ dependencies {
//noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
- //noinspection GradleDynamicVersion
- implementation 'org.webkit:android-jsc:+'
+
+ // Hermes JS engine
+ def hermesPath = "../../node_modules/hermes-engine/android/"
+ debugImplementation files(hermesPath + "hermes-debug.aar")
+ releaseImplementation files(hermesPath + "hermes-release.aar")
implementation 'com.dropbox.core:dropbox-core-sdk:3.0.8'
implementation 'com.jakewharton.timber:timber:4.7.1'
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java
index d7c2982a1b..9e40ad8141 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java
@@ -20,6 +20,7 @@ package org.jitsi.meet.sdk;
import android.app.Activity;
import androidx.annotation.Nullable;
+import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
@@ -27,14 +28,12 @@ import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.common.LifecycleState;
import com.facebook.react.devsupport.DevInternalSettings;
-import com.facebook.react.jscexecutor.JSCExecutorFactory;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.soloader.SoLoader;
import com.oney.WebRTCModule.RTCVideoViewManager;
import com.oney.WebRTCModule.WebRTCModule;
-import org.jitsi.meet.sdk.log.JitsiMeetLogger;
import org.webrtc.SoftwareVideoDecoderFactory;
import org.webrtc.SoftwareVideoEncoderFactory;
import org.webrtc.VideoDecoderFactory;
@@ -219,9 +218,8 @@ class ReactInstanceManagerHolder {
// Ignore any error, the module is not compiled when LIBRE_BUILD is enabled.
}
- // Keep on using JSC, the jury is out on Hermes.
- JSCExecutorFactory jsFactory
- = new JSCExecutorFactory("", "");
+ // Use the Hermes JavaScript engine.
+ HermesExecutorFactory jsFactory = new HermesExecutorFactory();
reactInstanceManager
= ReactInstanceManager.builder()