Skip to content

config.json — WebUI X Configuration

config.json defines the configuration for the WebUI X modules in your system. It is parsed using Moshi into a strongly-typed Kotlin data class, allowing flexible and safe management of WebUI X behaviors, permissions, and dynamic dex loading.

  • /data/adb/modules/<ID>/webroot/config.json
  • /data/adb/modules/<ID>/webroot/config.mmrl.json

Overview

The config file controls essential WebUI X features like:

  • Minimum required versions and packages
  • Permissions granted to the UI
  • Window and navigation behavior
  • Security policies
  • Dynamic loading of additional dex or apk files
  • UI metadata like title and icon

JSON Structure

json
{
  "modId": "string",
  "require": {
    "packages": [
      {
        "code": -1,
        "packageName": "string or array of strings",
        "supportText": "string",
        "supportLink": "string"
      }
    ]
  },
  "permissions": ["string", "..."],
  "historyFallback": false,
  "title": "string",
  "icon": "string",
  "windowResize": true,
  "backHandler": true,
  "backInterceptor": null,
  "refreshInterceptor": "string",
  "exitConfirm": true,
  "pullToRefresh": false,
  "historyFallbackFile": "index.html",
  "autoStatusBarsStyle": true,
  "dexFiles": [
    {
      "type": "dex | apk",
      "path": "string",
      "className": "string",
      "cache": true,
    }
  ],
  "killShellWhenBackground": true,
  "contentSecurityPolicy": "string",
  "caching": true,
  "cachingMaxAge": 86400
}

Properties

require

object — Requirements for WebUI X compatibility.

  • packages — List of required package sets with optional support info.

    • code (int, default -1) — Status or error code associated.
    • packageName (string or string array) — Package(s) required.
    • supportText (string, optional) — Message to display regarding package.
    • supportLink (string, optional) — URL for more info on package requirements.

permissions

string[] — List of permission strings granted to the WebUI X instance, e.g., "wx.permission.ROOT_PATH".

historyFallback

boolean — If true, fallback to the historyFallbackFile when URL not found. Default false.

title

string — Title displayed in the WebUI X or shortcut.

icon

string — Path relative to the module's webroot pointing to the icon file used for shortcuts or UI.

windowResize

boolean — Enables window resizing behavior. Default true.

backHandler

boolean? — Enables handling back button presses internally. Default true.

backInterceptor

any — Custom logic or object for intercepting back presses. Usually null.

refreshInterceptor

string? — Type of refresh interceptor used; "javascript" or "native".

exitConfirm

boolean — Enable confirmation dialog before exiting. Default true.

pullToRefresh

boolean — Enables pull-to-refresh gesture. Default false.

historyFallbackFile

string — Filename fallback for history navigation. Default "index.html".

autoStatusBarsStyle

boolean — Automatically style Android status bars. Default true.

dexFiles Since v53 Stable on v108

array of objects — Specifies external .dex or .apk files to load additional JavaScript interfaces dynamically.

Each object includes:

  • type: "dex" or "apk" — File type.
  • path: Path to the .dex or .apk file (relative to module root).
  • className: Fully qualified Java class name to load from the dex/apk.
  • cache: Boolean to enable caching of loaded interface instances. Default true.
    • If you try to load any native library (*.so) be aware that you always need cache to true

killShellWhenBackground Since v96

boolean — Whether to terminate shell processes when app goes to background. Default true.

contentSecurityPolicy Since v181

string — Content Security Policy header for WebUI X. Supports placeholders like {domain}.

Default value:

txt
default-src 'self' data: blob: {domain};
script-src 'self' 'unsafe-inline' 'unsafe-eval' {domain};
style-src 'self' 'unsafe-inline' {domain};
connect-src *

caching Since v181

boolean — Enables caching of WebUI X resources. Default true.

cachingMaxAge Since v181

int — Maximum cache age in seconds. Default 86400 (24 hours).

Released under the GPL3 License.