From 1200cdc81052ea74e3e7cefb27c2754a84b815bb Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 9 May 2023 13:41:53 -0700 Subject: [PATCH] Migrate BindingsInstaller to kotlin (#37322) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37322 migration of BindingsInstaller to kotlin to ez integration with ReactInstanceDelegate bypass-github-export-checks changelog: [internal] internal Reviewed By: philIip Differential Revision: D45577886 fbshipit-source-id: 67991b09bf7c719136a615d846d3f7ee3bf359b2 --- .../react/bridgeless/BindingsInstaller.java | 26 ------------------- .../react/bridgeless/BindingsInstaller.kt | 22 ++++++++++++++++ 2 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.java create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.java deleted file mode 100644 index 53d1c59e84d..00000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.java +++ /dev/null @@ -1,26 +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.bridgeless; - -import com.facebook.jni.HybridData; -import com.facebook.proguard.annotations.DoNotStrip; -import com.facebook.proguard.annotations.DoNotStripAny; -import com.facebook.soloader.SoLoader; - -@DoNotStripAny -public abstract class BindingsInstaller { - static { - SoLoader.loadLibrary("rninstance"); - } - - @DoNotStrip private final HybridData mHybridData; - - protected BindingsInstaller(HybridData hybridData) { - mHybridData = hybridData; - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.kt new file mode 100644 index 00000000000..8225c484bdc --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BindingsInstaller.kt @@ -0,0 +1,22 @@ +/* + * 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.bridgeless + +import com.facebook.jni.HybridData +import com.facebook.proguard.annotations.DoNotStrip +import com.facebook.proguard.annotations.DoNotStripAny +import com.facebook.soloader.SoLoader + +@DoNotStripAny +abstract class BindingsInstaller(@field:DoNotStrip private val mHybridData: HybridData) { + companion object { + init { + SoLoader.loadLibrary("rninstance") + } + } +}