Skip to content

plugin.json

Every plugin has src/main/resources/plugin.json. The build reads it for packaging and checks; the runtime reads the copy at the jar root.

{
  "id": "coffee-timer",
  "name": "Coffee Timer",
  "version": "1.0.0",
  "author": "your-name",
  "api": 9,
  "main": "tutorial.coffeetimer.CoffeeTimerPlugin",
  "permissions": ["ui.slot.carmenu", "ui.slot.statusbar"],
  "icons": ["cup", "cup-20"]
}

Fields

Field Required Rules
id Yes 2–40 characters: a letter, then a-z, 0-9 and -. It names the jar, the mibpkg package, your storage and your icon directory. mibsdk is reserved
name Yes Free text shown in the Plugins menu and in mibpkg
version Yes Semver: 1.2.3 or 1.2.3-beta.1. mibpkg uses it to order updates
author Yes Free text. Read by the runtime; ignored by the build
api Yes Integer: the newest plugin API your code uses. Currently 9, the only level this SDK loads
main Yes Fully qualified class that extends mibsdk.api.MibPlugin
permissions No Array of permission ids from api/permissions.json
icons No Array of icon names, [a-z0-9-]{1,32}, at most 8. Each needs src/main/icons/<name>.png
dependencies No Array of plugin ids that must be enabled first. Read by the runtime; not checked by the build

Validation

Build

PluginJson.read fails the build for:

  • missing id, name, version, main;
  • an id outside the rule above, or mibsdk;
  • a version that is not semver;
  • an api other than the one this SDK implements (see API levels), or a non-integer;
  • an unknown permission, with a "did you mean" hint;
  • an invalid, duplicate or excessive icon name;
  • a missing icon PNG, or a PNG that fails the format rules.

The package also carries a generated requires.toml:

[mibsdk]
min = "0.7.0"

It is stamped with the SDK version the plugin was built against. mibpkg refuses to install the plugin on an older SDK, so it cannot silently run against a runtime missing a fix it was built with. It is a sidecar file rather than a manifest field so older mibpkg releases still install the package. There is no plugin.json field for it.

permissionScan additionally fails the build when:

  • your code uses a permission the manifest does not declare;
  • your code uses API newer than "api";
  • your code uses reflection, exec or raw sockets without platform.unrestricted.

It warns when a status-bar call names a declared icon larger than 30×30.

Runtime

ManifestParser re-checks the manifest when the jar is loaded. A plugin whose manifest is invalid is BLOCKED_INVALID. A plugin whose declared permissions are not all granted is BLOCKED_PERMISSIONS and never starts.

The runtime accepts a slightly wider id range than the build (2–41 characters, starting with a letter or digit). Use the build's rule; it is the one that determines whether a package can be created.

Permissions

The catalog lives in api/permissions.json:

Id Approval text
vehicle.read Read vehicle state: ignition, gear, parking sensors
vehicle.parking.write Change parking-sensor settings, for example mute the rear tones
hooks.parking Watch and override parking-system messages
ui.slot.carmenu Add a row to the Car menu
ui.slot.statusbar Show an item in the status bar
network Query local services on this unit (loopback only)
network.outbound Connect to hosts outside this unit
platform.unrestricted Unrestricted: may use reflection and stock HMI classes; the SDK cannot contain it

See Permissions for the enforcement model.

Icons

"icons" lists file names without the .png extension:

src/main/icons/cup.png      declared as "cup"
src/main/icons/cup-20.png   declared as "cup-20"

The package carries them as icons/<name>.png; mibpkg installs them as icons/<id>/<sha16>.png.