refactor(android)!: remove deprecated Java APIs for Capacitor 9 - #8553
Merged
Conversation
…ic accessors Removes the deprecated CapConfig(AssetManager, JSONObject) constructor and the generic getObject/getString/getBoolean/getInt/getArray accessors. Use CapConfig.loadDefault(Context) or the CapConfig.Builder to construct a config, the typed getters for main config values and PluginConfig for plugin config values.
Removes save(), isSaved(), hasOption() and isReleased() along with the backing isReleased flag. Use setKeepAlive(Boolean), isKeptAlive() and the typed accessors instead.
…RT constant All proxied requests are handled via CAPACITOR_HTTP_INTERCEPTOR_START.
Use getConfig() and the typed accessors on PluginConfig instead.
Removes the constructor taking an unused cordovaPluginManager argument. Use MessageHandler(Bridge, WebView) instead.
andredestro
requested review from
ItsChaceD,
OS-pedrogustavobilro,
OS-ruimoreiramendes,
alexgerardojacinto,
jcesarmobile,
markemer and
theproducer
August 6, 2026 09:07
theproducer
approved these changes
Aug 6, 2026
markemer
approved these changes
Aug 6, 2026
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the Java APIs marked
@Deprecatedin previous major versions, as part of the Capacitor 9 cleanup (RMET-5304). All of them have direct replacements that have been available since Capacitor 3.CapConfig(AssetManager, JSONObject)constructorCapConfig.loadDefault(Context)orCapConfig.BuilderCapConfig.getObject(String),getString(...),getBoolean(...),getInt(...),getArray(...)CapConfigfor main config values;PluginConfigaccessors for plugin config valuesPluginCall.save()setKeepAlive(true)PluginCall.isSaved()isKeptAlive()PluginCall.hasOption(String)getString(...),getInt(...), etc.)PluginCall.isReleased()(and the backingisReleasedflag)Bridge.CAPACITOR_HTTPS_INTERCEPTOR_STARTCAPACITOR_HTTP_INTERCEPTOR_STARTPlugin.getConfigValue(String)getConfig()and the typed accessors onPluginConfigMessageHandler(Bridge, WebView, Object)constructorMessageHandler(Bridge, WebView)Intentionally kept: the legacy
@NativePluginecosystem (theNativePluginannotation and the deprecated permission/activity-result cluster inPluginandBridge:saveCall,getSavedCall,freeSavedCall,hasDefinedPermissions,hasPermission,pluginRequestPermission(s),handleOnActivityResult,startActivityForResult(int),getPluginWithRequestCode,startActivityForPluginWithResult). Those are still wired into the legacy permission handling and their removal is being evaluated separately (RMET-5305).Change Type
Rationale / Problems Fixed
Capacitor 9 is a major release, which is the opportunity to drop APIs that have been deprecated for several majors. This reduces the public API surface and makes the remaining deprecation warnings actionable again. It is the Android counterpart of the iOS cleanup in #8551.
Tests or Reproductions
./gradlew :capacitor-android:testDebugUnitTestpasses.prettier(used by the repository'snpm run lintfor Java) reports no violations on the changed files.Platforms Affected
Notes / Comments