qml: don't import QtMultimedia when running on android (android 8 compat)
What changed, and why it matters
This is a compatibility fix for Electrum's Android app. It stops loading the QtMultimedia camera module on Android because it causes crashes on older Android versions (Android 8). The QR-code scanner is still available on desktop. There is no direct security vulnerability being patched here; it is primarily a stability/compatibility change.
No security action required. Treat as a normal stability/compatibility commit. If reviewing, verify that desktop QR scanning still works and that the Android-specific scanner remains unaffected.
Security signals we found
No security-relevant code paths modified (no crypto, networking, parsing, permissions, or authentication logic)
Change is a UI module loading / platform compatibility fix
Comment explicitly states motivation is camera crashing, not a security issue
No input validation, deserialization, or privilege changes
Evidence from the diff
The commit removes an unconditional import QtMultimedia from main.qml and stops instantiating a ScanDialog component that relies on QtMultimedia on Android. On Android, the app now uses a platform-specific scan dialog (_scanDialog), while desktop continues to use ScanDialog.qml via dynamic component creation. A memory-cleanup onClosed: destroy() was also added directly to ScanDialog.qml. The change is framed as ‘android 8 compat’ and addresses Qt6 camera crashes on Android.
Changed components
electrum/gui/qml/components/main.qmlelectrum/gui/qml/components/ScanDialog.qmlAndroid QML GUI camera/QR scanner initializationInspect captured patch +6 / −9
diff --git a/electrum/gui/qml/components/ScanDialog.qml b/electrum/gui/qml/components/ScanDialog.qml
index d8e4ed9..8b6b3d7 100644
--- a/electrum/gui/qml/components/ScanDialog.qml
+++ b/electrum/gui/qml/components/ScanDialog.qml
@@ -6,7 +6,8 @@ import org.electrum
import "controls"
-// currently not used on android, kept for future use when qt6 camera stops crashing
+// currently not used on android, kept for testing on desktop, and future use
+// on android when qt6 camera support becomes usable (i.e. stops crashing)
ElDialog {
id: scanDialog
@@ -50,4 +51,6 @@ ElDialog {
onClicked: doReject()
}
}
+
+ onClosed: destroy()
}
diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml
index 7de57ff..ce01372 100644
--- a/electrum/gui/qml/components/main.qml
+++ b/electrum/gui/qml/components/main.qml
@@ -7,7 +7,6 @@ import QtQuick.Controls.Material.impl
import QtQuick.Window
import QtQml
-import QtMultimedia
import org.electrum 1.0
@@ -450,12 +449,6 @@ ApplicationWindow
onFinished: destroy()
}
}
- Component {
- id: _qtScanDialog
- ScanDialog {
- onClosed: destroy()
- }
- }
Component {
id: crashDialog
@@ -533,7 +526,8 @@ ApplicationWindow
if (AppController.isAndroid()) {
app.scanDialog = _scanDialog
} else {
- app.scanDialog = _qtScanDialog
+ // for running on Desktop. uses QtMultimedia.
+ app.scanDialog = Qt.createComponent('ScanDialog.qml')
}
function continueWithServerConnection() {
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.