diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt index 90593bdbf7419c..39344aac7716cb 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt @@ -53,15 +53,11 @@ internal object AgpConfiguratorUtils { fun configureDevPorts(project: Project) { val devServerPort = project.properties["reactNativeDevServerPort"]?.toString() ?: DEFAULT_DEV_SERVER_PORT - val inspectorProxyPort = - project.properties["reactNativeInspectorProxyPort"]?.toString() ?: devServerPort val action = Action { project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext -> ext.defaultConfig.resValue("integer", "react_native_dev_server_port", devServerPort) - ext.defaultConfig.resValue( - "integer", "react_native_inspector_proxy_port", inspectorProxyPort) } } diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index ff804236865973..a6cbbc6d8d7966 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -3452,7 +3452,6 @@ public class com/facebook/react/modules/systeminfo/AndroidInfoHelpers { public static fun getAdbReverseTcpCommand (Landroid/content/Context;)Ljava/lang/String; public static fun getAdbReverseTcpCommand (Ljava/lang/Integer;)Ljava/lang/String; public static fun getFriendlyDeviceName ()Ljava/lang/String; - public static fun getInspectorProxyHost (Landroid/content/Context;)Ljava/lang/String; public static fun getServerHost (Landroid/content/Context;)Ljava/lang/String; public static fun getServerHost (Ljava/lang/Integer;)Ljava/lang/String; } @@ -3528,7 +3527,6 @@ public abstract class com/facebook/react/packagerconnection/NotificationOnlyHand public class com/facebook/react/packagerconnection/PackagerConnectionSettings { public fun (Landroid/content/Context;)V public fun getDebugServerHost ()Ljava/lang/String; - public fun getInspectorServerHost ()Ljava/lang/String; public fun getPackageName ()Ljava/lang/String; public fun setDebugServerHost (Ljava/lang/String;)V } diff --git a/packages/react-native/ReactAndroid/build.gradle.kts b/packages/react-native/ReactAndroid/build.gradle.kts index 104fa7583bf52b..e205d965f7aa96 100644 --- a/packages/react-native/ReactAndroid/build.gradle.kts +++ b/packages/react-native/ReactAndroid/build.gradle.kts @@ -429,11 +429,6 @@ fun reactNativeDevServerPort(): String { return value?.toString() ?: "8081" } -fun reactNativeInspectorProxyPort(): String { - val value = project.properties["reactNativeInspectorProxyPort"] - return value?.toString() ?: reactNativeDevServerPort() -} - fun reactNativeArchitectures(): List { val value = project.properties["reactNativeArchitectures"] return value?.toString()?.split(",") ?: listOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a") @@ -498,7 +493,6 @@ android { buildConfigField("int", "EXOPACKAGE_FLAGS", "0") resValue("integer", "react_native_dev_server_port", reactNativeDevServerPort()) - resValue("integer", "react_native_inspector_proxy_port", reactNativeInspectorProxyPort()) testApplicationId = "com.facebook.react.tests.gradle" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java index 5b5e28c57bcfa4..a812b6a0a48d25 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java @@ -312,7 +312,7 @@ private String getInspectorDeviceUrl() { return String.format( Locale.US, "http://%s/inspector/device?name=%s&app=%s&device=%s", - mPackagerConnectionSettings.getInspectorServerHost(), + mPackagerConnectionSettings.getDebugServerHost(), Uri.encode(AndroidInfoHelpers.getFriendlyDeviceName()), Uri.encode(mPackageName), Uri.encode(getInspectorDeviceId())); @@ -491,7 +491,7 @@ public void openDebugger(final ReactContext context, final String errorMessage) String.format( Locale.US, "http://%s/open-debugger?appId=%s&device=%s", - mPackagerConnectionSettings.getInspectorServerHost(), + mPackagerConnectionSettings.getDebugServerHost(), Uri.encode(mPackageName), Uri.encode(getInspectorDeviceId())); Request request = diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.java index e9c9c54c820132..9a6fb36630a8bd 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.java @@ -52,10 +52,6 @@ public static String getAdbReverseTcpCommand(Context context) { return getAdbReverseTcpCommand(getDevServerPort(context)); } - public static String getInspectorProxyHost(Context context) { - return getServerIpAddress(getInspectorProxyPort(context)); - } - // WARNING(festevezga): This RN helper method has been copied to another FB-only target. Any // changes should be applied to both. public static String getFriendlyDeviceName() { @@ -72,11 +68,6 @@ private static Integer getDevServerPort(Context context) { return resources.getInteger(R.integer.react_native_dev_server_port); } - private static Integer getInspectorProxyPort(Context context) { - Resources resources = context.getResources(); - return resources.getInteger(R.integer.react_native_dev_server_port); - } - private static String getServerIpAddress(int port) { // Since genymotion runs in vbox it use different hostname to refer to adb host. // We detect whether app runs on genymotion and replace js bundle server hostname accordingly diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.java index 61526205f63ebb..94572ae9ba99db 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.java @@ -57,10 +57,6 @@ public void setDebugServerHost(String host) { mPreferences.edit().putString(PREFS_DEBUG_SERVER_HOST_KEY, host).apply(); } - public String getInspectorServerHost() { - return AndroidInfoHelpers.getInspectorProxyHost(mAppContext); - } - public @Nullable String getPackageName() { return mPackageName; }