Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ public class Bridge {
public static final String CAPACITOR_FILE_START = "/_capacitor_file_";
public static final String CAPACITOR_CONTENT_START = "/_capacitor_content_";
public static final String CAPACITOR_HTTP_INTERCEPTOR_START = "/_capacitor_http_interceptor_";

/** @deprecated CAPACITOR_HTTPS_INTERCEPTOR_START is no longer required. All proxied requests are handled via CAPACITOR_HTTP_INTERCEPTOR_START instead */
@Deprecated
public static final String CAPACITOR_HTTPS_INTERCEPTOR_START = "/_capacitor_https_interceptor_";

public static final String CAPACITOR_HTTP_INTERCEPTOR_URL_PARAM = "u";

public static final int DEFAULT_ANDROID_WEBVIEW_VERSION = 60;
Expand Down
119 changes: 0 additions & 119 deletions android/capacitor/src/main/java/com/getcapacitor/CapConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,6 @@ public class CapConfig {
*/
private CapConfig() {}

/**
* Get an instance of the Config file object.
* @deprecated use {@link #loadDefault(Context)} to load an instance of the Config object
* from the capacitor.config.json file, or use the {@link CapConfig.Builder} to construct
* a CapConfig for embedded use.
*
* @param assetManager The AssetManager used to load the config file
* @param config JSON describing a configuration to use
*/
@Deprecated
public CapConfig(AssetManager assetManager, JSONObject config) {
if (config != null) {
this.configJSON = config;
} else {
// Load the capacitor.config.json
loadConfigFromAssets(assetManager, null);
}

deserializeConfig(null);
}

/**
* Constructs a Capacitor Configuration from config.json file.
*
Expand Down Expand Up @@ -429,104 +408,6 @@ public PluginConfig getPluginConfiguration(String pluginId) {
return pluginConfig;
}

/**
* Get a JSON object value from the Capacitor config.
* @deprecated use {@link PluginConfig#getObject(String)} to access plugin config values.
* For main Capacitor config values, use the appropriate getter.
*
* @param key A key to fetch from the config
* @return The value from the config, if exists. Null if not
*/
@Deprecated
public JSONObject getObject(String key) {
try {
return configJSON.getJSONObject(key);
} catch (Exception ex) {}
return null;
}

/**
* Get a string value from the Capacitor config.
* @deprecated use {@link PluginConfig#getString(String, String)} to access plugin config
* values. For main Capacitor config values, use the appropriate getter.
*
* @param key A key to fetch from the config
* @return The value from the config, if exists. Null if not
*/
@Deprecated
public String getString(String key) {
return JSONUtils.getString(configJSON, key, null);
}

/**
* Get a string value from the Capacitor config.
* @deprecated use {@link PluginConfig#getString(String, String)} to access plugin config
* values. For main Capacitor config values, use the appropriate getter.
*
* @param key A key to fetch from the config
* @param defaultValue A default value to return if the key does not exist in the config
* @return The value from the config, if key exists. Default value returned if not
*/
@Deprecated
public String getString(String key, String defaultValue) {
return JSONUtils.getString(configJSON, key, defaultValue);
}

/**
* Get a boolean value from the Capacitor config.
* @deprecated use {@link PluginConfig#getBoolean(String, boolean)} to access plugin config
* values. For main Capacitor config values, use the appropriate getter.
*
* @param key A key to fetch from the config
* @param defaultValue A default value to return if the key does not exist in the config
* @return The value from the config, if key exists. Default value returned if not
*/
@Deprecated
public boolean getBoolean(String key, boolean defaultValue) {
return JSONUtils.getBoolean(configJSON, key, defaultValue);
}

/**
* Get an integer value from the Capacitor config.
* @deprecated use {@link PluginConfig#getInt(String, int)} to access the plugin config
* values. For main Capacitor config values, use the appropriate getter.
*
* @param key A key to fetch from the config
* @param defaultValue A default value to return if the key does not exist in the config
* @return The value from the config, if key exists. Default value returned if not
*/
@Deprecated
public int getInt(String key, int defaultValue) {
return JSONUtils.getInt(configJSON, key, defaultValue);
}

/**
* Get a string array value from the Capacitor config.
* @deprecated use {@link PluginConfig#getArray(String)} to access the plugin config
* values. For main Capacitor config values, use the appropriate getter.
*
* @param key A key to fetch from the config
* @return The value from the config, if exists. Null if not
*/
@Deprecated
public String[] getArray(String key) {
return JSONUtils.getArray(configJSON, key, null);
}

/**
* Get a string array value from the Capacitor config.
* @deprecated use {@link PluginConfig#getArray(String, String[])} to access the plugin
* config values. For main Capacitor config values, use the appropriate getter.
*
* @param key A key to fetch from the config
* @param defaultValue A default value to return if the key does not exist in the config
* @return The value from the config, if key exists. Default value returned if not
*/
@Deprecated
public String[] getArray(String key, String[] defaultValue) {
return JSONUtils.getArray(configJSON, key, defaultValue);
}

private static Map<String, PluginConfig> deserializePluginsConfig(JSONObject pluginsConfig) {
Map<String, PluginConfig> pluginsMap = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ public MessageHandler(Bridge bridge, WebView webView) {
}
}

@Deprecated
public MessageHandler(Bridge bridge, WebView webView, Object cordovaPluginManager) {
this(bridge, webView);
}

/**
* The main message handler that will be called from JavaScript
* to send a message to the native bridge.
Expand Down
18 changes: 0 additions & 18 deletions android/capacitor/src/main/java/com/getcapacitor/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,24 +296,6 @@ public PluginConfig getConfig() {
return bridge.getConfig().getPluginConfiguration(handle.getId());
}

/**
* Get the value for a key on the config for this plugin.
* @deprecated use {@link #getConfig()} and access config values using the methods available
* depending on the type.
*
* @param key the key for the config value
* @return some object containing the value from the config
*/
@Deprecated
public Object getConfigValue(String key) {
try {
PluginConfig pluginConfig = getConfig();
return pluginConfig.getConfigJSON().get(key);
} catch (JSONException ex) {
return null;
}
}

/**
* Check whether any of the given permissions has been defined in the AndroidManifest.xml
* @deprecated use {@link #isPermissionDeclared(String)}
Expand Down
43 changes: 0 additions & 43 deletions android/capacitor/src/main/java/com/getcapacitor/PluginCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ public class PluginCall {

private boolean keepAlive = false;

/**
* Indicates that this PluginCall was released, and should no longer be used
*/
@Deprecated
private boolean isReleased = false;

public PluginCall(MessageHandler msgHandler, String pluginId, String callbackId, String methodName, JSObject data) {
this.msgHandler = msgHandler;
this.pluginId = pluginId;
Expand Down Expand Up @@ -324,28 +318,6 @@ public JSArray getArray(String name, JSArray defaultValue) {
return defaultValue;
}

/**
* @param name of the option to check
* @return boolean indicating if the plugin call has an option for the provided name.
* @deprecated Presence of a key should not be considered significant.
* Use typed accessors to check the value instead.
*/
@Deprecated
public boolean hasOption(String name) {
return this.data.has(name);
}

/**
* Indicate that the Bridge should cache this call in order to call
* it again later. For example, the addListener system uses this to
* continuously call the call's callback (😆).
* @deprecated use {@link #setKeepAlive(Boolean)} instead
*/
@Deprecated
public void save() {
setKeepAlive(true);
}

/**
* Indicate that the Bridge should cache this call in order to call
* it again later. For example, the addListener system uses this to
Expand All @@ -360,16 +332,6 @@ public void setKeepAlive(Boolean keepAlive) {
public void release(Bridge bridge) {
this.keepAlive = false;
bridge.releaseCall(this);
this.isReleased = true;
}

/**
* @deprecated use {@link #isKeptAlive()}
* @return true if the plugin call is kept alive
*/
@Deprecated
public boolean isSaved() {
return isKeptAlive();
}

/**
Expand All @@ -380,11 +342,6 @@ public boolean isKeptAlive() {
return keepAlive;
}

@Deprecated
public boolean isReleased() {
return isReleased;
}

class PluginCallDataTypeException extends Exception {

PluginCallDataTypeException(String m) {
Expand Down
Loading