Modify HTML5 container switch configurations to control container behavior, such as enabling or disabling offline package signature verification.
You can modify switch configurations in the following ways:
-
Add
custom_config.jsonto theconfigfolder underassetsin your portal or main application project. This method applies only to version 10.1.60 and later. Format ofcustom_config.json:[ { "value": "NO", "key": "h5_shouldverifyapp" }, { "value": "0", "key": "TSBS" } ] -
Use
H5ExtConfigProviderto configure switches in code. This method applies only to versions earlier than 10.1.60. Usage ofH5ExtConfigProvider:public class H5ExtConfigProviderImpl implements H5ExtConfigProvider { @Override public String getConfig(String key) { if ("h5_shouldverifyapp".equalsIgnoreCase(key)) { return "YES"; } else if ("TSBS".equalsIgnoreCase(key)) { return "0"; } return null; } } // Call this method at startup. Only one global instance of H5ExtConfigProvider can be active. The last instance that is set takes precedence. H5Utils.setProvider(H5ExtConfigProvider.class.getName(), new H5ExtConfigProviderImpl()); -
Distribute switch configurations from the MDS platform. Switch configuration management.
List of container switches
The following table lists the available container switches.
|
Switch name |
Purpose |
Description |
Default value |
|
|
Enables or disables signature verification. Enable for online environments. On rooted devices, verification is forced on and this switch is ignored. |
Set to YES to enable the feature. Set to NO to disable it. |
YES |
|
|
Controls the immersive title bar. Android only. |
Set to `1` to use it. Set to `0` not to use it. Important
The values `1` and `0` are strings. |
1 |
|
|
Server address for remote app debugging. |
|
- |
|
|
Controls whether the mPaaS network library loads fallback resources. |
YES: uses the mPaaS network library. NO: uses the system network library. |
YES |
|
|
Controls whether a new Activity is forced when `pushWindow` is called. |
Set to YES to enable this feature. Other values disable it. |
NO |
|
|
Shows or hides the options menu in the upper-right corner of a miniapp. Note
Takes effect only when the options menu visibility is configured during miniapp publishing. |
Set to YES to display the menu. Other values hide it. |
NO |
|
|
Shows or hides the share option in the miniapp options menu. |
Set to YES to display the option. Other values hide it. |
NO |
|
|
Controls whether a miniapp uses the built-in navigation bar. |
Set to YES to use it. Other values disable it. |
YES |
|
|
Domain whitelist for cross-domain access to offline resources. Note
For online resources, configure the correct cross-domain settings on the resource server. |
Format: JSON array. Special characters must be escaped. Example: |
Empty |
|
|
Enables Mixed Content mode. Security risk — use with caution. Note
Supported only in version 10.1.60. |
Set to YES to allow the mode. Set to NO to disallow it. |
NO |