Skip to content

Comments

feat: add MQTT configuration support via ADB intents#70

Open
harcerz wants to merge 2 commits intoRushB-fr:mainfrom
harcerz:feature/mqtt-adb-config
Open

feat: add MQTT configuration support via ADB intents#70
harcerz wants to merge 2 commits intoRushB-fr:mainfrom
harcerz:feature/mqtt-adb-config

Conversation

@harcerz
Copy link

@harcerz harcerz commented Feb 21, 2026

📝 Description

Adds 11 MQTT parameters (broker, port, username, password, client_id, base_topic, discovery_prefix, status_interval, allow_control, device_name, enabled) to ADB intent handling and JSON config mapping. MQTT password is stored securely in Android Keychain via the pending config bridge, same pattern as PIN.

This enables fully automated tablet provisioning with MQTT via ADB scripts, removing the need for manual UI configuration.

Usage

adb shell am start -n com.freekiosk/.MainActivity \
    --es pin "1234" \
    --es mqtt_enabled "true" \
    --es mqtt_broker_url "broker.local" \
    --es mqtt_port "1883" \
    --es mqtt_username "user" \
    --es mqtt_password "pass"

🔧 Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 📝 Documentation update

✅ Testing

  • Tested on real Android device
  • Tested in Device Owner mode
  • Tested on multiple Android versions: 14, 15
  • No regressions found

Device(s) tested:

  • Device: Lenovo IdeaPad Pro (TB373FU)
  • Android version: Android 14 & 15

📋 Checklist

  • My code follows the project's code style
  • I have commented my code where necessary
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • I have tested on a real device (not just emulator)
  • All existing tests still pass

Adds 11 MQTT parameters (broker, port, username, password, client_id,
base_topic, discovery_prefix, status_interval, allow_control, device_name,
enabled) to ADB intent handling and JSON config mapping.
MQTT password is stored securely in Android Keychain via the pending
config bridge, same pattern as PIN.
@harcerz
Copy link
Author

harcerz commented Feb 21, 2026

Sorry for the separate PR but I remembered about it when I had to prepare 7 tablets :)

- Fix R8 obfuscation breaking Netty JCTools Unsafe field access by adding
  official HiveMQ ProGuard rules (-keepclassmembernames)
- Fix silent error swallowing in autoStartMqtt() — errors now propagate to UI
- Add connection error display and 15s timeout in MQTT settings
- Add onConnectionError callback from native to JS for broker error messages
- Fix password paste capturing only one character (slice(-1) → slice(-charsAdded))
- Fix broker URL field adding spaces after dots (keyboardType="url")
- Add TLS auto-detection for port 8883
- Add password saved hint in MQTT settings
- Catch Throwable instead of Exception in MqttModule.startMqtt()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants