|
All checks were successful
build-release / linux (push) Successful in 4m5s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .gitea/workflows | ||
| desktop | ||
| icon | ||
| Resources | ||
| scripts | ||
| Sources | ||
| web | ||
| .gitignore | ||
| build.sh | ||
| Info.plist | ||
| install.sh | ||
| LICENSE | ||
| README.md | ||
Wi-Fi2QR
A tiny, one-click macOS app that turns this Mac's current Wi-Fi connection into a scannable QR code. Launch it → approve the two permission prompts → a QR appears that any phone (iOS or Android) can scan from the camera to join the network. No typing, no copy-paste, and nothing ever leaves the Mac.
Download
No install (any device): open wifi2qr.mineracks.com in a browser.
Desktop app (auto-reads your current Wi-Fi) — all builds on the releases page:
| Platform | Installer |
|---|---|
| macOS (Universal — Intel + Apple Silicon) | Wi-Fi2QR_1.0.0_macOS_universal.dmg |
| Linux · Debian/Ubuntu | Wi-Fi2QR_1.0.0_linux_amd64.deb |
| Linux · Fedora/RHEL | Wi-Fi2QR_1.0.0_linux_x86_64.rpm |
| Windows (x64) | Wi-Fi2QR_1.0.0_windows_x64_portable.zip — portable, needs WebView2 (built into Win10/11) |
Why it's handy
Modern Wi-Fi passwords are long, random, and a pain to read aloud or thumb-type on a phone. A Wi-Fi QR fixes that — point a camera at it and the device joins, no typing and no mistakes. It's genuinely useful when:
- Guests arrive. Friends, family, clients, contractors scan and they're on — without you reciting
xK7$mq…character by character or scribbling it on a whiteboard. - You run a café, studio, clinic, Airbnb or rental. Generate the QR once, print it on a card or poster, and every visitor self-serves. No staff time, no password on a sticky note by the till.
- You're onboarding a new device. Phone, tablet, laptop, smart TV, printer, or any IoT gadget with a camera or companion app — scan to join instead of pecking at an on-screen keyboard with a remote.
- You never memorised the password. macOS saved it years ago and you've no idea what it is. This reads it from your keychain and turns it into a QR without ever showing the plaintext to you or anyone.
- Meetings & events. Share the room's network with everyone at once — throw the QR up on the projector.
- You switch networks often. Hit Refresh after joining a different one and it regenerates instantly.
It's the same convenience iPhones have for sharing Wi-Fi to nearby Apple devices — but as a plain QR that anything with a camera can scan, generated on demand from your Mac, completely offline.
Two ways to use it
1. Web app — runs on any device (web/). A tiny browser app: type or paste a network name +
password and it draws the QR instantly, entirely client-side — no upload, works offline, and installs
as a PWA (Add to Home Screen). Open web/index.html directly, or host the web/ folder anywhere static.
This is what covers iPhone, iPad, Android, GrapheneOS, Windows, Linux, ChromeOS — anything with a browser.
The QR engine is Project Nayuki's MIT encoder (vendored, verified by an encode→decode round-trip).
2. macOS app — one-click auto-read. Reads this Mac's current Wi-Fi (SSID + keychain password) and shows the QR with no typing. See Build & run below.
Why not auto-read on phones? Reading the live Wi-Fi password is an OS-privileged operation only desktop OSes (macOS/Windows/Linux) allow. iOS/iPadOS forbid it entirely and Android/GrapheneOS block it without root — which is why phones ship their own Wi-Fi-QR sharing in Settings. So the auto-read app is desktop-only; the web app (manual entry) is the universal path. (A cross-platform Windows/Linux auto-read build is on the roadmap.)
launch → [grant Location] → [approve keychain] → QR shown, ready to scan
Why it needs two permissions
| Permission | Why | Who asks |
|---|---|---|
| Location | On macOS 10.15+, the OS only tells an app the name (SSID) of the Wi-Fi you're on if it has Location access. (Apple classes "which Wi-Fi you're near/on" as location data.) | System dialog on first launch |
| Keychain | The Wi-Fi password lives in your keychain. The app reads it with the same /usr/bin/security tool Keychain Access uses, which shows the standard "allow / always allow" authorization dialog. |
System dialog when it reads the password |
Both are the user's to grant — the app can't (and doesn't try to) bypass either. The password is used only to build the QR payload in memory; it is never written to disk, logged, or sent anywhere.
How it works
Pure SwiftUI + system frameworks, no third-party dependencies:
| File | Responsibility |
|---|---|
Sources/WiFi2QRApp.swift |
@main app + window |
Sources/LocationAuth.swift |
Requests/observes Location authorization (CoreLocation) — the gate that unlocks the SSID |
Sources/WiFiInfo.swift |
Reads the SSID (CoreWLAN) and the password (shells out to security, triggering the keychain prompt) |
Sources/QRCode.swift |
Builds the standard WIFI:T:WPA;S:…;P:…;; payload (with proper escaping) and renders it with CoreImage's CIQRCodeGenerator |
Sources/ContentView.swift |
The one-click flow + UI: auto-runs on launch, shows the QR, with Save PNG / Copy / Refresh |
The Wi-Fi provisioning payload is the cross-platform standard camera apps understand:
WIFI:T:WPA;S:<ssid>;P:<password>;; # H:true; appended for hidden networks
\ ; , : " in the SSID/password are backslash-escaped per the spec. Security type defaults to WPA
(covers WPA/WPA2/WPA3); a network with no saved password is emitted as T:nopass (open).
Build & run
Requirements: macOS 13+ and the Xcode Command Line Tools (xcode-select --install). No full Xcode
or Xcode project needed — it builds with swiftc + codesign.
./install.sh # builds (if needed) and installs into /Applications, then opens it
# or, to just build without installing:
./build.sh && open build/WiFi2QR.app
install.sh drops WiFi2QR.app into /Applications (falls back to ~/Applications) so it's clickable
from Finder / Launchpad / Spotlight. build.sh compiles the sources, assembles WiFi2QR.app, and
ad-hoc code-signs it (that gives the app a
stable identity so macOS can attach the Location/keychain permissions to it). It builds for the host
architecture by default; for an Intel build run ARCH_OVERRIDE=x86_64 ./build.sh.
Because you built it locally, macOS Gatekeeper opens it without fuss. If you ever copy it to another Mac
(so it carries a download quarantine flag), open it the first time with right-click → Open, or clear the
flag: xattr -dr com.apple.quarantine /path/to/WiFi2QR.app.
First launch
- Approve "WiFi2QR would like to use your location." → the app reads the current network name.
- Approve the keychain dialog for the Wi-Fi password (tick Always Allow to skip it next time).
- The QR appears with the network name under it — point another device's camera at it to join.
Buttons: Save PNG (to show on a bigger screen / print), Copy (QR to clipboard), Refresh (re-read after switching networks).
Troubleshooting
- "Location access is off" — click Open Settings, enable Location for WiFi2QR, then Continue. Or click Enter name manually and type the SSID; the password step still works.
- Network name not detected — you're on Ethernet, Wi-Fi is off, or Location isn't granted. Type the name in the manual field.
- "No saved password found" — the network is open, enterprise (802.1X, no simple password), or was never joined on this Mac. Open networks still produce a valid (password-less) QR.
- Keychain prompt every time — tick Always Allow in the dialog.
Notes / design choices
- Not sandboxed. The app shells out to
/usr/bin/securityto read the Wi-Fi password, which the App Sandbox would block. It ships as a locally-built, ad-hoc-signed utility — appropriate for a personal tool, not the Mac App Store. - Not notarized. It's meant to be built and run locally from source (which you can read in full). To distribute it to other people's Macs you'd sign it with a Developer ID and notarize it.
- No network code, no analytics, no persistence. MIT licensed.
- Icon is generated from code — no image assets.
icon/makeicon.swiftdraws a QR code's three finder "eyes" with a Wi-Fi fan in the fourth corner on a blue→cyan squircle;./icon/makeicon.shrenders it toResources/AppIcon.icns(all sizes), whichbuild.shbundles.
License
MIT — see LICENSE.