Adding a firmware adapter¶
The plugin API is firmware-neutral. All car-specific code lives in one adapter behind
mibsdk.platform.PlatformAdapter. The repository ships one adapter, adapter-hqc, for
HMI_AU_MIB2_HQC_NAR_G22_C10_180803.
This page is the investigation and implementation guide for a second adapter. It is deliberately concrete: you will pull files, build a map, and prove each layer on a bench unit before touching a car.
Warning
A wrong adapter can boot-loop the HMI. Work on a bench unit, keep SSH or SD-card recovery available, and test safe mode before you install anything on a car.
1. What an adapter has to provide¶
flowchart TB
RT["mibsdk.runtime"] --> SPI["mibsdk.platform.PlatformAdapter"]
SPI --> V["supports(hmiVersion)"]
SPI --> F["features()"]
SPI --> S["start(host) / stop()"]
SPI --> P["parking()"]
S --> B["bundle activator / configurator"]
S --> UI["UI: pages, Car rows, status bar, toasts, dialogs"]
S --> EV["events: ignition, parking, trailer, hooks"]
| SPI member | What it must do |
|---|---|
id() |
A short adapter name, used in logs |
supports(hmiVersion) |
Exact match against the HMI = ... line, or a deliberate family rule |
features() |
The mibsdk.api.Features this build can provide |
start(PlatformHost) |
Register with the stock HMI, create the UI and event bridges, report features |
stop() |
Remove everything; restore stock state |
parking() |
A ParkingIo or null when the unit has no parking system |
The runtime never sees an stock HMI class. The adapter is the only module allowed to.
2. Inventory the unit¶
Start with the version and the boot chain.
ssh root@<unit-ip> 'grep "^HMI" /ifs/version_info.txt'
ssh root@<unit-ip> 'ls -la /mnt/app/eso/hmi/lsd /mnt/app/eso/hmi/lsd/jars /ifs'
Pull the stock files (see Stock files):
| File | What it tells you |
|---|---|
version_info.txt |
The exact HMI = ... string your supports must match |
lsd.sh |
Boot classpath, heap, system properties, bundle list selection, JXE path |
bundles*.properties |
Bundle activators and autostart order |
lsd/jars/*.jar |
Classes that shadow the JXE; note duplicates and load order |
lsd.jxe / lsd.jar |
The HMI itself: ~30k classes |
hmi.zip |
Developer-mode HMI classes, when present |
DSITracer.jar |
The DSI service tracer the adapter links against |
Convert and inspect¶
The commands below use de.<vendor> and de.<framework> as placeholders for the package prefixes in your
image. Find the real prefixes with unzip -l first; do not copy the HQC build's names.
PYTHONPATH=/path/to/jxe2jar/src python3 /path/to/jxe2jar/src/jxe2jar.py \
build/stock/lsd.jxe build/stock/lsd.jar
unzip -l build/stock/lsd.jar | grep -E 'de/<vendor>|de/<framework>|org/dsi' | head
javap -classpath build/stock/lsd.jar -p de.<vendor>.atip.base.Framework
For readable sources, decompile with CFR or Vineflower. Treat the output as a map, not as truth: jxe2jar
byte-swaps some numeric constants and can drop InnerClasses attributes. Verify anything you rely on
against the class file with javap or at runtime.
3. Build a firmware map¶
Write down evidence as you go. A table like this is worth more than a memory of a class name:
| Question | Where to look | Record |
|---|---|---|
| How does the HMI start? | lsd.sh, startup.sh, runHMI.sh |
Command line, JXE path, boot classpath |
| Which bundles start? | bundles.properties, bundles_*.properties |
Activator class, autostart order |
| What wraps DSI? | the serviceDelegateConfigurator property, DSITracer.jar |
Configurator class and chain order |
| Where is the framework? | IFrameworkAccess, the framework access class |
Service name, lookup method |
| Where is the screen model? | DisplayManagerMIB2High, HMITerminalImplMIB2High |
Context ids, terminal ids |
| Where do screens come from? | *ScreenFactory, ScreenBag, ConditionBank |
Factory class, model ids |
| Where is the status bar? | StatusBar*, PartialPopup* |
Widget ids, model ids |
| How does input arrive? | KbdListener, KeyEventDistributorEvo |
Key codes, focus path |
| How is parking exposed? | org.dsi.ifc.*parking*, ParkingBridge in HQC |
Service name, methods |
The HQC adapter's classes are the reference for each row. The bundle, configurator and the two HMI activators
(SdkBundleActivator, ChainingConfigurator, ui/SdkCarActivator, ui/SdkSystemActivator) keep their packages on
purpose: their names are written into the unit's lsd/bundles*.properties and mibpkg compares them on every update.
| HQC class | Pattern to copy |
|---|---|
boot/HqcVersion |
Exact version match |
SdkBundleActivator |
Bundle entry point and lifecycle |
boot/ConfiguratorCore, ChainingConfigurator |
Hooking the stock configurator chain |
HqcPlatform |
PlatformAdapter implementation and feature set |
boot/SdkBoot, boot/SdkGlobals, boot/SdkFiles |
Runtime boot and on-unit paths |
dsi/ServiceWaiter, dsi/RawServices |
Waiting for late stock services |
dsi/DsiServiceProxy, dsi/DsiConstants, bridge/BridgeListener |
DSI proxies and event pumps |
bridge/IgnitionBridge, bridge/ParkingBridge, dsi/HookBindings |
Events, parking and hooks |
ui/ids/HqcUiIds, ui/ids/TextIds, ui/ids/InputTextIds |
Stock id tables |
ui/SdkCarActivator, ui/car/SdkCarScreenFactory, ui/car/SdkCarModelBank |
Car drawer and screens |
ui/SdkSystemActivator, ui/car/SdkSystemScreenFactory |
Plugins menu and status bar |
ui/page/PageScreens, ui/page/PageRenderer, ui/page/PageWidgets |
Page rendering |
ui/status/BarStatusLine, ui/status/StatusSinks, ui/popup/StatusPopupController |
Status-line and popup paths |
ui/screen/ConfirmScreen, ui/screen/SliderScreen, ui/screen/SpellerScreen |
Dialogs and inputs |
ui/page/UiApplier, ui/page/UiInputs, ui/hmi/HmiPoster |
Applying snapshots and input |
How to find a class you only know by behaviour¶
# Class names, without decompiling everything
unzip -l build/stock/lsd.jar | grep -i statusbar
# A string constant, a log line or a method name in the jar
zipgrep -a 'PDC R OFF' build/stock/lsd.jar || true
# One class's full signature
javap -classpath build/stock/lsd.jar -p -c de.<vendor>.atip.displaymanager.DSIDisplayManagerControllerImpl
# Decompile one package
cfr build/stock/lsd.jar --outputdir build/stock/src --jarfilter 'de.<vendor>.atip.base.*'
Prefer javap for facts and decompilers for shape. A decompiled name is a guess until the bytecode or the
bench confirms it.
4. Implement the adapter¶
- Copy the module shape. Create
adapter-<name>with the same dependencies asadapter-hqc: the stocklsd.jarandDSITracer.jar,platform, and themibsdk.car-libraryconvention. - Version gate first. Implement
supportsand make the SDK logadapter=noneand stop on an unknown build. Never fall through to an HMI you have not tested. - Boot. Register a bundle activator and a configurator chain. Prove that the SDK starts, logs its
STATUSlines and stops cleanly before you add UI. - Services. Wait for the framework access and the DSI services. Report features only when the
service is actually available. Handle services that arrive late: call
PlatformHost.featuresChanged(). - UI, one path at a time: Plugins menu, page, Car row, status item, toast, confirm. Keep the id
tables in one class (
HqcUiIdsis the model) and never scatter raw stock ids. - Events and parking. Prove ignition and parking events, then the override and restore path.
- Hooks last. Hooks depend on the DSI proxy and the stock thread model. Prove that no plugin code runs on a stock thread.
What not to do¶
- Do not let plugin code touch the manufacturer's stock packages or
org.dsi.*. The class-loader allow-list is the boundary. - Do not shadow a stock class unless there is no other way. Every shadow is a firmware-specific liability.
- Do not run plugin code from a stock callback. Queue it on the plugin's worker.
- Do not assume a screen, model id or key code from another firmware. Measure it.
- Do not ship a stock jar, a decompiled class or an HMI image.
5. Bench loop¶
The adapter is the one part that cannot be tested on the host fake. Use a bench unit:
./gradlew :dist:assembleUnitand./gradlew :dist:mibpkgPackage.- Install the SDK with
installer/mibsdk-dev install <unit-ip>. - Watch
installer/mibsdk-dev log <unit-ip>forSTATUSlines and startup errors. - Use
installer/mibsdk-dev ui-forcefail factory|screen|offto prove the fallback paths. - Capture the screen after every UI change. A screenshot is evidence that the stock HMI drew what you think it did.
- Test safe mode:
installer/mibsdk-dev safe-mode on, reboot, thenoff. - Test a plugin that fails in
onEnable, one that hangs, and one that is quarantined.
Evidence to collect¶
| Area | Evidence |
|---|---|
| Version gate | Unknown build logs adapter=none and loads no plugin |
| Boot | Warm and cold boot, no boot loop, clean stop |
| Menu | SDK entry, Plugins page, Car drawer row |
| Pages | Every row kind and input on the real HMI |
| Status bar | Text, icon, colour, contexts, pagination, icon-only |
| Dialogs | Confirm, speller, toast, BACK and timeout |
| Parking | Read, override, restore on disable and ignition-off |
| Hooks | Veto and observe, no plugin code on a stock thread |
| Recovery | Safe mode, failed restore retry, uninstall restores stock files |
6. Definition of done¶
supportsmatches exactly the documented build; anything else makes the SDK stay off.- Every
PlatformAdaptermethod is implemented and tested. - Every reported
Featureis real at that boot; a missing service is reported as missing. - Plugin code never runs on a stock thread.
- The adapter compiles against the stock jars and passes
linkCheck. carJclSignaturesis regenerated and committed if the class library changed.- A bench record exists for every UI path, with screenshots and a clean log.
- Safe mode and uninstall are tested.
- The docs say which build the adapter supports and what is still unproven.
7. Tips for a person or an agent¶
- Start with the version gate and the boot chain. Do not read 30,000 classes first.
- Build a map with exact class names, method names and evidence. Update it after every bench run.
- Use
javapto confirm a signature; use a decompiler to understand the shape. - Check whether a class is in
lsd.jxeor in a shadow jar. The first copy on the boot classpath wins. - When a name looks meaningful (
StatusBarStubController), verify it with the model id it writes. - Keep every experiment on a branch and in the bench record. A second adapter is a long investigation.
- The repository's internal research notes show the shape of one such map: the onboard Java map and the HMI UI injection notes. They describe the HQC build, not yours, but the questions and evidence style transfer.