Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
302c990
Update Flutter for Pixel map markers
MrAlders0n Sep 22, 2026
198ce7a
Stop blaming a distant repeater for a nearby radio's direct packets
MrAlders0n Sep 26, 2026
71ee581
Stop waiting 3 s after every TX ping
MrAlders0n Sep 26, 2026
b312157
Time the TX reply at the ping entry point
MrAlders0n Sep 26, 2026
2c3cf57
Parse repeater scope replies
MrAlders0n Sep 26, 2026
374daaa
Keep a leading byte order mark in scope names
MrAlders0n Sep 26, 2026
9c5c384
Add a radio lease for scope requests
MrAlders0n Sep 27, 2026
c1b05b2
Keep scope answers and block the lease after a reboot
MrAlders0n Sep 27, 2026
0b61070
Add scope discovery setting
MrAlders0n Sep 27, 2026
1d1efe4
Add scope discovery due rule and cache
MrAlders0n Sep 27, 2026
242d3eb
Count overlapping scope budget saves
MrAlders0n Sep 27, 2026
8c0a6da
Test a budget save that lands mid-write
MrAlders0n Sep 27, 2026
507e855
Queue scope answers for upload
MrAlders0n Sep 27, 2026
51b278f
Keep scope uploads in order and out of cleared queues
MrAlders0n Sep 27, 2026
60a3818
Close the scope upload test gaps
MrAlders0n Sep 27, 2026
ea93d1e
Ask discovered repeaters for their scopes
MrAlders0n Sep 27, 2026
7fc8994
Tie scope answers to their sweep and test the stop wiring
MrAlders0n Sep 27, 2026
254a06d
Show a badge while asking for scopes
MrAlders0n Sep 27, 2026
7c40c0f
Finish the scopes badge
MrAlders0n Sep 27, 2026
e1c8e44
Test the scopes badge on the real buttons
MrAlders0n Sep 27, 2026
d1c7b10
Show scope requests in the log
MrAlders0n Sep 27, 2026
c0d70d0
Test the scope log wiring
MrAlders0n Sep 27, 2026
c80fb0a
Document scope discovery
MrAlders0n Sep 27, 2026
8a72f01
Correct the scope discovery notes
MrAlders0n Sep 27, 2026
27518fe
Start the echo window when the ping goes out
MrAlders0n Sep 27, 2026
1ed15bc
Stop scope work when the server withdraws it
MrAlders0n Sep 27, 2026
2b6fb50
Tidy scope logging, colours and notes
MrAlders0n Sep 27, 2026
9272eb0
Stop scope requests once replies fall out of step
MrAlders0n Sep 27, 2026
37055e4
Withdraw scope work before session cleanup
MrAlders0n Sep 27, 2026
2ac70fa
Keep scope work off during the Offline switch
MrAlders0n Sep 27, 2026
e0572c0
Use the region scope name as given
MrAlders0n Sep 26, 2026
d584c3f
Drop a dash from the scope key comment
MrAlders0n Sep 26, 2026
ab154e0
Drop scope answers from a replayed upload once withdrawn
MrAlders0n Sep 27, 2026
dd59385
Bump the queue generation on storage recovery
MrAlders0n Sep 27, 2026
2b4bfaa
Refresh Manage when the radio frees up
MrAlders0n Sep 27, 2026
36ecd9e
Keep withdrawn scope answers out of the custom forward
MrAlders0n Sep 27, 2026
6d035c9
Leave scope answers out of the coverage refresh
MrAlders0n Sep 27, 2026
7307065
Test scope discovery alongside Smart Pinging
MrAlders0n Sep 27, 2026
a1ec88e
Bump the generation before recovery waits
MrAlders0n Sep 27, 2026
0ec247f
Ignore block padding after scope names
MrAlders0n Sep 27, 2026
e9ad927
Hold off a repeater that does not answer
MrAlders0n Sep 27, 2026
2797517
Refresh repeaters more often while asking for scopes
MrAlders0n Sep 27, 2026
6aa39f1
Keep the scope refresh timer in step with the mode
MrAlders0n Sep 27, 2026
db9eb4c
Stop asking non-contacts when the radio's contact list is full
MrAlders0n Sep 27, 2026
fb4fedc
Confirm a full contact list before giving up on non-contacts
MrAlders0n Sep 27, 2026
c42e774
Report a full contact list in the error log
MrAlders0n Sep 27, 2026
dd7fd0b
Call the antenna setting Internal or External everywhere
MrAlders0n Sep 29, 2026
ab8bab4
Retry silent repeaters sooner once the signal improves
MrAlders0n Sep 30, 2026
6cf9476
Explain when scope discovery actually asks a repeater
MrAlders0n Oct 1, 2026
5b842f8
Regenerate Hive adapters before every release build
MrAlders0n Oct 1, 2026
90474fb
Ignore impossible airborne altitudes at driving speed
MrAlders0n Oct 1, 2026
212f825
Wait for a stale background service to stop before starting a new one
MrAlders0n Oct 1, 2026
4a15b59
Don't mint a new session for an idle app coming back to the foreground
MrAlders0n Oct 1, 2026
4d29fd9
Say that downloaded-tiles-only hides the coverage overlay
MrAlders0n Oct 1, 2026
fc56049
Pin the Flutter version release builds must use
MrAlders0n Oct 1, 2026
6fcd4cc
Recover a lapsed session before Manage talks to the server
MrAlders0n Oct 1, 2026
fee1820
Retry a background service a late stop took down, and let disconnect …
MrAlders0n Oct 1, 2026
99cd54e
Don't create a second wardriving channel after a broken channel scan
MrAlders0n Oct 1, 2026
1de57a8
Only take a channel reply for the slot that was asked for
MrAlders0n Oct 1, 2026
b22a950
Raise the iOS minimum to 15 for Flutter 3.47.5
MrAlders0n Oct 1, 2026
08e6518
Send the app key when fetching repeaters
MrAlders0n Oct 5, 2026
ba990e3
Respect the radio channel limit when connecting
MrAlders0n Oct 5, 2026
6912679
Stop the CarPlay card showing doubled text
MrAlders0n Oct 6, 2026
853867d
Keep adding map dots once the pin lists are full
MrAlders0n Oct 7, 2026
d103d80
Send people to Settings when Android stops asking for location
MrAlders0n Oct 7, 2026
d404052
Retry busy Bluetooth writes, back off noise floor polling, and wait f…
MrAlders0n Oct 7, 2026
644ef45
Wait for an accurate GPS fix before checking the zone
MrAlders0n Oct 7, 2026
106e69d
Document the zone check accuracy gate and noise floor backoff
MrAlders0n Oct 7, 2026
dd8f309
Show an update screen with the right store link when the app is too old
MrAlders0n Oct 7, 2026
8d7b8ea
Drop 'here' from the update screen copy
MrAlders0n Oct 7, 2026
18d8e46
Let a Bluetooth connect be cancelled and fix the grey Scan button aft…
MrAlders0n Oct 7, 2026
2bf8c27
Give debug logs their own card, stop stub log files and rotate once p…
MrAlders0n Oct 10, 2026
9f46f01
Add the rule that labels a fix's altitude with its reference
MrAlders0n Oct 10, 2026
6c16158
Remember each fix's altitude reference in a small store
MrAlders0n Oct 10, 2026
c5baaf8
Read the last Android fix natively so its altitude reference can be p…
MrAlders0n Oct 10, 2026
5148bce
Upload an altitude only with its reference and vertical accuracy
MrAlders0n Oct 10, 2026
d00f26c
Resolve each fix's altitude reference as it arrives
MrAlders0n Oct 10, 2026
b0bc601
Carry the labelled altitude on every TX, RX, discovery and trace row
MrAlders0n Oct 10, 2026
cae3067
Strip bare altitudes from old offline sessions and document the new f…
MrAlders0n Oct 10, 2026
ebe3f21
Key each fix's altitude answer on the whole fix, not just its time an…
MrAlders0n Oct 10, 2026
1f42282
Send beta builds to the releases page, not the latest stable release
MrAlders0n Oct 10, 2026
8fa908e
Describe the account overview as a sum of each radio's own points
MrAlders0n Oct 11, 2026
1085f18
Answer the connect intent before iOS gives up on it
MrAlders0n Oct 12, 2026
a6806e9
Draw zoomed-out coverage blocks from tile format 2
MrAlders0n Oct 12, 2026
9f1e439
Redraw the spider right after it opens or closes
MrAlders0n Oct 12, 2026
f0b7245
Read the zone's region group from the status answer
MrAlders0n Oct 13, 2026
001d5bb
Track the zone's region group in app state
MrAlders0n Oct 13, 2026
acd1afb
Show the region group code in place of the zone code
MrAlders0n Oct 13, 2026
4e2a45e
Load coverage from the region group's site
MrAlders0n Oct 13, 2026
559eff9
Move between members of a region group without a visible transfer
MrAlders0n Oct 13, 2026
7fc805a
Let a group handoff drain and release without tripping itself
MrAlders0n Oct 13, 2026
a661755
Document region groups
MrAlders0n Oct 13, 2026
411ecb2
Close the gaps a group handoff leaves on screen
MrAlders0n Oct 13, 2026
431975a
Never leave a radio connected without a session after a handoff
MrAlders0n Oct 13, 2026
bc7055a
Fix the deferred credit, session check and reconnect backstop around …
MrAlders0n Oct 13, 2026
c15671f
Show each repeater's scopes in its detail sheet
MrAlders0n Oct 13, 2026
744bf9a
Let the map settings pickers scroll on short screens
MrAlders0n Oct 13, 2026
3b5b5af
Bring the development guide up to date with the wire tag and echo window
MrAlders0n Oct 16, 2026
7e6ac4c
Open the share sheet on iPad for offline sessions and debug logs
MrAlders0n Oct 17, 2026
b506482
Fixed Download JSON on offline sessions and Share on debug logs doing…
MrAlders0n Oct 17, 2026
0d18a11
Keep the GPS arrow centered on Android after a ping, cell or repeater…
MrAlders0n Oct 17, 2026
ff18ad8
Repeater nicknames for Top Heard and the Apple surfaces (#36)
MrAlders0n Oct 18, 2026
f7e7eb9
Merge pull request #35 from MeshMapper/fix/ipad-share-origin
MrAlders0n Oct 18, 2026
c5bb1df
Merge pull request #37 from MeshMapper/claude/android-map-center-afte…
MrAlders0n Oct 18, 2026
5b4eaee
Let repeater login wait for a long contact list (#38)
MrAlders0n Oct 18, 2026
5e066af
Top Heard: repeater names and a longer list (#39)
MrAlders0n Oct 19, 2026
e1a169b
Keep Offline Mode pings when a radio drop ends the drive
MrAlders0n Oct 19, 2026
0308a31
Merge pull request #40 from MeshMapper/fix/offline-save-on-ble-drop
MrAlders0n Oct 19, 2026
1c9fc63
Repeater coverage lines: a switch, off by default
MrAlders0n Oct 19, 2026
16bd0fe
Merge pull request #41 from MeshMapper/feat/repeater-coverage-lines-s…
MrAlders0n Oct 19, 2026
474018d
Draw every coverage square of a busy repeater
MrAlders0n Oct 19, 2026
f0f04f5
Stop the stuck Android "Starting wardriving..." service
MrAlders0n Oct 20, 2026
bb92e0b
Stop re-downloading region borders on every zone check
MrAlders0n Oct 24, 2026
5daf05a
Keep a held TX ping ahead of discovery in Hybrid
MrAlders0n Oct 24, 2026
7069b5e
Name the held GRP_TXT in the Smart Pinging help, matching the wiki
MrAlders0n Oct 24, 2026
7fa72f8
Fix border cache gaps found in review
MrAlders0n Oct 24, 2026
8bf4920
Stop the Connection screen calling a 0-slot preset Flood Off
MrAlders0n Oct 26, 2026
bff65fe
Say flood is off for the radio's settings, not the whole region
MrAlders0n Oct 26, 2026
ed703cc
Send a held TX ping in place of a Hybrid discovery leg
MrAlders0n Oct 26, 2026
531736b
Read each ping button's label once to screen readers
MrAlders0n Oct 26, 2026
26035e8
Move Close App to the Settings tab
MrAlders0n Oct 26, 2026
87b27c1
Upload the last queued pings on Disconnect and Close App
MrAlders0n Oct 27, 2026
21cab40
Send an accurate GPS fix when a session is renewed
MrAlders0n Oct 27, 2026
f51f7bd
Check the zone before Go Online stops wardriving
MrAlders0n Oct 27, 2026
b7371c5
Show a scrollbar on the ping and error logs
MrAlders0n Oct 28, 2026
d5b1a96
Clear the Log tab's red dot once the errors are seen
MrAlders0n Oct 28, 2026
04e4e1e
Show the quick guide's icons on the antenna buttons
MrAlders0n Oct 28, 2026
290d2f6
Say to reboot the radio when it cannot sign a manual link
MrAlders0n Oct 28, 2026
2845af4
Stop the Google Location Accuracy dialog looping on Android
MrAlders0n Oct 28, 2026
b857836
Back off zone check retries when there is no answer
MrAlders0n Oct 28, 2026
bd986c2
Read the region's Smart Ping flood only setting
MrAlders0n Oct 30, 2026
b2a2320
Ask Smart Pinging per ping kind
MrAlders0n Oct 30, 2026
1702a85
Hold flood pings only in green squares by default
MrAlders0n Oct 30, 2026
b684931
Add the Delay only flood pings switch
MrAlders0n Oct 30, 2026
c918457
Say both halves of flood only in the notes
MrAlders0n Oct 30, 2026
55b914d
Sync the custom API endpoint doc with the wiki copy
MrAlders0n Oct 31, 2026
95767b4
Describe wire_tag as the encrypted session tag in the custom API doc
MrAlders0n Oct 31, 2026
16f9911
Say linked radio points can take up to 24 hours to move
MrAlders0n Nov 2, 2026
daa8dca
Add the sample drive used for store screenshots
MrAlders0n Nov 2, 2026
00e2acd
Track lib/debug and keep the newest sample ping heard
MrAlders0n Nov 2, 2026
dc94d9b
Add a debug-only capture mode for store screenshots
MrAlders0n Nov 2, 2026
6875ef4
Keep capture mode off on web and when the documents folder is unreadable
MrAlders0n Nov 2, 2026
df4003b
Set the Watch sample data in Ottawa
MrAlders0n Nov 2, 2026
10ea553
Use the Ottawa zone code in the Watch sample
MrAlders0n Nov 2, 2026
6d88030
Capture App Store screenshots from the simulators
MrAlders0n Nov 2, 2026
c7be5f6
Capture Play Store screenshots from an emulator
MrAlders0n Nov 2, 2026
d44d6f2
Add the App Store Connect script for versions, screenshots and review
MrAlders0n Nov 2, 2026
9d0d30c
Let submit resume a half-finished review submission
MrAlders0n Nov 2, 2026
da3b263
Add the Google Play script for production uploads and screenshots
MrAlders0n Nov 2, 2026
568cb3d
Make the Play upload safe to re-run
MrAlders0n Nov 2, 2026
25d626c
Keep waiting when App Store Connect answers 500 for a new screenshot
MrAlders0n Nov 2, 2026
d432778
Stop starting the Android service with the dataSync type
MrAlders0n Nov 3, 2026
ab89b51
Stop the background service when a disconnect is final
MrAlders0n Nov 3, 2026
7249be5
Use Google Play's wording for the location disclosure
MrAlders0n Nov 3, 2026
0339edc
Say location is collected in the background only while a mode runs
MrAlders0n Nov 3, 2026
4ae533c
Read no location until the disclosure is agreed to
MrAlders0n Nov 3, 2026
054b039
Stop GPS in the background when no mode needs it
MrAlders0n Nov 3, 2026
0aa1d14
Close the gaps in the location disclosure flow
MrAlders0n Nov 3, 2026
2ad305e
Revert "Stop GPS in the background when no mode needs it"
MrAlders0n Nov 3, 2026
63365ad
Let the connected-device service type pass without Bluetooth permission
MrAlders0n Nov 3, 2026
b7b6666
Add the policy for when background location may run
MrAlders0n Nov 3, 2026
8c41be0
Let a GPS stop win over a start still in flight
MrAlders0n Nov 3, 2026
81b5a1b
Stop GPS in the background when no radio is connected
MrAlders0n Nov 3, 2026
d2d65a2
Do the first GPS start in full when init had to wait
MrAlders0n Nov 3, 2026
b4249b7
Keep GPS through the disconnect cleanup
MrAlders0n Nov 3, 2026
f5318a3
Add the app's own Android session service
MrAlders0n Nov 3, 2026
5fa9432
Run Android's background work in the app's own session service
MrAlders0n Nov 3, 2026
ee5b6b3
Keep the session service awake through a reconnect or zone grace
MrAlders0n Nov 3, 2026
4d2be33
Drop the background location permission on Android
MrAlders0n Nov 3, 2026
0bf8ffa
Bring the background service notes up to date
MrAlders0n Nov 3, 2026
889ef27
Say location is used in the background only while a radio is connected
MrAlders0n Nov 3, 2026
42e9bb5
Close the gaps the final review found
MrAlders0n Nov 3, 2026
e558c8f
Bump build version to 1.4.2
MrAlders0n Nov 3, 2026
74e8c23
Keep GPS off on a background launch until the app is on screen
MrAlders0n Nov 8, 2026
235da8f
Ask Android for a location fix every second
MrAlders0n Nov 8, 2026
ddaa236
Keep the History session when the app is killed mid-drive
MrAlders0n Nov 8, 2026
9f7290b
Drop channel messages with a ragged ciphertext length before decrypting
MrAlders0n Nov 8, 2026
c4fdb41
Quieter logs for short packets, tiles with no verdict and ignored frames
MrAlders0n Nov 8, 2026
498ab16
Log each device a Bluetooth scan finds and how many it found
MrAlders0n Nov 8, 2026
affd31d
Run region border rebuilds one at a time
MrAlders0n Nov 8, 2026
8dba0ce
Finish a debug log upload that landed before its answer was lost
MrAlders0n Nov 8, 2026
67c5a0d
Drop a dash from the debug upload notes
MrAlders0n Nov 8, 2026
d3e6409
Stop pinging after the radio drops
MrAlders0n Nov 8, 2026
7180a94
Drop the map marker for a discovery that never sent
MrAlders0n Nov 8, 2026
58e8fd0
Log why Smart Pinging let each auto ping through
MrAlders0n Nov 8, 2026
a6304b8
Give up on a radio that keeps dropping right after reconnecting
MrAlders0n Nov 8, 2026
a26fa83
Skip the disconnect alert when the user cancels a reconnect
MrAlders0n Nov 8, 2026
6453d3f
Keep a late reconnect from tearing down a newer connection
MrAlders0n Nov 8, 2026
ea1a7b0
Stop reconnects from eating slot estimates and the claims rate limit
MrAlders0n Nov 8, 2026
a749ba9
Describe the reconnect and dispose fixes in the dev notes
MrAlders0n Nov 8, 2026
1e07cf6
Never hold a GPS start that is already running
MrAlders0n Nov 8, 2026
c881c6b
Stop retrying a debug upload into a closed session
MrAlders0n Nov 8, 2026
3822405
Drop an abandoned reconnect's connection before the cleanup awaits
MrAlders0n Nov 8, 2026
1548f67
Let a superseded TCP connect stand down like a Bluetooth one
MrAlders0n Nov 8, 2026
e4bce7c
Keep a disconnect cleanup from releasing a newer connect's session
MrAlders0n Nov 8, 2026
660fa5b
Go back to the 5 second Android location interval
MrAlders0n Nov 9, 2026
942ec9c
Ask Android for a location fix every second, like iOS
MrAlders0n Nov 9, 2026
9e2c46c
Export all offline sessions at once
MrAlders0n Nov 9, 2026
12f0309
Show a short repeater id as the one repeater it matches
MrAlders0n Nov 9, 2026
cbfb650
Let the GPS marker be green
MrAlders0n Nov 9, 2026
a257fa0
Remember the map zoom and folded panels
MrAlders0n Nov 9, 2026
7ce00ca
Ask for Precise Location before connecting
MrAlders0n Nov 9, 2026
d7649f9
Keep the top bar on small phones and show a scope count
MrAlders0n Nov 9, 2026
118f8f2
Say Precise Location is off when only approximate is granted
MrAlders0n Nov 10, 2026
bad4760
Drop the launch notice for approximate location
MrAlders0n Nov 10, 2026
8ff9806
Show the location permission warning on the Connect tab only
MrAlders0n Nov 10, 2026
43e8489
Fix five narrow bugs found reviewing 1.4.2
MrAlders0n Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .build_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.4.2
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.47.5'

- run: flutter pub get
- run: dart run build_runner build --delete-conflicting-outputs
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ android/key.properties
*.jks
*.keystore

# App Store Connect API keys and Google Play service accounts (never commit)
*.p8
service-account*.json

# iOS generated files
/ios/Flutter/Flutter.framework
/ios/Flutter/Flutter.podspec
Expand Down Expand Up @@ -73,6 +77,8 @@ ios/Flutter/flutter_export_environment.sh

# Debug logs
debug/
!lib/debug/
!test/debug/
debuglog/
meshmapper-debug-*.txt

Expand Down
45 changes: 45 additions & 0 deletions Build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

set -e # Exit on any error

# The Flutter SDK every release is built with. Bump this when Flutter is
# upgraded, together with flutter-version in .github/workflows/ci.yml, so the
# store builds and CI never drift onto different SDKs.
REQUIRED_FLUTTER_VERSION="3.47.5"

# CLI flags for scripted use: ./Build.sh [--type dev|prod] [--version X.Y.Z] [--dry-run]
# With no flags the script behaves exactly as before (interactive prompts).
CLI_TYPE=""
Expand Down Expand Up @@ -224,6 +229,22 @@ fi
ANDROID_DIR="$HOME/Documents/MeshMapper_Apps/Andriod"
IOS_DIR="$HOME/Documents/MeshMapper_Apps/IOS"

# The Flutter SDK on PATH builds everything, and regenerates code with it too
FLUTTER_BIN="$(command -v flutter || true)"
if [ -z "$FLUTTER_BIN" ]; then
echo "Error: flutter not found on PATH"
exit 1
fi
FLUTTER_VERSION_LINE="$(flutter --version 2>/dev/null | head -1)"
FLUTTER_FRAMEWORK_VERSION="$(flutter --version --machine 2>/dev/null | sed -n 's/.*"frameworkVersion": *"\([^"]*\)".*/\1/p' | head -1)"
if [ "$FLUTTER_FRAMEWORK_VERSION" != "$REQUIRED_FLUTTER_VERSION" ]; then
echo "Error: Flutter $REQUIRED_FLUTTER_VERSION is required, but the flutter on PATH"
echo "($FLUTTER_BIN) is ${FLUTTER_FRAMEWORK_VERSION:-unknown}."
echo "Install or switch to $REQUIRED_FLUTTER_VERSION, or bump REQUIRED_FLUTTER_VERSION"
echo "at the top of Build.sh (and ci.yml) if you are upgrading on purpose."
exit 1
fi

# Dry run: everything is resolved and validated - print the plan and stop
if [ "$DRY_RUN" = "1" ]; then
echo ""
Expand All @@ -234,6 +255,11 @@ if [ "$DRY_RUN" = "1" ]; then
echo "Build name: $VERSION_NUMBER"
echo "Build number: $EPOCH"
echo "Secrets: present (API key + signing passwords)"
echo "Flutter SDK: $FLUTTER_VERSION_LINE ($FLUTTER_BIN)"
echo ""
echo "Would run first:"
echo " flutter pub run build_runner build --delete-conflicting-outputs"
echo " (fails the build if it fails or rewrites pubspec.lock)"
echo ""
echo "Would produce:"
echo " APK: $ANDROID_DIR/MeshMapper-$FILE_TAG.apk"
Expand All @@ -250,9 +276,28 @@ echo "============================================"
echo "MeshMapper Build Script"
echo "Version: $APP_VERSION"
echo "Build number: $EPOCH"
echo "Flutter SDK: $FLUTTER_VERSION_LINE ($FLUTTER_BIN)"
echo "============================================"
echo ""

# Regenerate generated code (Hive adapters). *.g.dart is gitignored, so a
# stale local copy would otherwise ship and silently drop newer Hive fields.
echo "[0/3] Regenerating generated code (build_runner)..."
LOCK_BEFORE="$(shasum pubspec.lock 2>/dev/null || true)"
if ! flutter pub run build_runner build --delete-conflicting-outputs; then
echo "Error: build_runner failed, not building"
exit 1
fi
LOCK_AFTER="$(shasum pubspec.lock 2>/dev/null || true)"
if [ "$LOCK_BEFORE" != "$LOCK_AFTER" ]; then
echo "Error: build_runner rewrote pubspec.lock. The Flutter SDK on PATH"
echo "($FLUTTER_VERSION_LINE) is likely not the one the lock was resolved"
echo "with. Restore pubspec.lock and put the right SDK first on PATH."
exit 1
fi
echo "✓ Generated code is up to date"
echo ""

# Ensure output directories exist
mkdir -p "$ANDROID_DIR"
mkdir -p "$IOS_DIR"
Expand Down
1,169 changes: 1,089 additions & 80 deletions DEVELOPMENT.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ analyzer:
# Vendored, patched copy of maplibre_gl (see pubspec.yaml dependency_overrides).
# Analyze it under its own options, not ours.
- third_party/**
- build/**
- android/**
- ios/**
- web/**
10 changes: 10 additions & 0 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,14 @@ dependencies {
// OfflineManager for the tile cache MethodChannel handlers. Version must
// match maplibre_gl-0.27.1's OpenGL transitive dependency.
implementation("org.maplibre.gl:android-sdk-opengl:13.5.0")

// Fused location client, already pulled transitively by geolocator_android
// 4.6.2, but declared so MeshMapperAltitudeService.kt compiles against it.
// Version must match geolocator_android's transitive dependency.
implementation("com.google.android.gms:play-services-location:21.2.0")

// AndroidX core, already pulled transitively (maplibre_gl's core-ktx), but
// declared so MeshMapperSessionService.kt compiles against ServiceCompat
// and NotificationCompat. Version must match the one Gradle resolves.
implementation("androidx.core:core:1.18.0")
}
40 changes: 34 additions & 6 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
<!-- Location permissions for GPS and BLE scanning -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<!-- Background GPS comes from the session service, which starts on screen
at connect, so "Allow all the time" is not needed. remove keeps a
plugin from merging the permission back in. -->
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove" />

<!-- BLE hardware feature -->
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
Expand All @@ -21,6 +24,13 @@
<uses-permission android:name="android.permission.INTERNET" />
<!-- Network state for satellite/constrained-network detection -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Android 14+ requires one of a short list of permissions for a
connectedDevice foreground service. Without this one, a TCP-only user
who denied Nearby devices (Bluetooth) fails the type check:
startForeground throws, the session service never becomes
foreground, and the session dies once the app is in the background.
It is a normal permission: no prompt. -->
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

<!-- Wake lock for auto-ping mode -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
Expand All @@ -29,8 +39,10 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- Only flutter_background_service asks for this, for its BootReceiver,
which is removed below. Nothing starts at boot. -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" tools:node="remove" />

<application
android:label="MeshMapper"
Expand Down Expand Up @@ -84,12 +96,28 @@
android:name="android.telephony.PROPERTY_SATELLITE_DATA_OPTIMIZED"
android:value="net.meshmapper.app" />

<!-- Background service for continuous wardriving -->
<!-- The app's own foreground service (MeshMapperSessionService.kt),
which keeps BLE and GPS running in the background. It is started
while the app is on screen. stopWithTask ends it when the app is
swiped away, and nothing starts it at boot or restarts it. -->
<service
android:name=".MeshMapperSessionService"
android:exported="false"
android:stopWithTask="true"
android:foregroundServiceType="location|connectedDevice" />

<!-- flutter_background_service is iOS only now. Its Android service,
restart alarm receiver and boot receiver are removed from the
merged manifest. -->
<service
android:name="id.flutter.flutter_background_service.BackgroundService"
android:foregroundServiceType="location|connectedDevice|dataSync"
android:exported="true"
tools:replace="android:exported,android:foregroundServiceType" />
tools:node="remove" />
<receiver
android:name="id.flutter.flutter_background_service.WatchdogReceiver"
tools:node="remove" />
<receiver
android:name="id.flutter.flutter_background_service.BootReceiver"
tools:node="remove" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
Expand Down
11 changes: 11 additions & 0 deletions android/app/src/main/kotlin/net/meshmapper/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import java.io.File
class MainActivity : FlutterActivity() {
private var usbService: MeshMapperUsbService? = null
private var networkService: MeshMapperNetworkService? = null
private var altitudeService: MeshMapperAltitudeService? = null
private var sessionServiceChannel: SessionServiceChannel? = null

override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
Expand All @@ -20,6 +22,10 @@ class MainActivity : FlutterActivity() {

networkService = MeshMapperNetworkService(applicationContext)
networkService!!.configureFlutterEngine(flutterEngine)
altitudeService = MeshMapperAltitudeService(applicationContext)
altitudeService!!.configureFlutterEngine(flutterEngine)
sessionServiceChannel = SessionServiceChannel(applicationContext)
sessionServiceChannel!!.configureFlutterEngine(flutterEngine)

// MapLibre tile cache management. Mirrors AppDelegate.swift's iOS
// implementation. Called from Dart's TileCacheService by the Offline
Expand Down Expand Up @@ -101,6 +107,11 @@ class MainActivity : FlutterActivity() {
}

override fun onDestroy() {
// Back on the root screen finishes the activity and destroys its
// engine without removing the task, so stopWithTask never fires
// there. With the engine gone nothing drives the radio session, so
// the session service stops with it.
if (!isChangingConfigurations) sessionServiceChannel?.stop()
usbService?.dispose()
networkService?.dispose()
super.onDestroy()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
package net.meshmapper.app

import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.location.Location
import android.location.LocationManager
import android.os.Build
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.gms.location.LocationServices
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel

/// Describes the location provider's most recent fix object to Dart, so the
/// app can prove whether the altitude the location plugin delivered was the
/// fix's sea level value or its ellipsoid value. Android 14 is the first
/// version whose fixes can carry a sea level altitude, so below it nothing is
/// read and only the SDK is answered.
///
/// This service converts nothing, does no disk I/O and logs nothing: the Dart
/// resolver owns the one throttled warning. It reads one cached fix from the
/// fused provider (or, without Google services, the last known fix of each
/// enabled location manager provider) and answers exactly once, on the main
/// thread, with an empty fix list on any failure. It holds the application
/// context, never the activity.
class MeshMapperAltitudeService(private val context: Context) {
private companion object {
const val METHOD_CHANNEL = "meshmapper/altitude"
const val MSL_SDK = Build.VERSION_CODES.UPSIDE_DOWN_CAKE
}

fun configureFlutterEngine(flutterEngine: FlutterEngine) {
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, METHOD_CHANNEL)
.setMethodCallHandler { call, result ->
when (call.method) {
"describeLastFix" -> describeLastFix(result)
else -> result.notImplemented()
}
}
}

private fun answer(sdk: Int, fixes: List<Map<String, Any?>>): Map<String, Any?> =
mapOf("sdk" to sdk, "fixes" to fixes)

/// Answers exactly once. Every branch, including the asynchronous fused
/// callbacks, is wrapped: an exception anywhere answers an empty list.
private fun describeLastFix(result: MethodChannel.Result) {
val sdk = Build.VERSION.SDK_INT
val empty = answer(sdk, emptyList())
try {
if (sdk < MSL_SDK || !hasLocationPermission()) {
result.success(empty)
return
}
if (!playServicesAvailable()) {
result.success(answer(sdk, managerFixes()))
return
}
LocationServices.getFusedLocationProviderClient(context).lastLocation
.addOnSuccessListener { location ->
val reply = try {
if (location == null) empty else answer(sdk, listOf(describe("fused", location)))
} catch (e: Exception) {
empty
}
result.success(reply)
}
.addOnFailureListener { result.success(empty) }
} catch (e: Exception) {
// SecurityException, a missing Play services class, anything else.
result.success(empty)
}
}

private fun hasLocationPermission(): Boolean =
context.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) ==
PackageManager.PERMISSION_GRANTED ||
context.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) ==
PackageManager.PERMISSION_GRANTED

/// The same test geolocator makes before choosing its fused client.
private fun playServicesAvailable(): Boolean = try {
GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) ==
ConnectionResult.SUCCESS
} catch (e: NoClassDefFoundError) {
false
}

// Only reached when SDK_INT >= MSL_SDK (checked once in describeLastFix),
// which is what makes the Android 14 Location getters below safe.
private fun managerFixes(): List<Map<String, Any?>> {
val manager = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager
val fixes = mutableListOf<Map<String, Any?>>()
for (provider in manager.getProviders(true)) {
try {
manager.getLastKnownLocation(provider)?.let { fixes.add(describe("manager:$provider", it)) }
} catch (e: Exception) {
// A provider this app may not read contributes nothing.
}
}
return fixes
}

private fun describe(source: String, l: Location): Map<String, Any?> = mapOf(
"source" to source,
"timeMs" to l.time,
"lat" to l.latitude,
"lon" to l.longitude,
"hasAltitude" to l.hasAltitude(),
"altitude" to l.altitude,
"hasVerticalAccuracy" to l.hasVerticalAccuracy(),
"verticalAccuracy" to l.verticalAccuracyMeters.toDouble(),
"hasMsl" to l.hasMslAltitude(),
"msl" to (if (l.hasMslAltitude()) l.mslAltitudeMeters else 0.0),
"hasMslAccuracy" to l.hasMslAltitudeAccuracy(),
"mslAccuracy" to (if (l.hasMslAltitudeAccuracy()) l.mslAltitudeAccuracyMeters.toDouble() else 0.0),
"isMock" to l.isMock,
)
}
Loading
Loading