make DevServerHelper open (#51323)

Summary:
Expo inherits from the DevServerHelper class, and needs it to be declared as open, the same goes for its public interface.

Expo is using this in `DevLauncherDevServerHelper` and overrides the methods:

- getDevServerBundleURL
- getDevServerSplitBundleURL
- getSourceUrl
- getSourceMapUrl
- isPackagerRunning

This PR fixes this by adding the open to the class and to the methods that should be open

## Changelog:

[ANDROID] [FIXED] - Made DevServerHelper and its method open so that they can be overridden.

Pull Request resolved: https://github.com/facebook/react-native/pull/51323

Test Plan: Verify that we can build against Expo.

Reviewed By: cipolleschi

Differential Revision: D74876479

Pulled By: cortinico

fbshipit-source-id: 0037d6f7cee190a690ec3ec59896df04f46797b2
This commit is contained in:
Christian Falch
2025-05-16 07:52:01 -07:00
committed by Facebook GitHub Bot
parent e4ef685dd7
commit 2a0c1e6a9e
2 changed files with 12 additions and 12 deletions
@@ -1947,7 +1947,7 @@ public final class com/facebook/react/devsupport/DefaultDevLoadingViewImplementa
public final fun setDevLoadingEnabled (Z)V
}
public final class com/facebook/react/devsupport/DevServerHelper {
public class com/facebook/react/devsupport/DevServerHelper {
public fun <init> (Lcom/facebook/react/modules/debug/interfaces/DeveloperSettings;Landroid/content/Context;Lcom/facebook/react/packagerconnection/PackagerConnectionSettings;)V
public final fun closeInspectorConnection ()V
public final fun closePackagerConnection ()V
@@ -1956,12 +1956,12 @@ public final class com/facebook/react/devsupport/DevServerHelper {
public final fun downloadBundleFromURL (Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;)V
public static synthetic fun downloadBundleFromURL$default (Lcom/facebook/react/devsupport/DevServerHelper;Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;ILjava/lang/Object;)V
public final fun downloadBundleResourceFromUrlSync (Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
public final fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
public final fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
public final fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
public final fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
public fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
public fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
public fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
public fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
public final fun getWebsocketProxyURL ()Ljava/lang/String;
public final fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
public fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
public final fun openDebugger (Lcom/facebook/react/bridge/ReactContext;Ljava/lang/String;)V
public final fun openInspectorConnection ()V
public final fun openPackagerConnection (Ljava/lang/String;Lcom/facebook/react/devsupport/DevServerHelper$PackagerCommandListener;)V
@@ -59,7 +59,7 @@ import okio.Okio
*/
@SuppressLint(
"StaticFieldLeak") // TODO: This entire class should be rewritten to don't use AsyncTask
public class DevServerHelper(
public open class DevServerHelper(
private val settings: DeveloperSettings,
private val applicationContext: Context,
private val packagerConnectionSettings: PackagerConnectionSettings
@@ -287,20 +287,20 @@ public class DevServerHelper(
additionalOptionsBuilder.toString())
}
public fun getDevServerBundleURL(jsModulePath: String): String =
public open fun getDevServerBundleURL(jsModulePath: String): String =
createBundleURL(jsModulePath, BundleType.BUNDLE, packagerConnectionSettings.debugServerHost)
public fun getDevServerSplitBundleURL(jsModulePath: String): String =
public open fun getDevServerSplitBundleURL(jsModulePath: String): String =
createSplitBundleURL(jsModulePath, packagerConnectionSettings.debugServerHost)
public fun isPackagerRunning(callback: PackagerStatusCallback) {
public open fun isPackagerRunning(callback: PackagerStatusCallback) {
packagerStatusCheck.run(packagerConnectionSettings.debugServerHost, callback)
}
public fun getSourceMapUrl(mainModuleName: String): String =
public open fun getSourceMapUrl(mainModuleName: String): String =
createBundleURL(mainModuleName, BundleType.MAP)
public fun getSourceUrl(mainModuleName: String): String =
public open fun getSourceUrl(mainModuleName: String): String =
createBundleURL(mainModuleName, BundleType.BUNDLE)
/**