diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index f82ec0593a43bd..73449433924335 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -3645,9 +3645,12 @@ public class com/facebook/react/runtime/CoreReactPackage$$ReactModuleInfoProvide public fun getReactModuleInfos ()Ljava/util/Map; } -public class com/facebook/react/runtime/JSCInstance : com/facebook/react/runtime/JSRuntimeFactory { +public final class com/facebook/react/runtime/JSCInstance : com/facebook/react/runtime/JSRuntimeFactory { + public static final field Companion Lcom/facebook/react/runtime/JSCInstance$Companion; public fun ()V - protected static fun initHybrid ()Lcom/facebook/jni/HybridData; +} + +public final class com/facebook/react/runtime/JSCInstance$Companion { } public abstract class com/facebook/react/runtime/JSRuntimeFactory { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.java deleted file mode 100644 index 0524c58eac2312..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.runtime; - -import com.facebook.infer.annotation.Nullsafe; -import com.facebook.jni.HybridData; -import com.facebook.jni.annotations.DoNotStrip; -import com.facebook.soloader.SoLoader; - -@Nullsafe(Nullsafe.Mode.LOCAL) -public class JSCInstance extends JSRuntimeFactory { - static { - SoLoader.loadLibrary("jscinstance"); - } - - @DoNotStrip - protected static native HybridData initHybrid(); - - public JSCInstance() { - super(initHybrid()); - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.kt new file mode 100644 index 00000000000000..6f3cfcb21c4417 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.kt @@ -0,0 +1,24 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.runtime + +import com.facebook.jni.HybridData +import com.facebook.jni.annotations.DoNotStrip +import com.facebook.soloader.SoLoader +import com.facebook.soloader.annotation.SoLoaderLibrary + +@SoLoaderLibrary("jscinstance") +public class JSCInstance constructor() : JSRuntimeFactory(initHybrid()) { + public companion object { + init { + SoLoader.loadLibrary("jscinstance") + } + + @DoNotStrip protected external fun initHybrid(): HybridData + } +}