What changed, and why it matters
This commit adds a 'tap to focus' feature to Electrum's Android QR code scanner. It is a usability improvement for users whose phones lack automatic focus, not a security fix or vulnerability. There are no security signals in the code or commit message.
No security action needed; treat as a normal usability/feature commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change calls mScannerView.setTapToFocus() in SimpleScannerActivity.java and reformats a few comments/whitespace lines. It enables manual focus on tap inside the ZXing-based barcode scanner view. No permissions, input handling, network, cryptography, or data-flow behavior is changed.
Changed components
electrum/gui/qml/java_classes/org/electrum/qr/SimpleScannerActivity.javaInspect captured patch +6 / −3
diff --git a/electrum/gui/qml/java_classes/org/electrum/qr/SimpleScannerActivity.java b/electrum/gui/qml/java_classes/org/electrum/qr/SimpleScannerActivity.java
index d6db097..476c375 100644
--- a/electrum/gui/qml/java_classes/org/electrum/qr/SimpleScannerActivity.java
+++ b/electrum/gui/qml/java_classes/org/electrum/qr/SimpleScannerActivity.java
@@ -95,7 +95,10 @@ public class SimpleScannerActivity extends Activity {
private void startCamera() {
if (mScannerView == null) {
mScannerView = new BarcodeScannerView(this);
- mScannerView.setCropRatio(0.75f); // Set crop ratio to 75% (this defines the square area shown in the scanner view)
+ // Set crop ratio to 75% (this defines the square area shown in the scanner view)
+ mScannerView.setCropRatio(0.75f);
+ // allow tap to focus (note: some devices don't support autofocus which is enabled by default)
+ mScannerView.setTapToFocus();
// by default only Format.QR_CODE is set
ViewGroup contentFrame = (ViewGroup) findViewById(R.id.content_frame);
contentFrame.addView(mScannerView);
@@ -172,7 +175,7 @@ public class SimpleScannerActivity extends Activity {
// Get the root view and set up insets listener
getWindow().getDecorView().setOnApplyWindowInsetsListener((v, insets) -> {
android.graphics.Insets systemBars = insets.getInsets(WindowInsets.Type.systemBars());
-
+
// Apply padding to content frame to keep scanner focus area centered
ViewGroup contentFrame = findViewById(R.id.content_frame);
if (contentFrame != null) {
@@ -195,7 +198,7 @@ public class SimpleScannerActivity extends Activity {
);
}
- // Apply bottom margin to paste button for navigation bar
+ // Apply bottom margin to paste button for navigation bar
Button pasteButton = findViewById(R.id.paste_btn);
if (pasteButton != null) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) pasteButton.getLayoutParams();
Why this scored 20/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.