@@ -7,7 +7,6 @@ import androidx.activity.OnBackPressedCallback
77import androidx.fragment.app.FragmentActivity
88import androidx.lifecycle.DefaultLifecycleObserver
99import androidx.lifecycle.LifecycleOwner
10- import com.callstack.reactnativebrownfield.utils.VersionUtils
1110import com.facebook.react.ReactHost
1211import com.facebook.react.ReactInstanceEventListener
1312import com.facebook.react.ReactPackage
@@ -28,13 +27,6 @@ fun interface OnMessageListener {
2827 fun onMessage (message : String )
2928}
3029
31- /* *
32- * The threshold RN version based on which we decide whether to
33- * load JNI libs or not. We only load JNI libs on version less
34- * than this.
35- */
36- private const val RN_THRESHOLD_VERSION = " 0.80.0"
37-
3830class ReactNativeBrownfield private constructor(val reactHost : ReactHost ) {
3931 private val messageListeners = CopyOnWriteArrayList <OnMessageListener >()
4032
@@ -54,29 +46,8 @@ class ReactNativeBrownfield private constructor(val reactHost: ReactHost) {
5446 }
5547
5648 private fun loadNativeLibsInternal (application : Application ) {
57- val rnVersion = BuildConfig .RN_VERSION
58-
59- if (VersionUtils .isVersionLessThan(rnVersion, RN_THRESHOLD_VERSION )) {
60- SoLoader .init (application.applicationContext, OpenSourceMergedSoMapping )
61- load()
62- } else {
63- try {
64- val reactNativeApplicationEntryPointClazz =
65- Class .forName(" com.facebook.react.ReactNativeApplicationEntryPoint" )
66- val loadReactNativeMethod = reactNativeApplicationEntryPointClazz.getMethod(
67- " loadReactNative" ,
68- android.content.Context ::class .java
69- )
70- loadReactNativeMethod.invoke(null , application.applicationContext)
71- } catch (e: ClassNotFoundException ) {
72- throw RuntimeException (
73- " ReactNativeApplicationEntryPoint not found. Ensure the brownfield AAR " +
74- " consumer-rules.pro is applied and ReactNativeApplicationEntryPoint is " +
75- " not stripped by R8." ,
76- e
77- )
78- }
79- }
49+ SoLoader .init (application.applicationContext, OpenSourceMergedSoMapping )
50+ load()
8051 }
8152
8253 @JvmStatic
0 commit comments