Skip to content

chore: fast_scanner maintenance [1/2] - #3602

Open
MrCyjaneK wants to merge 1 commit into
devfrom
CW-1648-fast-scanner-maintenance
Open

MrCyjaneK wants to merge 1 commit into
devfrom
CW-1648-fast-scanner-maintenance

Conversation

@MrCyjaneK

@MrCyjaneK MrCyjaneK commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Please include a summary of the changes and which issue is fixed / feature is added.

Pull Request - Checklist

  • Initial Manual Tests Passed
  • Double check modified code and verify it with the feature/task requirements
  • Format code
  • Look for code duplication
  • Clear naming for variables and methods
  • Manual tests in accessibility mode (TalkBack on Android) passed

Note

Medium Risk
Native library and scanner plugin upgrades affect QR/decode paths on all platforms; dropping rawBytes and changing launchMode could alter edge-case scan results or Android deep-link/back-stack behavior.

Overview
Updates the fast_scanner git dependency and wires in the scanqr_c_gozxing native decoder (libsimple.so / simple.xcframework) via new prepare_scanqr and platform build scripts, Android Docker cache layers, and iOS Xcode copy/embed steps.

On the scan UI, gallery import is enabled on ScanPage using ImagePicker and controller.analyzeImage, with user-facing “No QR code found” errors and camera resume after failure. Successful scans now return rawValue only (no rawBytes fallback) in ScanPage and qr_scanner.dart.

Android MainActivity launchMode changes from singleInstance to singleTask, likely to improve activity stacking when returning from the gallery picker.

Reviewed by Cursor Bugbot for commit 45f0d77. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

changes in dependencies

changed git refs:
  fast_scanner
    url   https://github.com/MrCyjaneK/fast_scanner -> https://github.com/MrCyjaneK/fast_scanner
    ref   69b3276b090fa6ac01b4483ca3adca93a8e615be -> d53afcca247ed4a700d90368fe71b3880c816990
    path  - -> -
     .fvmrc                                             |   2 +-
     .gitmodules                                        |   3 +
     android/build.gradle                               |  10 +-
     .../dev/steenbakker/fast_scanner/BarcodeHandler.kt |   4 +
     .../fast_scanner/GrayscaleFrameAnalyzer.kt         |  95 +++++
     .../dev/steenbakker/fast_scanner/MobileScanner.kt  |  42 +-
     .../fast_scanner/MobileScannerCallbacks.kt         |   4 +-
     .../fast_scanner/MobileScannerHandler.kt           |  23 +-
     .../fast_scanner/QrCodeAnalyzerBoofcv.kt           | 157 --------
     .../fast_scanner/QrCodeAnalyzerZxing.kt            |  79 ----
     .../fast_scanner/UniversalQrCodeAnalyzer.kt        |  27 --
     backend/README.md                                  |  61 +++
     backend/simple                                     |   1 +
     example/android/app/build.gradle                   |   5 +-
     example/android/app/src/main/jniLibs/.gitignore    |   4 +
     .../gradle/wrapper/gradle-wrapper.properties       |   2 +-
     example/android/settings.gradle                    |   2 +-
     example/lib/barcode_scanner_simple.dart            | 132 ++++++-
     example/lib/barcode_scanner_window.dart            | 114 +-----
     example/lib/scanner_error_widget.dart              |   1 -
     ios/Classes/BarcodeHandler.swift                   |   4 +
     ios/Classes/MobileScanner.swift                    | 134 +++----
     ios/Classes/MobileScannerPlugin.swift              |  19 +-
     lib/fast_scanner.dart                              |  16 -
     lib/src/enums/address_type.dart                    |  29 --
     lib/src/enums/barcode_format.dart                  |  70 +---
     lib/src/enums/barcode_type.dart                    |  79 ----
     lib/src/enums/email_type.dart                      |  29 --
     lib/src/enums/encryption_type.dart                 |  34 --
     lib/src/enums/phone_type.dart                      |  39 --
     lib/src/fast_scanner_controller.dart               |  24 +-
     lib/src/fast_scanner_platform_interface.dart       |   6 +
     .../fast_scanner_method_channel.dart               | 143 ++++---
     lib/src/objects/address.dart                       |  33 --
     lib/src/objects/barcode.dart                       | 152 +-------
     lib/src/objects/calendar_event.dart                |  47 ---
     lib/src/objects/contact_info.dart                  |  73 ----
     lib/src/objects/driver_license.dart                |  90 -----
     lib/src/objects/email.dart                         |  34 --
     lib/src/objects/geo_point.dart                     |  31 --
     lib/src/objects/person_name.dart                   |  49 ---
     lib/src/objects/phone.dart                         |  24 --
     lib/src/objects/sms.dart                           |  22 --
     lib/src/objects/url_bookmark.dart                  |  22 --
     lib/src/objects/wifi.dart                          |  32 --
     lib/src/scanqrc/envelope.dart                      |  76 ++++
     lib/src/scanqrc/gray_frame.dart                    |  24 ++
     lib/src/scanqrc/scanqrc.dart                       |   2 +
     lib/src/scanqrc/scanqrc_ffi.dart                   | 421 +++++++++++++++++++++
     lib/src/scanqrc/scanqrc_stub.dart                  |  24 ++
     lib/src/web/zxing/result.dart                      |  28 +-
     lib/src/web/zxing/zxing_barcode_reader.dart        |  14 +-
     macos/Classes/MobileScannerPlugin.swift            | 251 ++++--------
     pubspec.yaml                                       |   1 +
     test/enums/address_type_test.dart                  |  42 --
     test/enums/barcode_format_test.dart                |  26 +-
     test/enums/barcode_type_test.dart                  |  62 ---
     test/enums/email_type_test.dart                    |  42 --
     test/enums/encryption_type_test.dart               |  47 ---
     test/enums/phone_type_test.dart                    |  46 ---
     60 files changed, 1125 insertions(+), 1984 deletions(-)

@MrCyjaneK
MrCyjaneK force-pushed the CW-1648-fast-scanner-maintenance branch from ee8f7e9 to 28a93ad Compare September 22, 2026 19:47
@MrCyjaneK
MrCyjaneK marked this pull request as ready for review September 22, 2026 20:00
@MrCyjaneK
MrCyjaneK force-pushed the CW-1648-fast-scanner-maintenance branch 2 times, most recently from 3057b04 to c0e5234 Compare September 23, 2026 13:39
@MrCyjaneK

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread lib/new-ui/pages/scan_page.dart
@MrCyjaneK
MrCyjaneK force-pushed the CW-1648-fast-scanner-maintenance branch from c0e5234 to aa69530 Compare September 24, 2026 14:15
@MrCyjaneK
MrCyjaneK force-pushed the CW-1648-fast-scanner-maintenance branch from aa69530 to 45f0d77 Compare September 26, 2026 06:38
@MrCyjaneK

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 45f0d77. Configure here.


./build_torch.sh

./build_scanqr.sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS omits built scanner library

Medium Severity

macOS now builds simple.xcframework via build_scanqr.sh, but that library is never added to the macOS Xcode project. iOS embeds it in the app bundle through Copy Files; macOS has no matching embed for simple.xcframework or libsimple. After the fast_scanner bump, macOS QR scanning can fail at runtime because the native scanner library is not in the app.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 45f0d77. Configure here.

if (capture != null &&
capture.barcodes.any((barcode) => barcode.rawValue?.trim().isNotEmpty ?? false)) {
_handleBarcode(capture);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gallery scan pops empty barcode

Low Severity

Gallery success only checks that some barcode has a non-empty rawValue, then _handleBarcode pops barcodes.firstOrNull. If the first entry is empty or null and a later one is valid, the scanner closes with a null or blank result and callers treat that as a cancel, so a readable gallery QR is dropped.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 45f0d77. Configure here.

This branch has not been deployed

No deployments
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.

1 participant