Author: Calin Culianu [email protected]
A helper app for Electrum. This app emulates the 'zbar' functionality present on Windows and Linux for Electrum.
It is a very small and lightweight app with no external dependencies other than what macOS provides in its own system libs for reading from the camera and detecting QR codes in video.
The app basically creates a window and reads from the default camera device on the system. It will continue to run until either the window is closed by the user or a QR image is read.
- If a QR image is scanned, it will print the decoded string to stdout and exit.
- If there is an error detecting the camera, it will show an error message and wait.
- If the user closes the window without having scanned a QR code (because of an error or s/he changed his/her mind), it will print nothing to stdout and exit.
In order to build the app and have it actually work on deployed machines other than your developer machine, you need an Apple Developer Certificate (you have to join the Apple developer program), and you need to sign the app. Otherwise on newer macOS, camera access won't be granted to the app.
- Load included source code in Xcode.
- Hit build.
Or, if you prefer the command-line:
- Chdir to sources
xcodebuild
codesign -v -f -s MY_DEVELOPER_CERT build/Release/CalinsQRReader.app
- electrum/qrscanner.py - for how it is integrated into Electrum.
- contrib/build-osx/osx.spec - for how it's collected and put into the final Electrum.app.