diff --git a/.copilotignore b/.copilotignore
new file mode 100644
index 000000000..02ec3ad1d
--- /dev/null
+++ b/.copilotignore
@@ -0,0 +1,27 @@
+# Ignore build artifacts and generated files from Copilot indexing
+# This saves context window tokens and prevents Copilot from hallucinating off of minified code.
+
+# Build directories
+**/build/**
+.gradle/
+.idea/
+
+# Android generated files
+**/generated/**
+.cxx/
+.externalNativeBuild/
+
+# Git history & worktrees
+.git/
+.worktrees/
+
+# Protobuf (Prevents Copilot from suggesting raw protobuf byte buffers)
+core/proto/
+
+# Environment and secrets
+local.properties
+secrets.properties
+*.jks
+
+# Agent References (Prevents pollution of project space with external code)
+.agent_refs/
diff --git a/.gemini/settings.json b/.gemini/settings.json
new file mode 100644
index 000000000..5e535b215
--- /dev/null
+++ b/.gemini/settings.json
@@ -0,0 +1,5 @@
+{
+ "context": {
+ "fileName": ["AGENTS.md", "GEMINI.md"]
+ }
+}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index ecf5296e7..ef57ec56d 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -1,13 +1,16 @@
name: Bug Report
description: File a bug report.
title: "[Bug]: "
-labels: ["bug"]
-projects: ["meshtastic/Meshtastic-Android"]
+labels: [bug]
+projects: [meshtastic/Meshtastic-Android]
body:
- type: markdown
attributes:
value: |
- Thanks for taking the time to fill out this bug report!
+ Thank you for helping to make Meshtastic-Android better by reporting a bug. :hugs:
+
+ Please provide as much detail as possible so we can efficiently address your issue and avoid unnecessary back-and-forth.
+
- type: input
id: contact
attributes:
@@ -16,58 +19,164 @@ body:
placeholder: ex. email@example.com, discord username
validations:
required: false
- - type: textarea
- id: what-happened
+
+ - type: checkboxes
+ id: checklist
attributes:
- label: What happened?
- description: Also tell us, what did you expect to happen?
- placeholder: Tell us what you see!
- value: "A bug happened!"
+ label: "Checklist"
+ description: |
+ Please make sure you have done the following before submitting your bug report.
+ Bug reports that do not meet these criteria will be closed.
+ Requests that do not meet these criteria will be closed.
+ Links:
+ [**OPEN ISSUES**](https://github.com/meshtastic/Meshtastic-Android/issues)
+ [**CLOSED ISSUES**](https://github.com/meshtastic/Meshtastic-Android/issues?q=is%3Aissue+is%3Aclosed)
+ [Contribution Guidelines](https://github.com/meshtastic/Meshtastic-Android/blob/main/README.md#contributing)
+ options:
+ - label: |
+ I am able to reproduce the bug with the latest version.
+ required: true
+ - label: |
+ I have updated to the latest *Alpha* firmware, and am able to reproduce the bug. Many issues are fixed quickly in alpha before the general beta release.
+ required: true
+ - label: |
+ I made sure that there are no existing **OPEN or CLOSED issues** which I could contribute my information to.
+ required: true
+ - label: |
+ I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
+ required: true
+ - label: |
+ This issue contains only one bug.
+ required: true
+ - label: |
+ I have read and understood the **Contribution Guidelines**.
+ required: true
+ - label: |
+ I agree to follow this project's Code of Conduct
+ required: true
+ - label: |
+ I actually read this list, and should be taken seriously.
+ required: false
+ - type: input
+ id: app-version
+ attributes:
+ label: Affected app version
+ description: |
+ In which Meshtastic-Android app version did you encounter the bug?
+ Can be seen on the bottom of the `Settings` screen in the app.
+ placeholder: "x.y.z-channel.x (build) flavor"
validations:
required: true
- - type: textarea
- id: app_version
+
+ - type: input
+ id: phone-os
attributes:
- label: App Version
- description: What version of Meshtastic Android are you running?
- placeholder: 2.4.1
+ label: Affected Android version
+ description: |
+ With what operating system (+ version) did you encounter the bug?
+ placeholder: "Example: Android 14"
validations:
required: true
- - type: textarea
- id: phone
+
+ - type: input
+ id: phone-model
attributes:
- label: Phone
- description: What phone/tablet and OS are you running it on?
- placeholder: Pixel 8a, Android 15
+ label: Affected phone model
+ description: |
+ On what phone did you encounter the bug?
+ placeholder: "Example: Samsung Galaxy S20 / Google Pixel 8"
validations:
required: true
- - type: textarea
- id: radio
+
+ - type: input
+ id: hardware-model
attributes:
- label: Device
- description: Which meshtastic radio device are you connecting to?
- placeholder: heltec v3
+ label: Affected node model
+ placeholder: "Example: Seeed T1000-E, Heltec v3, etc."
+ description: |
+ On which hardware device (Node) did you encounter the bug?
validations:
required: true
- - type: textarea
- id: firmware
+
+ - type: input
+ id: firmware-version
attributes:
- label: Firmware
- description: Which meshtastic firmware is running on the device?
- placeholder: 2.4.1.394e0e1 Beta
+ label: Affected node firmware version
+ placeholder: "x.x.x"
+ description: "Which Meshtastic firmware version did you encounter the bug?"
validations:
required: true
+
+ - type: textarea
+ id: steps-to-reproduce
+ attributes:
+ label: Steps to reproduce the bug
+ description: |
+ What did you do for the bug to show up?
+
+ If you can't cause the bug to show up again reliably (and hence don't have a proper set of steps to give us), please still try to give as many details as possible on how you think you encountered the bug.
+ placeholder: |
+ 1. Go to '...'
+ 2. Press on '....'
+ 3. Swipe down to '....'
+ validations:
+ required: true
+
+ - type: textarea
+ id: actual-behavior
+ attributes:
+ label: Actual behavior
+ description: |
+ Tell us what happens with the steps given above.
+
+ - type: textarea
+ id: expected-behavior
+ attributes:
+ label: Expected behavior
+ description: |
+ Tell us what you expect to happen.
+
+ - type: textarea
+ id: screen-media
+ attributes:
+ label: Screenshots/Screen recordings
+ description: |
+ A picture or video is worth a thousand words.
+ Provide as much context as possible so we know what we are looking at.
+
+ Add screenshots or a screen recording to help explain your problem, provide detailed context to help us know what to look for.
+ GitHub supports uploads of images and (small) videos directly in the text box.
+
- type: textarea
id: logs
attributes:
label: Relevant log output
- description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
+ description: |
+ Logs help us to diagnose and reproduce issues, particularly when they are unique to your setup.
+ Depending on the issue, the following logs may be useful:
+ - App logs: This will help with most issues. If possible, provide the relevant output of:
+ `adb logcat -d | grep com.geeksville.mesh`
+ - Mesh logs: UI issues, communication issues etc.
+ - ` App > Settings > Advanced > Debug Panel > Export specific / export all `
+ - Broader Android logs: Potentially useful if the issue goes beyond the app (connections, network etc.)
+ `adb logcat -d`
+ - Firmware logs: Useful for all connection issues with nodes
+ - These are piped to the USB serial port on the node, the most foolproof is to use the 'open serial' button on the web-flasher interface, and then save the output.
+ - The app needs to be connecting to the node via Bluetooth or Network for this to work.
render: shell
- - type: checkboxes
- id: terms
+
+ - type: textarea
+ id: additional-information
attributes:
- label: Code of Conduct
- description: By submitting this issue, you agree to follow our [Code of Conduct](https://meshtastic.org/docs/legal/conduct/).
- options:
- - label: I agree to follow this project's Code of Conduct
- required: true
\ No newline at end of file
+ label: Additional information
+ description: |
+ Any other information you'd like to include, for instance that
+ * the affected device is foldable or a TV
+ * you have disabled all animations on your device or otherwise changed system settings
+ * you are using battery optimization or power saving mode
+ * you are using a custom Android ROM or launcher
+ * your ferret chewed your antennas
+ * you are using a VPN
+ * you live in a faraday cage
+ * you dismissed all popups telling you not to do things you shouldn't do without reading them
+ * ...
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
index d5f33e54e..1c7881533 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.yml
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -1,13 +1,39 @@
name: Feature Request
description: File a request for new feature or functionality.
title: "[Feature Request]: "
-labels: ["enhancement"]
-projects: ["meshtastic/Meshtastic-Android"]
+labels: [enhancement]
+projects: [meshtastic/Meshtastic-Android]
body:
- - type: markdown
+ - type: checkboxes
+ id: checklist
attributes:
- value: |
- Thanks for taking the time to fill out this feature request!
+ label: Checklist
+ description: |
+ Please make sure you have done the following before submitting your feature request.
+ Requests that do not meet these criteria will be closed.
+ Links:
+ [**OPEN ISSUES**](https://github.com/meshtastic/Meshtastic-Android/issues)
+ [**CLOSED ISSUES**](https://github.com/meshtastic/Meshtastic-Android/issues?q=is%3Aissue+is%3Aclosed)
+ [Contribution Guidelines](https://github.com/meshtastic/Meshtastic-Android/blob/main/README.md#contributing)
+ options:
+ - label:
+ I have used the search function for **OPEN ISSUES** to see if someone else has already submitted the same feature request.
+ required: true
+ - label: |
+ I have **also** used the search function for **CLOSED ISSUES** to see if the feature was already implemented and is just waiting to be released, or if the feature was rejected.
+ required: true
+ - label: |
+ I will describe the request with as much detail as possible.
+ required: true
+ - label: |
+ This request contains only one single feature, **not** a list of multiple (related) features.
+ required: true
+ - label: |
+ I have read and understood the **Contribution Guidelines**.
+ required: true
+ - label: |
+ I agree to follow this project's Code of Conduct
+ required: true
- type: input
id: contact
attributes:
@@ -17,25 +43,19 @@ body:
validations:
required: false
- type: textarea
- id: request
+ id: feature
attributes:
- label: Tell us your idea.
- description: Tell us what you'd like the app to do. Give as much detail as you can.
- placeholder: Your idea
- value: "I'd like the app to..."
- validations:
- required: true
+ label: Feature or improvement you want
+ description: Try to be as specific as possible. Please not only explain what the feature does, but also how.
- type: textarea
- id: logs
+ id: reason
attributes:
- label: Relevant log output
- description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
- render: shell
- - type: checkboxes
- id: terms
+ label: Why should this be added?
+ description: |
+ What problem does the feature solve? In what use-cases is the feature needed?
+ Is this supported by the firmware? Please provide links to relevant firmware issues or PRs if applicable.
+ - type: textarea
+ id: screenshots
attributes:
- label: Code of Conduct
- description: By submitting this issue, you agree to follow our [Code of Conduct](https://meshtastic.org/docs/legal/conduct/).
- options:
- - label: I agree to follow this project's Code of Conduct
- required: true
\ No newline at end of file
+ label: Screenshots / Drawings / Technical details
+ description: If your request is about (or includes) changing or extending the UI, describe what the UI would look like and how the user would interact with it.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/zbug_report_internal.yml b/.github/ISSUE_TEMPLATE/zbug_report_internal.yml
new file mode 100644
index 000000000..5f01a4573
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/zbug_report_internal.yml
@@ -0,0 +1,180 @@
+name: Internal testing - Bug Report
+description: File a bug report.
+title: "[Bug]: "
+labels: [bug, ch_testing]
+projects: [meshtastic/Meshtastic-Android]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ This Bug report is only for the internal testing builds. If you are not on the list, or didn't seek one out deliberately, you should use the generic Bug Report. :hugs:
+
+ Please provide as much detail as possible so we can efficiently reproduce the issue.
+
+ - type: input
+ id: contact
+ attributes:
+ label: Contact Details
+ description: How can we get in touch with you if we need more info?
+ placeholder: ex. email@example.com, discord username
+ validations:
+ required: false
+
+ - type: checkboxes
+ id: checklist
+ attributes:
+ label: "Checklist"
+ description: |
+ Please make sure you have done the following before submitting your bug report.
+ Bug reports that do not meet these criteria will be closed.
+ Requests that do not meet these criteria will be closed.
+ Links:
+ [**OPEN ISSUES**](https://github.com/meshtastic/Meshtastic-Android/issues)
+ [**CLOSED ISSUES**](https://github.com/meshtastic/Meshtastic-Android/issues?q=is%3Aissue+is%3Aclosed)
+ [Contribution Guidelines](https://github.com/meshtastic/Meshtastic-Android/blob/main/README.md#contributing)
+ options:
+ - label: |
+ I am able to reproduce the bug with the latest version.
+ required: true
+ - label: |
+ I have updated to the latest *Alpha* firmware, and am able to reproduce the bug. Many issues are fixed quickly in alpha before the general beta release.
+ required: true
+ - label: |
+ I made sure that there are no existing **OPEN or CLOSED issues** which I could contribute my information to.
+ required: true
+ - label: |
+ I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
+ required: true
+ - label: |
+ This issue contains only one bug.
+ required: true
+ - label: |
+ I have read and understood the **Contribution Guidelines**.
+ required: true
+ - label: |
+ I agree to follow this project's Code of Conduct
+ required: true
+
+ - type: input
+ id: app-version
+ attributes:
+ label: Affected app version
+ description: |
+ In which Meshtastic-Android app version did you encounter the bug?
+ Can be seen on the bottom of the `Settings` screen in the app.
+ placeholder: "x.y.z-channel.x (build) flavor"
+ validations:
+ required: true
+
+ - type: input
+ id: phone-os
+ attributes:
+ label: Affected Android version
+ description: |
+ With what operating system (+ version) did you encounter the bug?
+ placeholder: "Example: Android 14"
+ validations:
+ required: true
+
+ - type: input
+ id: phone-model
+ attributes:
+ label: Affected phone model
+ description: |
+ On what phone did you encounter the bug?
+ placeholder: "Example: Samsung Galaxy S20 / Google Pixel 8"
+ validations:
+ required: true
+
+ - type: input
+ id: hardware-model
+ attributes:
+ label: Affected node model
+ placeholder: "Example: Seeed T1000-E, Heltec v3, etc."
+ description: |
+ On which hardware device (Node) did you encounter the bug?
+ validations:
+ required: true
+
+ - type: input
+ id: firmware-version
+ attributes:
+ label: Affected node firmware version
+ placeholder: "x.x.x"
+ description: "Which Meshtastic firmware version did you encounter the bug?"
+ validations:
+ required: true
+
+ - type: textarea
+ id: steps-to-reproduce
+ attributes:
+ label: Steps to reproduce the bug
+ description: |
+ What did you do for the bug to show up?
+
+ If you can't cause the bug to show up again reliably (and hence don't have a proper set of steps to give us), please still try to give as many details as possible on how you think you encountered the bug.
+ placeholder: |
+ 1. Go to '...'
+ 2. Press on '....'
+ 3. Swipe down to '....'
+ validations:
+ required: true
+
+ - type: textarea
+ id: actual-behavior
+ attributes:
+ label: Actual behavior
+ description: |
+ Tell us what happens with the steps given above.
+
+ - type: textarea
+ id: expected-behavior
+ attributes:
+ label: Expected behavior
+ description: |
+ Tell us what you expect to happen.
+
+ - type: textarea
+ id: screen-media
+ attributes:
+ label: Screenshots/Screen recordings
+ description: |
+ A picture or video is worth a thousand words.
+ Provide as much context as possible so we know what we are looking at.
+
+ Add screenshots or a screen recording to help explain your problem, provide detailed context to help us know what to look for.
+ GitHub supports uploads of images and (small) videos directly in the text box.
+
+ - type: textarea
+ id: logs
+ attributes:
+ label: Relevant log output
+ description: |
+ Logs help us to diagnose and reproduce issues, particularly when they are unique to your setup.
+ Depending on the issue, the following logs may be useful:
+ - App logs: This will help with most issues. If possible, provide the relevant output of:
+ `adb logcat -d | grep com.geeksville.mesh`
+ - Mesh logs: UI issues, communication issues etc.
+ - ` App > Settings > Advanced > Debug Panel > Export specific / export all `
+ - Broader Android logs: Potentially useful if the issue goes beyond the app (connections, network etc.)
+ `adb logcat -d`
+ - Firmware logs: Useful for all connection issues with nodes
+ - These are piped to the USB serial port on the node, the most foolproof is to use the 'open serial' button on the web-flasher interface, and then save the output.
+ - The app needs to be connecting to the node via Bluetooth or Network for this to work.
+ render: shell
+
+ - type: textarea
+ id: additional-information
+ attributes:
+ label: Additional information
+ description: |
+ Any other information you'd like to include, for instance that
+ * the affected device is foldable or a TV
+ * you have disabled all animations on your device or otherwise changed system settings
+ * you are using battery optimization or power saving mode
+ * you are using a custom Android ROM or launcher
+ * your ferret chewed your antennas
+ * you are using a VPN
+ * you live in a faraday cage
+ * you dismissed all popups telling you not to do things you shouldn't do without reading them
+ * ...
\ No newline at end of file
diff --git a/.github/actions/gradle-setup/action.yml b/.github/actions/gradle-setup/action.yml
new file mode 100644
index 000000000..a42959190
--- /dev/null
+++ b/.github/actions/gradle-setup/action.yml
@@ -0,0 +1,40 @@
+name: Gradle Setup
+description: Setup Java and Gradle for KMP builds
+inputs:
+ cache_read_only:
+ description: 'Whether Gradle cache is read-only'
+ default: 'true'
+ jdk_distribution:
+ description: 'JDK distribution (temurin or jetbrains)'
+ default: 'temurin'
+ gradle_encryption_key:
+ description: 'Encryption key for Gradle remote cache'
+ required: false
+runs:
+ using: composite
+ steps:
+ - name: Copy CI Gradle properties
+ shell: bash
+ run: mkdir -p ~/.gradle && cp .github/ci-gradle.properties ~/.gradle/gradle.properties
+
+ - name: Validate Gradle Wrapper
+ uses: gradle/actions/wrapper-validation@v6
+
+ - name: Set up JDK 21
+ uses: actions/setup-java@v5
+ with:
+ java-version: '21'
+ distribution: ${{ inputs.jdk_distribution }}
+ token: ${{ github.token }}
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v6
+ with:
+ cache-read-only: ${{ inputs.cache_read_only }}
+ cache-encryption-key: ${{ inputs.gradle_encryption_key }}
+ cache-cleanup: on-success
+ add-job-summary: always
+ gradle-home-cache-includes: |
+ caches
+ notifications
+ ~/.m2/repository/org/robolectric
\ No newline at end of file
diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties
new file mode 100644
index 000000000..e4d203ef7
--- /dev/null
+++ b/.github/ci-gradle.properties
@@ -0,0 +1,52 @@
+#
+# CI-specific Gradle properties.
+#
+# This file is copied to ~/.gradle/gradle.properties by the gradle-setup
+# composite action, overriding the dev-oriented values in the repo-root
+# gradle.properties. Inspired by the nowinandroid & sqldelight patterns.
+#
+
+# ── Daemon ────────────────────────────────────────────────────────────
+# Single-use CI runners never reuse a daemon, so the startup cost is pure
+# overhead. Disabling it also avoids "daemon disappeared" warnings.
+org.gradle.daemon=false
+
+# ── Memory ────────────────────────────────────────────────────────────
+# Standard GitHub runners have 7 GB RAM. Keep Gradle + Kotlin daemon
+# within budget (4g Gradle + 2g Kotlin daemon + 1g OS/tooling headroom).
+org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8
+kotlin.daemon.jvm.options=-Xmx2g -XX:+UseParallelGC
+
+# ── Parallelism ───────────────────────────────────────────────────────
+org.gradle.parallel=true
+org.gradle.workers.max=4
+
+# ── Caching & Configuration ──────────────────────────────────────────
+org.gradle.caching=true
+org.gradle.configuration-cache=true
+org.gradle.configureondemand=false
+org.gradle.vfs.watch=false
+org.gradle.isolated-projects=true
+
+# ── Kotlin ────────────────────────────────────────────────────────────
+# Incremental compilation is wasted on fresh CI checkouts (no prior build
+# state to diff against). Disabling avoids the overhead of maintaining
+# incremental state that will never be reused.
+kotlin.incremental=false
+kotlin.code.style=official
+kotlin.parallel.tasks.in.project=true
+
+# ── KSP ──────────────────────────────────────────────────────────────
+# In CI, KSP incremental processing adds overhead without benefit (fresh
+# checkouts). Keep intermodule incremental off (no prior state).
+ksp.incremental=false
+ksp.run.in.process=true
+
+# ── Android ──────────────────────────────────────────────────────────
+android.experimental.lint.analysisPerComponent=true
+# Disable unused build features to reduce build time
+android.defaults.buildfeatures.resvalues=false
+android.defaults.buildfeatures.shaders=false
+
+# ── Misc ─────────────────────────────────────────────────────────────
+org.gradle.welcome=never
diff --git a/.github/copilot-commit-message-instructions.md b/.github/copilot-commit-message-instructions.md
new file mode 100644
index 000000000..93c242d16
--- /dev/null
+++ b/.github/copilot-commit-message-instructions.md
@@ -0,0 +1,27 @@
+# GitHub Copilot Commit Message Instructions
+
+
+You are an expert Git maintainer enforcing Conventional Commits.
+
+
+
+1. **Format:** Use the Conventional Commits format: `(): ` (Replace angle brackets with actual text, do NOT output angle brackets).
+2. **Types allowed:**
+ - `feat` (new feature for the user, not a new feature for build script)
+ - `fix` (bug fix for the user, not a fix to a build script)
+ - `docs` (changes to the documentation)
+ - `style` (formatting, missing semi colons, etc; no production code change)
+ - `refactor` (refactoring production code, e.g. KMP migration, extracting to commonMain)
+ - `test` (adding missing tests, refactoring tests; no production code change)
+ - `chore` (updating grunt tasks etc; no production code change)
+3. **Scope:** Use the module or logical component as the scope (e.g., `ui`, `navigation`, `ble`, `firmware`, `deps`, `ai`).
+4. **Subject line:**
+ - Use the imperative, present tense: "change" not "changed" nor "changes".
+ - Do not capitalize the first letter.
+ - Do not use a period (.) at the end.
+ - Keep it under 50 characters if possible.
+5. **Body (Optional but recommended for large diffs):**
+ - Leave one blank line after the subject.
+ - Explain *why* the change was made, not just *what* changed.
+ - If migrating to KMP or extracting to `commonMain`, explicitly state "Decoupled from Android framework".
+
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 000000000..e856cbe8f
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,6 @@
+# Meshtastic Android - GitHub Copilot Guide
+
+> **Note:** The canonical instructions for all AI Agents have been deduplicated.
+
+You MUST immediately read and internalize the unified instructions located at the root of the repository in `AGENTS.md`.
+After reading `AGENTS.md`, consult the `.skills/` directory for task-specific playbooks.
diff --git a/.github/copilot-pull-request-instructions.md b/.github/copilot-pull-request-instructions.md
new file mode 100644
index 000000000..8e79d63d2
--- /dev/null
+++ b/.github/copilot-pull-request-instructions.md
@@ -0,0 +1,18 @@
+# GitHub Copilot Pull Request Instructions
+
+
+You are an expert open-source maintainer. Your goal is to write clear, professional, and highly structured Pull Request descriptions based on the provided diffs.
+
+
+
+1. **Remove Boilerplate:** Always delete the "tips" section at the top of the `PULL_REQUEST_TEMPLATE.md` before generating your text.
+2. **Context First:** Start with a clear, 1-2 sentence summary of *why* this change is being made. If the branch name or commits reference an issue (e.g., `fix-1234`), explicitly add `Fixes #1234` or `Resolves #1234`.
+3. **Structured Changes:** Break down the code changes into bullet points categorized by:
+ - 🌟 **New Features** (UI, modules, logic)
+ - 🛠️ **Refactoring & Architecture** (KMP migrations, Koin DI updates)
+ - 🐛 **Bug Fixes**
+ - 🧹 **Chores** (Dependencies, formatting, docs)
+4. **Architecture Callouts:** If the diff includes moving files from `androidMain` to `commonMain`, or migrating from Android Views to Compose, highlight this as a "KMP Migration Milestone".
+5. **Testing Callouts:** If the diff includes changes to `commonTest` or mentions tests, add a section called "Testing Performed" and list the tests that were added/modified.
+6. **No "Magic" Text:** Do not invent URLs or insert fake image placeholders. Leave the HTML comment block for images intact so the user can manually add their screenshots.
+
diff --git a/.github/instructions/android-source-set.instructions.md b/.github/instructions/android-source-set.instructions.md
new file mode 100644
index 000000000..6179bc61a
--- /dev/null
+++ b/.github/instructions/android-source-set.instructions.md
@@ -0,0 +1,11 @@
+---
+applyTo: "**/androidMain/**/*.kt"
+---
+
+# Android Source-Set Rules
+
+- This is `androidMain` — Android framework imports (`android.*`, `java.*`) are allowed here.
+- Do NOT put business logic here. Business logic belongs in `commonMain`.
+- If you find identical pure-Kotlin logic in both `androidMain` and `jvmMain`, extract it to `commonMain`.
+- Use `expect`/`actual` only for small platform primitives. Prefer interfaces + DI.
+- Keep `expect` declarations in `FileIo.kt` and shared helpers in `FileIoUtils.kt` to avoid JVM duplicate class errors.
diff --git a/.github/instructions/build-logic.instructions.md b/.github/instructions/build-logic.instructions.md
new file mode 100644
index 000000000..d61fa34b8
--- /dev/null
+++ b/.github/instructions/build-logic.instructions.md
@@ -0,0 +1,10 @@
+---
+applyTo: "build-logic/**/*.kt"
+---
+
+# Build-Logic Convention Plugin Rules
+
+- Prefer lazy Gradle configuration (`configureEach`, `withPlugin`, provider APIs).
+- Avoid `afterEvaluate` unless there is no viable lazy alternative.
+- Check `gradle/libs.versions.toml` for version catalog aliases before adding new ones.
+- Convention plugins: `meshtastic.kmp.feature`, `meshtastic.kmp.library`, `meshtastic.kmp.jvm.android`, `meshtastic.koin`.
diff --git a/.github/instructions/ci-workflows.instructions.md b/.github/instructions/ci-workflows.instructions.md
new file mode 100644
index 000000000..55a72b328
--- /dev/null
+++ b/.github/instructions/ci-workflows.instructions.md
@@ -0,0 +1,14 @@
+---
+applyTo: "**/*.yml"
+excludeAgent: "code-review"
+---
+
+# CI Workflow Rules
+
+- Prefer explicit Gradle task paths (`app:lintFdroidDebug`) over shorthand (`lintDebug`).
+- CI uses `.github/ci-gradle.properties` — don't assume local `gradle.properties` values.
+- CI passes `-Pci=true` to enable full processor usage via `maxParallelForks`.
+- Use `fetch-depth: 0` only where needed (spotless ratcheting, version code). Use `fetch-depth: 1` otherwise.
+- Desktop build matrix: `macos-latest`, `windows-latest`, `ubuntu-24.04`, `ubuntu-24.04-arm`.
+- Lightweight jobs (labelers, triage, stale): use `ubuntu-24.04-arm` runners.
+- Gradle-heavy jobs: use `ubuntu-24.04` runners.
diff --git a/.github/instructions/kmp-common.instructions.md b/.github/instructions/kmp-common.instructions.md
new file mode 100644
index 000000000..7dac915bc
--- /dev/null
+++ b/.github/instructions/kmp-common.instructions.md
@@ -0,0 +1,20 @@
+---
+applyTo: "**/commonMain/**/*.kt"
+---
+
+# KMP commonMain Rules
+
+- NEVER import `java.*` or `android.*` in `commonMain`.
+- Use `org.meshtastic.core.common.util.ioDispatcher` instead of `Dispatchers.IO`.
+- Use Okio (`BufferedSource`/`BufferedSink`) instead of `java.io.*`.
+- Use `kotlinx.coroutines.sync.Mutex` instead of `java.util.concurrent.locks.*`.
+- Use `atomicfu` or Mutex-guarded `mutableMapOf()` instead of `ConcurrentHashMap`.
+- Use `jetbrains-*` catalog aliases for lifecycle/navigation dependencies.
+- Use `compose-multiplatform-*` catalog aliases for CMP dependencies.
+- Never use plain `androidx.compose` dependencies in `commonMain`.
+- Strings: use `stringResource(Res.string.key)` from `core:resources`. No hardcoded strings.
+- CMP `stringResource` only supports `%N$s` and `%N$d` — pre-format floats with `NumberFormatter.format()`.
+- Use `MetricFormatter` from `core:common` for display strings (temperature, voltage, percent, signal). Avoid scattered `formatString("%.1f°C", val)` calls.
+- Check `gradle/libs.versions.toml` before adding dependencies.
+- Use `safeCatching {}` from `core:common` instead of `runCatching {}` in coroutine/suspend contexts. Keep `runCatching` only in cleanup/teardown code.
+- Use `kotlinx.coroutines.CancellationException`, not `kotlin.coroutines.cancellation.CancellationException`.
diff --git a/.github/lsp.json b/.github/lsp.json
new file mode 100644
index 000000000..983ecf785
--- /dev/null
+++ b/.github/lsp.json
@@ -0,0 +1,12 @@
+{
+ "lspServers": {
+ "kotlin": {
+ "command": "kotlin-language-server",
+ "args": [],
+ "fileExtensions": {
+ ".kt": "kotlin",
+ ".kts": "kotlin"
+ }
+ }
+ }
+}
diff --git a/.github/meshtastic_logo.png b/.github/meshtastic_logo.png
new file mode 100644
index 000000000..11c5db18c
Binary files /dev/null and b/.github/meshtastic_logo.png differ
diff --git a/.github/release.yml b/.github/release.yml
index 72cb085af..6ec1c03ba 100644
--- a/.github/release.yml
+++ b/.github/release.yml
@@ -1,13 +1,36 @@
-# .github/release.yml
+# .github/release.yml - GitHub Release Notes Configuration
changelog:
+ exclude:
+ labels:
+ - dependencies
+ - automation
+ - release
+ - repo
+ - skip-changelog
+ - chore
+ - ci
+ - build
+ - testing
+ - test
+ - refactor
+ - documentation
+ - translation
+ authors:
+ - renovate[bot]
+ - dependabot[bot]
+ - github-actions[bot]
+
categories:
- - title: 🛠️Fixes & Features
+ - title: 🏗️ Features
+ labels:
+ - enhancement
+ - feature
+ - title: 🛠️ Fixes
+ labels:
+ - bug
+ - bugfix
+ - fix
+ - title: 📝 Other Changes
labels:
- '*'
- exclude:
- labels:
- - dependencies
- - title: 👷Dependencies
- labels:
- - dependencies
diff --git a/.github/renovate.json b/.github/renovate.json
index 583583ab8..1faa1a4ad 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -15,23 +15,82 @@
"git-submodules": {
"enabled": true
},
+ "bundler": {
+ "enabled": true
+ },
"packageRules": [
{
- "matchUpdateTypes": ["minor", "patch"],
+ "description": "Automerge non-major updates for stable versions",
+ "matchUpdateTypes": [
+ "minor",
+ "patch",
+ "pin",
+ "digest"
+ ],
"matchCurrentVersion": "!/^0/",
"automerge": true
},
{
+ "description": "Automerge patch updates for unstable (0.x) versions",
+ "matchUpdateTypes": [
+ "patch",
+ "pin",
+ "digest"
+ ],
+ "matchCurrentVersion": "/^0/",
+ "automerge": true
+ },
+ {
+ "description": "Automerge pins and digests regardless of version",
+ "matchUpdateTypes": [
+ "pin",
+ "digest"
+ ],
+ "automerge": true
+ },
+ {
+ "description": "Meshtastic Protobufs changelog link",
"matchPackageNames": [
"https://github.com/meshtastic/protobufs.git"
],
- "changelogUrl": "https://github.com/meshtastic/protobufs/compare/{{currentDigest}}...{{newDigest}}"
+ "changelogUrl": "https://github.com/meshtastic/protobufs/compare/{{currentDigest}}...{{newDigest}}",
+ "automerge": true
},
{
+ "description": "Group CMP and the androidx.compose artifacts that track it so Renovate bumps them together (see PR #5180)",
+ "groupName": "compose-multiplatform",
"matchPackageNames": [
- "https://github.com/meshtastic/design.git"
+ "/^org\\.jetbrains\\.compose/",
+ "androidx.compose.runtime:runtime-tracing",
+ "androidx.compose.ui:ui-test-manifest"
+ ]
+ },
+ {
+ "description": "Restrict sensitive infrastructure to manual minor updates",
+ "matchUpdateTypes": [
+ "minor"
],
- "changelogUrl": "https://github.com/meshtastic/design/compare/{{currentDigest}}...{{newDigest}}"
+ "matchPackageNames": [
+ "/^org\\.jetbrains\\.kotlin/",
+ "/^org\\.jetbrains\\.kotlinx/",
+ "/^org\\.jetbrains\\.compose/",
+ "/^com\\.google\\.dagger/",
+ "/^androidx\\.hilt/",
+ "/^com\\.google\\.protobuf/",
+ "/^androidx\\.lifecycle/",
+ "/^androidx\\.navigation/",
+ "/^androidx\\.datastore/",
+ "/^androidx\\.compose\\.material3\\.adaptive/",
+ "/^androidx\\.compose\\.material3:material3-adaptive-navigation-suite$/"
+ ],
+ "automerge": false
+ },
+ {
+ "description": "Disable automerge for major updates (safety net)",
+ "matchUpdateTypes": [
+ "major"
+ ],
+ "automerge": false
}
]
}
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
deleted file mode 100644
index 7e2ed63fc..000000000
--- a/.github/workflows/android.yml
+++ /dev/null
@@ -1,154 +0,0 @@
-name: Android CI
-
-on:
- push:
- branches: [ main ]
- paths-ignore:
- - "**.md"
- - ".idea/**"
- - ".gitignore"
- - ".gitmodules"
-
- pull_request:
- branches: [ main ]
-
-concurrency:
- group: build-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
-
- build:
- runs-on: ubuntu-latest
- timeout-minutes: 30
-
- steps:
-
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- submodules: 'recursive'
-
- - name: Validate Gradle wrapper
- uses: gradle/actions/wrapper-validation@v4
-
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'zulu'
-
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v4
- with:
- cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
-
- - name: Check lint
- run: ./gradlew lintFdroidDebug lintGoogleDebug
-
- - name: Build debug artifacts
- run: ./gradlew assembleDebug
-
- - name: Run local tests
- run: ./gradlew testFdroidDebug testGoogleDebug
-
- - name: Upload debug artifact
- uses: actions/upload-artifact@v4
- with:
- name: fdroidDebug
- path: app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk
- retention-days: 30
-
- - name: Upload build reports
- if: ${{ !cancelled() }}
- uses: actions/upload-artifact@v4
- with:
- name: build-reports
- path: app/build/reports
- retention-days: 30
-
- detekt:
- runs-on: ubuntu-latest
- timeout-minutes: 30
-
- steps:
-
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- submodules: 'recursive'
-
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'zulu'
-
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v4
-
- - name: Check detekt
- run: ./gradlew detekt
-
- - name: Upload build reports
- if: ${{ !cancelled() }}
- uses: actions/upload-artifact@v4
- with:
- name: detekt-reports
- path: app/build/reports
- retention-days: 30
-
- androidTest:
- runs-on: ubuntu-latest
- timeout-minutes: 30
- strategy:
- matrix:
- api-level: [26, 35]
-
- steps:
- - uses: actions/checkout@v4
- with:
- submodules: 'recursive'
-
- - name: Enable KVM group perms
- run: |
- echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
- sudo udevadm control --reload-rules
- sudo udevadm trigger --name-match=kvm
-
- - uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'zulu'
-
- - uses: gradle/actions/setup-gradle@v4
-
- - uses: actions/cache@v4
- id: avd-cache
- with:
- path: |
- ~/.android/avd/*
- ~/.android/adb*
- key: avd-${{ matrix.api-level }}
-
- - name: create AVD and generate snapshot for caching
- if: steps.avd-cache.outputs.cache-hit != 'true'
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: ${{ matrix.api-level }}
- arch: x86_64
- force-avd-creation: false
- emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
- disable-animations: true
- script: echo "Generated AVD snapshot for caching."
-
- - uses: reactivecircus/android-emulator-runner@v2
- env:
- ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 60
- with:
- api-level: ${{ matrix.api-level }}
- arch: x86_64
- force-avd-creation: false
- emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-metrics -camera-back none
- disable-animations: true
- script: ./gradlew connectedFdroidDebugAndroidTest && killall -INT crashpad_handler || true
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
deleted file mode 100644
index 85d5c51e2..000000000
--- a/.github/workflows/codeql.yml
+++ /dev/null
@@ -1,106 +0,0 @@
-# For most projects, this workflow file will not need changing; you simply need
-# to commit it to your repository.
-#
-# You may wish to alter this file to override the set of languages analyzed,
-# or to provide custom queries or build logic.
-#
-# ******** NOTE ********
-# We have attempted to detect the languages in your repository. Please check
-# the `language` matrix defined below to confirm you have the correct set of
-# supported CodeQL languages.
-#
-name: "CodeQL Advanced"
-
-on:
- # push:
- # branches: [ "main" ]
- # pull_request:
- # branches: [ "main" ]
- schedule:
- - cron: '0 0 * * 0'
- workflow_dispatch:
-
-jobs:
- analyze:
- name: Analyze (${{ matrix.language }})
- # Runner size impacts CodeQL analysis time. To learn more, please see:
- # - https://gh.io/recommended-hardware-resources-for-running-codeql
- # - https://gh.io/supported-runners-and-hardware-resources
- # - https://gh.io/using-larger-runners (GitHub.com only)
- # Consider using larger runners or machines with greater resources for possible analysis time improvements.
- runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
- permissions:
- # required for all workflows
- security-events: write
-
- # required to fetch internal or private CodeQL packs
- packages: read
-
- # only required for workflows in private repositories
- actions: read
- contents: read
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - language: actions
- build-mode: none
- - language: java-kotlin
- build-mode: autobuild
- # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
- # Use `c-cpp` to analyze code written in C, C++ or both
- # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
- # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
- # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
- # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
- # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
- # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- # Add any setup steps before running the `github/codeql-action/init` action.
- # This includes steps like installing compilers or runtimes (`actions/setup-node`
- # or others). This is typically only required for manual builds.
- # - name: Setup runtime (example)
- # uses: actions/setup-example@v1
- - name: Java Setup
- uses: actions/setup-java@v4
- with:
- distribution: 'temurin' # See 'Supported distributions' for available options
- java-version: '17'
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v3
- with:
- languages: ${{ matrix.language }}
- build-mode: ${{ matrix.build-mode }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
-
- # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
- # queries: security-extended,security-and-quality
-
- # If the analyze step fails for one of the languages you are analyzing with
- # "We were unable to automatically build your code", modify the matrix above
- # to set the build mode to "manual" for that language. Then modify this step
- # to build your code.
- # ℹ️ Command-line programs to run using the OS shell.
- # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- - if: matrix.build-mode == 'manual'
- shell: bash
- run: |
- echo 'If you are using a "manual" build mode for one or more of the' \
- 'languages you are analyzing, replace this with the commands to build' \
- 'your code, for example:'
- echo ' make bootstrap'
- echo ' make release'
- exit 1
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v3
- with:
- category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/create-or-promote-release.yml b/.github/workflows/create-or-promote-release.yml
new file mode 100644
index 000000000..3c6ddd61a
--- /dev/null
+++ b/.github/workflows/create-or-promote-release.yml
@@ -0,0 +1,166 @@
+name: Create or Promote Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ base_version:
+ description: 'Base version for the release (e.g., 2.3.0)'
+ required: true
+ channel:
+ description: 'The channel to create a release for or promote to'
+ required: true
+ type: choice
+ options:
+ - internal
+ - closed
+ - open
+ - production
+ dry_run:
+ description: 'If true, calculates the tag but does not push it or start the release'
+ required: true
+ type: boolean
+ default: false
+ build_desktop:
+ description: 'Whether to build the desktop distribution'
+ required: true
+ type: boolean
+ default: false
+
+permissions:
+ contents: write
+ pull-requests: read
+ id-token: write
+ attestations: write
+
+jobs:
+ determine-tags:
+ runs-on: ubuntu-24.04-arm
+ outputs:
+ tag_to_process: ${{ steps.calculate_tags.outputs.tag_to_process }}
+ release_name: ${{ steps.calculate_tags.outputs.release_name }}
+ final_tag: ${{ steps.calculate_tags.outputs.final_tag }}
+ from_channel: ${{ steps.calculate_tags.outputs.from_channel }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
+
+ - name: Calculate tags
+ id: calculate_tags
+ run: |
+ BASE_VERSION="${{ inputs.base_version }}"
+ CHANNEL="${{ inputs.channel }}"
+
+ if [[ "$CHANNEL" == "internal" ]]; then
+ # This is a new build, create a new internal tag
+ LATEST_TAG=$(git tag --list "v${BASE_VERSION}-internal.*" --sort=-v:refname | head -n 1)
+
+ if [ -z "$LATEST_TAG" ]; then
+ INCREMENT=1
+ else
+ INCREMENT=$(echo "$LATEST_TAG" | sed -n "s/.*-internal\.\([0-9]*\)/\1/p" | awk '{print $1+1}')
+ fi
+
+ NEW_TAG="v${BASE_VERSION}-internal.${INCREMENT}"
+ echo "Calculated new tag: $NEW_TAG"
+ echo "tag_to_process=$NEW_TAG" >> $GITHUB_OUTPUT
+ echo "release_name=$NEW_TAG" >> $GITHUB_OUTPUT
+ echo "final_tag=$NEW_TAG" >> $GITHUB_OUTPUT
+ else
+ # This is a promotion, find the latest tag from the previous channel to promote
+ FROM_CHANNEL="internal"
+ if [[ "$CHANNEL" == "open" ]]; then
+ FROM_CHANNEL="closed"
+ elif [[ "$CHANNEL" == "production" ]]; then
+ FROM_CHANNEL="open"
+ fi
+
+ LATEST_TAG_TO_PROMOTE=$(git tag --list "v${BASE_VERSION}-${FROM_CHANNEL}.*" --sort=-v:refname | head -n 1)
+
+ if [ -z "$LATEST_TAG_TO_PROMOTE" ]; then
+ echo "::error::No ${FROM_CHANNEL} release found for base version ${BASE_VERSION} to promote."
+ exit 1
+ fi
+
+ echo "Found latest ${FROM_CHANNEL} tag to promote: $LATEST_TAG_TO_PROMOTE"
+
+ # Calculate the increment for the TARGET channel
+ if [[ "$CHANNEL" != "production" ]]; then
+ LATEST_CHANNEL_TAG=$(git tag --list "v${BASE_VERSION}-${CHANNEL}.*" --sort=-v:refname | head -n 1)
+
+ if [ -z "$LATEST_CHANNEL_TAG" ]; then
+ INCREMENT=1
+ else
+ INCREMENT=$(echo "$LATEST_CHANNEL_TAG" | sed -n "s/.*-${CHANNEL}\.\([0-9]*\)/\1/p" | awk '{print $1+1}')
+ fi
+
+ NEW_TAG="v${BASE_VERSION}-${CHANNEL}.${INCREMENT}"
+ else
+ # Production is special, it has no increment
+ NEW_TAG="v${BASE_VERSION}"
+ fi
+
+ echo "New release name will be: $NEW_TAG"
+ echo "Final tag will be: $NEW_TAG"
+ echo "from_channel=${FROM_CHANNEL}" >> $GITHUB_OUTPUT
+ echo "tag_to_process=${LATEST_TAG_TO_PROMOTE}" >> $GITHUB_OUTPUT
+ echo "release_name=${NEW_TAG}" >> $GITHUB_OUTPUT
+ echo "final_tag=${NEW_TAG}" >> $GITHUB_OUTPUT
+ fi
+ shell: bash
+
+ - name: Create and Push Release Tag
+ if: ${{ !inputs.dry_run && inputs.channel == 'internal' }}
+ env:
+ FINAL_TAG: ${{ steps.calculate_tags.outputs.final_tag }}
+ run: |
+ echo "Tagging and pushing release: $FINAL_TAG"
+ git tag "$FINAL_TAG"
+ git push origin "$FINAL_TAG"
+ shell: bash
+
+ call-release-workflow:
+ if: ${{ !inputs.dry_run && inputs.channel == 'internal' }}
+ needs: determine-tags
+ uses: ./.github/workflows/release.yml
+ with:
+ tag_name: ${{ needs.determine-tags.outputs.final_tag }}
+ channel: ${{ inputs.channel }}
+ base_version: ${{ inputs.base_version }}
+ build_desktop: ${{ inputs.build_desktop }}
+ secrets: inherit
+
+ call-promote-workflow:
+ if: ${{ !inputs.dry_run && inputs.channel != 'internal' }}
+ needs: determine-tags
+ uses: ./.github/workflows/promote.yml
+ with:
+ tag_name: ${{ needs.determine-tags.outputs.tag_to_process }}
+ release_name: ${{ needs.determine-tags.outputs.release_name }}
+ final_tag: ${{ needs.determine-tags.outputs.final_tag }}
+ channel: ${{ inputs.channel }}
+ base_version: ${{ inputs.base_version }}
+ from_channel: ${{ needs.determine-tags.outputs.from_channel }}
+ secrets: inherit
+
+ cleanup-on-failure:
+ needs: [determine-tags, call-release-workflow]
+ if: ${{ (failure() || cancelled()) && !inputs.dry_run && inputs.channel == 'internal' }}
+ runs-on: ubuntu-24.04-arm
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Delete Failed or Cancelled Tag
+ env:
+ FINAL_TAG: ${{ needs.determine-tags.outputs.final_tag }}
+ run: |
+ if [ -n "$FINAL_TAG" ]; then
+ echo "Release workflow failed or was cancelled. Deleting tag $FINAL_TAG to allow a clean retry..."
+ git push origin :refs/tags/"$FINAL_TAG" || echo "Tag was not pushed or already deleted."
+ else
+ echo "No tag was created to delete."
+ fi
diff --git a/.github/workflows/crowdin-download.yml b/.github/workflows/crowdin-download.yml
deleted file mode 100644
index f6fcb54ab..000000000
--- a/.github/workflows/crowdin-download.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-name: Crowdin Download Translations Action
-
-on:
- schedule: # Every Sunday at midnight
- - cron: '0 */1 * * *'
- workflow_dispatch: # Allow manual triggering
-
-jobs:
- synchronize-with-crowdin:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Download translations with Crowdin
- uses: crowdin/github-action@v2
- with:
- base_url: 'https://meshtastic.crowdin.com/api/v2'
- config: 'config/crowdin/crowdin.yml'
- upload_sources: false
- upload_translations: false
- download_translations: true
- localization_branch_name: l10n_crowdin_translations
- commit_message: 'chore(l10n): New Crowdin Translations by GitHub Action'
- create_pull_request: true
- pull_request_title: 'chore(l10n): New Crowdin Translations'
- pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
- pull_request_base_branch_name: 'main'
- pull_request_labels: 'l10n'
- crowdin_branch_name: 'main'
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
diff --git a/.github/workflows/crowdin-upload-sources.yml b/.github/workflows/crowdin-upload-sources.yml
deleted file mode 100644
index 05ea3ac78..000000000
--- a/.github/workflows/crowdin-upload-sources.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: Crowdin Upload Sources Action
-
-on:
- push: # Watch source strings.xml for changes on main
- paths: [ 'app/src/main/res/values/strings.xml' ]
- branches: [ main ]
- workflow_dispatch: # Allow manual triggering
-
-jobs:
- synchronize-with-crowdin:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Upload sources with Crowdin
- uses: crowdin/github-action@v2
- with:
- base_url: 'https://meshtastic.crowdin.com/api/v2'
- config: 'config/crowdin/crowdin.yml'
- upload_sources: true
- upload_translations: false
- download_translations: false
- crowdin_branch_name: 'main'
- env:
- CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
diff --git a/.github/workflows/crowdin-upload-translations.yml b/.github/workflows/crowdin-upload-translations.yml
deleted file mode 100644
index 70f280e29..000000000
--- a/.github/workflows/crowdin-upload-translations.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: Crowdin Upload Translations Action
-
-on:
- workflow_dispatch: # Allow manual triggering
-
-jobs:
- synchronize-with-crowdin:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Upload translations with Crowdin
- uses: crowdin/github-action@v2
- with:
- base_url: 'https://meshtastic.crowdin.com/api/v2'
- config: 'config/crowdin/crowdin.yml'
- upload_sources: fals
- upload_translations: true
- download_translations: false
- crowdin_branch_name: 'main'
- env:
- CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml
new file mode 100644
index 000000000..10535d723
--- /dev/null
+++ b/.github/workflows/dependency-submission.yml
@@ -0,0 +1,29 @@
+name: Dependency Submission
+
+on:
+ push:
+ branches: [ 'main' ]
+ workflow_dispatch:
+
+permissions:
+ contents: write
+
+jobs:
+ dependency-submission:
+ runs-on: ubuntu-24.04
+ if: github.repository == 'meshtastic/Meshtastic-Android'
+
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/setup-java@v5
+ with:
+ distribution: temurin
+ java-version: 21
+ token: ${{ github.token }}
+
+ - name: Generate and submit dependency graph
+ uses: gradle/actions/dependency-submission@v6
+ with:
+ build-scan-publish: true
+ build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
+ build-scan-terms-of-use-agree: "yes"
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 000000000..f7c8151c7
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,83 @@
+# This workflow builds and deploys the Dokka documentation to GitHub Pages.
+
+name: Deploy Documentation
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ # Only rebuild docs when source code changes (Dokka generates from KDoc)
+ - 'app/src/**'
+ - 'core/**/src/**'
+ - 'feature/**/src/**'
+ - 'desktop/src/**'
+ - 'build-logic/**'
+ - 'build.gradle.kts'
+ - 'settings.gradle.kts'
+ - '.github/workflows/docs.yml'
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+ inputs:
+ ref:
+ description: 'The branch, tag or SHA to checkout'
+ required: false
+ type: string
+
+ # Allow this workflow to be called from other workflows
+ workflow_call:
+ inputs:
+ ref:
+ description: 'The branch, tag or SHA to checkout'
+ required: false
+ type: string
+
+# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+# Allow only one concurrent deployment; cancel queued runs since only the latest
+# main state matters for documentation.
+concurrency:
+ group: "pages"
+ cancel-in-progress: true
+
+jobs:
+ build-docs:
+ if: github.repository == 'meshtastic/Meshtastic-Android'
+ runs-on: ubuntu-24.04
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ submodules: 'recursive'
+ ref: ${{ inputs.ref || '' }}
+
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+
+ - name: Build Dokka HTML documentation
+ run: ./gradlew dokkaGeneratePublicationHtml
+
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v5
+ with:
+ path: build/dokka/html
+
+ deploy:
+ if: github.repository == 'meshtastic/Meshtastic-Android'
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-24.04-arm
+ needs: build-docs
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v5
diff --git a/.github/workflows/main-check.yml b/.github/workflows/main-check.yml
new file mode 100644
index 000000000..eaf3f54d3
--- /dev/null
+++ b/.github/workflows/main-check.yml
@@ -0,0 +1,26 @@
+name: Main CI (Verify & Build)
+
+on:
+ push:
+ branches: [ main ]
+ paths-ignore:
+ - '**/*.md'
+ - 'docs/**'
+
+permissions:
+ contents: read
+
+concurrency:
+ group: main-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ validate-and-build:
+ if: github.repository == 'meshtastic/Meshtastic-Android'
+ uses: ./.github/workflows/reusable-check.yml
+ with:
+ run_lint: true
+ run_unit_tests: false
+ run_desktop_builds: false
+ upload_artifacts: true
+ secrets: inherit
diff --git a/.github/workflows/main-push-changelog.yml b/.github/workflows/main-push-changelog.yml
new file mode 100644
index 000000000..da161e44e
--- /dev/null
+++ b/.github/workflows/main-push-changelog.yml
@@ -0,0 +1,71 @@
+name: Main Push Changelog
+
+on:
+ push:
+ branches:
+ - main
+
+permissions:
+ contents: write
+ pull-requests: read
+
+concurrency:
+ group: main-push-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ main-push-changelog:
+ name: Generate main push changelog
+ runs-on: ubuntu-24.04-arm
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - name: Determine last tag
+ id: last_prod_tag
+ run: |
+ TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
+ echo "Found last tag: $TAG"
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
+
+ - name: Generate changelog from last tag to current
+ if: steps.last_prod_tag.outputs.tag != ''
+ uses: mikepenz/release-changelog-builder-action@v6
+ id: changelog
+ with:
+ configuration: .github/release.yml
+ fromTag: ${{ steps.last_prod_tag.outputs.tag }}
+ toTag: ${{ github.sha }}
+ outputFile: main-push-changelog.md
+ fetchViaCommits: true
+ fetchReviewers: false
+ fetchReleaseInformation: false
+ fetchReviews: false
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Upload changelog artifact
+ if: steps.last_prod_tag.outputs.tag != ''
+ uses: actions/upload-artifact@v7
+ with:
+ name: main-push-changelog
+ path: main-push-changelog.md
+
+ - name: Print main push summary
+ env:
+ LAST_TAG: ${{ steps.last_prod_tag.outputs.tag }}
+ run: |
+ echo "Pushed to main"
+ echo "SHA: $GITHUB_SHA"
+ echo "Actor: $GITHUB_ACTOR"
+ echo "Ref: $GITHUB_REF"
+ echo ""
+ if [ "$LAST_TAG" != "" ]; then
+ echo "Changelog since last tag ($LAST_TAG)":
+ echo "----------------------------------------"
+ cat main-push-changelog.md
+ else
+ echo "No tag found. Skipping changelog generation."
+ fi
diff --git a/.github/workflows/merge-queue.yml b/.github/workflows/merge-queue.yml
new file mode 100644
index 000000000..44d31183d
--- /dev/null
+++ b/.github/workflows/merge-queue.yml
@@ -0,0 +1,38 @@
+name: Android CI (Merge Queue)
+
+on:
+ merge_group:
+ types: [checks_requested]
+
+permissions:
+ contents: read
+
+concurrency:
+ group: build-mq-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ android-check:
+ if: github.repository == 'meshtastic/Meshtastic-Android'
+ uses: ./.github/workflows/reusable-check.yml
+ with:
+ run_lint: true
+ run_unit_tests: true
+ upload_artifacts: false
+ secrets: inherit
+
+ check-workflow-status:
+ name: Check Workflow Status
+ runs-on: ubuntu-24.04-arm
+ permissions: {}
+ needs:
+ - android-check
+ if: always()
+ steps:
+ - name: Check Workflow Status
+ run: |
+ if [[ "${{ needs.android-check.result }}" == "failure" || "${{ needs.android-check.result }}" == "cancelled" ]]; then
+ echo "::error::Android Check failed"
+ exit 1
+ fi
+ echo "All jobs passed successfully"
diff --git a/.github/workflows/models_issue_triage.yml b/.github/workflows/models_issue_triage.yml
new file mode 100644
index 000000000..a02fb8ed8
--- /dev/null
+++ b/.github/workflows/models_issue_triage.yml
@@ -0,0 +1,204 @@
+name: Issue Triage (Models)
+
+on:
+ issues:
+ types: [opened]
+
+permissions:
+ issues: write
+ models: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.issue.number }}
+ cancel-in-progress: true
+
+jobs:
+ triage:
+ if: ${{ github.repository == 'meshtastic/Meshtastic-Android' && github.event.issue.user.type != 'Bot' }}
+ runs-on: ubuntu-24.04-arm
+ steps:
+ # ─────────────────────────────────────────────────────────────────────────
+ # Step 1: Quality check (spam/AI-slop detection) - runs first, exits early if spam
+ # ─────────────────────────────────────────────────────────────────────────
+ - name: Detect spam or low-quality content
+ uses: actions/ai-inference@v2
+ id: quality
+ continue-on-error: true
+ with:
+ max-tokens: 20
+ prompt: |
+ Is this GitHub issue spam, AI-generated slop, or low quality?
+
+ Title: ${{ github.event.issue.title }}
+ Body: ${{ github.event.issue.body }}
+
+ Respond with exactly one of: spam, ai-generated, needs-review, ok
+ system-prompt: You detect spam and low-quality contributions. Be conservative - only flag obvious spam or AI slop.
+ model: openai/gpt-4o-mini
+
+ - name: Apply quality label if needed
+ if: steps.quality.outputs.response != '' && steps.quality.outputs.response != 'ok'
+ uses: actions/github-script@v9
+ env:
+ QUALITY_LABEL: ${{ steps.quality.outputs.response }}
+ with:
+ script: |
+ const label = (process.env.QUALITY_LABEL || '').trim().toLowerCase();
+ const labelMeta = {
+ 'spam': { color: 'd73a4a', description: 'Possible spam' },
+ 'ai-generated': { color: 'fbca04', description: 'Possible AI-generated low-quality content' },
+ 'needs-review': { color: 'f9d0c4', description: 'Needs human review' },
+ };
+ const meta = labelMeta[label];
+ if (!meta) return;
+
+ // Ensure label exists
+ try {
+ await github.rest.issues.getLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label });
+ } catch (e) {
+ if (e.status !== 404) throw e;
+ await github.rest.issues.createLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: meta.color, description: meta.description });
+ }
+
+ // Apply label
+ await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.issue.number, labels: [label] });
+
+ // Set output to skip remaining steps
+ core.setOutput('is_spam', 'true');
+
+ # ─────────────────────────────────────────────────────────────────────────
+ # Step 2: Duplicate detection - only if not spam
+ # ─────────────────────────────────────────────────────────────────────────
+ - name: Detect duplicate issues
+ if: steps.quality.outputs.response == 'ok' || steps.quality.outputs.response == ''
+ uses: pelikhan/action-genai-issue-dedup@bdb3b5d9451c1090ffcdf123d7447a5e7c7a2528 # v0.0.19
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+
+ # ─────────────────────────────────────────────────────────────────────────
+ # Step 3: Completeness check + auto-labeling (combined into one AI call)
+ # ─────────────────────────────────────────────────────────────────────────
+ - name: Determine if completeness check should be skipped
+ if: steps.quality.outputs.response == 'ok' || steps.quality.outputs.response == ''
+ uses: actions/github-script@v9
+ id: check-skip
+ with:
+ script: |
+ const title = (context.payload.issue.title || '').toLowerCase();
+ const labels = (context.payload.issue.labels || []).map(label => label.name);
+ const hasFeatureRequest = title.includes('feature request');
+ const hasEnhancement = labels.includes('enhancement');
+ const shouldSkip = hasFeatureRequest && hasEnhancement;
+ core.setOutput('should_skip', shouldSkip ? 'true' : 'false');
+
+ - name: Analyze issue completeness and determine labels
+ if: (steps.quality.outputs.response == 'ok' || steps.quality.outputs.response == '') && steps.check-skip.outputs.should_skip != 'true'
+ uses: actions/ai-inference@v2
+ id: analysis
+ continue-on-error: true
+ with:
+ prompt: |
+ Analyze this GitHub issue for the Meshtastic Android app and determine if it needs labels.
+
+ If this looks like a bug in the Android app (crash, ANR, UI glitch, connection failure, Bluetooth issues, notification problems, map issues), request app logs and explain how to get them:
+
+ Android app debug logs:
+ - Open the Meshtastic app, go to Settings > Debug > Save Logs
+ - Reproduce the problem, then share/attach the exported log file
+
+ Android logcat (if app logs are insufficient):
+ - Connect phone via USB with USB debugging enabled
+ - Run: adb logcat -s Meshtastic:* *:E
+ - Reproduce the problem, then copy/paste the relevant output
+
+ Also request key context if missing: Android version, phone model, app version, Meshtastic device model, firmware version, connection type (BLE/USB/TCP), steps to reproduce, expected vs actual.
+
+ Respond ONLY with JSON:
+ {
+ "complete": true|false,
+ "comment": "Your helpful comment requesting missing info, or empty string if complete",
+ "label": "needs-logs" | "needs-info" | "none"
+ }
+
+ Use "needs-logs" if this is an app bug AND no logs are attached.
+ Use "needs-info" if basic info like firmware version or steps to reproduce are missing.
+ Use "none" if the issue is complete or is a feature request.
+
+ Title: ${{ github.event.issue.title }}
+ Body: ${{ github.event.issue.body }}
+ system-prompt: You are a helpful assistant that triages GitHub issues. Be conservative with labels.
+ model: openai/gpt-4o-mini
+
+ - name: Process analysis result
+ if: (steps.quality.outputs.response == 'ok' || steps.quality.outputs.response == '') && steps.check-skip.outputs.should_skip != 'true' && steps.analysis.outputs.response != ''
+ uses: actions/github-script@v9
+ id: process
+ env:
+ AI_RESPONSE: ${{ steps.analysis.outputs.response }}
+ with:
+ script: |
+ const raw = (process.env.AI_RESPONSE || '').trim();
+
+ let complete = false;
+ let comment = '';
+ let label = 'none';
+
+ try {
+ const parsed = JSON.parse(raw);
+ complete = !!parsed.complete;
+ comment = (parsed.comment ?? '').toString().trim();
+ label = (parsed.label ?? 'none').toString().trim().toLowerCase();
+ } catch {
+ // If JSON parse fails, treat as incomplete with raw response as comment
+ complete = false;
+ comment = raw;
+ label = 'none';
+ }
+
+ // Validate label
+ const allowedLabels = new Set(['needs-logs', 'needs-info', 'none']);
+ if (!allowedLabels.has(label)) label = 'none';
+
+ core.setOutput('should_comment', (!complete && comment.length > 0) ? 'true' : 'false');
+ core.setOutput('comment_body', comment);
+ core.setOutput('label', label);
+
+ - name: Apply triage label
+ if: steps.process.outputs.label != '' && steps.process.outputs.label != 'none'
+ uses: actions/github-script@v9
+ env:
+ LABEL_NAME: ${{ steps.process.outputs.label }}
+ with:
+ script: |
+ const label = process.env.LABEL_NAME;
+ const labelMeta = {
+ 'needs-logs': { color: 'cfd3d7', description: 'Device logs requested for triage' },
+ 'needs-info': { color: 'f9d0c4', description: 'More information requested for triage' },
+ };
+ const meta = labelMeta[label];
+ if (!meta) return;
+
+ // Ensure label exists
+ try {
+ await github.rest.issues.getLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label });
+ } catch (e) {
+ if (e.status !== 404) throw e;
+ await github.rest.issues.createLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: meta.color, description: meta.description });
+ }
+
+ // Apply label
+ await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.issue.number, labels: [label] });
+
+ - name: Comment on issue
+ if: steps.process.outputs.should_comment == 'true'
+ uses: actions/github-script@v9
+ env:
+ COMMENT_BODY: ${{ steps.process.outputs.comment_body }}
+ with:
+ script: |
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.payload.issue.number,
+ body: process.env.COMMENT_BODY
+ });
diff --git a/.github/workflows/models_pr_triage.yml b/.github/workflows/models_pr_triage.yml
new file mode 100644
index 000000000..c2a1aaf25
--- /dev/null
+++ b/.github/workflows/models_pr_triage.yml
@@ -0,0 +1,144 @@
+name: PR Triage (Models)
+
+on:
+ pull_request_target:
+ types: [opened]
+
+permissions:
+ pull-requests: write
+ issues: write
+ models: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ triage:
+ if: ${{ github.repository == 'meshtastic/Meshtastic-Android' && github.event.pull_request.user.type != 'Bot' }}
+ runs-on: ubuntu-24.04-arm
+ steps:
+ # ─────────────────────────────────────────────────────────────────────────
+ # Step 1: Check if PR already has automation/type labels (skip if so)
+ # ─────────────────────────────────────────────────────────────────────────
+ - name: Check existing labels
+ uses: actions/github-script@v9
+ id: check-labels
+ with:
+ script: |
+ const skipLabels = new Set(['automation', 'release']);
+ const typeLabels = new Set(['bugfix', 'enhancement', 'dependencies', 'repo', 'refactor']);
+ const prLabels = context.payload.pull_request.labels.map(l => l.name);
+
+ const shouldSkipAll = prLabels.some(l => skipLabels.has(l));
+ const hasTypeLabel = prLabels.some(l => typeLabels.has(l));
+
+ core.setOutput('skip_all', shouldSkipAll ? 'true' : 'false');
+ core.setOutput('has_type_label', hasTypeLabel ? 'true' : 'false');
+
+ # ─────────────────────────────────────────────────────────────────────────
+ # Step 2: Quality check (spam/AI-slop detection)
+ # ─────────────────────────────────────────────────────────────────────────
+ - name: Detect spam or low-quality content
+ if: steps.check-labels.outputs.skip_all != 'true'
+ uses: actions/ai-inference@v2
+ id: quality
+ continue-on-error: true
+ env:
+ PR_TITLE: ${{ github.event.pull_request.title }}
+ PR_BODY: ${{ github.event.pull_request.body }}
+ with:
+ max-tokens: 20
+ prompt: |
+ Is this GitHub pull request spam, AI-generated slop, or low quality?
+
+ Title: ${{ env.PR_TITLE }}
+ Body: ${{ env.PR_BODY }}
+
+ Respond with exactly one of: spam, ai-generated, needs-review, ok
+ system-prompt: You detect spam and low-quality contributions. Be conservative - only flag obvious spam or AI slop.
+ model: openai/gpt-4o-mini
+
+ - name: Apply quality label if needed
+ if: steps.check-labels.outputs.skip_all != 'true' && steps.quality.outputs.response != '' && steps.quality.outputs.response != 'ok'
+ uses: actions/github-script@v9
+ id: quality-label
+ env:
+ QUALITY_LABEL: ${{ steps.quality.outputs.response }}
+ with:
+ script: |
+ const label = (process.env.QUALITY_LABEL || '').trim().toLowerCase();
+ const labelMeta = {
+ 'spam': { color: 'd73a4a', description: 'Possible spam' },
+ 'ai-generated': { color: 'fbca04', description: 'Possible AI-generated low-quality content' },
+ 'needs-review': { color: 'f9d0c4', description: 'Needs human review' },
+ };
+ const meta = labelMeta[label];
+ if (!meta) return;
+
+ // Ensure label exists
+ try {
+ await github.rest.issues.getLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label });
+ } catch (e) {
+ if (e.status !== 404) throw e;
+ await github.rest.issues.createLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: meta.color, description: meta.description });
+ }
+
+ // Apply label
+ await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.pull_request.number, labels: [label] });
+
+ core.setOutput('is_spam', 'true');
+
+ # ─────────────────────────────────────────────────────────────────────────
+ # Step 3: Auto-label PR type (bugfix/enhancement/refactor)
+ # ─────────────────────────────────────────────────────────────────────────
+ - name: Classify PR for labeling
+ if: steps.check-labels.outputs.skip_all != 'true' && steps.check-labels.outputs.has_type_label != 'true' && (steps.quality.outputs.response == 'ok' || steps.quality.outputs.response == '')
+ uses: actions/ai-inference@v2
+ id: classify
+ continue-on-error: true
+ env:
+ PR_TITLE: ${{ github.event.pull_request.title }}
+ PR_BODY: ${{ github.event.pull_request.body }}
+ with:
+ max-tokens: 30
+ prompt: |
+ Classify this pull request for the Meshtastic Android app into exactly one category.
+
+ Return exactly one of: bugfix, enhancement, refactor
+
+ Use bugfix if it fixes a bug, crash, or incorrect behavior.
+ Use enhancement if it adds a new feature, improves performance, or adds new functionality.
+ Use refactor if it restructures code without changing behavior, cleans up code, or improves architecture.
+
+ Title: ${{ env.PR_TITLE }}
+ Body: ${{ env.PR_BODY }}
+ system-prompt: You classify pull requests into categories. Be conservative and pick the most appropriate single label.
+ model: openai/gpt-4o-mini
+
+ - name: Apply type label
+ if: steps.check-labels.outputs.skip_all != 'true' && steps.check-labels.outputs.has_type_label != 'true' && steps.classify.outputs.response != ''
+ uses: actions/github-script@v9
+ env:
+ TYPE_LABEL: ${{ steps.classify.outputs.response }}
+ with:
+ script: |
+ const label = (process.env.TYPE_LABEL || '').trim().toLowerCase();
+ const labelMeta = {
+ 'bugfix': { color: 'd73a4a', description: 'Bug fix' },
+ 'enhancement': { color: 'a2eeef', description: 'New feature or enhancement' },
+ 'refactor': { color: 'c5def5', description: 'Code restructuring without behavior change' },
+ };
+ const meta = labelMeta[label];
+ if (!meta) return;
+
+ // Ensure label exists
+ try {
+ await github.rest.issues.getLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label });
+ } catch (e) {
+ if (e.status !== 404) throw e;
+ await github.rest.issues.createLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: meta.color, description: meta.description });
+ }
+
+ // Apply label
+ await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.pull_request.number, labels: [label] });
diff --git a/.github/workflows/moderate.yml b/.github/workflows/moderate.yml
new file mode 100644
index 000000000..4b8f94bfa
--- /dev/null
+++ b/.github/workflows/moderate.yml
@@ -0,0 +1,31 @@
+name: AI Moderator
+on:
+ issues:
+ types: [opened]
+ issue_comment:
+ types: [created]
+ pull_request_review_comment:
+ types: [created]
+
+jobs:
+ spam-detection:
+ if: github.repository == 'meshtastic/Meshtastic-Android'
+ runs-on: ubuntu-24.04-arm
+ permissions:
+ issues: write
+ pull-requests: write
+ models: read
+ contents: read
+ steps:
+ - uses: actions/checkout@v6
+ - uses: github/ai-moderator@v1
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ spam-label: 'spam'
+ ai-label: 'ai-generated'
+ minimize-detected-comments: true
+ # Built-in prompt configuration (all enabled by default)
+ enable-spam-detection: true
+ enable-link-spam-detection: true
+ enable-ai-detection: true
+ # custom-prompt-path: '.github/prompts/my-custom.prompt.yml' # Optional
diff --git a/.github/workflows/post-release-cleanup.yml b/.github/workflows/post-release-cleanup.yml
new file mode 100644
index 000000000..d62c36ed9
--- /dev/null
+++ b/.github/workflows/post-release-cleanup.yml
@@ -0,0 +1,78 @@
+name: Post-Release Cleanup
+
+on:
+ workflow_dispatch:
+ inputs:
+ base_version:
+ description: 'The base version to clean up (e.g., 2.3.0)'
+ required: true
+ type: string
+ confirm_deletion:
+ description: 'WARNING: This is a destructive action. Set to true to perform deletion. Defaults to a dry run.'
+ required: true
+ type: boolean
+ default: false
+
+permissions:
+ contents: write
+
+jobs:
+ cleanup_prereleases:
+ runs-on: ubuntu-24.04-arm
+ environment: Release
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - name: Cleanup pre-releases and their tags
+ id: cleanup_releases
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ BASE_VERSION="${{ github.event.inputs.base_version }}"
+ TAG_PREFIX="v${BASE_VERSION}-"
+ echo "Searching for pre-releases with tag prefix '$TAG_PREFIX'."
+ RELEASES_TO_DELETE=$(gh release list --json tagName,isPrerelease --limit 100 | jq -r --arg prefix "$TAG_PREFIX" '.[] | select(.isPrerelease == true and .tagName != null and (.tagName | startswith($prefix))) | .tagName')
+
+ if [ -z "$RELEASES_TO_DELETE" ]; then
+ echo "No pre-releases found for base version $BASE_VERSION."
+ else
+ if [[ "${{ github.event.inputs.confirm_deletion }}" == "true" ]]; then
+ echo "!!! DELETING RELEASES AND TAGS !!!"
+ echo "The following pre-releases and their tags will be deleted:"
+ echo "$RELEASES_TO_DELETE"
+ echo "$RELEASES_TO_DELETE" | xargs -n 1 gh release delete --cleanup-tag --yes
+ else
+ echo "DRY RUN: The following pre-releases and their tags would be deleted:"
+ echo "$RELEASES_TO_DELETE"
+ fi
+ fi
+
+ - name: Cleanup dangling pre-release tags
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ BASE_VERSION="${{ github.event.inputs.base_version }}"
+ TAG_PREFIX="v${BASE_VERSION}-"
+ echo "Searching for any remaining remote pre-release tags with prefix '$TAG_PREFIX'."
+
+ # This finds all remote tags matching the pattern. Some may have been deleted in the previous step.
+ TAGS_TO_DELETE=$(git ls-remote --tags origin "refs/tags/${TAG_PREFIX}*" | awk '{print $2}' | sed 's|refs/tags/||')
+
+ if [ -z "$TAGS_TO_DELETE" ]; then
+ echo "No dangling pre-release tags found."
+ else
+ if [[ "${{ github.event.inputs.confirm_deletion }}" == "true" ]]; then
+ echo "!!! DELETING DANGLING TAGS !!!"
+ echo "The following pre-release tags will be deleted:"
+ # We pipe to xargs which will run the command for each tag.
+ # If a tag was already deleted by the previous 'release delete' step, this will fail for that tag.
+ # We add '|| true' to ignore any errors and ensure the workflow doesn't fail.
+ echo "$TAGS_TO_DELETE" | xargs -n 1 -I {} sh -c 'git push --delete origin {} || true'
+ else
+ echo "DRY RUN: The following dangling pre-release tags would be deleted:"
+ echo "$TAGS_TO_DELETE"
+ fi
+ fi
diff --git a/.github/workflows/pr_enforce_labels.yml b/.github/workflows/pr_enforce_labels.yml
new file mode 100644
index 000000000..fa68a597b
--- /dev/null
+++ b/.github/workflows/pr_enforce_labels.yml
@@ -0,0 +1,37 @@
+name: Check PR Labels
+
+on:
+ pull_request:
+ types: [edited, labeled]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+permissions:
+ pull-requests: read
+ contents: read
+
+jobs:
+ check-label:
+ # Skip bot PRs — they already have labels from the workflows/bots that create them
+ if: >-
+ github.event.pull_request.user.login != 'renovate[bot]' &&
+ github.event.pull_request.user.login != 'github-actions[bot]' &&
+ github.event.pull_request.user.login != 'dependabot[bot]' &&
+ github.event.pull_request.head.ref != 'scheduled-updates' &&
+ github.event.pull_request.head.ref != 'l10n_main'
+ runs-on: ubuntu-24.04-arm
+ steps:
+ - name: Check for PR labels
+ uses: actions/github-script@v9
+ with:
+ script: |
+ // Extract labels from the payload directly to avoid extra API calls
+ const latestLabels = context.payload.pull_request.labels.map(label => label.name);
+ const requiredLabels = ['bugfix', 'enhancement', 'automation', 'dependencies', 'repo', 'release', 'refactor'];
+ console.log('Labels from payload:', latestLabels);
+ const hasRequiredLabel = latestLabels.some(label => requiredLabels.includes(label));
+ if (!hasRequiredLabel) {
+ core.setFailed(`PR must have at least one of the following labels before it can be merged: ${requiredLabels.join(', ')}.`);
+ }
diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml
new file mode 100644
index 000000000..df16866f3
--- /dev/null
+++ b/.github/workflows/promote.yml
@@ -0,0 +1,190 @@
+name: Promote Release
+
+on:
+ workflow_call:
+ inputs:
+ base_version:
+ description: 'The base version for the release (e.g., 2.3.0)'
+ required: true
+ type: string
+ tag_name:
+ description: 'The tag that triggered the release'
+ required: true
+ type: string
+ release_name:
+ description: 'The desired name for the GitHub release'
+ required: true
+ type: string
+ final_tag:
+ description: 'The final tag for the release'
+ required: true
+ type: string
+ commit_sha:
+ description: 'The commit SHA to tag'
+ required: false
+ type: string
+ channel:
+ description: 'The channel to promote to'
+ required: true
+ type: string
+ from_channel:
+ description: 'The channel to promote from'
+ required: true
+ type: string
+ secrets:
+ GSERVICES:
+ required: true
+ KEYSTORE:
+ required: true
+ KEYSTORE_FILENAME:
+ required: true
+ KEYSTORE_PROPERTIES:
+ required: true
+ DATADOG_APPLICATION_ID:
+ required: true
+ DATADOG_CLIENT_TOKEN:
+ required: true
+ GOOGLE_MAPS_API_KEY:
+ required: true
+ GOOGLE_PLAY_JSON_KEY:
+ required: true
+ GRADLE_ENCRYPTION_KEY:
+ required: true
+ DISCORD_WEBHOOK_ANDROID:
+ required: false
+
+concurrency:
+ group: ${{ github.workflow }}-${{ inputs.tag_name }}
+ cancel-in-progress: true
+
+permissions:
+ contents: write
+ pull-requests: read
+ id-token: write
+ attestations: write
+
+jobs:
+ prepare-build-info:
+ runs-on: ubuntu-24.04-arm
+ outputs:
+ APP_VERSION_NAME: ${{ steps.prep_version.outputs.APP_VERSION_NAME }}
+ APP_VERSION_CODE: ${{ steps.calculate_version_code.outputs.versionCode }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.commit_sha || inputs.tag_name }}
+ fetch-depth: 0
+ submodules: 'recursive'
+
+ - name: Prep APP_VERSION_NAME
+ id: prep_version
+ env:
+ INPUT_TAG_NAME: ${{ inputs.tag_name }}
+ run: |
+ VERSION_NAME=$(echo $INPUT_TAG_NAME | sed 's/-.*//' | sed 's/v//')
+ echo "APP_VERSION_NAME=$VERSION_NAME" >> $GITHUB_OUTPUT
+ echo "Parsed Version: $VERSION_NAME"
+
+ - name: Extract VERSION_CODE_OFFSET from config.properties
+ id: get_version_code_offset
+ run: |
+ OFFSET=$(grep '^VERSION_CODE_OFFSET=' config.properties | cut -d'=' -f2)
+ echo "VERSION_CODE_OFFSET=$OFFSET" >> $GITHUB_OUTPUT
+
+ - name: Calculate Version Code from Git Commit Count
+ id: calculate_version_code
+ run: |
+ COMMIT_COUNT=$(git rev-list --count HEAD)
+ OFFSET=${{ steps.get_version_code_offset.outputs.VERSION_CODE_OFFSET }}
+ VERSION_CODE=$((COMMIT_COUNT + OFFSET))
+ echo "versionCode=$VERSION_CODE" >> $GITHUB_OUTPUT
+ shell: bash
+
+ promote-release:
+ runs-on: ubuntu-24.04-arm
+ environment: Release
+ needs: [ prepare-build-info ]
+ steps:
+ - name: Promote to next channel
+ uses: kevin-david/promote-play-release@v1.2.0
+ with:
+ service-account-json-raw: ${{ secrets.GOOGLE_PLAY_JSON_KEY }}
+ package-name: 'com.geeksville.mesh'
+ from-track: ${{ inputs.from_channel == 'closed' && 'NewAlpha' || (inputs.from_channel == 'open' && 'beta' || 'internal') }}
+ to-track: ${{ inputs.channel == 'closed' && 'NewAlpha' || (inputs.channel == 'open' && 'beta' || 'production') }}
+ user-fraction: ${{ (inputs.channel == 'production' && '0.1') || (inputs.channel == 'open' && '0.5') || '1.0' }}
+
+ update-github-release:
+ runs-on: ubuntu-24.04-arm
+ needs: [ prepare-build-info, promote-release ]
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.commit_sha || inputs.tag_name }}
+ fetch-depth: 0
+ submodules: 'recursive'
+
+ - name: Push Git Tag on Success
+ if: ${{ inputs.commit_sha != '' }}
+ run: |
+ git tag ${{ inputs.final_tag }} ${{ inputs.commit_sha }}
+ git push origin ${{ inputs.final_tag }}
+
+ - name: Update GitHub Release with gh CLI
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ gh release edit ${{ inputs.tag_name }} \
+ --tag ${{ inputs.final_tag }} \
+ --title "${{ inputs.release_name }} (${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }})" \
+ --draft=false \
+ --prerelease=${{ inputs.channel != 'production' }}
+
+ - name: Notify Discord
+ if: ${{ inputs.channel != 'internal' }}
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_ANDROID }}
+ VERSION: ${{ inputs.final_tag }}
+ CHANNEL: ${{ inputs.channel }}
+ run: |
+ if [[ -z "$DISCORD_WEBHOOK" ]]; then
+ echo "No Discord webhook provided. Skipping notification."
+ exit 0
+ fi
+
+ # Determine Track Name for Display
+ if [ "$CHANNEL" == "closed" ]; then TRACK="Alpha (Closed)"; fi
+ if [ "$CHANNEL" == "open" ]; then TRACK="Beta (Open)"; fi
+ if [ "$CHANNEL" == "production" ]; then TRACK="Production"; fi
+
+ # Construct JSON Payload
+ PAYLOAD=$(cat <> $GITHUB_ENV
+ else
+ # Use a timestamp-based version for manual/branch builds to avoid collisions
+ # or use the base version + suffix
+ BASE_VERSION=$(grep "VERSION_NAME_BASE" config.properties | cut -d'=' -f2)
+ echo "VERSION_NAME=${BASE_VERSION}${VERSION_SUFFIX}" >> $GITHUB_ENV
+ fi
+
+ - name: Publish to GitHub Packages
+ run: ./gradlew :core:api:publish :core:model:publish :core:proto:publish
+ env:
+ GITHUB_ACTOR: ${{ github.actor }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/pull-request-target.yml b/.github/workflows/pull-request-target.yml
new file mode 100644
index 000000000..d37cecf43
--- /dev/null
+++ b/.github/workflows/pull-request-target.yml
@@ -0,0 +1,67 @@
+name: "Pull Request Labeler"
+on:
+ pull_request_target:
+ types: [opened, synchronize]
+# Do not execute arbitrary code on this workflow.
+# See warnings at https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ labeler:
+ permissions:
+ contents: read
+ pull-requests: write
+ runs-on: ubuntu-24.04-arm
+ steps:
+ - name: Auto-label PR
+ uses: actions/github-script@v9
+ with:
+ script: |
+ const branch = context.payload.pull_request.head.ref;
+ const labels = new Set();
+
+ // enhancement: branch contains feat
+ if (/feat/i.test(branch)) labels.add('enhancement');
+
+ // bugfix: branch starts with fix or bug
+ if (/^(fix|bug)/i.test(branch)) labels.add('bugfix');
+
+ // refactor: branch starts with refactor
+ if (/^refactor/i.test(branch)) labels.add('refactor');
+
+ // repo: branch contains repo or ci
+ if (/repo|ci/i.test(branch)) {
+ labels.add('repo');
+ } else {
+ // Also label 'repo' if .github files were changed (needs one API call)
+ try {
+ const files = await github.paginate(
+ github.rest.pulls.listFiles,
+ { owner: context.repo.owner, repo: context.repo.repo, pull_number: context.payload.pull_request.number, per_page: 100 },
+ (res) => res.data.map(f => f.filename)
+ );
+ if (files.some(f => f.startsWith('.github/'))) labels.add('repo');
+ } catch (e) {
+ core.warning(`Could not list PR files (rate limited?): ${e.message}`);
+ }
+ }
+
+ if (labels.size > 0) {
+ const labelArray = [...labels];
+ core.info(`Applying labels: ${labelArray.join(', ')}`);
+ try {
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.payload.pull_request.number,
+ labels: labelArray,
+ });
+ } catch (e) {
+ core.warning(`Could not apply labels (rate limited?): ${e.message}`);
+ }
+ } else {
+ core.info('No labels matched for this PR.');
+ }
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
new file mode 100644
index 000000000..d450711ce
--- /dev/null
+++ b/.github/workflows/pull-request.yml
@@ -0,0 +1,134 @@
+name: Pull Request CI
+
+on:
+ pull_request:
+ branches: [ main ]
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ # 1. CHANGE DETECTION: Prevents unnecessary builds
+ check-changes:
+ if: github.repository == 'meshtastic/Meshtastic-Android' && !( github.head_ref == 'scheduled-updates' || github.head_ref == 'l10n_main' )
+ runs-on: ubuntu-24.04-arm
+ outputs:
+ android: ${{ steps.filter.outputs.android }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: dorny/paths-filter@v4
+ id: filter
+ with:
+ token: ''
+ filters: |
+ android:
+ # CI/workflow implementation
+ - '.github/workflows/**'
+ - '.github/actions/**'
+ # Product modules validated by reusable-check
+ - 'app/**'
+ - 'baselineprofile/**'
+ - 'desktop/**'
+ - 'core/**'
+ - 'feature/**'
+ # Shared build infrastructure
+ - 'build-logic/**'
+ - 'config/**'
+ - 'gradle/**'
+ # Root build entrypoints/config that can alter task graph or outputs
+ - 'build.gradle.kts'
+ - 'config.properties'
+ - 'compose_compiler_config.conf'
+ - 'gradle.properties'
+ - 'gradlew'
+ - 'gradlew.bat'
+ - 'settings.gradle.kts'
+ - 'test.gradle.kts'
+
+ # 1b. FILTER DRIFT CHECK: Ensures check-changes stays aligned with module roots
+ verify-check-changes-filter:
+ if: github.repository == 'meshtastic/Meshtastic-Android' && !( github.head_ref == 'scheduled-updates' || github.head_ref == 'l10n_main' )
+ runs-on: ubuntu-24.04-arm
+ steps:
+ - uses: actions/checkout@v6
+ - name: Verify module roots are represented in check-changes filter
+ run: |
+ python3 - <<'PY'
+ import re
+ from pathlib import Path
+
+ settings = Path('settings.gradle.kts').read_text()
+ workflow = Path('.github/workflows/pull-request.yml').read_text()
+
+ module_roots = {
+ module.split(':')[0]
+ for module in re.findall(r'":([^"]+)"', settings)
+ }
+
+ allowed_extra_roots = {'baselineprofile'}
+ expected_roots = module_roots | allowed_extra_roots
+
+ filter_paths = {
+ path.split('/')[0]
+ for path in re.findall(r"-\s*'([^']+/\*\*)'", workflow)
+ }
+
+ actual_module_roots = filter_paths & expected_roots
+
+ missing = sorted(expected_roots - actual_module_roots)
+ unexpected = sorted(actual_module_roots - expected_roots)
+
+ if missing or unexpected:
+ print('check-changes filter drift detected:')
+ if missing:
+ print(' Missing roots:', ', '.join(missing))
+ if unexpected:
+ print(' Unexpected roots:', ', '.join(unexpected))
+ raise SystemExit(1)
+
+ print('check-changes filter is aligned with settings.gradle module roots.')
+ PY
+
+ # 2. VALIDATION & BUILD: Delegate to reusable-check.yml
+ # We disable coverage and desktop builds for PRs to keep feedback fast
+ # (< 10 mins). Desktop compilation is already covered by the :desktop:test
+ # task in the shard-app test shard.
+ validate-and-build:
+ needs: check-changes
+ if: needs.check-changes.outputs.android == 'true'
+ uses: ./.github/workflows/reusable-check.yml
+ with:
+ run_lint: true
+ run_unit_tests: true
+ run_coverage: false
+ run_desktop_builds: false
+ upload_artifacts: true
+ secrets: inherit
+
+ # 3. WORKFLOW STATUS: Ensures required checks are satisfied
+ check-workflow-status:
+ name: Check Workflow Status
+ runs-on: ubuntu-24.04-arm
+ permissions: {}
+ needs: [check-changes, verify-check-changes-filter, validate-and-build]
+ if: always()
+ steps:
+ - name: Check Workflow Status
+ run: |
+ if [[ "${{ needs.verify-check-changes-filter.result }}" == "failure" || "${{ needs.verify-check-changes-filter.result }}" == "cancelled" ]]; then
+ echo "::error::check-changes filter verification failed"
+ exit 1
+ fi
+
+ # If changes were detected but build failed, fail the status check
+ if [[ "${{ needs.check-changes.outputs.android }}" == "true" && ("${{ needs.validate-and-build.result }}" == "failure" || "${{ needs.validate-and-build.result }}" == "cancelled") ]]; then
+ echo "::error::Android Check failed"
+ exit 1
+ fi
+
+ # If no changes were detected, this still succeeds to satisfy required status check
+ echo "Workflow status satisfied."
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6f74f8c84..40d8e40f3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,108 +1,353 @@
name: Make Release
on:
- workflow_dispatch:
+ workflow_call:
+ inputs:
+ base_version:
+ description: 'The base version for the release (e.g., 2.3.0)'
+ required: true
+ type: string
+ tag_name:
+ description: 'The tag that triggered the release'
+ required: true
+ type: string
+ commit_sha:
+ description: 'The commit SHA to build and tag'
+ required: false
+ type: string
+ channel:
+ description: 'The channel to create a release for or promote to'
+ required: true
+ type: string
+ build_desktop:
+ description: 'Whether to build the desktop distribution'
+ required: false
+ type: boolean
+ default: false
+ secrets:
+ GSERVICES:
+ required: true
+ KEYSTORE:
+ required: true
+ KEYSTORE_FILENAME:
+ required: true
+ KEYSTORE_PROPERTIES:
+ required: true
+ DATADOG_APPLICATION_ID:
+ required: true
+ DATADOG_CLIENT_TOKEN:
+ required: true
+ GOOGLE_MAPS_API_KEY:
+ required: true
+ GOOGLE_PLAY_JSON_KEY:
+ required: true
+ GRADLE_ENCRYPTION_KEY:
+ required: true
+ GRADLE_CACHE_URL:
+ required: false
+ GRADLE_CACHE_USERNAME:
+ required: false
+ GRADLE_CACHE_PASSWORD:
+ required: false
+ INTERNAL_BUILDS_HOST:
+ required: false
+ INTERNAL_BUILDS_HOST_PAT:
+ required: false
-permissions: write-all
+concurrency:
+ group: ${{ github.workflow }}-${{ inputs.tag_name }}
+ cancel-in-progress: true
+
+permissions:
+ contents: write
+ pull-requests: read
+ id-token: write
+ attestations: write
jobs:
-
- release-build:
- runs-on: ubuntu-latest
+ prepare-build-info:
+ runs-on: ubuntu-24.04-arm
+ outputs:
+ APP_VERSION_NAME: ${{ steps.prep_version.outputs.APP_VERSION_NAME }}
+ APP_VERSION_CODE: ${{ steps.calculate_version_code.outputs.versionCode }}
+ env:
+ GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
+ GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
+ GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.tag_name }}
+ fetch-depth: 0
+ submodules: 'recursive'
+ - name: Prep APP_VERSION_NAME
+ id: prep_version
+ env:
+ INPUT_TAG_NAME: ${{ inputs.tag_name }}
+ run: |
+ VERSION_NAME=$(echo $INPUT_TAG_NAME | sed 's/-.*//' | sed 's/v//')
+ echo "APP_VERSION_NAME=$VERSION_NAME" >> $GITHUB_OUTPUT
+ echo "Parsed Version: $VERSION_NAME"
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- submodules: 'recursive'
+ - name: Extract VERSION_CODE_OFFSET from config.properties
+ id: get_version_code_offset
+ run: |
+ OFFSET=$(grep '^VERSION_CODE_OFFSET=' config.properties | cut -d'=' -f2)
+ echo "VERSION_CODE_OFFSET=$OFFSET" >> $GITHUB_OUTPUT
- - name: Get `versionCode` & `versionName`
- run: |
- echo "versionCode=$(grep -oP 'VERSION_CODE = \K\d+' ./buildSrc/src/main/kotlin/Configs.kt)" >> $GITHUB_ENV
- echo "versionName=$(grep -oP 'VERSION_NAME = \"\K[^\"]+' ./buildSrc/src/main/kotlin/Configs.kt)" >> $GITHUB_ENV
+ - name: Calculate Version Code from Git Commit Count
+ id: calculate_version_code
+ run: |
+ COMMIT_COUNT=$(git rev-list --count HEAD)
+ OFFSET=${{ steps.get_version_code_offset.outputs.VERSION_CODE_OFFSET }}
+ VERSION_CODE=$((COMMIT_COUNT + OFFSET))
+ echo "versionCode=$VERSION_CODE" >> $GITHUB_OUTPUT
+ shell: bash
- - name: Validate Gradle wrapper
- uses: gradle/actions/wrapper-validation@v4
+ release-google:
+ runs-on: ubuntu-24.04
+ needs: [prepare-build-info]
+ environment: Release
+ env:
+ GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
+ GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
+ GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.tag_name }}
+ fetch-depth: 0
+ submodules: 'recursive'
- - name: Load secrets
- run: |
- rm ./app/google-services.json
- echo $GSERVICES > ./app/google-services.json
- echo $KEYSTORE | base64 -di > ./app/$KEYSTORE_FILENAME
- echo "$KEYSTORE_PROPERTIES" > ./keystore.properties
- echo -e "versionCode=$versionCode\nversionName=$versionName" > ./version_info.txt
- env:
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: 'false'
+
+ - name: Load secrets
+ env:
GSERVICES: ${{ secrets.GSERVICES }}
KEYSTORE: ${{ secrets.KEYSTORE }}
KEYSTORE_FILENAME: ${{ secrets.KEYSTORE_FILENAME }}
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
+ DATADOG_APPLICATION_ID: ${{ secrets.DATADOG_APPLICATION_ID }}
+ DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
+ GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
+ GOOGLE_PLAY_JSON_KEY: ${{ secrets.GOOGLE_PLAY_JSON_KEY }}
+ run: |
+ rm -f ./app/google-services.json
+ echo $GSERVICES > ./app/google-services.json
+ echo $KEYSTORE | base64 -di > ./app/$KEYSTORE_FILENAME
+ echo "$KEYSTORE_PROPERTIES" > ./keystore.properties
+ echo "datadogApplicationId=$DATADOG_APPLICATION_ID" >> ./secrets.properties
+ echo "datadogClientToken=$DATADOG_CLIENT_TOKEN" >> ./secrets.properties
+ echo "MAPS_API_KEY=$GOOGLE_MAPS_API_KEY" >> ./secrets.properties
+ echo "$GOOGLE_PLAY_JSON_KEY" > ./fastlane/play-store-credentials.json
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'zulu'
- # Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine
+ - name: Setup Fastlane
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: '3.4.9'
+ bundler-cache: true
- - name: Build F-Droid release
- run: ./gradlew assembleFdroidRelease
+ - name: Build and Deploy Google Play to Internal Track with Fastlane
+ env:
+ VERSION_NAME: ${{ needs.prepare-build-info.outputs.APP_VERSION_NAME }}
+ VERSION_CODE: ${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }}
+ run: bundle exec fastlane internal
- - name: Enable Crashlytics
- run: sed -i 's/USE_CRASHLYTICS = false/USE_CRASHLYTICS = true/g' ./buildSrc/src/main/kotlin/Configs.kt
+ - name: List outputs
+ run: ls -R app/build/outputs/
- - name: Build Play Store release
- run: ./gradlew bundleGoogleRelease assembleGoogleRelease
+ - name: Upload Google AAB artifact
+ if: always()
+ uses: actions/upload-artifact@v7
+ with:
+ name: google-aab
+ path: app/build/outputs/bundle/googleRelease/app-google-release.aab
+ retention-days: 1
- - name: Create GitHub release
- uses: actions/create-release@v1
- id: create_release
- with:
- draft: true
- prerelease: true
- release_name: Meshtastic Android ${{ env.versionName }} alpha
- tag_name: ${{ env.versionName }}
- body: |
- Autogenerated by github action, developer should edit as required before publishing...
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Upload Google APK artifact
+ if: always()
+ uses: actions/upload-artifact@v7
+ with:
+ name: google-apk
+ path: app/build/outputs/apk/google/release/*.apk
+ retention-days: 1
- - name: Add F-Droid APK to release
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: app/build/outputs/apk/fdroid/release/app-fdroid-release.apk
- asset_name: fdroidRelease-${{ env.versionName }}.apk
- asset_content_type: application/zip
+ - name: Attest Google AAB provenance
+ if: success()
+ uses: actions/attest-build-provenance@v4
+ with:
+ subject-path: app/build/outputs/bundle/googleRelease/app-google-release.aab
- - name: Add Play Store AAB to release
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: app/build/outputs/bundle/googleRelease/app-google-release.aab
- asset_name: googleRelease-${{ env.versionName }}.aab
- asset_content_type: application/zip
+ - name: Attest Google APK provenance
+ if: success()
+ uses: actions/attest-build-provenance@v4
+ with:
+ subject-path: app/build/outputs/apk/google/release/*.apk
- - name: Add Play Store APK to release
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: app/build/outputs/apk/google/release/app-google-release.apk
- asset_name: googleRelease-${{ env.versionName }}.apk
- asset_content_type: application/zip
+ release-fdroid:
+ runs-on: ubuntu-24.04
+ needs: [prepare-build-info]
+ environment: Release
+ env:
+ GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
+ GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
+ GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.tag_name }}
+ fetch-depth: 0
+ submodules: 'recursive'
- # https://github.com/f-droid/fdroiddata/blob/main/metadata/com.geeksville.mesh.yml#L34
- - name: Add `version_info.txt` to release
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: version_info.txt
- asset_name: version_info.txt
- asset_content_type: text/plain
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: 'false'
+
+ - name: Load secrets
+ env:
+ KEYSTORE: ${{ secrets.KEYSTORE }}
+ KEYSTORE_FILENAME: ${{ secrets.KEYSTORE_FILENAME }}
+ KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
+ run: |
+ echo $KEYSTORE | base64 -di > ./app/$KEYSTORE_FILENAME
+ echo "$KEYSTORE_PROPERTIES" > ./keystore.properties
+
+ - name: Setup Fastlane
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: '3.4.9'
+ bundler-cache: true
+
+ - name: Build F-Droid with Fastlane
+ env:
+ VERSION_NAME: ${{ needs.prepare-build-info.outputs.APP_VERSION_NAME }}
+ VERSION_CODE: ${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }}
+ run: bundle exec fastlane fdroid_build
+
+ - name: List outputs
+ run: ls -R app/build/outputs/
+
+ - name: Upload F-Droid APK artifact
+ if: always()
+ uses: actions/upload-artifact@v7
+ with:
+ name: fdroid-apk
+ path: app/build/outputs/apk/fdroid/release/*.apk
+ retention-days: 1
+
+ - name: Attest F-Droid APK provenance
+ if: success()
+ uses: actions/attest-build-provenance@v4
+ with:
+ subject-path: app/build/outputs/apk/fdroid/release/*.apk
+
+ release-desktop:
+ if: ${{ inputs.build_desktop }}
+ runs-on: ${{ matrix.os }}
+ needs: [prepare-build-info]
+ environment: Release
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest, ubuntu-24.04, ubuntu-24.04-arm]
+ env:
+ GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
+ GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
+ GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.tag_name }}
+ fetch-depth: 0
+ submodules: 'recursive'
+
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: 'false'
+
+ - name: Install dependencies for AppImage
+ if: runner.os == 'Linux'
+ run: sudo apt-get update && sudo apt-get install -y libfuse2
+
+ - name: Package Native Distributions
+ env:
+ ORG_GRADLE_PROJECT_appVersionName: ${{ needs.prepare-build-info.outputs.APP_VERSION_NAME }}
+ APPIMAGE_EXTRACT_AND_RUN: 1
+ run: ./gradlew :desktop:packageReleaseDistributionForCurrentOS -PaboutLibraries.release=true --no-daemon
+
+ - name: List Desktop Binaries
+ if: runner.os == 'Linux'
+ run: ls -R desktop/build/compose/binaries/main-release
+
+ - name: Upload Desktop Artifacts
+ if: always()
+ uses: actions/upload-artifact@v7
+ with:
+ name: desktop-${{ runner.os }}-${{ runner.arch }}
+ path: |
+ desktop/build/compose/binaries/main-release/*/*.dmg
+ desktop/build/compose/binaries/main-release/*/*.msi
+ desktop/build/compose/binaries/main-release/*/*.exe
+ desktop/build/compose/binaries/main-release/*/*.deb
+ desktop/build/compose/binaries/main-release/*/*.rpm
+ desktop/build/compose/binaries/main-release/*/*.AppImage
+ retention-days: 1
+ if-no-files-found: ignore
+
+ github-release:
+ if: ${{ !cancelled() && !failure() }}
+ runs-on: ubuntu-24.04-arm
+ needs: [prepare-build-info, release-google, release-fdroid, release-desktop]
+ env:
+ INTERNAL_BUILDS_HOST: ${{ secrets.INTERNAL_BUILDS_HOST }}
+ permissions:
+ contents: write
+ id-token: write
+ attestations: write
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.tag_name }}
+
+ - name: Download all artifacts
+ uses: actions/download-artifact@v8
+ with:
+ path: ./artifacts
+
+ - name: Create or Update GitHub Release
+ uses: softprops/action-gh-release@v3
+ with:
+ tag_name: ${{ inputs.tag_name }}
+ target_commitish: ${{ inputs.commit_sha || github.sha }}
+ name: ${{ inputs.tag_name }} (${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }})
+ generate_release_notes: true
+ files: ./artifacts/**/*
+ draft: true
+ prerelease: true
+
+ - name: Create or Update internal GitHub Release
+ continue-on-error: true
+ if: ${{ env.INTERNAL_BUILDS_HOST != '' }}
+ uses: softprops/action-gh-release@v3
+ with:
+ repository: ${{ secrets.INTERNAL_BUILDS_HOST }}
+ token: ${{ secrets.INTERNAL_BUILDS_HOST_PAT }}
+ tag_name: ${{ inputs.tag_name }}
+ name: ${{ inputs.tag_name }} (${{ needs.prepare-build-info.outputs.APP_VERSION_CODE }})
+ generate_release_notes: false
+ files: ./artifacts/**/*
+ draft: false
+ prerelease: true
\ No newline at end of file
diff --git a/.github/workflows/reusable-check.yml b/.github/workflows/reusable-check.yml
new file mode 100644
index 000000000..632bf1ea4
--- /dev/null
+++ b/.github/workflows/reusable-check.yml
@@ -0,0 +1,315 @@
+name: Reusable Android Check
+
+on:
+ workflow_call:
+ inputs:
+ run_lint:
+ type: boolean
+ default: true
+ run_unit_tests:
+ type: boolean
+ default: true
+ run_coverage:
+ type: boolean
+ default: true
+ run_desktop_builds:
+ type: boolean
+ default: true
+ upload_artifacts:
+ type: boolean
+ default: true
+ secrets:
+ GRADLE_ENCRYPTION_KEY:
+ required: false
+ CODECOV_TOKEN:
+ required: false
+ DATADOG_APPLICATION_ID:
+ required: false
+ DATADOG_CLIENT_TOKEN:
+ required: false
+ GOOGLE_MAPS_API_KEY:
+ required: false
+ GRADLE_CACHE_URL:
+ required: false
+ GRADLE_CACHE_USERNAME:
+ required: false
+ GRADLE_CACHE_PASSWORD:
+ required: false
+
+env:
+ DATADOG_APPLICATION_ID: ${{ secrets.DATADOG_APPLICATION_ID }}
+ DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
+ MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
+ GITHUB_TOKEN: ${{ github.token }}
+ GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
+ GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
+ GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
+ # Fallback VERSION_CODE for the lint-check job itself (which computes the real
+ # value from git). Downstream jobs override this with the git-derived value.
+ VERSION_CODE: ${{ github.run_number }}
+
+jobs:
+ # ── Lint & Static Analysis ──────────────────────────────────────────
+ lint-check:
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: read
+ timeout-minutes: 30
+ outputs:
+ cache_read_only: ${{ steps.cache_config.outputs.cache_read_only }}
+ version_code: ${{ steps.version_code.outputs.version_code }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ filter: 'blob:none'
+ submodules: true
+
+ - name: Determine cache read-only setting
+ id: cache_config
+ shell: bash
+ run: |
+ if [[ "${{ github.ref }}" == "refs/heads/main" ]] || [[ "${{ github.event_name }}" == "merge_group" ]] || [[ "${{ github.ref }}" == gh-readonly-queue/* ]]; then
+ echo "cache_read_only=false" >> "$GITHUB_OUTPUT"
+ else
+ echo "cache_read_only=true" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Calculate version code from git commit count
+ id: version_code
+ shell: bash
+ run: |
+ COMMIT_COUNT=$(git rev-list --count HEAD)
+ OFFSET=$(grep '^VERSION_CODE_OFFSET=' config.properties | cut -d'=' -f2 || echo 0)
+ VERSION_CODE=$((COMMIT_COUNT + OFFSET))
+ echo "version_code=$VERSION_CODE" >> "$GITHUB_OUTPUT"
+
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: ${{ steps.cache_config.outputs.cache_read_only }}
+
+ - name: Lint, Analysis & KMP Smoke Compile
+ if: inputs.run_lint == true
+ run: ./gradlew spotlessCheck detekt app:lintFdroidDebug app:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug core:api:lintDebug kmpSmokeCompile -Pci=true --continue --scan
+
+ - name: KMP Smoke Compile (lint skipped)
+ if: inputs.run_lint == false
+ run: ./gradlew kmpSmokeCompile -Pci=true --continue --scan
+
+ # ── Sharded Unit Tests ──────────────────────────────────────────────
+ # Tests are split into 3 shards that run in parallel:
+ # shard-core: core:* KMP module tests (allTests)
+ # shard-feature: feature:* KMP module tests (allTests)
+ # shard-app: Pure-Android/JVM tests (app, desktop, core:barcode, etc.)
+ test-shards:
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: read
+ timeout-minutes: 45
+ needs: lint-check
+ if: inputs.run_unit_tests == true
+ env:
+ VERSION_CODE: ${{ needs.lint-check.outputs.version_code }}
+ strategy:
+ fail-fast: false
+ matrix:
+ shard:
+ - name: shard-core
+ tasks: >-
+ :core:ble:allTests
+ :core:common:allTests
+ :core:data:allTests
+ :core:database:allTests
+ :core:domain:allTests
+ :core:model:allTests
+ :core:navigation:allTests
+ :core:network:allTests
+ :core:prefs:allTests
+ :core:repository:allTests
+ :core:service:allTests
+ :core:takserver:allTests
+ :core:testing:allTests
+ :core:ui:allTests
+ kover: >-
+ :core:ble:koverXmlReport
+ :core:common:koverXmlReport
+ :core:data:koverXmlReport
+ :core:database:koverXmlReport
+ :core:domain:koverXmlReport
+ :core:model:koverXmlReport
+ :core:navigation:koverXmlReport
+ :core:network:koverXmlReport
+ :core:prefs:koverXmlReport
+ :core:repository:koverXmlReport
+ :core:service:koverXmlReport
+ :core:takserver:koverXmlReport
+ :core:testing:koverXmlReport
+ :core:ui:koverXmlReport
+ - name: shard-feature
+ tasks: >-
+ :feature:connections:allTests
+ :feature:firmware:allTests
+ :feature:intro:allTests
+ :feature:map:allTests
+ :feature:messaging:allTests
+ :feature:node:allTests
+ :feature:settings:allTests
+ kover: >-
+ :feature:connections:koverXmlReport
+ :feature:firmware:koverXmlReport
+ :feature:intro:koverXmlReport
+ :feature:map:koverXmlReport
+ :feature:messaging:koverXmlReport
+ :feature:node:koverXmlReport
+ :feature:settings:koverXmlReport
+ - name: shard-app
+ tasks: >-
+ :app:testFdroidDebugUnitTest
+ :app:testGoogleDebugUnitTest
+ :desktop:test
+ :core:barcode:testFdroidDebugUnitTest
+ :core:barcode:testGoogleDebugUnitTest
+ kover: >-
+ :app:koverXmlReportFdroidDebug
+ :app:koverXmlReportGoogleDebug
+ :core:barcode:koverXmlReportFdroidDebug
+ :core:barcode:koverXmlReportGoogleDebug
+ :desktop:koverXmlReport
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 1
+ submodules: true
+
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: ${{ needs.lint-check.outputs.cache_read_only }}
+
+ - name: Run Tests & Coverage (${{ matrix.shard.name }})
+ run: |
+ kover_tasks=""
+ if [[ "${{ inputs.run_coverage }}" == "true" ]]; then
+ kover_tasks="${{ matrix.shard.kover }}"
+ fi
+ ./gradlew ${{ matrix.shard.tasks }} $kover_tasks -Pci=true --continue --scan
+
+ - name: Upload test results to Codecov
+ if: ${{ !cancelled() }}
+ uses: codecov/codecov-action@v6
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ slug: meshtastic/Meshtastic-Android
+ flags: ${{ matrix.shard.name }}
+ fail_ci_if_error: false
+ report_type: test_results
+ files: "**/build/test-results/**/*.xml"
+
+ - name: Upload coverage to Codecov
+ if: ${{ !cancelled() && inputs.run_coverage }}
+ uses: codecov/codecov-action@v6
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ slug: meshtastic/Meshtastic-Android
+ flags: ${{ matrix.shard.name }}
+ fail_ci_if_error: false
+ files: "**/build/reports/kover/report*.xml"
+
+ - name: Upload shard reports
+ if: ${{ always() && inputs.upload_artifacts }}
+ uses: actions/upload-artifact@v7
+ with:
+ name: reports-${{ matrix.shard.name }}
+ path: |
+ **/build/reports
+ **/build/test-results
+ retention-days: 7
+
+ # ── Android Build ────────────────────────────────────────────────────
+ android-check:
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: read
+ timeout-minutes: 60
+ needs: lint-check
+ env:
+ VERSION_CODE: ${{ needs.lint-check.outputs.version_code }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 1
+ submodules: true
+
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: ${{ needs.lint-check.outputs.cache_read_only }}
+
+ - name: Build Android APKs
+ run: ./gradlew app:assembleFdroidDebug app:assembleGoogleDebug -Pci=true --parallel --configuration-cache --continue --scan
+
+ - name: Upload debug artifact
+ if: ${{ inputs.upload_artifacts }}
+ uses: actions/upload-artifact@v7
+ with:
+ name: app-debug-apks
+ path: app/build/outputs/apk/*/debug/*.apk
+ retention-days: 7
+
+ - name: Report App Size
+ if: always()
+ run: |
+ echo "### App Size Report" >> $GITHUB_STEP_SUMMARY
+ echo "| Artifact | Size |" >> $GITHUB_STEP_SUMMARY
+ echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
+ find app/build/outputs/apk -name "*.apk" -exec du -h {} + | awk '{print "| " $2 " | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
+
+ # ── Desktop Build ───────────────────────────────────────────────────
+ build-desktop:
+ name: Build Desktop Debug (${{ matrix.os }})
+ if: inputs.run_desktop_builds == true
+ runs-on: ${{ matrix.os }}
+ permissions:
+ contents: read
+ timeout-minutes: 60
+ needs: lint-check
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest, ubuntu-24.04, ubuntu-24.04-arm]
+ env:
+ VERSION_CODE: ${{ needs.lint-check.outputs.version_code }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 1
+ submodules: true
+
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: ${{ needs.lint-check.outputs.cache_read_only }}
+
+ - name: Build Desktop
+ run: ./gradlew :desktop:createDistributable -Pci=true --scan
+
+ - name: Upload Desktop artifact
+ if: ${{ inputs.upload_artifacts }}
+ uses: actions/upload-artifact@v7
+ with:
+ name: desktop-app-${{ runner.os }}-${{ runner.arch }}
+ path: desktop/build/compose/binaries/main/app/
+ retention-days: 7
diff --git a/.github/workflows/scheduled-updates.yml b/.github/workflows/scheduled-updates.yml
new file mode 100644
index 000000000..2399d1f88
--- /dev/null
+++ b/.github/workflows/scheduled-updates.yml
@@ -0,0 +1,145 @@
+name: Scheduled Updates (Firmware, Hardware, Translations)
+
+on:
+ schedule:
+ - cron: '0 */4 * * *' # Run every 4 hours (was hourly — reduced to cut cascade CI cost)
+ workflow_dispatch: # Allow manual triggering
+
+jobs:
+ update_assets:
+ runs-on: ubuntu-24.04
+ if: github.repository == 'meshtastic/Meshtastic-Android'
+ permissions:
+ contents: write # To commit files and push branches
+ pull-requests: write # To create pull requests
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v6
+ with:
+ token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
+
+ - name: Update firmware releases list
+ run: |
+ firmware_file_path="app/src/main/assets/firmware_releases.json"
+ temp_firmware_file="/tmp/new_firmware_releases.json"
+
+ echo "Fetching latest firmware releases..."
+ curl -s --fail https://api.meshtastic.org/github/firmware/list > "$temp_firmware_file"
+
+ if ! jq empty "$temp_firmware_file" 2>/dev/null; then
+ echo "::error::Firmware API returned invalid JSON data. Skipping firmware update."
+ else
+ if [ ! -f "$firmware_file_path" ] || ! jq --sort-keys . "$temp_firmware_file" | diff -q - <(jq --sort-keys . "$firmware_file_path"); then
+ echo "Changes detected in firmware list or local file missing. Updating $firmware_file_path."
+ cp "$temp_firmware_file" "$firmware_file_path"
+ else
+ echo "No changes detected in firmware list."
+ fi
+ fi
+
+ - name: Update hardware list
+ run: |
+ hardware_file_path="app/src/main/assets/device_hardware.json"
+ temp_hardware_file="/tmp/new_device_hardware.json"
+
+ echo "Fetching latest device hardware data..."
+ curl -s --fail https://api.meshtastic.org/resource/deviceHardware > "$temp_hardware_file"
+
+ if ! jq empty "$temp_hardware_file" 2>/dev/null; then
+ echo "::error::Hardware API returned invalid JSON data. Skipping hardware update."
+ else
+ if [ ! -f "$hardware_file_path" ] || ! jq --sort-keys . "$temp_hardware_file" | diff -q - <(jq --sort-keys . "$hardware_file_path"); then
+ echo "Changes detected in hardware list or local file missing. Updating $hardware_file_path."
+ cp "$temp_hardware_file" "$hardware_file_path"
+ else
+ echo "No changes detected in hardware list."
+ fi
+ fi
+
+ - name: Sync with Crowdin
+ uses: crowdin/github-action@v2
+ with:
+ base_url: 'https://meshtastic.crowdin.com/api/v2'
+ config: 'crowdin.yml'
+ crowdin_branch_name: 'main'
+ upload_sources: true
+ upload_sources_args: '--preserve-hierarchy'
+ upload_translations: false
+ download_translations: true
+ download_translations_args: '--preserve-hierarchy'
+ create_pull_request: false
+ commit_message: 'chore(l10n): New Crowdin Translations from scheduled update'
+ push_translations: false
+ push_sources: false
+ localization_branch_name: ${{ github.ref_name }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
+ CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
+ CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
+
+ - name: Fix file permissions
+ run: sudo chown -R $USER:$USER .
+
+ - name: Gradle Setup
+ uses: ./.github/actions/gradle-setup
+ with:
+ gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
+ cache_read_only: 'false'
+
+ - name: Update Graphs
+ run: ./gradlew graphUpdate
+ continue-on-error: true
+
+ - name: Create Pull Request if changes occurred
+ uses: peter-evans/create-pull-request@v8
+ with:
+ token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
+ commit-message: |
+ chore: Scheduled updates (Firmware, Hardware, Translations, Graphs)
+
+ Automated updates for:
+ - Firmware releases list
+ - Device hardware list
+ - Crowdin source string uploads
+ - Crowdin translation downloads
+ - Module dependency graphs
+ title: 'chore: Scheduled updates (Firmware, Hardware, Translations, Graphs)'
+ body: |
+ This PR includes automated updates from the scheduled workflow:
+
+ - Updated `firmware_releases.json` from the Meshtastic API (if changed).
+ - Updated `device_hardware.json` from the Meshtastic API (if changed).
+ - Source strings were uploaded to Crowdin.
+ - Latest translations were downloaded from Crowdin (if available).
+ - Updated module dependency graphs in README.md files (if changed).
+
+ Please review the changes.
+ branch: 'scheduled-updates'
+ base: 'main'
+ delete-branch: true
+ add-paths: |
+ app/src/main/assets/firmware_releases.json
+ app/src/main/assets/device_hardware.json
+ fastlane/metadata/android/**
+ **/strings.xml
+ **/README.md
+ labels: |
+ automation
+ l10n
+ firmware
+ hardware
+
+ check-workflow-status:
+ name: Check Workflow Status
+ runs-on: ubuntu-24.04-arm
+ permissions: {}
+ needs:
+ - update_assets
+ if: always()
+ steps:
+ - name: Check Workflow Status
+ if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')"
+ run: |
+ echo "One of the dependent jobs failed or was cancelled. Failing the workflow."
+ exit 1
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 7f2cdf8bd..f1ae45660 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -12,13 +12,15 @@ permissions:
jobs:
stale_issues:
name: Close Stale Issues
- runs-on: ubuntu-latest
+ runs-on: ubuntu-24.04-arm
+ if: github.repository == 'meshtastic/Meshtastic-Android'
steps:
- name: Stale PR+Issues
- uses: actions/stale@v9.1.0
+ uses: actions/stale@v10.2.0
with:
days-before-stale: 30
+ stale-issue-message: This issue has not had any comment or update in the last 30 days. If it is still relevant, please post update comments. If no comments are made, this issue will be closed in 7 days.
exempt-issue-labels: 'has sponsor,needs sponsor,help wanted,backlog,security issue,l10n,dependencies'
exempt-pr-labels: 'has sponsor,needs sponsor,help wanted,backlog,security issue,l10n,dependencies'
- operations-per-run: 1000
+ operations-per-run: 100
diff --git a/.github/workflows/update-firmware-releases-list.yml b/.github/workflows/update-firmware-releases-list.yml
deleted file mode 100644
index d12d09060..000000000
--- a/.github/workflows/update-firmware-releases-list.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: Update Firmware Releases List
-
-on:
- schedule:
- - cron: '0 * * * *' # Run every hour
- workflow_dispatch: # Allow manual triggering
-
-jobs:
- update-hardware-list:
- runs-on: ubuntu-latest
- permissions:
- contents: write
- pull-requests: write
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- node-version: '22'
-
- - name: Fetch latest firmware releases data
- id: fetch-data
- run: |
- # Define variables for file paths
- firmware_releases_json="app/src/main/assets/firmware_releases.json"
- new_firmware_releases_json="/tmp/new_firmware_releases.json"
-
- # Fetch data from API
- curl -s --fail https://api.meshtastic.org/github/firmware/list > "$new_firmware_releases_json"
-
- # Ensure the output is valid JSON
- if ! jq empty "$new_firmware_releases_json" 2>/dev/null; then
- echo "::error::API returned invalid JSON data"
- exit 1
- fi
-
- # Check if "$firmware_releases_json" exists
- if [ -f "$firmware_releases_json" ]; then
- # Format both files for consistent comparison
- jq --sort-keys . "$new_firmware_releases_json" > /tmp/new-formatted.json
- jq --sort-keys . "$firmware_releases_json" > /tmp/existing-formatted.json
-
- # Compare files
- if cmp -s /tmp/new-formatted.json /tmp/existing-formatted.json; then
- echo "No changes detected in hardware list"
- echo "has_changes=false" >> $GITHUB_OUTPUT
- else
- echo "Changes detected in hardware list"
- echo "has_changes=true" >> $GITHUB_OUTPUT
- fi
- else
- echo "firmware_releases.json doesn't exist yet"
- echo "has_changes=true" >> $GITHUB_OUTPUT
- fi
-
- # Copy new data to destination
- cp "$new_firmware_releases_json" "$firmware_releases_json"
-
- - name: Create Pull Request
- if: steps.fetch-data.outputs.has_changes == 'true'
- uses: peter-evans/create-pull-request@v7
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- commit-message: "chore: update firmware releases list from Meshtastic API"
- title: "chore: update firmware releases list from Meshtastic API"
- body: |
- This PR updates the firmware releases list with the latest data from the Meshtastic API.
-
- This PR was automatically generated by the update-hardware-list workflow.
- branch: update-hardware-list
- base: main
- delete-branch: true
diff --git a/.github/workflows/update-hardware-list.yml b/.github/workflows/update-hardware-list.yml
deleted file mode 100644
index cdb3c713c..000000000
--- a/.github/workflows/update-hardware-list.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: Update Hardware List
-
-on:
- schedule:
- - cron: '0 * * * *' # Run every hour
- workflow_dispatch: # Allow manual triggering
-
-jobs:
- update-hardware-list:
- runs-on: ubuntu-latest
- permissions:
- contents: write
- pull-requests: write
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- node-version: '22'
-
- - name: Fetch latest device hardware data
- id: fetch-data
- run: |
- # Define variables for file paths
- device_hardware_json="app/src/main/assets/device_hardware.json"
- new_device_hardware_json="/tmp/new_device_hardware.json"
-
- # Fetch data from API
- curl -s --fail https://api.meshtastic.org/resource/deviceHardware > "$new_device_hardware_json"
-
- # Ensure the output is valid JSON
- if ! jq empty "$new_device_hardware_json" 2>/dev/null; then
- echo "::error::API returned invalid JSON data"
- exit 1
- fi
-
- # Check if "$device_hardware_json" exists
- if [ -f "$device_hardware_json" ]; then
- # Format both files for consistent comparison
- jq --sort-keys . "$new_device_hardware_json" > /tmp/new-formatted.json
- jq --sort-keys . "$device_hardware_json" > /tmp/existing-formatted.json
-
- # Compare files
- if cmp -s /tmp/new-formatted.json /tmp/existing-formatted.json; then
- echo "No changes detected in hardware list"
- echo "has_changes=false" >> $GITHUB_OUTPUT
- else
- echo "Changes detected in hardware list"
- echo "has_changes=true" >> $GITHUB_OUTPUT
- fi
- else
- echo "device_hardware.json doesn't exist yet"
- echo "has_changes=true" >> $GITHUB_OUTPUT
- fi
-
- # Copy new data to destination
- cp "$new_device_hardware_json" "$device_hardware_json"
-
- - name: Create Pull Request
- if: steps.fetch-data.outputs.has_changes == 'true'
- uses: peter-evans/create-pull-request@v7
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- commit-message: "chore: update device hardware list from Meshtastic API"
- title: "chore: update device hardware list from Meshtastic API"
- body: |
- This PR updates the device hardware list with the latest data from the Meshtastic API.
-
- This PR was automatically generated by the update-hardware-list workflow.
- branch: update-hardware-list
- base: main
- delete-branch: true
diff --git a/.gitignore b/.gitignore
index 610cbc7b6..447d8a28e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,12 +10,14 @@
.gradle
/local.properties
.DS_Store
-/build
+**/build/**
/captures
.externalNativeBuild
.cxx
/app/release
/buildSrc/build
+**/debug/**
+**/release/**
# Java KeyStore certificates
*.jks
@@ -26,3 +28,31 @@ keystore.properties
# Kotlin compiler
.kotlin
+
+# VS code
+.vscode/settings.json
+
+# Secrets
+/secrets.properties
+/fastlane/play-store-credentials.json
+**/google-services.json
+
+# Generated library definitions
+**/src/main/resources/aboutlibraries.json
+
+/fastlane/report.xml
+
+/build-logic/convention/build/*
+/build-logic/build/
+
+# Personal build scripts
+build-and-install-android.sh
+wireless-install.sh
+
+# Git worktrees
+.worktrees/
+/firebase-debug.log.jdk/
+firebase-debug.log
+.agent_plans/
+.agent_refs/
+.agent_artifacts/
diff --git a/.gitmodules b/.gitmodules
index 5b0a38e1e..e115fe990 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
-[submodule "app/src/main/proto"]
- path = app/src/main/proto
+[submodule "app proto submodule"]
+ path = core/proto/src/main/proto
url = https://github.com/meshtastic/protobufs.git
-[submodule "design"]
- path = design
- url = https://github.com/meshtastic/design.git
diff --git a/.jdk b/.jdk
new file mode 120000
index 000000000..096e1a9e3
--- /dev/null
+++ b/.jdk
@@ -0,0 +1 @@
+/home/james/.jdks/ms-17.0.18
\ No newline at end of file
diff --git a/.pr5167.diff b/.pr5167.diff
new file mode 100644
index 000000000..d0a809449
--- /dev/null
+++ b/.pr5167.diff
@@ -0,0 +1,295 @@
+diff --git a/core/common/src/commonMain/kotlin/org/meshtastic/core/common/di/ApplicationCoroutineScope.kt b/core/common/src/commonMain/kotlin/org/meshtastic/core/common/di/ApplicationCoroutineScope.kt
+new file mode 100644
+index 0000000000..2a27b96906
+--- /dev/null
++++ b/core/common/src/commonMain/kotlin/org/meshtastic/core/common/di/ApplicationCoroutineScope.kt
+@@ -0,0 +1,39 @@
++/*
++ * Copyright (c) 2026 Meshtastic LLC
++ *
++ * This program is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation, either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see .
++ */
++package org.meshtastic.core.common.di
++
++import kotlinx.coroutines.CoroutineScope
++import kotlinx.coroutines.SupervisorJob
++import org.koin.core.annotation.Single
++import org.meshtastic.core.common.util.ioDispatcher
++
++/**
++ * A process-wide [CoroutineScope] that outlives individual ViewModels and UI components.
++ *
++ * Use this scope for fire-and-forget cleanup work that must continue after a ViewModel's own scope has been cancelled
++ * (for example, deleting temporary files in `onCleared()`). Backed by a [SupervisorJob] so failures in one child do not
++ * cancel siblings, and by [ioDispatcher] so work runs off the main thread.
++ *
++ * Prefer scoping work to a more specific scope (like `viewModelScope`) whenever possible; this scope is an escape hatch
++ * and should be used sparingly.
++ */
++interface ApplicationCoroutineScope : CoroutineScope
++
++@Single(binds = [ApplicationCoroutineScope::class])
++internal class ApplicationCoroutineScopeImpl : ApplicationCoroutineScope {
++ override val coroutineContext = SupervisorJob() + ioDispatcher
++}
+diff --git a/core/ui/src/androidMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt b/core/ui/src/androidMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt
+index 231c84d401..5365ab95e2 100644
+--- a/core/ui/src/androidMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt
++++ b/core/ui/src/androidMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt
+@@ -37,12 +37,12 @@ import androidx.lifecycle.compose.LifecycleEventEffect
+ import co.touchlab.kermit.Logger
+ import com.eygraber.uri.toAndroidUri
+ import com.eygraber.uri.toKmpUri
+-import kotlinx.coroutines.Dispatchers
+ import kotlinx.coroutines.withContext
+ import org.jetbrains.compose.resources.StringResource
+ import org.jetbrains.compose.resources.getString
+ import org.meshtastic.core.common.gpsDisabled
+ import org.meshtastic.core.common.util.CommonUri
++import org.meshtastic.core.common.util.ioDispatcher
+ import java.net.URLEncoder
+
+ @Composable
+@@ -146,7 +146,7 @@ actual fun rememberReadTextFromUri(): suspend (uri: CommonUri, maxChars: Int) ->
+ val context = LocalContext.current
+ return remember(context) {
+ { uri, maxChars ->
+- withContext(Dispatchers.IO) {
++ withContext(ioDispatcher) {
+ @Suppress("TooGenericExceptionCaught")
+ try {
+ val androidUri = uri.toAndroidUri()
+diff --git a/core/ui/src/jvmMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt b/core/ui/src/jvmMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt
+index 031e1fe35d..a938f92ea6 100644
+--- a/core/ui/src/jvmMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt
++++ b/core/ui/src/jvmMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.kt
+@@ -20,10 +20,10 @@ package org.meshtastic.core.ui.util
+
+ import androidx.compose.runtime.Composable
+ import co.touchlab.kermit.Logger
+-import kotlinx.coroutines.Dispatchers
+ import kotlinx.coroutines.withContext
+ import org.jetbrains.compose.resources.StringResource
+ import org.meshtastic.core.common.util.CommonUri
++import org.meshtastic.core.common.util.ioDispatcher
+ import java.awt.Desktop
+ import java.awt.FileDialog
+ import java.awt.Frame
+@@ -89,7 +89,7 @@ actual fun rememberOpenFileLauncher(onUriReceived: (CommonUri?) -> Unit): (mimeT
+ /** JVM — Reads text from a file URI. */
+ @Composable
+ actual fun rememberReadTextFromUri(): suspend (uri: CommonUri, maxChars: Int) -> String? = { uri, maxChars ->
+- withContext(Dispatchers.IO) {
++ withContext(ioDispatcher) {
+ @Suppress("TooGenericExceptionCaught")
+ try {
+ val file = File(URI(uri.toString()))
+diff --git a/feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModel.kt b/feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModel.kt
+index dc1c459716..f8ff9fcac8 100644
+--- a/feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModel.kt
++++ b/feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModel.kt
+@@ -35,6 +35,7 @@ import kotlinx.coroutines.launch
+ import kotlinx.coroutines.withTimeoutOrNull
+ import org.jetbrains.compose.resources.StringResource
+ import org.koin.core.annotation.KoinViewModel
++import org.meshtastic.core.common.di.ApplicationCoroutineScope
+ import org.meshtastic.core.common.util.CommonUri
+ import org.meshtastic.core.common.util.safeCatching
+ import org.meshtastic.core.database.entity.FirmwareRelease
+@@ -91,6 +92,7 @@ class FirmwareUpdateViewModel(
+ private val firmwareUpdateManager: FirmwareUpdateManager,
+ private val usbManager: FirmwareUsbManager,
+ private val fileHandler: FirmwareFileHandler,
++ private val applicationScope: ApplicationCoroutineScope,
+ ) : ViewModel() {
+
+ private val _state = MutableStateFlow(FirmwareUpdateState.Idle)
+@@ -124,12 +126,10 @@ class FirmwareUpdateViewModel(
+
+ override fun onCleared() {
+ super.onCleared()
+- // viewModelScope is already cancelled when onCleared() runs, so launch cleanup in a
+- // standalone scope. SupervisorJob prevents the coroutine from propagating failures to a
+- // shared parent, and NonCancellable on the launch keeps cleanup running even if the scope
+- // is cancelled concurrently.
+- @OptIn(kotlinx.coroutines.DelicateCoroutinesApi::class)
+- kotlinx.coroutines.GlobalScope.launch(NonCancellable) {
++ // viewModelScope is already cancelled when onCleared() runs, so launch cleanup on the
++ // application-wide scope (SupervisorJob + ioDispatcher). NonCancellable keeps cleanup
++ // running even if something tries to cancel it mid-flight.
++ applicationScope.launch(NonCancellable) {
+ tempFirmwareFile = cleanupTemporaryFiles(fileHandler, tempFirmwareFile)
+ }
+ }
+diff --git a/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateIntegrationTest.kt b/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateIntegrationTest.kt
+index 4c48a1ced5..030d84effd 100644
+--- a/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateIntegrationTest.kt
++++ b/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateIntegrationTest.kt
+@@ -108,6 +108,7 @@ class FirmwareUpdateIntegrationTest {
+ firmwareUpdateManager,
+ usbManager,
+ fileHandler,
++ TestApplicationCoroutineScope(testDispatcher),
+ )
+
+ @Test
+diff --git a/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelTest.kt b/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelTest.kt
+index 7032ed4088..a8eddff838 100644
+--- a/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelTest.kt
++++ b/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelTest.kt
+@@ -124,6 +124,7 @@ class FirmwareUpdateViewModelTest {
+ firmwareUpdateManager,
+ usbManager,
+ fileHandler,
++ TestApplicationCoroutineScope(testDispatcher),
+ )
+
+ @Test
+diff --git a/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/TestApplicationCoroutineScope.kt b/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/TestApplicationCoroutineScope.kt
+new file mode 100644
+index 0000000000..3ef5c44ef4
+--- /dev/null
++++ b/feature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/TestApplicationCoroutineScope.kt
+@@ -0,0 +1,26 @@
++/*
++ * Copyright (c) 2026 Meshtastic LLC
++ *
++ * This program is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation, either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see .
++ */
++package org.meshtastic.feature.firmware
++
++import kotlinx.coroutines.CoroutineDispatcher
++import kotlinx.coroutines.CoroutineScope
++import kotlinx.coroutines.SupervisorJob
++import org.meshtastic.core.common.di.ApplicationCoroutineScope
++
++internal class TestApplicationCoroutineScope(dispatcher: CoroutineDispatcher) :
++ ApplicationCoroutineScope,
++ CoroutineScope by CoroutineScope(SupervisorJob() + dispatcher)
+diff --git a/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelFileTest.kt b/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelFileTest.kt
+index acb1545bdd..23a0d03ab2 100644
+--- a/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelFileTest.kt
++++ b/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/FirmwareUpdateViewModelFileTest.kt
+@@ -116,6 +116,7 @@ class FirmwareUpdateViewModelFileTest {
+ firmwareUpdateManager,
+ usbManager,
+ fileHandler,
++ TestApplicationCoroutineScope(testDispatcher),
+ )
+
+ // -----------------------------------------------------------------------
+diff --git a/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt b/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt
+index c251b4d5ef..315ad1da85 100644
+--- a/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt
++++ b/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt
+@@ -27,6 +27,7 @@ import co.touchlab.kermit.Logger
+ import kotlinx.coroutines.Dispatchers
+ import kotlinx.coroutines.launch
+ import kotlinx.coroutines.withContext
++import org.meshtastic.core.common.util.ioDispatcher
+ import org.meshtastic.core.resources.Res
+ import org.meshtastic.core.resources.debug_export_failed
+ import org.meshtastic.core.resources.debug_export_success
+@@ -48,7 +49,7 @@ actual fun rememberLogExporter(logsProvider: suspend () -> List) =
+- withContext(Dispatchers.IO) {
++ withContext(ioDispatcher) {
+ try {
+ if (logs.isEmpty()) {
+ withContext(Dispatchers.Main) { context.showToast(Res.string.debug_export_failed, "No logs to export") }
+diff --git a/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/tak/PrefExporter.kt b/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/tak/PrefExporter.kt
+index 9afde85e5f..a28a576788 100644
+--- a/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/tak/PrefExporter.kt
++++ b/feature/settings/src/androidMain/kotlin/org/meshtastic/feature/settings/tak/PrefExporter.kt
+@@ -24,9 +24,9 @@ import androidx.compose.runtime.Composable
+ import androidx.compose.runtime.rememberCoroutineScope
+ import androidx.compose.ui.platform.LocalContext
+ import co.touchlab.kermit.Logger
+-import kotlinx.coroutines.Dispatchers
+ import kotlinx.coroutines.launch
+ import kotlinx.coroutines.withContext
++import org.meshtastic.core.common.util.ioDispatcher
+
+ @Composable
+ actual fun rememberDataPackageExporter(dataPackageProvider: suspend () -> ByteArray): (fileName: String) -> Unit {
+@@ -41,7 +41,7 @@ actual fun rememberDataPackageExporter(dataPackageProvider: suspend () -> ByteAr
+ return { fileName -> exportLauncher.launch(fileName) }
+ }
+
+-private suspend fun exportZipToUri(context: Context, targetUri: Uri, data: ByteArray) = withContext(Dispatchers.IO) {
++private suspend fun exportZipToUri(context: Context, targetUri: Uri, data: ByteArray) = withContext(ioDispatcher) {
+ try {
+ context.contentResolver.openOutputStream(targetUri)?.use { os -> os.write(data) }
+ Logger.i { "TAK data package exported successfully to $targetUri" }
+diff --git a/feature/settings/src/jvmMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt b/feature/settings/src/jvmMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt
+index 5b63cc90a3..a9a7285593 100644
+--- a/feature/settings/src/jvmMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt
++++ b/feature/settings/src/jvmMain/kotlin/org/meshtastic/feature/settings/debugging/LogExporter.kt
+@@ -19,9 +19,9 @@ package org.meshtastic.feature.settings.debugging
+ import androidx.compose.runtime.Composable
+ import androidx.compose.runtime.rememberCoroutineScope
+ import co.touchlab.kermit.Logger
+-import kotlinx.coroutines.Dispatchers
+ import kotlinx.coroutines.launch
+ import kotlinx.coroutines.withContext
++import org.meshtastic.core.common.util.ioDispatcher
+ import java.awt.FileDialog
+ import java.awt.Frame
+ import java.io.File
+@@ -41,7 +41,7 @@ actual fun rememberLogExporter(logsProvider: suspend () -> List ByteAr
+ if (directory != null && file != null) {
+ val targetFile = File(directory, file)
+ val data = dataPackageProvider()
+- withContext(Dispatchers.IO) { targetFile.writeBytes(data) }
++ withContext(ioDispatcher) { targetFile.writeBytes(data) }
+ Logger.i { "TAK data package exported successfully to ${targetFile.absolutePath}" }
+ }
+ }
diff --git a/.ruby-version b/.ruby-version
new file mode 100644
index 000000000..7bcbb3808
--- /dev/null
+++ b/.ruby-version
@@ -0,0 +1 @@
+3.4.9
diff --git a/.run/Pre-Commit [spotlessApply detekt].run.xml b/.run/Pre-Commit [spotlessApply detekt].run.xml
new file mode 100644
index 000000000..e5dd9e926
--- /dev/null
+++ b/.run/Pre-Commit [spotlessApply detekt].run.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+
+ false
+ false
+
+ false
+ false
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/.skills/code-review/SKILL.md b/.skills/code-review/SKILL.md
new file mode 100644
index 000000000..acab253d5
--- /dev/null
+++ b/.skills/code-review/SKILL.md
@@ -0,0 +1,66 @@
+# Skill: Code Review
+
+## Description
+Perform comprehensive code reviews for `Meshtastic-Android`, ensuring changes adhere to KMP architecture, Kotlin Multiplatform conventions, MAD standards, and CMP best practices.
+
+## Code Review Checklist
+
+When reviewing code, meticulously verify the following categories. Flag any deviations and propose the canonical project pattern as a fix.
+
+### 1. KMP Architecture & Source Set Boundaries
+- [ ] **No Platform Bleed:** Ensure absolutely no `java.*` or `android.*` imports exist in `commonMain` source sets.
+- [ ] **KMP Native Alternatives:** Verify the use of KMP alternatives for standard JVM libraries:
+ - `java.util.concurrent.locks.*` -> `kotlinx.coroutines.sync.Mutex`
+ - `java.util.concurrent.ConcurrentHashMap` -> `atomicfu` or Mutex-guarded `mutableMapOf()`
+ - `java.io.*` -> `Okio` (`BufferedSource`/`BufferedSink`)
+ - `java.util.Locale` -> Kotlin `uppercase()`/`lowercase()` (purged from `commonMain`)
+- [ ] **Coroutine Safety:** Use `safeCatching {}` from `core:common` instead of `runCatching {}` in coroutine/suspend contexts. `runCatching` silently swallows `CancellationException`, breaking structured concurrency. Keep `runCatching` only in cleanup/teardown code (abort, close, eviction). Use `kotlinx.coroutines.CancellationException` (not `kotlin.coroutines.cancellation.CancellationException`).
+- [ ] **Shared Helpers:** If `androidMain` and `jvmMain` contain identical pure-Kotlin logic, mandate extracting it to a shared function in `commonMain`.
+- [ ] **File Naming Conflicts:** For `expect`/`actual` declarations, ensure files sharing the same package namespace have distinct names (e.g., keep `expect` in `LogExporter.kt` and shared helpers in `LogFormatter.kt`) to avoid duplicate class errors on the JVM target.
+- [ ] **Interface & DI Over `expect`/`actual`:** Check that `expect`/`actual` is reserved for small platform primitives. Interfaces + DI should be preferred for larger capabilities.
+
+### 2. UI & Compose Multiplatform (CMP)
+- [ ] **Compose Multiplatform Resources:** Ensure NO hardcoded strings. Must use `core:resources` (e.g., `stringResource(Res.string.key)` or asynchronous `getStringSuspend(Res.string.key)` for ViewModels/Coroutines). NEVER use blocking `getString()` in a coroutine.
+- [ ] **String Formatting:** CMP only supports `%N$s` and `%N$d`. Flag any float formats (`%N$.1f`) in Compose string resources; they must be pre-formatted using `NumberFormatter.format()` from `core:common`. Use `MetricFormatter` for metric-specific displays (temperature, voltage, current, percent, humidity, pressure, SNR, RSSI).
+- [ ] **Centralized Dialogs & Alerts:** Flag inline alert-rendering logic. Mandate the use of `AlertHost(alertManager)` or `SharedDialogs` from `core:ui/commonMain`.
+- [ ] **Placeholders:** Require `PlaceholderScreen(name)` from `core:ui/commonMain` for unimplemented desktop/JVM features. No inline placeholders in feature modules.
+- [ ] **Adaptive Layouts:** Verify use of `currentWindowAdaptiveInfo(supportLargeAndXLargeWidth = true)` to support desktop/tablet breakpoints (≥ 1200dp).
+
+### 3. Navigation & State
+- [ ] **Shared Navigation Graphs:** Feature navigation graphs must be defined as extension functions on `EntryProviderScope` in `commonMain` (e.g., `fun EntryProviderScope.settingsGraph(...)`). Flag any graphs defined in platform-specific source sets.
+- [ ] **Navigation Host:** Ensure `MeshtasticNavDisplay` (from `core:ui/commonMain`) is used as the host instead of invoking `NavDisplay` directly. Host modules should not configure `entryDecorators` themselves.
+- [ ] **ViewModel Scoping:** ViewModels obtained via `koinViewModel()` must be inside `entry` blocks to correctly tie to the backstack lifetime.
+
+### 4. Dependency Injection (Koin Annotations)
+- [ ] **Annotation Usage:** Ensure Koin is configured via annotations (`@Single`, `@Factory`, `@KoinViewModel`).
+- [ ] **Root Assembly:** Confirm that the root Koin DI graph is only assembled in host shells (`app` and `desktop`).
+
+### 5. Networking, DB & I/O
+- [ ] **Ktor Strictly:** Check that Ktor is used for all HTTP networking. Flag and reject any usage of OkHttp.
+- [ ] **HTTP Configuration:** Verify timeouts and base URLs use `HttpClientDefaults` from `core:network`. Never hardcode timeouts in feature modules. `DefaultRequest` sets the base URL; feature API services use relative paths.
+- [ ] **Image Loading (Coil):** Coil must use `coil-network-ktor3` in host modules. Feature modules should ONLY depend on `libs.coil` (coil-compose) and never configure fetchers.
+- [ ] **Room KMP:** Ensure `factory = { MeshtasticDatabaseConstructor.initialize() }` is used in `Room.databaseBuilder`. DAOs and Entities must reside in `commonMain`.
+- [ ] **Room Patterns:** Verify use of `@Upsert` for insert-or-update logic. Check for `LIMIT 1` on single-row queries. Flag N+1 query patterns (loops calling single-row queries) — batch with chunked `WHERE IN` instead.
+- [ ] **Bluetooth (BLE):** All Bluetooth communication must be routed through `core:ble` using Kable abstractions.
+
+### 6. Dependency Catalog Aliases
+- [ ] **JetBrains vs. AndroidX:**
+ - In `commonMain`: Must use `jetbrains-*` aliases (e.g., `jetbrains-lifecycle-*`, `jetbrains-navigation3-ui`).
+ - In `androidMain`: Can use `androidx-*` or `jetbrains-*` as appropriate, but do not mix them up in `commonMain`.
+- [ ] **Compose Multiplatform:** Ensure `compose-multiplatform-*` aliases are used instead of plain `androidx.compose` in all KMP modules.
+
+### 7. Testing
+- [ ] **Test Placement:** New Compose UI tests must go in `commonTest` using `runComposeUiTest {}` from `androidx.compose.ui.test.v2` (not the deprecated v1 `androidx.compose.ui.test` package) + `kotlin.test.Test`. Do not add `androidTest` (instrumented) tests.
+- [ ] **Shared Test Utilities:** Test fakes, doubles, and utilities should be placed in `core:testing`.
+- [ ] **Libraries:** Verify usage of `Turbine` for Flow testing, `Kotest` for property-based testing, and `Mokkery` for mocking.
+- [ ] **Robolectric Configuration:** Check that Compose UI tests running via Robolectric on JVM are pinned to `@Config(sdk = [34])` to prevent Java 21 / SDK 35 compatibility issues.
+
+### 8. ProGuard / R8 Rules
+- [ ] **New Dependencies:** If a new reflection-heavy dependency is added (DI, serialization, JNI, ServiceLoader), verify keep rules exist in **both** `app/proguard-rules.pro` (R8) and `desktop/proguard-rules.pro` (ProGuard). The two files must stay aligned.
+- [ ] **Release Smoke-Test:** For dependency or ProGuard rule changes, verify `assembleRelease` and `./gradlew :desktop:runRelease` succeed.
+
+## Review Output Guidelines
+1. **Be Specific & Constructive:** Provide exact file references and code snippets illustrating the required project pattern.
+2. **Reference the Docs:** Cite `AGENTS.md` and project architecture playbooks to justify change requests (e.g., "Per AGENTS.md, `java.io.*` cannot be used in `commonMain`; please migrate to Okio").
+3. **Enforce Build Health:** Remind authors to run `./gradlew test allTests` locally to verify changes, especially since KMP `test` tasks are ambiguous.
+4. **Praise Good Patterns:** Acknowledge correct usage of complex architecture requirements, like proper Navigation 3 scene transitions or elegant `commonMain` helper extractions.
diff --git a/.skills/compose-ui/SKILL.md b/.skills/compose-ui/SKILL.md
new file mode 100644
index 000000000..22fe1b489
--- /dev/null
+++ b/.skills/compose-ui/SKILL.md
@@ -0,0 +1,61 @@
+# Skill: Compose Multiplatform (CMP) UI
+
+## Description
+Guidelines for building shared UI, adaptive layouts, and handling strings/resources in Meshtastic-Android. The codebase uses Material 3 Adaptive.
+
+## 1. UI Components & Layouts
+- **Material 3 / Adaptive:** Use `currentWindowAdaptiveInfo(supportLargeAndXLargeWidth = true)` to support Large (1200dp) and XL (1600dp) breakpoints. Investigate 3-pane "Power User" scenes using Navigation 3 Scenes and draggable dividers for desktop/tablets.
+- **Dialogs & Alerts:** Use centralized components like `AlertHost(alertManager)` from `core:ui/commonMain`. Do NOT trigger alerts inline or duplicate alert logic. Use `SharedDialogs(uiViewModel)` for general popups.
+- **Placeholders:** Use `PlaceholderScreen(name)` from `core:ui/commonMain` for unimplemented desktop/JVM features.
+- **Theme Picker:** Use `ThemePickerDialog` from `feature:settings/commonMain`.
+- **Platform Implementations:** Inject platform-specific behavior (e.g., Map providers) via `CompositionLocal` from the `app` or `desktop` shells. Do not tightly couple Google Maps/osmdroid dependencies to `commonMain`.
+
+## 2. Strings & Resources
+- **Multiplatform Resources:** MUST use `core:resources` (e.g., `stringResource(Res.string.your_key)`). Never use hardcoded strings.
+- **ViewModels/Coroutines:** Use the asynchronous `getStringSuspend(Res.string.your_key)`. NEVER use blocking `getString()` in a coroutine context.
+- **Formatting Constraints:** CMP `stringResource` only supports `%N$s` (string) and `%N$d` (integer).
+ - **No Float formatting:** Formats like `%N$.1f` pass through unsubstituted. Pre-format in Kotlin using `NumberFormatter.format(value, decimalPlaces)` from `core:common` and pass as a string argument (`%N$s`):
+ ```kotlin
+ val formatted = NumberFormatter.format(batteryLevel, 1) // "73.5"
+ stringResource(Res.string.battery_percent, formatted) // uses %1$s
+ ```
+ - **Percent Literals:** Use bare `%` (not `%%`) for literal percent signs in CMP-consumed strings.
+
+### String Formatting Decision Tree
+Choose the right tool for the job:
+
+| Scenario | Tool | Example |
+|----------|------|---------|
+| **Metric display** (temp, voltage, %, signal) | `MetricFormatter.*` | `MetricFormatter.temperature(25.0f, isFahrenheit)` → `"77.0°F"` |
+| **Simple number + unit** | `NumberFormatter` + interpolation | `"${NumberFormatter.format(val, 1)} dB"` |
+| **Localized template from strings.xml** | `stringResource(Res.string.key, preFormattedArgs)` | `stringResource(Res.string.battery, formatted)` |
+| **Non-composable template** (notifications, plain functions) | `formatString(template, args)` | `formatString(template, label, value)` |
+| **Hex formatting** | `formatString` | `formatString("!%08x", nodeNum)` |
+| **Date/time** | `DateFormatter` | `DateFormatter.format(instant)` |
+
+**Rules:**
+1. **NEVER use `%.Nf` in strings.xml** — CMP cannot substitute them. Use `%N$s` and pre-format floats.
+2. **Prefer `MetricFormatter`** over scattered `formatString("%.1f°C", temp)` calls.
+3. **`formatString` (pure Kotlin)** is a pure-Kotlin `commonMain` implementation for: hex formats, multi-arg templates fetched at runtime, and chart axis formatters. Located in `core:common` `Formatter.kt`.
+4. **`NumberFormatter`** always uses `.` as decimal separator — intentional for mesh networking precision.
+
+- **Workflow to Add a String:**
+ 1. Add to `core/resources/src/commonMain/composeResources/values/strings.xml`.
+ 2. Use the generated `org.meshtastic.core.resources.` symbol.
+ 3. Validate UI presentation.
+
+## 3. Tooling & Capabilities
+- **Image Loading:** Use `libs.coil` (Coil Compose) in feature modules. Configuration/Networking for Coil (`coil-network-ktor3`) happens strictly in the `app` and `desktop` host modules.
+- **QR Codes:** Use `rememberQrCodePainter` from `core:ui/commonMain` powered by `qrcode-kotlin`. No ZXing or Android Bitmap APIs in shared code.
+
+## 4. Compose Previews
+- **Preview in commonMain:** CMP 1.11+ supports `@Preview` in `commonMain` via `compose-multiplatform-ui-tooling-preview`. Place preview functions alongside their composables.
+- **Import:** Use `androidx.compose.ui.tooling.preview.Preview`. The JetBrains-prefixed import (`org.jetbrains.compose.ui.tooling.preview.Preview`) is deprecated.
+
+## 5. Dialog & State Patterns
+- **Dialog State Preservation:** Use `rememberSaveable` for dialog state (search queries, selected tabs, expanded flags) to preserve across configuration changes. Boolean and String types are auto-saveable — no custom `Saver` needed.
+
+## Reference Anchors
+- **Shared Strings:** `core/resources/src/commonMain/composeResources/values/strings.xml`
+- **Platform abstraction contract:** `core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/util/MapViewProvider.kt`
+- **Provider wiring:** `app/src/main/kotlin/org/meshtastic/app/MainActivity.kt`
diff --git a/.skills/implement-feature/SKILL.md b/.skills/implement-feature/SKILL.md
new file mode 100644
index 000000000..0277bee10
--- /dev/null
+++ b/.skills/implement-feature/SKILL.md
@@ -0,0 +1,41 @@
+# Skill: Implement a Feature
+
+## Description
+A step-by-step workflow for implementing a new feature in the Meshtastic-Android codebase, ensuring KMP compatibility and proper architecture.
+
+## Workflow
+
+### 1. Update Dependencies & Aliases
+- Check `gradle/libs.versions.toml` before adding libraries.
+- Use `jetbrains-*` aliases for lifecycle/navigation/adaptive dependencies in `commonMain`.
+- Use `compose-multiplatform-*` aliases for CMP dependencies.
+
+### 2. Define the State & ViewModels
+- Follow MVI/UDF patterns.
+- Extend shared ViewModel logic in `feature//src/commonMain/kotlin/org/meshtastic/feature//ViewModel.kt`.
+- Use `stateInWhileSubscribed` (from `core:ui`) for sharing state flows.
+- Keep the ViewModel free of Android framework dependencies.
+
+### 3. Build the UI
+- Use Jetpack Compose Multiplatform (CMP).
+- Define strings in `core:resources` (see the `compose-ui` skill).
+- Support adaptive layouts (Large/XL breakpoints).
+
+### 4. Wire Navigation & DI
+- Define typed route objects in `core:navigation`.
+- Export the navigation graph as an extension function on `EntryProviderScope` in `commonMain` (e.g., `fun EntryProviderScope.myFeatureGraph()`).
+- Add the required DI bindings via Koin Annotations (`@Factory`, `@Single`, `@KoinViewModel`) in `commonMain`.
+- **CRITICAL:** Ensure the module is registered in the app root graphs (`AppKoinModule.kt`, `DesktopKoinModule.kt`) and the navigation is injected into the root entry provider in the host shell.
+
+### 5. Validate Platform Separation
+- If you need a platform-specific API (like camera or specific mapping SDK), define an interface in `commonMain`, implement it in the host shell, and inject it via `CompositionLocal` or Koin.
+
+### 6. Verify Locally
+- Run the baseline checks (see `testing-ci` skill):
+ ```bash
+ ./gradlew spotlessCheck spotlessApply detekt assembleDebug test allTests
+ ```
+- If the feature adds a new reflection-heavy dependency, add keep rules to **both** `app/proguard-rules.pro` and `desktop/proguard-rules.pro`, then verify release builds:
+ ```bash
+ ./gradlew assembleFdroidRelease :desktop:runRelease
+ ```
diff --git a/.skills/kmp-architecture/SKILL.md b/.skills/kmp-architecture/SKILL.md
new file mode 100644
index 000000000..46602c430
--- /dev/null
+++ b/.skills/kmp-architecture/SKILL.md
@@ -0,0 +1,61 @@
+# Skill: KMP Architecture & Source-Set Bridging
+
+## Description
+Guidelines on managing Kotlin Multiplatform (KMP) source-sets, expected abstractions, networking, database, and platform integration rules.
+
+## 1. Source-Set Boundaries
+- **`commonMain`:** All business logic, DB entities, API network logic, ViewModels, and UI rendering. NO `java.*` or `android.*` imports.
+- **`androidMain`:** Android framework integration (`Context`, system services, NFC hardware, BLE Android bindings).
+- **`jvmMain` / `jvmAndroidMain`:** Shared JVM code between Android and Desktop. Uses the `meshtastic.kmp.jvm.android` convention plugin to bridge `jvm` and `android` source sets without manual `dependsOn` hacks.
+- **`app` / `desktop`:** Host shells. Responsible for Koin DI root wiring, `MainKoinModule`, host-level UI themes, and running the `MeshtasticNavDisplay`.
+
+## 2. Bridging Strategies
+- **Interface + DI (Preferred):** Expose an interface in `core:repository` or `core:ui` (e.g. `LocationRepository`, `MapViewProvider`), implement it in `androidMain` or the host `app`, and bind it via Koin or `CompositionLocal`.
+- **`expect`/`actual` (Restricted):** Use only when a platform API cannot be abstracted cleanly (e.g. low-level File I/O mappings, `uppercase()` Locale helpers). Avoid deep class hierarchies using `expect`/`actual`.
+ - **Naming:** Keep `expect` in `FileIo.kt`, but put shared helpers in `FileIoUtils.kt` to prevent JVM duplicate class errors.
+- **Shared Helpers:** Do not duplicate pure Kotlin logic between `androidMain` and `jvmMain`. Extract to a `commonMain` helper.
+
+## 3. Core Libraries & Constraints
+- **Concurrency:** `kotlinx.coroutines`. Use `org.meshtastic.core.common.util.ioDispatcher` over `Dispatchers.IO` directly. Inject `CoroutineDispatchers` from `core:di` into classes that need dispatchers — never reference `Dispatchers.IO`/`Main`/`Default` directly in business logic.
+- **Error Handling:** Use `safeCatching {}` from `core:common` instead of `runCatching {}` in coroutine/suspend contexts. `runCatching` swallows `CancellationException`, breaking structured concurrency. Keep `runCatching` only in cleanup/teardown code (abort, close, eviction loops).
+- **Standard Library Replacements:**
+ - `ConcurrentHashMap` -> `atomicfu` or Mutex-guarded `mutableMapOf()`.
+ - `java.util.concurrent.locks.*` -> `kotlinx.coroutines.sync.Mutex`.
+ - `java.io.*` -> `Okio` (`BufferedSource`/`BufferedSink`).
+- **Networking:** Pure **Ktor**. No OkHttp. Ktor `Logging` plugin for debugging.
+- **HTTP Configuration:** Use `HttpClientDefaults` from `core:network` for shared base URL (`API_BASE_URL`), timeouts, and retry constants. Both Android (`NetworkModule`) and Desktop (`DesktopKoinModule`) HttpClient instances must use these. Feature API services use relative paths; `DefaultRequest` sets the base URL.
+- **BLE:** Route through `core:ble` using **Kable**.
+- **Room KMP:** Use `factory = { MeshtasticDatabaseConstructor.initialize() }` in `Room.databaseBuilder`.
+
+## 4. Hierarchy & Source-Set Conventions
+- **Hierarchy template first:** Prefer Kotlin's default hierarchy template and convention plugins over manual `dependsOn(...)` graphs. Manual source-set wiring should be reserved for cases the template cannot model.
+- **`expect`/`actual` restraint:** Prefer interfaces + DI for platform capabilities; use `expect`/`actual` for small unavoidable platform primitives. Avoid broad expect/actual class hierarchies when an interface-based boundary is sufficient.
+- **Shared helpers over duplicated lambdas:** When `androidMain` and `jvmMain` contain identical pure-Kotlin logic (formatting, action dispatch, validation), extract to `commonMain`. Examples: `formatLogsTo()`, `handleNodeAction()`, `findNodeByNameSuffix()`, `MeshtasticAppShell`, `BaseRadioTransportFactory`.
+
+## 5. Dependency Catalog Aliases
+- **JetBrains fork aliases:** Version catalog aliases for JetBrains-forked AndroidX artifacts use the `jetbrains-*` prefix (e.g., `jetbrains-lifecycle-runtime-compose`, `jetbrains-navigation3-ui`). Plain `androidx-*` aliases are true Google AndroidX artifacts. Never mix them up in `commonMain`.
+- **Compose Multiplatform:** Version catalog aliases for Compose Multiplatform artifacts use the `compose-multiplatform-*` prefix (e.g., `compose-multiplatform-material3`, `compose-multiplatform-foundation`). Never use plain `androidx.compose` dependencies in `commonMain`.
+- **Dependencies:** Always check `gradle/libs.versions.toml` before assuming a library is available.
+
+## 6. I/O & Serialization
+- **Okio standard:** This project standardizes on Okio (`BufferedSource`/`BufferedSink`). JetBrains recommends `kotlinx-io` (built on Okio), but this project has not migrated. Do not introduce `kotlinx-io` without an explicit decision.
+- **Room KMP:** Always use `factory = { MeshtasticDatabaseConstructor.initialize() }` in `Room.databaseBuilder` and `inMemoryDatabaseBuilder`. DAOs and Entities reside in `commonMain`.
+- **Room Patterns:**
+ - Use `@Upsert` for insert-or-update operations instead of manual `INSERT OR IGNORE` + `UPDATE` logic.
+ - Use `LIMIT 1` on `@Query` methods that expect a single row.
+ - Prevent N+1 queries: batch operations with `@Upsert fun putAll(items: List)` or chunked `WHERE IN` queries (chunk size ≤ 999 to respect SQLite bind parameter limit).
+
+## 7. Build-Logic Conventions
+- In `build-logic/convention`, prefer lazy Gradle configuration (`configureEach`, `withPlugin`, provider APIs). Avoid `afterEvaluate` in convention plugins unless there is no viable lazy alternative.
+
+## 8. Onboarding a New Target (Desktop/iOS)
+1. Ensure all new logic compiles against the KMP core (`jvm()`, `iosArm64()`, etc.).
+2. Do not use platform-specific constructs in `commonMain` or you break the iOS/Desktop builds.
+3. Test using `kmpSmokeCompile` to verify cross-platform compilation.
+4. For desktop wiring, copy the pattern in `desktop/src/main/kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt` and use `NoopStubs.kt` to temporarily mock missing platform implementations.
+
+## Reference Anchors
+- **Shared Okio I/O:** `core/domain/src/commonMain/kotlin/org/meshtastic/core/domain/usecase/settings/ImportProfileUseCase.kt`
+- **Desktop DI Stubs:** `desktop/src/main/kotlin/org/meshtastic/desktop/stub/NoopStubs.kt`
+- **Version Catalog:** `gradle/libs.versions.toml`
+- **Convention Plugins:** `build-logic/convention/`
diff --git a/.skills/navigation-and-di/SKILL.md b/.skills/navigation-and-di/SKILL.md
new file mode 100644
index 000000000..c9d7336a6
--- /dev/null
+++ b/.skills/navigation-and-di/SKILL.md
@@ -0,0 +1,56 @@
+# Skill: DI and Navigation 3 Architecture
+
+## Description
+This skill covers dependency injection (Koin Annotations 4.2.x) and JetBrains Navigation 3 (1.1.x) architecture, constraints, and anti-patterns within the Meshtastic-Android KMP codebase.
+
+## Dependency Injection (Koin)
+
+### Guidelines
+1. **Annotations First:** Use `@Module`, `@ComponentScan`, and `@KoinViewModel` annotations directly in `commonMain` shared modules to encapsulate dependency graphs per feature.
+2. **App Root Assembly:** Don't assume feature/core `@Module` classes are active automatically. Ensure they are included by the app root module (`@Module(includes = [...])`) in `app/src/main/kotlin/org/meshtastic/app/di/AppKoinModule.kt` and `desktop/.../DesktopKoinModule.kt`.
+3. **No Platform Bleed:** Don't put Android framework dependencies (`Context`, `Activity`, `Application`) into shared `commonMain` business logic. Inject interfaces instead.
+4. **Resolution:** Resolve app-layer wrappers via `koinViewModel()` or injected bindings within Compose navigation graphs.
+
+### Anti-Patterns
+- **A1 Module Compile Safety:** Do **not** enable `compileSafety`. It is a single boolean that enables A1 per-module checks — there is no separate A3 full-graph mode. Runtime graph verification is handled by `KoinVerificationTest` and `DesktopKoinTest` instead.
+- **Default Parameters:** Do **not** expect Koin to inject default parameters automatically. The K2 plugin's `skipDefaultValues = true` behavior skips parameters with default Kotlin values.
+
+### Koin Startup Pattern (K2 Compiler Plugin)
+The project uses the **K2 Compiler Plugin** (`koin-compiler-plugin`, not KSP). The canonical startup uses the plugin's typed `startKoin()` stub, which the plugin transforms at compile time via IR:
+```kotlin
+// Bootstrap class — separate from @Module, references the root module graph
+@KoinApplication(modules = [AppKoinModule::class])
+object AndroidKoinApp
+
+// In Application.onCreate()
+startKoin {
+ androidContext(this@MeshUtilApplication)
+ workManagerFactory()
+}
+```
+- `@KoinApplication` goes on a **dedicated bootstrap object**, not on a `@Module` class.
+- `startKoin()` (from `org.koin.plugin.module.dsl`) is a compiler plugin stub — if the plugin isn't applied, it throws `NotImplementedError`.
+- `stopKoin()` uses the standard runtime API (`org.koin.core.context.stopKoin`).
+- `compileSafety` must stay **disabled** — it enables A1 per-module checks that break our inverted-dependency architecture. There is no separate A3 full-graph flag.
+
+## Navigation 3
+
+### Guidelines
+1. **Types:** Use Navigation 3 types consistently (`NavKey`, `NavBackStack`, `EntryProviderScope`).
+2. **Typed Routes:** Keep route definitions in `core:navigation/src/commonMain/.../Routes.kt` as `@Serializable sealed interface` hierarchies. Don't use ad-hoc strings.
+3. **Graph Assembly:** Define feature navigation graphs as extension functions on `EntryProviderScope` in `commonMain` (e.g., `fun EntryProviderScope.settingsGraph(backStack)`).
+4. **Host Integration:** Use `MeshtasticNavDisplay` (from `core:ui/commonMain`) as the Navigation 3 host. Do not configure decorators manually inside feature modules.
+5. **Back Handlers:** Use `NavigationBackHandler` from `androidx.navigationevent:navigationevent-compose` for back gestures in multiplatform code. Do not use Android's `BackHandler`.
+6. **Deep Links:** Use `DeepLinkRouter.route()` in `core:navigation` to synthesize typed backstacks from RESTful paths.
+
+### Anti-Patterns
+- **Single Backstack for Multiple Tabs:** Do **not** use a single `NavBackStack` list for multiple tabs. Use `MultiBackstack` (from `core:navigation`).
+- **Decorator Reuse Across Tabs:** Do **not** reuse the same `NavEntryDecorator` instances across different backstacks. When rendering an active tab in `MeshtasticNavDisplay`, you **must** supply a fresh set of decorators (using `remember(backStack) { ... }`) bound to the active backstack instance to prevent permanent `ViewModelStore` destruction.
+- **Custom Backstack Mutation:** Do **not** mutate back navigation with custom stacks disconnected from the app backstack. Mutate `NavBackStack` directly with `add(...)` and `removeLastOrNull()`.
+
+## Reference Anchors
+- **App Startup / Koin Bootstrap:** `app/src/main/kotlin/org/meshtastic/app/MeshUtilApplication.kt`
+- **DI Bootstrap Object:** `app/src/main/kotlin/org/meshtastic/app/di/AndroidKoinApp.kt`
+- **DI App Wiring:** `app/src/main/kotlin/org/meshtastic/app/di/AppKoinModule.kt`
+- **Shared Routes:** `core/navigation/src/commonMain/kotlin/org/meshtastic/core/navigation/Routes.kt`
+- **Desktop Nav Shell:** `desktop/src/main/kotlin/org/meshtastic/desktop/ui/DesktopMainScreen.kt`
diff --git a/.skills/new-branch/SKILL.md b/.skills/new-branch/SKILL.md
new file mode 100644
index 000000000..d63f3f4c2
--- /dev/null
+++ b/.skills/new-branch/SKILL.md
@@ -0,0 +1,79 @@
+# Skill: New Branch Bootstrap
+
+## Description
+Canonical recipe for spinning up a fresh working branch off the latest upstream `main`. Use this skill
+whenever the user says things like *"make a new branch off fetched origin/main"*, *"peel off a fresh
+branch"*, *"dust off #NNNN"*, or otherwise signals the start of a new unit of work.
+
+This replaces the ad-hoc prose that used to be retyped at the start of every session.
+
+## When to Use
+- Starting any new feature, fix, chore, or refactor.
+- Rebasing a stale PR onto current `main` (see [Rebase variant](#rebase-variant)).
+- Reproducing a CI failure from a clean baseline.
+
+## Preconditions (verify before branching)
+1. **Clean worktree.** If `git status --porcelain` is non-empty, ask the user before proceeding.
+2. **Upstream remote present.** `git remote -v` must list `upstream` pointing at
+ `meshtastic/Meshtastic-Android`. If only `origin` exists on a fork, treat `origin` as upstream.
+3. **Submodules initialised.** `core/proto/src/main/proto` must be populated — see AGENTS.md
+ workspace bootstrap rules.
+4. **Secrets bootstrapped.** If `local.properties` is missing, copy `secrets.defaults.properties`
+ (required for `google` flavor builds).
+
+## Standard Recipe
+
+```bash
+# 1. Fetch latest upstream
+git fetch upstream --prune --tags
+
+# 2. Create the branch from upstream/main (never from a local stale main)
+git switch -c upstream/main
+
+# 3. Ensure submodules track the new base
+git submodule update --init --recursive
+
+# 4. Sanity check
+git --no-pager log -1 --oneline
+```
+
+## Branch Naming
+Use conventional-commit style prefixes that match the PR title convention in AGENTS.md
+``:
+
+| Prefix | Use for |
+| :--- | :--- |
+| `feat/` | New user-visible behavior |
+| `fix/` | Bug fixes |
+| `refactor/` | Code structure changes, no behavior change |
+| `chore/` | Tooling, deps, CI, cleanup |
+| `docs/` | Documentation only |
+
+Keep the slug short and kebab-case, e.g. `fix/r8-animation-release`, `chore/koin-application-migration`.
+
+## Rebase Variant
+When the user says *"rebase #NNNN"* or *"dust off PR NNNN"*:
+
+```bash
+git fetch upstream --prune
+gh pr checkout # checks out the PR head locally
+git rebase upstream/main
+git submodule update --init --recursive
+# Resolve conflicts, then:
+git push --force-with-lease
+```
+
+Never use plain `--force`. Always `--force-with-lease` to avoid clobbering collaborator pushes.
+
+## Post-Branch Checklist
+- [ ] Branch name follows conventional prefix.
+- [ ] Submodules up to date.
+- [ ] `local.properties` exists.
+- [ ] `ANDROID_HOME` exported (see AGENTS.md workspace bootstrap).
+- [ ] Optional: run `./gradlew assembleDebug` once to catch environment regressions before editing.
+
+## Tip: Prefer `/delegate` for Long Audits
+If the user's opening prompt is a sweeping audit or investigation (e.g. *"audit changes since
+v2.7.13 for regressions"*, *"investigate why animations are broken on release"*), consider
+suggesting `/delegate` — the GitHub cloud agent can execute the branch + investigation + PR
+end-to-end while the user keeps working locally. See AGENTS.md ``.
diff --git a/.skills/project-overview/SKILL.md b/.skills/project-overview/SKILL.md
new file mode 100644
index 000000000..2224fa7ad
--- /dev/null
+++ b/.skills/project-overview/SKILL.md
@@ -0,0 +1,83 @@
+# Skill: Project Overview & Codebase Map
+
+## Description
+Module directory, namespacing conventions, environment setup, and troubleshooting for Meshtastic-Android.
+
+- **Build System:** Gradle (Kotlin DSL). JDK 21 REQUIRED. Target SDK: API 36. Min SDK: API 26.
+- **Flavors:** `fdroid` (OSS only) · `google` (Maps + DataDog analytics)
+- **Android-only Modules:** `core:api` (AIDL), `core:barcode` (CameraX). Shared contracts abstracted into `core:ui/commonMain`.
+
+## Codebase Map
+
+| Directory | Description |
+| :--- | :--- |
+| `app/` | Main application module. Contains `MainActivity`, Koin DI modules, and app-level logic. Uses package `org.meshtastic.app`. |
+| `build-logic/` | Convention plugins for shared build configuration (e.g., `meshtastic.kmp.feature`, `meshtastic.kmp.library`, `meshtastic.kmp.jvm.android`, `meshtastic.koin`). |
+| `config/` | Detekt static analysis rules (`config/detekt/detekt.yml`) and Spotless formatting config (`config/spotless/.editorconfig`). |
+| `docs/` | Architecture docs and agent playbooks. See `docs/kmp-status.md` and `docs/roadmap.md` for current status. |
+| `core/model` | Domain models and common data structures. |
+| `core:proto` | Protobuf definitions (Git submodule). |
+| `core:common` | Low-level utilities, I/O abstractions (Okio), and common types. |
+| `core:database` | Room KMP database implementation. |
+| `core:datastore` | Multiplatform DataStore for preferences. |
+| `core:repository` | High-level domain interfaces (e.g., `NodeRepository`, `LocationRepository`). |
+| `core:domain` | Pure KMP business logic and UseCases. |
+| `core:data` | Core manager implementations and data orchestration. |
+| `core:network` | KMP networking layer using Ktor, MQTT abstractions, and shared transport (`StreamFrameCodec`, `TcpTransport`, `SerialTransport`, `BleRadioInterface`). |
+| `core:di` | Common DI qualifiers and dispatchers. |
+| `core:navigation` | Shared navigation keys/routes for Navigation 3 using `@Serializable sealed interface` hierarchies. `DeepLinkRouter` for typed backstack synthesis, and `MeshtasticNavSavedStateConfig` with `subclassesOfSealed()` for automatic polymorphic backstack persistence. |
+| `core:ui` | Shared Compose UI components (`MeshtasticAppShell`, `MeshtasticNavDisplay`, `MeshtasticNavigationSuite`, `AlertHost`, `SharedDialogs`, `PlaceholderScreen`, `MainAppBar`, dialogs, preferences) and platform abstractions. |
+| `core:service` | KMP service layer; Android bindings stay in `androidMain`. |
+| `core:api` | Public AIDL/API integration module for external clients. |
+| `core:prefs` | KMP preferences layer built on DataStore abstractions. |
+| `core:barcode` | Barcode scanning (Android-only). |
+| `core:nfc` | NFC abstractions (KMP). Android NFC hardware implementation in `androidMain`. |
+| `core/ble/` | Bluetooth Low Energy stack using Kable. |
+| `core/resources/` | Centralized string and image resources (Compose Multiplatform). |
+| `core/testing/` | Shared test doubles, fakes, and utilities for `commonTest` across all KMP modules. |
+| `feature/` | Feature modules (e.g., `settings`, `map`, `messaging`, `node`, `intro`, `connections`, `firmware`, `wifi-provision`, `widget`). All are KMP except `widget`. Use `meshtastic.kmp.feature` convention plugin. |
+| `feature/wifi-provision` | KMP WiFi provisioning via BLE (Nymea protocol). Uses `core:ble` Kable abstractions. |
+| `feature/firmware` | Fully KMP firmware update system: Unified OTA (BLE + WiFi), native Nordic Secure DFU protocol (pure KMP), USB/UF2 updates, and `FirmwareRetriever` with manifest-based resolution. Desktop is a first-class target. |
+| `desktop/` | Compose Desktop application. Thin host shell relying on feature modules for shared UI. Full Koin DI graph, TCP, Serial/USB, and BLE transports. Versioning via `config.properties` + `GitVersionValueSource`. |
+
+## Namespacing
+- **Standard:** Use the `org.meshtastic.*` namespace for all code.
+- **Legacy:** Maintain the `com.geeksville.mesh` Application ID.
+
+## Environment Setup
+1. **JDK 21 MUST be used** to prevent Gradle sync/build failures.
+2. **Secrets:** Copy `secrets.defaults.properties` to `local.properties`:
+ ```properties
+ MAPS_API_KEY=dummy_key
+ datadogApplicationId=dummy_id
+ datadogClientToken=dummy_token
+ ```
+
+## Workspace Bootstrap (MUST run before any build)
+Agents **MUST** perform these steps automatically at the start of every session before running any Gradle task. Do not wait for the user to tell you.
+
+1. **Android SDK:** `ANDROID_HOME` may not be set in agent workspaces. Detect and export it:
+ ```bash
+ # Check common macOS/Linux locations in order of preference
+ if [ -z "$ANDROID_HOME" ]; then
+ for dir in "$HOME/Library/Android/sdk" "$HOME/Android/Sdk" "/opt/android-sdk"; do
+ if [ -d "$dir" ]; then export ANDROID_HOME="$dir"; break; fi
+ done
+ fi
+ ```
+ All `./gradlew` invocations must include `ANDROID_HOME` in the environment. If the SDK cannot be found, ask the user for the path.
+
+2. **Proto submodule:** `core/proto/src/main/proto` is a Git submodule containing Protobuf definitions. It must be initialized or builds will fail with proto generation errors:
+ ```bash
+ git submodule update --init
+ ```
+
+3. **Init secrets:** If `local.properties` does not exist, copy `secrets.defaults.properties` to `local.properties`. Without this the `google` flavor build fails:
+ ```bash
+ [ -f local.properties ] || cp secrets.defaults.properties local.properties
+ ```
+
+## Troubleshooting
+- **Build Failures:** Check `gradle/libs.versions.toml` for dependency conflicts.
+- **Configuration Cache:** Add `--no-configuration-cache` if cache-related issues persist.
+- **Koin Injection Failures:** Verify the component is included in `AppKoinModule`.
diff --git a/.skills/testing-ci/SKILL.md b/.skills/testing-ci/SKILL.md
new file mode 100644
index 000000000..1c8b7b901
--- /dev/null
+++ b/.skills/testing-ci/SKILL.md
@@ -0,0 +1,85 @@
+# Skill: Testing and CI Verification
+
+## Description
+Guidelines and commands for verifying code changes locally and understanding the Meshtastic-Android CI pipeline. Use this to determine which testing matrix is needed based on the change type.
+
+## 1) Baseline local verification order
+
+Run in a single invocation for routine changes to ensure code formatting, analysis, and basic compilation:
+
+```bash
+./gradlew spotlessCheck spotlessApply detekt assembleDebug test allTests
+```
+
+> **Why no `clean`?** Incremental builds are safe and significantly faster. Only use `clean` when debugging stale cache issues.
+
+> **Why `test allTests` and not just `test`:**
+> In KMP modules, the `test` task name is **ambiguous**. Gradle matches both `testAndroid` and
+> `testAndroidHostTest` and refuses to run either, silently skipping KMP modules.
+> `allTests` is the `KotlinTestReport` lifecycle task registered by the KMP plugin.
+> Conversely, `allTests` does **not** cover pure-Android modules (`:app`, `:core:api`, etc.), which is why both `test` and `allTests` are needed.
+
+*Note: If testing Compose UI on the JVM (Robolectric) with Java 21, pin tests to `@Config(sdk = [34])` to avoid SDK 35 compatibility crashes.*
+
+## 2) Change-type verification matrix
+
+- `docs-only` changes: Usually no Gradle run required, but run `spotlessCheck` if practical.
+- `UI text/resource` changes: `spotlessCheck`, `detekt`, `assembleDebug`.
+- `feature/commonMain logic` changes: `spotlessCheck`, `detekt`, `test allTests`, `assembleDebug`.
+- `navigation/DI wiring` changes: `spotlessCheck`, `detekt`, `assembleDebug`, `test allTests`, plus flavor unit tests if available.
+ - If touching any KMP module, also run `kmpSmokeCompile`.
+- `worker/service/background` changes: Broad tests, targeted WorkManager checks.
+- `BLE/networking/core repository`: `spotlessCheck`, `detekt`, `assembleDebug`, `test allTests`.
+
+## 3) Flavor checks
+
+Run these when relevant to map, provider, or flavor-specific behavior:
+
+```bash
+./gradlew lintFdroidDebug lintGoogleDebug
+./gradlew testFdroidDebug testGoogleDebug
+```
+
+## 4) CI Pipeline Architecture
+
+CI is defined in `.github/workflows/reusable-check.yml` and structured as four parallel job groups:
+
+1. **`lint-check`** — Runs spotless, detekt, Android lint, and KMP smoke compile in a single Gradle invocation (avoids 3x cold-start overhead). Uses `fetch-depth: 0` (full clone) for spotless ratcheting and version code calculation. Produces `cache_read_only` output and computed `version_code` for downstream jobs.
+2. **`test-shards`** — A 3-shard matrix that runs unit tests in parallel (depends on `lint-check`):
+ - `shard-core`: `allTests` for all `core:*` KMP modules.
+ - `shard-feature`: `allTests` for all `feature:*` KMP modules.
+ - `shard-app`: Explicit test tasks for pure-Android/JVM modules (`app`, `desktop`, `core:barcode`).
+ Each shard generates Kover XML coverage and uploads test results + coverage to Codecov with per-shard flags.
+ Downstream jobs use `fetch-depth: 1` and receive `VERSION_CODE` from lint-check via env var, enabling shallow clones.
+3. **`android-check`** — Builds APKs for all flavors (depends on `lint-check`).
+4. **`build-desktop`** — Multi-OS matrix (`macos-latest`, `windows-latest`, `ubuntu-24.04`, `ubuntu-24.04-arm`) that builds desktop distributions via `createDistributable` (depends on `lint-check`).
+
+### Runner Strategy (Three Tiers)
+- **`ubuntu-24.04-arm`** — Lightweight/utility jobs (status checks, labelers, triage, changelog, release metadata, stale, moderation). Benefits from ARM runners' shorter queue times.
+- **`ubuntu-24.04`** — Main Gradle-heavy jobs (CI `lint-check`/`test-shards`/`android-check`, release builds, Dokka, publish, dependency-submission). Pin for reproducibility.
+- **Desktop runners:** Multi-OS matrix (`macos-latest`, `windows-latest`, `ubuntu-24.04`, `ubuntu-24.04-arm`) for the `build-desktop` job and release packaging.
+
+### CI Gradle Properties
+`gradle.properties` is tuned for local dev (8g heap, 4g Kotlin daemon). CI uses `.github/ci-gradle.properties`, which the `gradle-setup` composite action copies to `~/.gradle/gradle.properties`. Key CI overrides:
+- `org.gradle.daemon=false` (single-use runners)
+- `kotlin.incremental=false` (fresh checkouts)
+- `-Xmx4g` Gradle heap, `-Xmx2g` Kotlin daemon
+- VFS watching disabled, workers capped at 4
+- `org.gradle.isolated-projects=true` for better parallelism
+- Disables unused Android build features (`resvalues`, `shaders`)
+
+### CI Conventions
+- **KMP Smoke Compile:** `./gradlew kmpSmokeCompile` is a lifecycle task (registered in `RootConventionPlugin`) that auto-discovers all KMP modules and depends on their `compileKotlinJvm` + `compileKotlinIosSimulatorArm64` tasks.
+- **`maxParallelForks` CI logic:** `ProjectExtensions.kt` checks `project.findProperty("ci") == "true"` and uses full available processors in CI (4 forks on std runners) vs. half locally. All CI invocations pass `-Pci=true`.
+- **Detekt report formats:** Detekt.kt checks `project.findProperty("ci") == "true"` and disables html, txt, md reports in CI; only xml + sarif are retained for GitHub annotations.
+- **Robolectric SDK caching:** The `gradle-setup` composite action caches `~/.m2/repository/org/robolectric` to prevent flaky `SocketException` on SDK downloads. Cache key is `robolectric-{version}-sdk{level}` — update when bumping version or SDK level.
+- **`mavenLocal()` gated:** Disabled by default to prevent CI cache poisoning. Pass `-PuseMavenLocal` for local JitPack testing.
+- **JUnit parallel execution:** Enabled project-wide with classes running sequentially (`junit.jupiter.execution.parallel.mode.classes.default=same_thread`) to avoid `Dispatchers.setMain()` races. Cross-module parallelism comes from Gradle forks (`maxParallelForks`).
+- **`test-retry` plugin:** Applied to all module types (maxRetries=2, maxFailures=10).
+- **`fail-fast: false`:** Test sharding does not cancel other shards on failure.
+- **Explicit Gradle task paths:** Prefer `app:lintFdroidDebug` over shorthand `lintDebug` in CI.
+- **Pull request CI:** Main-only (`.github/workflows/pull-request.yml` targets `main`).
+- **Cache writes:** Trusted on `main` and merge queue runs; other refs use read-only cache.
+- **Path filtering:** `check-changes` in `pull-request.yml` must include module dirs plus build/workflow entrypoints (`build-logic/**`, `gradle/**`, `.github/workflows/**`, `gradlew`, `settings.gradle.kts`, etc.).
+- **AboutLibraries:** Runs in `offlineMode` by default (no GitHub/SPDX API calls). Release builds pass `-PaboutLibraries.release=true` via Fastlane/Gradle CLI to enable remote license fetching. Do NOT re-gate on `CI` or `GITHUB_TOKEN` alone.
+
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 000000000..c1bafdd96
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,108 @@
+# Meshtastic Android - Unified Agent & Developer Guide
+
+
+You are an expert Android and Kotlin Multiplatform (KMP) engineer working on Meshtastic-Android, a decentralized mesh networking application. You must maintain strict architectural boundaries, use Modern Android Development (MAD) standards, and adhere to Compose Multiplatform and JetBrains Navigation 3 patterns.
+
+
+
+- **Project Goal:** Decouple business logic from the Android framework for seamless multi-platform execution (Android, Desktop, iOS) while maintaining a high-performance native Android experience.
+- **Language & Tech:** Kotlin 2.3+ (JDK 21 REQUIRED), Gradle Kotlin DSL, Ktor, Okio, Room KMP.
+- **Core Architecture:**
+ - `commonMain` is pure KMP. `androidMain` is strictly for Android framework bindings.
+ - App root DI and graph assembly live in the `app` and `desktop` host shells.
+- **Skills Directory:** You **MUST** consult the relevant `.skills/` module before executing work:
+ - `.skills/project-overview/` - Codebase map, module directory, namespacing, environment setup, troubleshooting.
+ - `.skills/kmp-architecture/` - Bridging, expect/actual, source-sets, catalog aliases, build-logic conventions.
+ - `.skills/compose-ui/` - Adaptive UI, placeholders, string resources.
+ - `.skills/navigation-and-di/` - JetBrains Navigation 3 & Koin 4.2+ annotations.
+ - `.skills/testing-ci/` - Validation commands, CI pipeline architecture, CI Gradle properties.
+ - `.skills/implement-feature/` - Step-by-step feature workflow.
+ - `.skills/code-review/` - PR validation checklist.
+ - `.skills/new-branch/` - Canonical recipe for branching off upstream/main and rebasing stale PRs.
+- **Active Status:** Read `docs/kmp-status.md` and `docs/roadmap.md` to understand the current KMP migration epoch.
+
+
+
+- **Workspace Bootstrap (MUST run first):** Before executing any Gradle task in a new workspace, agents MUST automatically:
+ 1. **Find the Android SDK** — `ANDROID_HOME` is often unset in agent worktrees. Probe `~/Library/Android/sdk`, `~/Android/Sdk`, and `/opt/android-sdk`. Export the first one found. If none exist, ask the user.
+ 2. **Init the proto submodule** — Run `git submodule update --init`. The `core/proto/src/main/proto` submodule contains Protobuf definitions required for builds.
+ 3. **Init secrets** — If `local.properties` does not exist, copy `secrets.defaults.properties` to `local.properties`. Without this the `google` flavor build fails.
+- **Think First:** Reason through the problem before writing code. For complex KMP tasks involving multiple modules or source sets, outline your approach step-by-step before executing.
+- **Plan Before Execution:** Use the git-ignored `.agent_plans/` directory to write markdown implementation plans (`plan.md`) and Mermaid diagrams (`.mmd`) for complex refactors before modifying code.
+- **Atomic Execution:** Follow your plan step-by-step. Do not jump ahead. Use TDD where feasible (write `commonTest` fakes first).
+- **Baseline Verification:** Always instruct the user (or use your CLI tools) to run the baseline check before finishing:
+ ```
+ ./gradlew spotlessCheck spotlessApply detekt assembleDebug test allTests
+ ```
+ > **Why both `test` and `allTests`?** In KMP modules, `test` is ambiguous and Gradle silently skips them. `allTests` is the KMP lifecycle task that covers KMP modules. Conversely, `allTests` does NOT cover pure-Android modules (`:app`, `:core:api`), so both tasks are required.
+ > For KMP cross-platform compilation, also run `./gradlew kmpSmokeCompile` (compiles all KMP modules for JVM + iOS Simulator — used by CI's `lint-check` job).
+
+
+
+- **Codebase Search:** Use whatever search and navigation tools your environment provides (file search, grep/ripgrep, symbol lookup, semantic search, etc.) to map out project boundaries before coding. Prefer `rg` (ripgrep) over `grep` or `find` for raw text search.
+- **Terminal Pagers:** When running shell commands like `git diff` or `git log`, ALWAYS use `--no-pager` (e.g., `git --no-pager diff`) to prevent getting stuck in an interactive prompt.
+- **Fetch Up-to-Date Docs:** If your environment supports web search, MCP servers, or documentation lookup tools, actively query them for the latest documentation on Koin 4.x, JetBrains Navigation 3, and Compose Multiplatform 1.11.
+- **Clone Reference Repos:** If documentation is insufficient, use shell commands to clone bleeding-edge KMP dependency repositories into the local `.agent_refs/` directory (git-ignored) to inspect their source and test suites. Recommended:
+ - `https://github.com/JetBrains/kotlin-multiplatform-dev-docs` (Official Docs)
+ - `https://github.com/InsertKoinIO/koin` (Koin Annotations 4.x)
+ - `https://github.com/JetBrains/compose-multiplatform` (Navigation 3, Adaptive UI)
+ - `https://github.com/JuulLabs/kable` (BLE)
+ - `https://github.com/coil-kt/coil` (Coil 3 KMP)
+ - `https://github.com/ktorio/ktor` (Ktor Networking)
+- **Formatting Hooks:** Always run `./gradlew spotlessApply` as an automatic formatting hook to fix style violations after editing.
+
+
+
+`AGENTS.md` is the single source of truth for agent instructions. Agent-specific files redirect here:
+- `.github/copilot-instructions.md` — Copilot redirect to `AGENTS.md`.
+- `CLAUDE.md` — Claude Code entry point; imports `AGENTS.md` via `@AGENTS.md` and adds Claude-specific instructions.
+- `GEMINI.md` — Gemini redirect to `AGENTS.md`. Gemini CLI also configured via `.gemini/settings.json` to read `AGENTS.md` directly.
+
+Do NOT duplicate content into agent-specific files. When you modify architecture, module targets, CI tasks, validation commands, or agent workflow rules, update `AGENTS.md`, `.skills/`, and `docs/kmp-status.md` as needed.
+
+
+
+- **No Lazy Coding:** DO NOT use placeholders like `// ... existing code ...`. Always provide complete, valid code blocks for the sections you modify to ensure correct diff application.
+- **No Framework Bleed:** NEVER import `java.*` or `android.*` in `commonMain`. Use KMP equivalents: `Okio` for `java.io.*`, `kotlinx.coroutines.sync.Mutex` for `java.util.concurrent.locks.*`, `atomicfu` or Mutex-guarded `mutableMapOf()` for `ConcurrentHashMap`. Use `org.meshtastic.core.common.util.ioDispatcher` instead of `Dispatchers.IO` directly.
+- **Koin Annotations:** Use `@Single`, `@Factory`, and `@KoinViewModel` inside `commonMain` instead of manual constructor trees. Do not enable A1 module compile safety — A3 full-graph validation (`VerifyModule`) is the correct approach because interfaces and implementations live in separate modules. Always register new feature modules in **both** `AppKoinModule.kt` and `DesktopKoinModule.kt`; they are not auto-activated.
+- **CMP Over Android:** Use `compose-multiplatform` constraints. `stringResource` only supports `%N$s` and `%N$d` — pre-format floats with `NumberFormatter.format()` from `core:common` and pass as `%N$s`. In ViewModels/coroutines use `getStringSuspend(Res.string.key)`; never blocking `getString()`. Always use `MeshtasticNavDisplay` (not raw `NavDisplay`) as the navigation host, and `NavigationBackHandler` (not Android's `BackHandler`) for back gestures in shared code.
+- **ProGuard:** When adding a reflection-heavy dependency, add keep rules to **both** `app/proguard-rules.pro` and `desktop/proguard-rules.pro` and verify release builds.
+- **Always Check Docs:** If unsure about an abstraction, search `core:ui/commonMain` or `core:navigation/commonMain` before assuming it doesn't exist.
+- **Privacy First:** Never log or expose PII, location data, or cryptographic keys. Meshtastic is used for sensitive off-grid communication — treat all user data with extreme caution.
+- **Dependency Discipline:** Never add a library without first checking `libs.versions.toml` and justifying its inclusion against the project's size and complexity goals. Prefer removing dependencies over adding them.
+- **Zero Lint Tolerance:** A task is incomplete if `detekt` fails or `spotlessCheck` does not pass for touched modules.
+- **Read Before Refactoring:** When a pattern contradicts best practices, analyze whether it is legacy debt or a deliberate architectural choice before proposing a change.
+
+
+
+These tips apply when the agent is the GitHub Copilot CLI. Other agent runtimes may ignore this
+section.
+
+- **Delegate long autonomous work.** For sweeping audits, multi-hour investigations, or "fleet"
+ prompts (*"investigate why X is broken on release"*, *"audit the diff since tag vX.Y.Z"*,
+ *"review the codebase for best practices against spec Z"*), prefer `/delegate` so the GitHub
+ cloud agent opens a PR while the user keeps working locally. Don't tie up an interactive
+ session on work that can run unattended.
+- **Use `/research` for "latest hotness" prompts.** When the user asks for *"the latest scoop"*
+ on Kotlin / KMP / Compose / Koin trends, the built-in `/research` slash command performs deep
+ research across GitHub and the web with better source grounding than an ad-hoc prompt.
+- **Use `/plan` mode for "noodle it out" prompts.** When the user asks for an implementation
+ plan, a "walk me through next steps", or explicitly says "don't do anything yet" — switch to
+ plan mode (Shift+Tab or `/plan`). Plans persist in the session workspace and keep the agent
+ from prematurely editing files. Continue to write long-form plans and Mermaid diagrams to
+ `.agent_plans/` (git-ignored) for multi-module refactors.
+- **`/share` audit and review outputs.** After large audits, PR safety reviews, or release-cycle
+ quality passes, offer `/share` to export the findings to a gist or markdown file. These
+ reports are valuable artifacts — don't let them die in session history.
+- **Prefer `/rewind` or `ctrl+s` over retyping.** If a turn went sideways, `/rewind` reverts
+ file changes and the turn; `ctrl+s` submits while preserving the input for quick iteration.
+ Avoid re-issuing the same prompt verbatim.
+- **New-branch flow lives in a skill.** When the user says "fresh branch off fetched origin/main"
+ or "rebase PR #NNNN", consult `.skills/new-branch/SKILL.md` rather than re-deriving the recipe.
+
+
+
+- **Commit Hygiene:** Squash fixup/polish/review-feedback commits before opening a PR. Each commit should represent a logical, self-contained unit of work — not a back-and-forth conversation.
+- **PR Descriptions:** Keep PR descriptions concise and scannable. State *what changed* and *why*, not a per-commit play-by-play. Use a short summary paragraph followed by a bullet list of changes. Avoid tables, headers-per-commit, or verbose breakdowns. Reference the `meshtastic/firmware` repo PRs for tone and style.
+- **PR Titles:** Use conventional commit format: `feat(scope):`, `fix(scope):`, `refactor(scope):`, `chore(scope):`. Keep titles under ~72 characters.
+
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 000000000..eb5cd5e5c
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,9 @@
+# Meshtastic Android - Claude Code Guide
+
+@AGENTS.md
+
+## Claude-Specific Instructions
+
+- **Think First:** Always outline your step-by-step reasoning inside `` tags before writing code or shell commands. Claude models perform significantly better on complex KMP tasks when they "think out loud" first.
+- **Skills:** The `.skills/` directory contains task-specific instruction modules. Load them as needed — only the skill relevant to your current task.
+- **Plan Mode:** Use plan mode for architectural changes spanning multiple modules. Write plans to `.agent_plans/` (git-ignored). The Copilot-CLI-specific `/plan`, `/delegate`, `/research`, and `/share` guidance in `AGENTS.md` does not apply to Claude Code — skip the `` section.
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..6843fc85d
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,4 @@
+# Contributor Covenant Code of Conduct
+
+The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
+https://meshtastic.org/docs/legal/conduct/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..d4fe0b740
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,94 @@
+# Contributing to Meshtastic-Android
+
+Thank you for your interest in contributing to Meshtastic-Android! We welcome contributions from everyone. Please take a moment to review these guidelines to help us maintain a high-quality, collaborative project.
+
+## How to Contribute
+
+- **Fork the repository** and create your branch from `main` or the appropriate feature branch.
+- **Make your changes** in a logical, atomic manner.
+- **Test your changes** thoroughly before submitting a pull request.
+- **Submit a pull request** (PR) with a clear description of your changes and the problem they solve.
+- If you are addressing an existing issue, please reference it in your PR (e.g., `Fixes #123`).
+
+## Code Style
+
+- Follow the [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html) for Kotlin code.
+- Use Android Studio's default formatting settings.
+- We use [spotless](https://github.com/diffplug/spotless) for automated code formatting. You can run `./gradlew spotlessApply` to format your code automatically.
+ - You can also run `./gradlew spotlessInstallGitPrePushHook --no-configuration-cache` to install a pre-push Git hook that will run a `spotlessCheck`.
+- Write clear, descriptive variable and function names.
+- Add comments where necessary, especially for complex logic.
+- Keep methods and classes focused and concise.
+- **Strings:** Use localised strings via the **Compose Multiplatform Resource** library in `:core:resources`.
+ - Do **not** use the legacy `app/src/main/res/values/strings.xml`.
+ - **Definition:** Add strings to `core/resources/src/commonMain/composeResources/values/strings.xml`.
+ - **Usage:**
+ ```kotlin
+ import org.jetbrains.compose.resources.stringResource
+ import org.meshtastic.core.resources.Res
+ import org.meshtastic.core.resources.your_string_key
+
+ Text(text = stringResource(Res.string.your_string_key))
+ ```
+
+### Linting
+
+Meshtastic-Android uses [Detekt](https://detekt.dev/) for static code analysis and linting of Kotlin code.
+
+- Run `./gradlew detekt` before submitting your pull request to ensure your code passes all lint checks.
+- Fix any Detekt warnings or errors reported in your code.
+- It is possible to suppress warnings individually, but this should be used very sparingly.
+- You can find Detekt configuration in the `config/detekt` directory. If you believe a rule should be changed or suppressed, discuss it in your PR.
+
+Consistent linting helps keep the codebase clean and maintainable.
+
+### Testing
+
+Meshtastic-Android uses unit tests, Robolectric JVM tests, and instrumented UI tests to ensure code quality and reliability.
+
+- **Unit tests** are located in the `src/test/` directory of each module.
+- **Compose UI Tests (JVM)** are preferred for component testing and are also located in `src/test/` using **Robolectric**.
+ - Note: If using Java 21, pin your Robolectric tests to `@Config(sdk = [34])` to avoid SDK 35 compatibility issues.
+- **Instrumented tests** (including full E2E UI tests) are located in `src/androidTest/`. For Compose UI, use the [Jetpack Compose Testing APIs](https://developer.android.com/jetpack/compose/testing).
+
+#### Guidelines for Testing
+
+- Add or update tests for any new features or bug fixes.
+- Ensure all tests pass by running:
+ - `./gradlew test` for unit and Robolectric tests
+ - `./gradlew connectedAndroidTest` for instrumented tests
+- For UI components, write Robolectric Compose tests where possible for faster execution.
+- If your change is difficult to test, explain why in your pull request.
+
+Comprehensive testing helps prevent regressions and ensures a stable experience for all users.
+
+
+## Pull Requests
+
+- branches should start with:
+ - bugfix
+ - enhancement
+ - dependencies
+ - repo
+ - reserved (release, automation)
+- Ensure your branch is up to date with the latest `main` branch before submitting a PR.
+- Provide a meaningful title and description for your PR.
+- Include information on how to test and/or replicate if it is not obvious.
+- Include screenshots or logs if your change affects the UI or user experience.
+- Be responsive to feedback and make requested changes promptly.
+- Squash commits if requested by a maintainer.
+
+## Issue Reporting
+
+- Search existing issues before opening a new one to avoid duplicates.
+- Provide a clear and descriptive title.
+- Include steps to reproduce, expected behavior, and actual behavior.
+- Attach logs, screenshots, or other helpful context if applicable.
+
+## Community Standards
+
+- Be respectful and considerate in all interactions.
+- The Meshtastic Android project is subject to the code of conduct for the parent project, which can be [found here:](https://meshtastic.org/docs/legal/conduct/)
+- Help others by reviewing pull requests and answering questions when possible.
+
+Thank you for helping make Meshtastic-Android better!
diff --git a/GEMINI.md b/GEMINI.md
new file mode 100644
index 000000000..72a350afb
--- /dev/null
+++ b/GEMINI.md
@@ -0,0 +1,6 @@
+# Meshtastic Android - Google Gemini Guide
+
+> **Note:** The canonical instructions for all AI Agents have been deduplicated.
+
+You MUST immediately read and internalize the unified instructions located at the root of the repository in `AGENTS.md`.
+After reading `AGENTS.md`, consult the `.skills/` directory for task-specific playbooks.
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 000000000..7a118b49b
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem "fastlane"
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 000000000..cf6a1b9c0
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,238 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ CFPropertyList (3.0.8)
+ abbrev (0.1.2)
+ addressable (2.9.0)
+ public_suffix (>= 2.0.2, < 8.0)
+ artifactory (3.0.17)
+ atomos (0.1.3)
+ aws-eventstream (1.4.0)
+ aws-partitions (1.1240.0)
+ aws-sdk-core (3.245.0)
+ aws-eventstream (~> 1, >= 1.3.0)
+ aws-partitions (~> 1, >= 1.992.0)
+ aws-sigv4 (~> 1.9)
+ base64
+ bigdecimal
+ jmespath (~> 1, >= 1.6.1)
+ logger
+ aws-sdk-kms (1.123.0)
+ aws-sdk-core (~> 3, >= 3.244.0)
+ aws-sigv4 (~> 1.5)
+ aws-sdk-s3 (1.219.0)
+ aws-sdk-core (~> 3, >= 3.244.0)
+ aws-sdk-kms (~> 1)
+ aws-sigv4 (~> 1.5)
+ aws-sigv4 (1.12.1)
+ aws-eventstream (~> 1, >= 1.0.2)
+ babosa (1.0.4)
+ base64 (0.2.0)
+ benchmark (0.5.0)
+ bigdecimal (4.1.2)
+ claide (1.1.0)
+ colored (1.2)
+ colored2 (3.1.2)
+ commander (4.6.0)
+ highline (~> 2.0.0)
+ csv (3.3.5)
+ declarative (0.0.20)
+ digest-crc (0.7.0)
+ rake (>= 12.0.0, < 14.0.0)
+ domain_name (0.6.20240107)
+ dotenv (2.8.1)
+ emoji_regex (3.2.3)
+ excon (0.112.0)
+ faraday (1.10.5)
+ faraday-em_http (~> 1.0)
+ faraday-em_synchrony (~> 1.0)
+ faraday-excon (~> 1.1)
+ faraday-httpclient (~> 1.0)
+ faraday-multipart (~> 1.0)
+ faraday-net_http (~> 1.0)
+ faraday-net_http_persistent (~> 1.0)
+ faraday-patron (~> 1.0)
+ faraday-rack (~> 1.0)
+ faraday-retry (~> 1.0)
+ ruby2_keywords (>= 0.0.4)
+ faraday-cookie_jar (0.0.8)
+ faraday (>= 0.8.0)
+ http-cookie (>= 1.0.0)
+ faraday-em_http (1.0.0)
+ faraday-em_synchrony (1.0.1)
+ faraday-excon (1.1.0)
+ faraday-httpclient (1.0.1)
+ faraday-multipart (1.2.0)
+ multipart-post (~> 2.0)
+ faraday-net_http (1.0.2)
+ faraday-net_http_persistent (1.2.0)
+ faraday-patron (1.0.0)
+ faraday-rack (1.0.0)
+ faraday-retry (1.0.4)
+ faraday_middleware (1.2.1)
+ faraday (~> 1.0)
+ fastimage (2.4.1)
+ fastlane (2.233.0)
+ CFPropertyList (>= 2.3, < 4.0.0)
+ abbrev (~> 0.1.2)
+ addressable (>= 2.8, < 3.0.0)
+ artifactory (~> 3.0)
+ aws-sdk-s3 (~> 1.197)
+ babosa (>= 1.0.3, < 2.0.0)
+ base64 (~> 0.2.0)
+ benchmark (>= 0.1.0)
+ bundler (>= 1.17.3, < 5.0.0)
+ colored (~> 1.2)
+ commander (~> 4.6)
+ csv (~> 3.3)
+ dotenv (>= 2.1.1, < 3.0.0)
+ emoji_regex (>= 0.1, < 4.0)
+ excon (>= 0.71.0, < 1.0.0)
+ faraday (~> 1.0)
+ faraday-cookie_jar (~> 0.0.6)
+ faraday_middleware (~> 1.0)
+ fastimage (>= 2.1.0, < 3.0.0)
+ fastlane-sirp (>= 1.1.0)
+ gh_inspector (>= 1.1.2, < 2.0.0)
+ google-apis-androidpublisher_v3 (~> 0.3)
+ google-apis-playcustomapp_v1 (~> 0.1)
+ google-cloud-env (>= 1.6.0, <= 2.1.1)
+ google-cloud-storage (~> 1.31)
+ highline (~> 2.0)
+ http-cookie (~> 1.0.5)
+ json (< 3.0.0)
+ jwt (>= 2.1.0, < 3)
+ logger (>= 1.6, < 2.0)
+ mini_magick (>= 4.9.4, < 5.0.0)
+ multipart-post (>= 2.0.0, < 3.0.0)
+ mutex_m (~> 0.3.0)
+ naturally (~> 2.2)
+ nkf (~> 0.2.0)
+ optparse (>= 0.1.1, < 1.0.0)
+ ostruct (>= 0.1.0)
+ plist (>= 3.1.0, < 4.0.0)
+ rubyzip (>= 2.0.0, < 3.0.0)
+ security (= 0.1.5)
+ simctl (~> 1.6.3)
+ terminal-notifier (>= 2.0.0, < 3.0.0)
+ terminal-table (~> 3)
+ tty-screen (>= 0.6.3, < 1.0.0)
+ tty-spinner (>= 0.8.0, < 1.0.0)
+ word_wrap (~> 1.0.0)
+ xcodeproj (>= 1.13.0, < 2.0.0)
+ xcpretty (~> 0.4.1)
+ xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
+ fastlane-sirp (1.1.0)
+ gh_inspector (1.1.3)
+ google-apis-androidpublisher_v3 (0.99.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-apis-core (0.18.0)
+ addressable (~> 2.5, >= 2.5.1)
+ googleauth (~> 1.9)
+ httpclient (>= 2.8.3, < 3.a)
+ mini_mime (~> 1.0)
+ mutex_m
+ representable (~> 3.0)
+ retriable (>= 2.0, < 4.a)
+ google-apis-iamcredentials_v1 (0.26.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-apis-playcustomapp_v1 (0.17.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-apis-storage_v1 (0.61.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-cloud-core (1.8.0)
+ google-cloud-env (>= 1.0, < 3.a)
+ google-cloud-errors (~> 1.0)
+ google-cloud-env (2.1.1)
+ faraday (>= 1.0, < 3.a)
+ google-cloud-errors (1.6.0)
+ google-cloud-storage (1.59.0)
+ addressable (~> 2.8)
+ digest-crc (~> 0.4)
+ google-apis-core (>= 0.18, < 2)
+ google-apis-iamcredentials_v1 (~> 0.18)
+ google-apis-storage_v1 (>= 0.42)
+ google-cloud-core (~> 1.6)
+ googleauth (~> 1.9)
+ mini_mime (~> 1.0)
+ googleauth (1.11.2)
+ faraday (>= 1.0, < 3.a)
+ google-cloud-env (~> 2.1)
+ jwt (>= 1.4, < 3.0)
+ multi_json (~> 1.11)
+ os (>= 0.9, < 2.0)
+ signet (>= 0.16, < 2.a)
+ highline (2.0.3)
+ http-cookie (1.0.8)
+ domain_name (~> 0.5)
+ httpclient (2.9.0)
+ mutex_m
+ jmespath (1.6.2)
+ json (2.19.4)
+ jwt (2.10.2)
+ base64
+ logger (1.7.0)
+ mini_magick (4.13.2)
+ mini_mime (1.1.5)
+ multi_json (1.20.1)
+ multipart-post (2.4.1)
+ mutex_m (0.3.0)
+ nanaimo (0.4.0)
+ naturally (2.3.0)
+ nkf (0.2.0)
+ optparse (0.8.1)
+ os (1.1.4)
+ ostruct (0.6.3)
+ plist (3.7.2)
+ public_suffix (7.0.5)
+ rake (13.4.2)
+ representable (3.2.0)
+ declarative (< 0.1.0)
+ trailblazer-option (>= 0.1.1, < 0.2.0)
+ uber (< 0.2.0)
+ retriable (3.4.1)
+ rexml (3.4.4)
+ rouge (3.28.0)
+ ruby2_keywords (0.0.5)
+ rubyzip (2.4.1)
+ security (0.1.5)
+ signet (0.21.0)
+ addressable (~> 2.8)
+ faraday (>= 0.17.5, < 3.a)
+ jwt (>= 1.5, < 4.0)
+ multi_json (~> 1.10)
+ simctl (1.6.10)
+ CFPropertyList
+ naturally
+ terminal-notifier (2.0.0)
+ terminal-table (3.0.2)
+ unicode-display_width (>= 1.1.1, < 3)
+ trailblazer-option (0.1.2)
+ tty-cursor (0.7.1)
+ tty-screen (0.8.2)
+ tty-spinner (0.9.3)
+ tty-cursor (~> 0.7)
+ uber (0.1.0)
+ unicode-display_width (2.6.0)
+ word_wrap (1.0.0)
+ xcodeproj (1.27.0)
+ CFPropertyList (>= 2.3.3, < 4.0)
+ atomos (~> 0.1.3)
+ claide (>= 1.0.2, < 2.0)
+ colored2 (~> 3.1)
+ nanaimo (~> 0.4.0)
+ rexml (>= 3.3.6, < 4.0)
+ xcpretty (0.4.1)
+ rouge (~> 3.28.0)
+ xcpretty-travis-formatter (1.0.1)
+ xcpretty (~> 0.2, >= 0.0.7)
+
+PLATFORMS
+ arm64-darwin-24
+ ruby
+
+DEPENDENCIES
+ fastlane
+
+BUNDLED WITH
+ 2.7.2
diff --git a/README.md b/README.md
index 6a11ec8ed..2cc1ffe1c 100644
--- a/README.md
+++ b/README.md
@@ -1,45 +1,106 @@
-
+
Meshtastic-Android

-[](https://github.com/meshtastic/Meshtastic-Android/actions/workflows/android.yml)
+[](https://github.com/meshtastic/Meshtastic-Android/actions/workflows/pull-request.yml)
+[](https://codecov.io/gh/meshtastic/Meshtastic-Android)
[](https://crowdin.meshtastic.org/android)
[](https://cla-assistant.io/meshtastic/Meshtastic-Android)
[](https://opencollective.com/meshtastic/)
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
-This is a tool for using Android with open-source mesh radios. For more information see our webpage: [meshtastic.org](https://www.meshtastic.org). If you are looking for the the device side code, see [here](https://github.com/meshtastic/Meshtastic-device).
+This is a tool for using Android (and Compose Desktop) with open-source mesh radios. For more information see our webpage: [meshtastic.org](https://www.meshtastic.org). If you are looking for the device side code, see [here](https://github.com/meshtastic/firmware).
-This project is currently beta testing, if you have questions or feedback
-please [Join our discussion forum](https://github.com/orgs/meshtastic/discussions). We would love to hear from
-you!
+This project is currently beta testing across various providers. If you have questions or feedback please [Join our discussion forum](https://github.com/orgs/meshtastic/discussions) or the [Discord Group](https://discord.gg/meshtastic) . We would love to hear from you!
+
+
+
+## Get Meshtastic
+
+The easiest, and fastest way to get the latest beta releases is to use our [github releases](https://github.com/meshtastic/Meshtastic-Android/releases). It is recommend to use these with [Obtainium](https://github.com/ImranR98/Obtainium) to get the latest updates.
+
+Alternatively, these other providers are also available, but may be slower to update.
[ ](https://f-droid.org/packages/com.geeksville.mesh/)
+width="24%">](https://f-droid.org/packages/com.geeksville.mesh/)
[ ](https://apt.izzysoft.de/fdroid/index/apk/com.geeksville.mesh)
+width="24%">](https://apt.izzysoft.de/fdroid/index/apk/com.geeksville.mesh)
+[ ](https://github.com/meshtastic/Meshtastic-Android/releases)
[ ](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub-android-readme)
+width="24%">](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub-android-readme)
-If you want to join the Play Store testing program go to [this URL](https://play.google.com/apps/testing/com.geeksville.mesh) and opt-in to become a tester.
-If you encounter any problems or have questions, [post in the forum](https://github.com/orgs/meshtastic/discussions) and we'll help.
+The play store is the last to update of these options, but if you want to join the Play Store testing program go to [this URL](https://play.google.com/apps/testing/com.geeksville.mesh) and opt-in to become a tester.
+If you encounter any problems or have questions, [ask us on the discord](https://discord.gg/meshtastic), [create an issue](https://github.com/meshtastic/Meshtastic-Android/issues), or [post in the forum](https://github.com/orgs/meshtastic/discussions) and we'll help as we can.
-However, if you must use 'raw' APKs you can get them from our [github releases](https://github.com/meshtastic/Meshtastic-Android/releases). It is recommend to use these with [Obtainum](https://github.com/ImranR98/Obtainium) to get the latest updates.
+## Documentation
+
+The project's documentation is generated with [Dokka](https://kotlinlang.org/docs/dokka-introduction.html) and hosted on GitHub Pages. It is automatically updated on every push to the `main` branch.
+
+[**View Documentation**](https://meshtastic.github.io/Meshtastic-Android/)
+
+### Generating Locally
+
+You can generate the documentation locally to preview your changes.
+
+1. **Run the Dokka task:**
+ ```bash
+ ./gradlew dokkaGeneratePublicationHtml
+ ```
+2. **View the output:**
+ The generated HTML files will be located in the `build/dokka/html` directory. You can open the `index.html` file in your browser to view the documentation.
+
+## Architecture
+
+### Modern Android Development (MAD)
+The app follows modern Android development practices, built on top of a shared Kotlin Multiplatform (KMP) Core:
+- **KMP Modules:** Business logic (`core:domain`), data sources (`core:data`, `core:database`, `core:datastore`), and communications (`core:network`, `core:ble`) are entirely platform-agnostic, targeting Android and Compose Desktop.
+- **UI:** JetBrains Compose Multiplatform (Material 3) using Compose Multiplatform resources.
+- **State Management:** Unidirectional Data Flow (UDF) with ViewModels, Coroutines, and Flow.
+- **Dependency Injection:** Koin with Koin Annotations (K2 Compiler Plugin).
+- **Navigation:** JetBrains Navigation 3 (Multiplatform routing with RESTful deep linking).
+- **Data Layer:** Repository pattern with Room KMP (local DB), DataStore (prefs), and Protobuf (device comms).
+
+### Bluetooth Low Energy (BLE)
+The BLE stack uses a multiplatform interface-driven architecture. Platform-agnostic interfaces live in `commonMain`, utilizing the **Kable** multiplatform BLE library to handle device communication across all supported targets (Android, Desktop). This provides a robust, Coroutine-based architecture for reliable device communication while remaining fully KMP compatible. See [core/ble/README.md](core/ble/README.md) for details.
## Translations
You can help translate the app into your native language using [Crowdin](https://crowdin.meshtastic.org/android).
+## API & Integration
+
+Developers can integrate with the Meshtastic Android app using our published API library via **JitPack**. This allows third-party applications (like the ATAK plugin) to communicate with the mesh service via AIDL.
+
+For detailed integration instructions, see [core/api/README.md](core/api/README.md).
+
+Additionally, the app includes a built-in **Local TAK Server** feature that can be enabled in settings. This runs a local TCP server on port 8089 to allow ATAK clients to connect directly and route their traffic over the mesh.
+
## Building the Android App
+> [!WARNING]
+> Debug and release builds can be installed concurrently. This is solely to enable smoother development, and you should avoid running both apps simultaneously. To ensure proper function, force quit the app not in use.
https://meshtastic.org/docs/development/android/
+Note: when building the `google` flavor locally you will need to supply your own [Google Maps Android SDK api key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) `MAPS_API_KEY` in `local.properties` in order to use Google Maps.
+e.g.
+```properties
+MAPS_API_KEY=your_google_maps_api_key_here
+```
+
+## Contributing guidelines
+
+For detailed instructions on how to contribute, please see our [CONTRIBUTING.md](CONTRIBUTING.md) file.
+For details on our release process, see the [RELEASE_PROCESS.md](RELEASE_PROCESS.md) file.
+
## Repository Statistics
-
+
+
Copyright 2025, Meshtastic LLC. GPL-3.0 license
diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md
new file mode 100644
index 000000000..8a1feb203
--- /dev/null
+++ b/RELEASE_PROCESS.md
@@ -0,0 +1,65 @@
+# Meshtastic-Android Release Process
+
+This guide summarizes the steps for releasing a new version of Meshtastic-Android. The process is fully automated via GitHub Actions and Fastlane.
+
+## Overview
+
+The entire release process is managed by a single, manually-triggered GitHub Action: **`Create or Promote Release`**.
+
+- **Trigger:** To start a new release or promote an existing one, a developer manually runs the workflow from the GitHub Actions tab.
+- **Inputs:** The workflow requires two inputs:
+ 1. `version`: The base version number you are releasing (e.g., `2.4.0`).
+ 2. `channel`: The release channel you are targeting (`internal`, `closed`, `open`, or `production`).
+- **Automation:** The workflow handles everything automatically:
+ - **Syncs Assets:** Fetches the latest firmware/hardware lists, protobuf definitions, and translations (Crowdin).
+ - **Generates Changelog:** Creates a clean changelog from commits since the last production release and commits it to the repo.
+ - **Updates Config:** Automatically bumps the `VERSION_NAME_BASE` in `config.properties`.
+ - **Verifies & Tags:** Runs lint checks, builds the app, and *only* tags the release if successful.
+ - **Deploys:** Uploads the build to the correct Google Play track and attaches artifacts (`.aab`/`.apk`) to a GitHub Release.
+- **Changelog:** Release notes are auto-generated from PR labels. Ensure PRs are labeled correctly to maintain an accurate changelog.
+
+## Release Steps
+
+### 1. Start an Internal Release
+
+1. Navigate to the **Actions** tab in the GitHub repository.
+2. Select the **`Create or Promote Release`** workflow.
+3. Click the **"Run workflow"** dropdown.
+4. Enter the base `version` (e.g., `2.4.0`).
+5. Select the `internal` channel.
+6. Click **"Run workflow"**.
+
+The workflow will:
+1. **Create a new commit** on the current branch containing updated assets, translations, and the new changelog.
+2. **Tag** that commit with an incremental internal tag (e.g., `v2.4.0-internal.1`).
+3. **Build & Deploy** the verified artifact to the Play Store Internal track.
+4. Publish a **draft** pre-release on GitHub.
+
+### 2. Promote to the Next Channel
+
+Once an internal build has been verified, you can promote it to a wider audience.
+
+1. Run the **`Create or Promote Release`** workflow again with the same base `version`.
+2. Select the next channel in the sequence (e.g., `closed`, then `open`).
+3. The workflow will create a new incremental tag for that channel (e.g., `v2.4.0-closed.1`) and create a **published** pre-release on GitHub.
+
+### 3. Promote to Production
+
+After testing is complete on all pre-release channels, you can create the final public release.
+
+1. Run the **`Create or Promote Release`** workflow one last time.
+2. Use the same base `version`.
+3. Select the `production` channel.
+4. The workflow will create a clean version tag (e.g., `v2.4.0`) and create a **published, stable** (non-prerelease) release on GitHub.
+
+### 4. Post-Release
+
+1. **Verify:** Check the Google Play Console to ensure the build is available on the correct track.
+2. **Merge:** Merge the release branch (if one was used for stabilization) back into `main`.
+
+## Build Attestations & Provenance
+
+All release artifacts are accompanied by explicit GitHub build attestations (provenance). This provides cryptographic proof that the artifacts were built by our trusted GitHub Actions workflow, ensuring supply chain integrity.
+
+- You can view and verify provenance in the GitHub UI under each release asset.
+- For more details, see [GitHub's documentation on build provenance](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#provenance-attestations).
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..dc4df33df
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,12 @@
+# Security Policy
+
+## Supported Versions
+
+| App Version | Supported |
+| ---------------- | ------------------ |
+| 2.7.x | :white_check_mark: |
+| <= 2.6.x | :x: |
+
+## Reporting a Vulnerability
+
+We support the private reporting of potential security vulnerabilities. Please go to the Security tab to file a report with a description of the potential vulnerability and reproduction scripts (preferred) or steps, and our developers will review.
diff --git a/app/.gitignore b/app/.gitignore
deleted file mode 100644
index 7863aa700..000000000
--- a/app/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/build
-/debug
-/release
-google-services.json
diff --git a/app/README.md b/app/README.md
new file mode 100644
index 000000000..ff6f5542f
--- /dev/null
+++ b/app/README.md
@@ -0,0 +1,70 @@
+# `:app`
+
+## Overview
+The `:app` module is the entry point for the Meshtastic Android application. It orchestrates the various feature modules, manages global state, and provides the main UI shell.
+
+## Key Components
+
+### 1. `MainActivity` & `Main.kt`
+The single Activity of the application. It hosts the shared `MeshtasticNavDisplay` navigation shell and manages the root UI structure (Navigation Bar, Rail, etc.).
+
+### 2. `MeshService`
+The core background service that manages long-running communication with the mesh radio. While it is declared in the `:app` manifest for system visibility, its implementation resides in the `:core:service` module. It runs as a **Foreground Service** to ensure reliable communication even when the app is in the background.
+
+### 3. Koin Application
+`MeshUtilApplication` is the Koin entry point, providing the global dependency injection container.
+
+## Architecture
+The module primarily serves as a "glue" layer, connecting:
+- `core:*` modules for shared logic.
+- `feature:*` modules for specific user-facing screens.
+
+## Module dependency graph
+
+
+```mermaid
+graph TB
+ :app[app]:::android-application
+ :app -.-> :core:ble
+ :app -.-> :core:common
+ :app -.-> :core:data
+ :app -.-> :core:database
+ :app -.-> :core:datastore
+ :app -.-> :core:di
+ :app -.-> :core:domain
+ :app -.-> :core:model
+ :app -.-> :core:navigation
+ :app -.-> :core:network
+ :app -.-> :core:nfc
+ :app -.-> :core:prefs
+ :app -.-> :core:proto
+ :app -.-> :core:service
+ :app -.-> :core:resources
+ :app -.-> :core:ui
+ :app -.-> :core:barcode
+ :app -.-> :core:takserver
+ :app -.-> :feature:intro
+ :app -.-> :feature:messaging
+ :app -.-> :feature:connections
+ :app -.-> :feature:map
+ :app -.-> :feature:node
+ :app -.-> :feature:settings
+ :app -.-> :feature:firmware
+ :app -.-> :feature:wifi-provision
+ :app -.-> :feature:widget
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
+classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+
+```
+
diff --git a/app/build.gradle b/app/build.gradle
deleted file mode 100644
index d80151c92..000000000
--- a/app/build.gradle
+++ /dev/null
@@ -1,220 +0,0 @@
-plugins {
- alias(libs.plugins.android.application)
- alias(libs.plugins.kotlin.android)
- alias(libs.plugins.compose)
- alias(libs.plugins.kotlin.parcelize)
- alias(libs.plugins.kotlin.serialization)
- alias(libs.plugins.hilt)
- alias(libs.plugins.protobuf)
- alias(libs.plugins.devtools.ksp)
- alias(libs.plugins.detekt)
-}
-
-def keystorePropertiesFile = rootProject.file("keystore.properties")
-def keystoreProperties = new Properties()
-if (keystorePropertiesFile.exists()) {
- keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
-}
-
-android {
- namespace 'com.geeksville.mesh'
-
- signingConfigs {
- release {
- keyAlias keystoreProperties['keyAlias']
- keyPassword keystoreProperties['keyPassword']
- storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
- storePassword keystoreProperties['storePassword']
- }
- }
- compileSdk Configs.COMPILE_SDK
- defaultConfig {
- applicationId Configs.APPLICATION_ID
- minSdkVersion Configs.MIN_SDK_VERSION
- targetSdk Configs.TARGET_SDK
- versionCode Configs.VERSION_CODE // format is Mmmss (where M is 1+the numeric major number
- versionName Configs.VERSION_NAME
- testInstrumentationRunner "com.geeksville.mesh.TestRunner"
- buildConfigField("String", "MIN_DEVICE_VERSION", "\"${Configs.MIN_DEVICE_VERSION}\"")
- // per https://developer.android.com/studio/write/vector-asset-studio
- vectorDrawables.useSupportLibrary = true
- }
- flavorDimensions = ['default']
- productFlavors {
- fdroid {
- dimension = 'default'
- dependenciesInfo {
- includeInApk = false
- }
- }
- google {
- dimension = 'default'
- if (Configs.USE_CRASHLYTICS) {
- apply plugin: 'com.google.gms.google-services'
- apply plugin: 'com.google.firebase.crashlytics'
- }
- }
- }
- buildTypes {
- release {
- if (keystoreProperties['storeFile']) {
- signingConfig signingConfigs.release
- }
- minifyEnabled true
- shrinkResources true
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- debug {
- pseudoLocalesEnabled true
- }
- }
- defaultConfig {
- // We have to list all translated languages here, because some of our libs have bogus languages that google play
- // doesn't like and we need to strip them (gr)
- resourceConfigurations += ['bg', 'ca', 'cs', 'de', 'el', 'en', 'es', 'et', 'fi', 'fr', 'fr-rHT', 'ga', 'gl', 'hr', 'hu', 'is', 'it', 'iw', 'ja', 'ko', 'lt', 'nl', 'nb', 'pl', 'pt', 'pt-rBR', 'ro', 'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'tr', 'zh-rCN', 'zh-rTW', 'uk']
-
- ndk {
- // abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
- }
- }
- bundle {
- language {
- enableSplit false
- }
- }
- buildFeatures {
- viewBinding true
- compose true
- aidl true
- buildConfig true
- }
- // Configure the build-logic plugins to target JDK 17
- // This matches the JDK used to build the project, and is not related to what is running on device.
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_17.toString()
- freeCompilerArgs += [
- '-opt-in=kotlin.RequiresOptIn',
- '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi'
- ]
- }
- lint {
- abortOnError false
- disable += "MissingTranslation"
- }
- sourceSets {
- // Adds exported schema location as test app assets.
- androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
- }
-}
-
-// per protobuf-gradle-plugin docs, this is recommended for android
-protobuf {
- protoc {
- artifact = libs.protobuf.protoc.get()
- }
- generateProtoTasks {
- all().each { task ->
- task.builtins {
- java {
- // turned off for now so I can use json printing in debug panel
- // use the smaller android version of the library
- //option "lite"
- }
- kotlin {
- }
- }
- }
- }
-}
-
-// workaround for https://github.com/google/ksp/issues/1590
-androidComponents {
- onVariants(selector().all(), { variant ->
- afterEvaluate {
- def capName = variant.name.capitalize()
- tasks.named("ksp${capName}Kotlin") {
- dependsOn("generate${capName}Proto")
- }
- }
- })
-}
-
-dependencies {
- implementation project(":network")
- implementation(fileTree(dir: 'libs', include: ['*.jar']))
-
- // Bundles
- implementation(libs.bundles.androidx)
- implementation(libs.bundles.ui)
- debugImplementation(libs.bundles.ui.tooling)
- implementation(libs.bundles.lifecycle)
- implementation(libs.bundles.navigation)
- implementation(libs.bundles.coroutines)
- implementation(libs.bundles.datastore)
- implementation(libs.bundles.room)
- implementation(libs.bundles.hilt)
- implementation(libs.bundles.protobuf)
- implementation(libs.bundles.coil)
-
- //OSM
- implementation(libs.bundles.osm)
- implementation(libs.osmdroid.geopackage){ exclude group: "com.j256.ormlite" }
-
- //ZXing
- implementation(libs.zxing.android.embedded) { transitive = false }
- implementation(libs.zxing.core) // do not update
-
- //Individual dependencies
- implementation(libs.appintro)
- googleImplementation(libs.awesome.app.rating)
- implementation(libs.core.splashscreen)
- implementation(libs.emoji2.emojipicker)
- implementation(libs.kotlinx.collections.immutable)
- implementation(libs.kotlinx.serialization.json)
- implementation(libs.org.eclipse.paho.client.mqttv3)
- implementation(libs.streamsupport.minifuture)
- implementation(libs.usb.serial.android)
- implementation(libs.work.runtime.ktx)
- implementation(libs.core.location.altitude)
-
- //Compose BOM
- implementation(platform(libs.compose.bom))
- androidTestImplementation(platform(libs.compose.bom))
-
- //Firebase BOM
- googleImplementation(platform(libs.firebase.bom)) //For Firebase
- googleImplementation(libs.bundles.firebase)
-
- //ksp
- ksp(libs.room.compiler)
- ksp(libs.hilt.compiler)
- kspAndroidTest(libs.hilt.compiler)
-
- //Testing
- testImplementation(libs.bundles.testing)
- debugImplementation(libs.bundles.testing.android.manifest)
- androidTestImplementation(libs.bundles.testing.android)
- androidTestImplementation(libs.bundles.testing.hilt)
- androidTestImplementation(libs.bundles.testing.navigation)
- androidTestImplementation(libs.bundles.testing.room)
-
- detektPlugins(libs.detekt.formatting)
-}
-
-ksp {
-// arg("room.generateKotlin", "true")
- arg("room.schemaLocation", "$projectDir/schemas")
-}
-
-repositories {
- maven { url "https://jitpack.io" }
-}
-
-detekt {
- config.setFrom("../config/detekt/detekt.yml")
- baseline = file("../config/detekt/detekt-baseline.xml")
-}
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
new file mode 100644
index 000000000..d239d0530
--- /dev/null
+++ b/app/build.gradle.kts
@@ -0,0 +1,338 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+import com.android.build.api.dsl.ApplicationExtension
+import com.mikepenz.aboutlibraries.plugin.DuplicateMode
+import com.mikepenz.aboutlibraries.plugin.DuplicateRule
+import org.meshtastic.buildlogic.GitVersionValueSource
+import org.meshtastic.buildlogic.configProperties
+import java.io.FileInputStream
+import java.util.Properties
+
+val gitVersionProvider = providers.of(GitVersionValueSource::class.java) {}
+
+plugins {
+ alias(libs.plugins.meshtastic.android.application)
+ alias(libs.plugins.meshtastic.android.application.flavors)
+ alias(libs.plugins.meshtastic.android.application.compose)
+ id("meshtastic.koin")
+ alias(libs.plugins.kotlin.parcelize)
+ alias(libs.plugins.secrets)
+ alias(libs.plugins.aboutlibraries)
+ id("dev.mokkery")
+}
+
+val keystorePropertiesFile = rootProject.file("keystore.properties")
+val keystoreProperties = Properties()
+
+if (keystorePropertiesFile.exists()) {
+ FileInputStream(keystorePropertiesFile).use { keystoreProperties.load(it) }
+}
+
+configure {
+ namespace = "org.meshtastic.app"
+
+ signingConfigs {
+ create("release") {
+ keyAlias = keystoreProperties["keyAlias"] as String?
+ keyPassword = keystoreProperties["keyPassword"] as String?
+ storeFile = keystoreProperties["storeFile"]?.let { file(it) }
+ storePassword = keystoreProperties["storePassword"] as String?
+ }
+ }
+ defaultConfig {
+ applicationId = configProperties.getProperty("APPLICATION_ID")
+
+ val vcOffset = configProperties.getProperty("VERSION_CODE_OFFSET")?.toInt() ?: 0
+ println("Version code offset: $vcOffset")
+ versionCode =
+ (
+ project.findProperty("android.injected.version.code")?.toString()?.toInt()
+ ?: System.getenv("VERSION_CODE")?.toInt()
+ ?: (gitVersionProvider.get().toInt() + vcOffset)
+ )
+ versionName =
+ (
+ project.findProperty("android.injected.version.name")?.toString()
+ ?: System.getenv("VERSION_NAME")
+ ?: configProperties.getProperty("VERSION_NAME_BASE")
+ )
+ buildConfigField("String", "MIN_FW_VERSION", "\"${configProperties.getProperty("MIN_FW_VERSION")}\"")
+ buildConfigField("String", "ABS_MIN_FW_VERSION", "\"${configProperties.getProperty("ABS_MIN_FW_VERSION")}\"")
+ // We have to list all translated languages here,
+ // because some of our libs have bogus languages that google play
+ // doesn't like and we need to strip them (gr)
+ @Suppress("UnstableApiUsage")
+ val ci = project.findProperty("ci")?.toString()?.toBoolean() ?: false
+ if (ci) {
+ println("CI build detected - limiting locale filters for faster packaging")
+ androidResources.localeFilters.addAll(listOf("en"))
+ } else {
+ androidResources.localeFilters.addAll(
+ listOf(
+ "en",
+ "ar",
+ "bg",
+ "ca",
+ "cs",
+ "de",
+ "el",
+ "es",
+ "et",
+ "fi",
+ "fr",
+ "ga",
+ "gl",
+ "hr",
+ "ht",
+ "hu",
+ "is",
+ "it",
+ "iw",
+ "ja",
+ "ko",
+ "lt",
+ "nl",
+ "no",
+ "pl",
+ "pt",
+ "pt-rBR",
+ "ro",
+ "ru",
+ "sk",
+ "sl",
+ "sq",
+ "sr",
+ "srp",
+ "sv",
+ "tr",
+ "uk",
+ "zh-rCN",
+ "zh-rTW",
+ ),
+ )
+ }
+ ndk { abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64") }
+
+ val disableSplits =
+ project.gradle.startParameter.taskNames.any {
+ it.contains("bundle", ignoreCase = true) || it.contains("google", ignoreCase = true)
+ }
+
+ // Enable ABI splits to generate smaller APKs per architecture for F-Droid/IzzyOnDroid
+ splits {
+ abi {
+ isEnable = !disableSplits
+ reset()
+ include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
+ isUniversalApk = true
+ }
+ }
+
+ dependenciesInfo {
+ // Disables dependency metadata when building APKs (for IzzyOnDroid/F-Droid)
+ includeInApk = false
+ // Disables dependency metadata when building Android App Bundles (for Google Play)
+ includeInBundle = false
+ }
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ // Configure existing product flavors (defined by convention plugin)
+ // with their dynamic version names.
+ productFlavors {
+ configureEach {
+ versionName = "${defaultConfig.versionName} (${defaultConfig.versionCode}) $name"
+ if (name == "google") {
+ manifestPlaceholders["MAPS_API_KEY"] = "dummy"
+ }
+ }
+ }
+
+ buildTypes {
+ release {
+ if (keystoreProperties["storeFile"] != null) {
+ signingConfig = signingConfigs.named("release").get()
+ } else {
+ signingConfig = signingConfigs.getByName("debug")
+ }
+ isDebuggable = false
+ }
+ }
+ bundle { language { enableSplit = false } }
+
+ testOptions { unitTests { isIncludeAndroidResources = true } }
+}
+
+secrets {
+ defaultPropertiesFileName = "secrets.defaults.properties"
+ propertiesFileName = "secrets.properties"
+}
+
+androidComponents {
+ onVariants(selector().withBuildType("debug")) { variant ->
+ variant.flavorName?.let { flavor -> variant.applicationId = "com.geeksville.mesh.$flavor.debug" }
+ }
+
+ onVariants(selector().withBuildType("release")) { variant ->
+ if (variant.flavorName == "google") {
+ val variantNameCapped = variant.name.replaceFirstChar { it.uppercase() }
+ val minifyTaskName = "minify${variantNameCapped}WithR8"
+ val uploadTaskName = "uploadMapping$variantNameCapped"
+ if (project.tasks.findByName(uploadTaskName) != null && project.tasks.findByName(minifyTaskName) != null) {
+ tasks.named(minifyTaskName).configure { finalizedBy(uploadTaskName) }
+ }
+ }
+ }
+}
+
+project.afterEvaluate {
+ logger.lifecycle(
+ "Version code is set to: ${extensions.getByType().defaultConfig.versionCode}",
+ )
+}
+
+dependencies {
+ implementation(projects.core.ble)
+ implementation(projects.core.common)
+ implementation(projects.core.data)
+ implementation(projects.core.database)
+ implementation(projects.core.datastore)
+ implementation(projects.core.di)
+ implementation(projects.core.domain)
+ implementation(projects.core.model)
+ implementation(projects.core.navigation)
+ implementation(libs.jetbrains.lifecycle.viewmodel.navigation3)
+ implementation(projects.core.network)
+ implementation(projects.core.nfc)
+ implementation(projects.core.prefs)
+ implementation(projects.core.proto)
+ implementation(projects.core.service)
+ implementation(projects.core.resources)
+ implementation(projects.core.ui)
+ implementation(projects.core.barcode)
+ implementation(projects.core.takserver)
+ implementation(projects.feature.intro)
+ implementation(projects.feature.messaging)
+ implementation(projects.feature.connections)
+ implementation(projects.feature.map)
+ implementation(projects.feature.node)
+ implementation(projects.feature.settings)
+ implementation(projects.feature.firmware)
+ implementation(projects.feature.wifiProvision)
+ implementation(projects.feature.widget)
+
+ implementation(libs.jetbrains.compose.material3.adaptive)
+ implementation(libs.jetbrains.compose.material3.adaptive.layout)
+ implementation(libs.jetbrains.compose.material3.adaptive.navigation)
+ implementation(libs.material)
+ implementation(libs.compose.multiplatform.animation)
+ implementation(libs.compose.multiplatform.material3)
+ implementation(libs.compose.multiplatform.ui.tooling.preview)
+ implementation(libs.compose.multiplatform.ui)
+ implementation(libs.androidx.glance.appwidget)
+ implementation(libs.androidx.glance.appwidget.preview)
+ implementation(libs.androidx.glance.material3)
+ implementation(libs.androidx.lifecycle.process)
+ implementation(libs.jetbrains.lifecycle.viewmodel.compose)
+ implementation(libs.jetbrains.lifecycle.runtime.compose)
+ implementation(libs.jetbrains.navigation3.ui)
+ implementation(libs.ktor.client.android)
+ implementation(libs.ktor.client.content.negotiation)
+ implementation(libs.ktor.serialization.kotlinx.json)
+ implementation(libs.ktor.client.logging)
+ implementation(libs.coil)
+ implementation(libs.coil.network.ktor3)
+ implementation(libs.coil.svg)
+ implementation(libs.androidx.core.splashscreen)
+ implementation(libs.kotlinx.serialization.json)
+ implementation(libs.usb.serial.android)
+ implementation(libs.androidx.work.runtime.ktx)
+ implementation(libs.koin.android)
+ implementation(libs.koin.compose.viewmodel)
+ implementation(libs.koin.androidx.workmanager)
+ implementation(libs.koin.annotations)
+ implementation(libs.accompanist.permissions)
+ implementation(libs.kermit)
+ implementation(libs.kotlinx.datetime)
+
+ debugImplementation(libs.androidx.compose.ui.test.manifest)
+ debugImplementation(libs.androidx.glance.preview)
+
+ googleImplementation(libs.location.services)
+ googleImplementation(libs.play.services.maps)
+ googleImplementation(libs.maps.compose)
+ googleImplementation(libs.maps.compose.utils)
+ googleImplementation(libs.maps.compose.widgets)
+ googleImplementation(libs.dd.sdk.android.logs)
+ googleImplementation(libs.dd.sdk.android.rum)
+ googleImplementation(libs.dd.sdk.android.session.replay)
+ googleImplementation(libs.dd.sdk.android.session.replay.material)
+ googleImplementation(libs.dd.sdk.android.timber)
+ googleImplementation(libs.dd.sdk.android.trace)
+ googleImplementation(libs.dd.sdk.android.trace.otel)
+ googleImplementation(platform(libs.firebase.bom))
+ googleImplementation(libs.firebase.analytics)
+ googleImplementation(libs.firebase.crashlytics)
+
+ fdroidImplementation(libs.osmdroid.android)
+ fdroidImplementation(libs.osmdroid.geopackage) { exclude(group = "com.j256.ormlite") }
+ fdroidImplementation(libs.osmbonuspack)
+
+ testImplementation(kotlin("test-junit"))
+ testImplementation(libs.androidx.work.testing)
+ testImplementation(libs.koin.test)
+ testRuntimeOnly(libs.junit.vintage.engine)
+ testImplementation(libs.kotlinx.coroutines.test)
+ testImplementation(libs.robolectric)
+ testImplementation(libs.androidx.test.core)
+ testImplementation(libs.compose.multiplatform.ui.test)
+ testImplementation(libs.androidx.test.ext.junit)
+ testImplementation(libs.androidx.glance.appwidget)
+}
+
+aboutLibraries {
+ // Run offline by default to avoid burning GitHub API calls on every build.
+ // Release builds pass -PaboutLibraries.release=true to fetch full license text + funding info.
+ val isReleaseBuild = providers.gradleProperty("aboutLibraries.release").map { it.toBoolean() }.getOrElse(false)
+ val ghToken = providers.environmentVariable("GITHUB_TOKEN")
+
+ offlineMode = !isReleaseBuild
+
+ collect {
+ fetchRemoteLicense = isReleaseBuild && ghToken.isPresent
+ fetchRemoteFunding = isReleaseBuild && ghToken.isPresent
+ if (ghToken.isPresent) {
+ gitHubApiToken = ghToken.get()
+ }
+ }
+ export {
+ excludeFields = listOf("generated")
+ outputFile = file("src/main/resources/aboutlibraries.json")
+ }
+ library {
+ duplicationMode = DuplicateMode.MERGE
+ duplicationRule = DuplicateRule.SIMPLE
+ }
+}
+
+// Ensure aboutlibraries.json is always up-to-date during the build.
+// This is required since AboutLibraries v11+ no longer auto-exports.
+tasks
+ .matching { it.name.startsWith("process") && it.name.endsWith("Resources") }
+ .configureEach { dependsOn("exportLibraryDefinitions") }
diff --git a/app/detekt-baseline.xml b/app/detekt-baseline.xml
new file mode 100644
index 000000000..c373eea43
--- /dev/null
+++ b/app/detekt-baseline.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/app/google-services.json b/app/google-services.json
index d44e7ae87..73d076ce6 100644
--- a/app/google-services.json
+++ b/app/google-services.json
@@ -48,6 +48,19 @@
]
}
}
+ },
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:xxx:android:1111",
+ "android_client_info": {
+ "package_name": "com.geeksville.mesh.google.debug"
+ }
+ },
+ "api_key": [
+ {
+ "current_key": "APlaceholderAPIKeyWith-ThirtyNineCharsX"
+ }
+ ]
}
],
"configuration_version": "1"
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 77aa35790..de2b3144c 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -1,46 +1,45 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
+# ============================================================================
+# Meshtastic Android — ProGuard / R8 rules for release minification
+# ============================================================================
+# Open-source project: obfuscation and optimization are disabled. We rely on
+# tree-shaking (unused code removal) for APK size reduction.
#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
+# Cross-platform library rules (Koin, kotlinx-serialization, Wire, Room,
+# Ktor, Coil, Kable, Kermit, Okio, DataStore, Paging, Lifecycle, Navigation 3,
+# AboutLibraries, Markdown, QRCode, CMP resources, core model) live in
+# config/proguard/shared-rules.pro and are wired in by the
+# AndroidApplicationConventionPlugin. This file holds only Android-specific
+# rules and R8-only directives.
+# ============================================================================
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+# ---- General ----------------------------------------------------------------
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
+# Open-source — no need to obfuscate
+-dontobfuscate
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
+# Disable R8 optimization passes. Tree-shaking (unused code removal) still
+# runs — only method-body rewrites and call-site transformations are suppressed.
+#
+# Why: CMP 1.11 ships consumer rules with -assumenosideeffects on
+# Composer.() and ComposerImpl.(), plus -assumevalues on
+# ComposeRuntimeFlags and ComposeStackTraceMode. These optimization directives
+# let R8 rewrite *call sites* (class-init triggers, flag reads) even when the
+# target classes are preserved by -keep rules. The result is that the Compose
+# recomposer/frame-clock/animation state machines silently freeze on their
+# first frame in release builds. -dontoptimize is the only directive that
+# disables processing of -assumenosideeffects/-assumevalues. See #5146.
+-dontoptimize
-# Needed for protobufs
--keep class com.google.protobuf.** { *; }
--keep class com.geeksville.mesh.** { *; }
+# Dump the full merged R8 configuration (app rules + all library consumer rules)
+# for auditing. Inspect this file after a release build to see what libraries inject.
+-printconfiguration build/outputs/mapping/r8-merged-config.txt
-# eclipse.paho.client
--keep class org.eclipse.paho.client.mqttv3.logging.JSR47Logger { *; }
+# ---- Networking (transitive references from Ktor on Android) ----------------
-# ormlite
--dontwarn com.j256.ormlite.**
-
-# OkHttp
--dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
-# ?
--dontwarn java.awt.image.**
--dontwarn java.lang.reflect.**
--dontwarn com.google.errorprone.annotations.**
-
-# Our app is opensource no need to obsfucate
--dontobfuscate
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable
+# Compose runtime/ui/animation/foundation/material3 keep rules now live in
+# config/proguard/shared-rules.pro so both Android (R8) and desktop (ProGuard)
+# get the same defence-in-depth coverage against CMP 1.11 optimizer folding.
diff --git a/app/src/androidTest/java/com/geeksville/mesh/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/geeksville/mesh/ExampleInstrumentedTest.kt
deleted file mode 100644
index 558ffc6e2..000000000
--- a/app/src/androidTest/java/com/geeksville/mesh/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
-import org.junit.Assert.assertEquals
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
- @Test
- fun useAppContext() {
- // Context of the app under test.
- val appContext = InstrumentationRegistry.getInstrumentation().targetContext
- assertEquals("com.geeksville.mesh", appContext.packageName)
- }
-}
diff --git a/app/src/androidTest/java/com/geeksville/mesh/NodeInfoDaoTest.kt b/app/src/androidTest/java/com/geeksville/mesh/NodeInfoDaoTest.kt
deleted file mode 100644
index 737685f37..000000000
--- a/app/src/androidTest/java/com/geeksville/mesh/NodeInfoDaoTest.kt
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import androidx.room.Room
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
-import com.geeksville.mesh.database.MeshtasticDatabase
-import com.geeksville.mesh.database.dao.NodeInfoDao
-import com.geeksville.mesh.database.entity.MyNodeEntity
-import com.geeksville.mesh.database.entity.NodeEntity
-import com.geeksville.mesh.model.Node
-import com.geeksville.mesh.model.NodeSortOption
-import com.google.protobuf.ByteString
-import kotlinx.coroutines.flow.first
-import kotlinx.coroutines.flow.map
-import kotlinx.coroutines.runBlocking
-import org.junit.After
-import org.junit.Assert.assertEquals
-import org.junit.Assert.assertFalse
-import org.junit.Assert.assertTrue
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-class NodeInfoDaoTest {
- private lateinit var database: MeshtasticDatabase
- private lateinit var nodeInfoDao: NodeInfoDao
-
- private val unknownNode = NodeEntity(
- num = 7,
- user = user {
- id = "!a1b2c3d4"
- longName = "Meshtastic c3d4"
- shortName = "c3d4"
- hwModel = MeshProtos.HardwareModel.UNSET
- },
- longName = "Meshtastic c3d4",
- shortName = null // Dao filter for includeUnknown
- )
-
- private val ourNode = NodeEntity(
- num = 8,
- user = user {
- id = "+16508765308".format(8)
- longName = "Kevin Mester"
- shortName = "KLO"
- hwModel = MeshProtos.HardwareModel.ANDROID_SIM
- isLicensed = false
- },
- longName = "Kevin Mester", shortName = "KLO",
- latitude = 30.267153, longitude = -97.743057 // Austin
- )
-
- private val myNodeInfo: MyNodeEntity = MyNodeEntity(
- myNodeNum = ourNode.num,
- model = null,
- firmwareVersion = null,
- couldUpdate = false,
- shouldUpdate = false,
- currentPacketId = 1L,
- messageTimeoutMsec = 5 * 60 * 1000,
- minAppVersion = 1,
- maxChannels = 8,
- hasWifi = false,
- )
-
- private val testPositions = arrayOf(
- 0.0 to 0.0,
- 32.776665 to -96.796989, // Dallas
- 32.960758 to -96.733521, // Richardson
- 32.912901 to -96.781776, // North Dallas
- 29.760427 to -95.369804, // Houston
- 33.748997 to -84.387985, // Atlanta
- 34.052235 to -118.243683, // Los Angeles
- 40.712776 to -74.005974, // New York City
- 41.878113 to -87.629799, // Chicago
- 39.952583 to -75.165222, // Philadelphia
- )
- private val testNodes = listOf(ourNode, unknownNode) + testPositions.mapIndexed { index, pos ->
- NodeEntity(
- num = 9 + index,
- user = user {
- id = "+165087653%02d".format(9 + index)
- longName = "Kevin Mester$index"
- shortName = "KM$index"
- hwModel = MeshProtos.HardwareModel.ANDROID_SIM
- isLicensed = false
- publicKey = ByteString.copyFrom(ByteArray(32) { index.toByte() })
- },
- longName = "Kevin Mester$index", shortName = "KM$index",
- latitude = pos.first, longitude = pos.second,
- lastHeard = 9 + index,
- )
- }
-
- @Before
- fun createDb(): Unit = runBlocking {
- val context = InstrumentationRegistry.getInstrumentation().targetContext
- database = Room.inMemoryDatabaseBuilder(context, MeshtasticDatabase::class.java).build()
- nodeInfoDao = database.nodeInfoDao()
-
- nodeInfoDao.apply {
- putAll(testNodes)
- setMyNodeInfo(myNodeInfo)
- }
- }
-
- @After
- fun closeDb() {
- database.close()
- }
-
- /**
- * Retrieves a list of nodes based on [sort], [filter] and [includeUnknown] parameters.
- * The list excludes [ourNode] to ensure consistency in the results.
- */
- private suspend fun getNodes(
- sort: NodeSortOption = NodeSortOption.LAST_HEARD,
- filter: String = "",
- includeUnknown: Boolean = true,
- ) = nodeInfoDao.getNodes(
- sort = sort.sqlValue,
- filter = filter,
- includeUnknown = includeUnknown,
- ).map { list -> list.map { it.toModel() } }.first().filter { it.num != ourNode.num }
-
- @Test // node list size
- fun testNodeListSize() = runBlocking {
- val nodes = nodeInfoDao.nodeDBbyNum().first()
- assertEquals(12, nodes.size)
- }
-
- @Test // nodeDBbyNum() re-orders our node at the top of the list
- fun testOurNodeInfoIsFirst() = runBlocking {
- val nodes = nodeInfoDao.nodeDBbyNum().first()
- assertEquals(ourNode.num, nodes.values.first().node.num)
- }
-
- @Test
- fun testSortByLastHeard() = runBlocking {
- val nodes = getNodes(sort = NodeSortOption.LAST_HEARD)
- val sortedNodes = nodes.sortedByDescending { it.lastHeard }
- assertEquals(sortedNodes, nodes)
- }
-
- @Test
- fun testSortByAlpha() = runBlocking {
- val nodes = getNodes(sort = NodeSortOption.ALPHABETICAL)
- val sortedNodes = nodes.sortedBy { it.user.longName.uppercase() }
- assertEquals(sortedNodes, nodes)
- }
-
- @Test
- fun testSortByDistance() = runBlocking {
- val nodes = getNodes(sort = NodeSortOption.DISTANCE)
- fun NodeEntity.toNode() = Node(num = num, user = user, position = position)
- val sortedNodes = nodes.sortedWith( // nodes with invalid (null) positions at the end
- compareBy { it.validPosition == null }.thenBy { it.distance(ourNode.toNode()) }
- )
- assertEquals(sortedNodes, nodes)
- }
-
- @Test
- fun testSortByChannel() = runBlocking {
- val nodes = getNodes(sort = NodeSortOption.CHANNEL)
- val sortedNodes = nodes.sortedBy { it.channel }
- assertEquals(sortedNodes, nodes)
- }
-
- @Test
- fun testSortByViaMqtt() = runBlocking {
- val nodes = getNodes(sort = NodeSortOption.VIA_MQTT)
- val sortedNodes = nodes.sortedBy { it.user.longName.contains("(MQTT)") }
- assertEquals(sortedNodes, nodes)
- }
-
- @Test
- fun testIncludeUnknownIsFalse() = runBlocking {
- val nodes = getNodes(includeUnknown = false)
- val containsUnsetNode = nodes.any { it.isUnknownUser }
- assertFalse(containsUnsetNode)
- }
-
- @Test
- fun testIncludeUnknownIsTrue() = runBlocking {
- val nodes = getNodes(includeUnknown = true)
- val containsUnsetNode = nodes.any { it.isUnknownUser }
- assertTrue(containsUnsetNode)
- }
-
- @Test
- fun testPkcMismatch() = runBlocking {
- val newNode = testNodes[1].copy(user = testNodes[1].user.copy {
- publicKey = ByteString.copyFrom(ByteArray(32) { 99 })
- })
- nodeInfoDao.putAll(listOf(newNode))
- val nodes = getNodes()
- val containsMismatchNode = nodes.any { it.mismatchKey }
- assertTrue(containsMismatchNode)
- }
-}
diff --git a/app/src/androidTest/java/com/geeksville/mesh/PacketDaoTest.kt b/app/src/androidTest/java/com/geeksville/mesh/PacketDaoTest.kt
deleted file mode 100644
index 8385439d0..000000000
--- a/app/src/androidTest/java/com/geeksville/mesh/PacketDaoTest.kt
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import androidx.room.Room
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
-import com.geeksville.mesh.database.MeshtasticDatabase
-import com.geeksville.mesh.database.dao.NodeInfoDao
-import com.geeksville.mesh.database.dao.PacketDao
-import com.geeksville.mesh.database.entity.MyNodeEntity
-import com.geeksville.mesh.database.entity.Packet
-import kotlinx.coroutines.flow.first
-import kotlinx.coroutines.runBlocking
-import org.junit.After
-import org.junit.Assert.assertEquals
-import org.junit.Assert.assertTrue
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-class PacketDaoTest {
- private lateinit var database: MeshtasticDatabase
- private lateinit var nodeInfoDao: NodeInfoDao
- private lateinit var packetDao: PacketDao
-
- private val myNodeInfo: MyNodeEntity = MyNodeEntity(
- myNodeNum = 42424242,
- model = null,
- firmwareVersion = null,
- couldUpdate = false,
- shouldUpdate = false,
- currentPacketId = 1L,
- messageTimeoutMsec = 5 * 60 * 1000,
- minAppVersion = 1,
- maxChannels = 8,
- hasWifi = false,
- )
-
- private val myNodeNum: Int get() = myNodeInfo.myNodeNum
-
- private val testContactKeys = listOf(
- "0${DataPacket.ID_BROADCAST}",
- "1!test1234",
- )
-
- private fun generateTestPackets(myNodeNum: Int) = testContactKeys.flatMap { contactKey ->
- List(SAMPLE_SIZE) {
- Packet(
- uuid = 0L,
- myNodeNum = myNodeNum,
- port_num = Portnums.PortNum.TEXT_MESSAGE_APP_VALUE,
- contact_key = contactKey,
- received_time = System.currentTimeMillis(),
- read = false,
- DataPacket(DataPacket.ID_BROADCAST, 0, "Message $it!"),
- )
- }
- }
-
- @Before
- fun createDb(): Unit = runBlocking {
- val context = InstrumentationRegistry.getInstrumentation().targetContext
- database = Room.inMemoryDatabaseBuilder(context, MeshtasticDatabase::class.java).build()
-
- nodeInfoDao = database.nodeInfoDao().apply {
- setMyNodeInfo(myNodeInfo)
- }
-
- packetDao = database.packetDao().apply {
- generateTestPackets(42424243).forEach { insert(it) }
- generateTestPackets(myNodeNum).forEach { insert(it) }
- }
- }
-
- @After
- fun closeDb() {
- database.close()
- }
-
- @Test
- fun test_myNodeNum() = runBlocking {
- val myNodeInfo = nodeInfoDao.getMyNodeInfo().first()
- assertEquals(myNodeNum, myNodeInfo?.myNodeNum)
- }
-
- @Test
- fun test_getAllPackets() = runBlocking {
- val packets = packetDao.getAllPackets(Portnums.PortNum.TEXT_MESSAGE_APP_VALUE).first()
- assertEquals(testContactKeys.size * SAMPLE_SIZE, packets.size)
-
- val onlyMyNodeNum = packets.all { it.myNodeNum == myNodeNum }
- assertTrue(onlyMyNodeNum)
- }
-
- @Test
- fun test_getContactKeys() = runBlocking {
- val contactKeys = packetDao.getContactKeys().first()
- assertEquals(testContactKeys.size, contactKeys.size)
-
- val onlyMyNodeNum = contactKeys.values.all { it.myNodeNum == myNodeNum }
- assertTrue(onlyMyNodeNum)
- }
-
- @Test
- fun test_getMessageCount() = runBlocking {
- testContactKeys.forEach { contactKey ->
- val messageCount = packetDao.getMessageCount(contactKey)
- assertEquals(SAMPLE_SIZE, messageCount)
- }
- }
-
- @Test
- fun test_getMessagesFrom() = runBlocking {
- testContactKeys.forEach { contactKey ->
- val messages = packetDao.getMessagesFrom(contactKey).first()
- assertEquals(SAMPLE_SIZE, messages.size)
-
- val onlyFromContactKey = messages.all { it.packet.contact_key == contactKey }
- assertTrue(onlyFromContactKey)
-
- val onlyMyNodeNum = messages.all { it.packet.myNodeNum == myNodeNum }
- assertTrue(onlyMyNodeNum)
- }
- }
-
- @Test
- fun test_getUnreadCount() = runBlocking {
- testContactKeys.forEach { contactKey ->
- val unreadCount = packetDao.getUnreadCount(contactKey)
- assertEquals(SAMPLE_SIZE, unreadCount)
- }
- }
-
- @Test
- fun test_clearUnreadCount() = runBlocking {
- val timestamp = System.currentTimeMillis()
- testContactKeys.forEach { contactKey ->
- packetDao.clearUnreadCount(contactKey, timestamp)
- val unreadCount = packetDao.getUnreadCount(contactKey)
- assertEquals(0, unreadCount)
- }
- }
-
- @Test
- fun test_deleteContacts() = runBlocking {
- packetDao.deleteContacts(testContactKeys)
-
- testContactKeys.forEach { contactKey ->
- val messages = packetDao.getMessagesFrom(contactKey).first()
- assertTrue(messages.isEmpty())
- }
- }
-
- companion object {
- private const val SAMPLE_SIZE = 10
- }
-}
diff --git a/app/src/androidTest/java/com/geeksville/mesh/compose/EditDeviceProfileDialogTest.kt b/app/src/androidTest/java/com/geeksville/mesh/compose/EditDeviceProfileDialogTest.kt
deleted file mode 100644
index 33a55bc0b..000000000
--- a/app/src/androidTest/java/com/geeksville/mesh/compose/EditDeviceProfileDialogTest.kt
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.compose
-
-import androidx.compose.ui.test.assertIsDisplayed
-import androidx.compose.ui.test.junit4.createComposeRule
-import androidx.compose.ui.test.onNodeWithText
-import androidx.compose.ui.test.performClick
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
-import com.geeksville.mesh.ClientOnlyProtos.DeviceProfile
-import com.geeksville.mesh.R
-import com.geeksville.mesh.deviceProfile
-import com.geeksville.mesh.position
-import com.geeksville.mesh.ui.radioconfig.components.EditDeviceProfileDialog
-import org.junit.Assert
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-class EditDeviceProfileDialogTest {
-
- @get:Rule
- val composeTestRule = createComposeRule()
-
- private fun getString(id: Int): String =
- InstrumentationRegistry.getInstrumentation().targetContext.getString(id)
-
- private val title = "Export configuration"
- private val deviceProfile = deviceProfile {
- longName = "Long name"
- shortName = "Short name"
- channelUrl = "https://meshtastic.org/e/#CgMSAQESBggBQANIAQ"
- fixedPosition = position {
- latitudeI = 327766650
- longitudeI = -967969890
- altitude = 138
- }
- }
-
- private fun testEditDeviceProfileDialog(
- onDismiss: () -> Unit = {},
- onConfirm: (DeviceProfile) -> Unit = {},
- ) = composeTestRule.setContent {
- EditDeviceProfileDialog(
- title = title,
- deviceProfile = deviceProfile,
- onConfirm = onConfirm,
- onDismiss = onDismiss,
- )
- }
-
- @Test
- fun testEditDeviceProfileDialog_showsDialogTitle() {
- composeTestRule.apply {
- testEditDeviceProfileDialog()
-
- // Verify that the dialog title is displayed
- onNodeWithText(title).assertIsDisplayed()
- }
- }
-
- @Test
- fun testEditDeviceProfileDialog_showsCancelAndSaveButtons() {
- composeTestRule.apply {
- testEditDeviceProfileDialog()
-
- // Verify the "Cancel" and "Save" buttons are displayed
- onNodeWithText(getString(R.string.cancel)).assertIsDisplayed()
- onNodeWithText(getString(R.string.save)).assertIsDisplayed()
- }
- }
-
- @Test
- fun testEditDeviceProfileDialog_clickCancelButton() {
- var onDismissClicked = false
- composeTestRule.apply {
- testEditDeviceProfileDialog(onDismiss = { onDismissClicked = true })
-
- // Click the "Cancel" button
- onNodeWithText(getString(R.string.cancel)).performClick()
- }
-
- // Verify onDismiss is called
- Assert.assertTrue(onDismissClicked)
- }
-
- @Test
- fun testEditDeviceProfileDialog_addChannels() {
- var actualDeviceProfile: DeviceProfile? = null
- composeTestRule.apply {
- testEditDeviceProfileDialog(onConfirm = { actualDeviceProfile = it })
-
- onNodeWithText(getString(R.string.save)).performClick()
- }
-
- // Verify onConfirm is called with the correct DeviceProfile
- Assert.assertEquals(deviceProfile, actualDeviceProfile)
- }
-}
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/geeksville/mesh/compose/ScannedQrCodeDialogTest.kt b/app/src/androidTest/java/com/geeksville/mesh/compose/ScannedQrCodeDialogTest.kt
deleted file mode 100644
index 769101598..000000000
--- a/app/src/androidTest/java/com/geeksville/mesh/compose/ScannedQrCodeDialogTest.kt
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.compose
-
-import androidx.compose.ui.test.assertIsDisplayed
-import androidx.compose.ui.test.junit4.createComposeRule
-import androidx.compose.ui.test.onNodeWithText
-import androidx.compose.ui.test.performClick
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
-import com.geeksville.mesh.AppOnlyProtos.ChannelSet
-import com.geeksville.mesh.ConfigProtos
-import com.geeksville.mesh.R
-import com.geeksville.mesh.channelSet
-import com.geeksville.mesh.channelSettings
-import com.geeksville.mesh.copy
-import com.geeksville.mesh.model.Channel
-import com.geeksville.mesh.ui.components.ScannedQrCodeDialog
-import org.junit.Assert
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-class ScannedQrCodeDialogTest {
-
- @get:Rule
- val composeTestRule = createComposeRule()
-
- private fun getString(id: Int): String =
- InstrumentationRegistry.getInstrumentation().targetContext.getString(id)
-
- private fun getRandomKey() = Channel.getRandomKey()
-
- private val channels = channelSet {
- settings.add(Channel.default.settings)
- loraConfig = Channel.default.loraConfig
- }
-
- private val incoming = channelSet {
- settings.addAll(
- listOf(
- Channel.default.settings,
- channelSettings { name = "2"; psk = getRandomKey() },
- channelSettings { name = "3"; psk = getRandomKey() },
- channelSettings { name = "admin"; psk = getRandomKey() },
- )
- )
- loraConfig = Channel.default.loraConfig
- .copy { modemPreset = ConfigProtos.Config.LoRaConfig.ModemPreset.SHORT_FAST }
- }
-
- private fun testScannedQrCodeDialog(
- onDismiss: () -> Unit = {},
- onConfirm: (ChannelSet) -> Unit = {},
- ) = composeTestRule.setContent {
- ScannedQrCodeDialog(
- channels = channels,
- incoming = incoming,
- onDismiss = onDismiss,
- onConfirm = onConfirm,
- )
- }
-
- @Test
- fun testScannedQrCodeDialog_showsDialogTitle() {
- composeTestRule.apply {
- testScannedQrCodeDialog()
-
- // Verify that the dialog title is displayed
- onNodeWithText(getString(R.string.new_channel_rcvd)).assertIsDisplayed()
- }
- }
-
- @Test
- fun testScannedQrCodeDialog_showsAddAndReplaceButtons() {
- composeTestRule.apply {
- testScannedQrCodeDialog()
-
- // Verify that the "Add" and "Replace" buttons are displayed
- onNodeWithText(getString(R.string.add)).assertIsDisplayed()
- onNodeWithText(getString(R.string.replace)).assertIsDisplayed()
- }
- }
-
- @Test
- fun testScannedQrCodeDialog_showsCancelAndAcceptButtons() {
- composeTestRule.apply {
- testScannedQrCodeDialog()
-
- // Verify the "Cancel" and "Accept" buttons are displayed
- onNodeWithText(getString(R.string.cancel)).assertIsDisplayed()
- onNodeWithText(getString(R.string.accept)).assertIsDisplayed()
- }
- }
-
- @Test
- fun testScannedQrCodeDialog_clickCancelButton() {
- var onDismissClicked = false
- composeTestRule.apply {
- testScannedQrCodeDialog(onDismiss = { onDismissClicked = true })
-
- // Click the "Cancel" button
- onNodeWithText(getString(R.string.cancel)).performClick()
- }
-
- // Verify onDismiss is called
- Assert.assertTrue(onDismissClicked)
- }
-
- @Test
- fun testScannedQrCodeDialog_replaceChannels() {
- var actualChannelSet: ChannelSet? = null
- composeTestRule.apply {
- testScannedQrCodeDialog(onConfirm = { actualChannelSet = it })
-
- // Click the "Accept" button
- onNodeWithText(getString(R.string.accept)).performClick()
- }
-
- // Verify onConfirm is called with the correct ChannelSet
- Assert.assertEquals(incoming, actualChannelSet)
- }
-
- @Test
- fun testScannedQrCodeDialog_addChannels() {
- var actualChannelSet: ChannelSet? = null
- composeTestRule.apply {
- testScannedQrCodeDialog(onConfirm = { actualChannelSet = it })
-
- // Click the "Add" button then the "Accept" button
- onNodeWithText(getString(R.string.add)).performClick()
- onNodeWithText(getString(R.string.accept)).performClick()
- }
-
- // Verify onConfirm is called with the correct ChannelSet
- val expectedChannelSet = channels.copy {
- val list = LinkedHashSet(settings + incoming.settingsList)
- settings.clear()
- settings.addAll(list)
- }
- Assert.assertEquals(expectedChannelSet, actualChannelSet)
- }
-}
diff --git a/app/src/fdroid/java/com/geeksville/mesh/analytics/NopAnalytics.kt b/app/src/fdroid/java/com/geeksville/mesh/analytics/NopAnalytics.kt
deleted file mode 100644
index 658c4370b..000000000
--- a/app/src/fdroid/java/com/geeksville/mesh/analytics/NopAnalytics.kt
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.analytics
-
-import android.content.Context
-import com.geeksville.mesh.android.Logging
-
-class DataPair(val name: String, valueIn: Any?) {
- val value = valueIn ?: "null"
-
- /// An accumulating firebase event - only one allowed per event
- constructor(d: Double) : this("BOGUS", d)
- constructor(d: Int) : this("BOGUS", d)
-}
-
-/**
- * Implement our analytics API using Firebase Analytics
- */
-@Suppress("UNUSED_PARAMETER")
-class NopAnalytics(context: Context) : AnalyticsProvider, Logging {
-
- init {
- }
-
- override fun setEnabled(on: Boolean) {
- }
-
- override fun endSession() {
- }
-
- override fun trackLowValue(event: String, vararg properties: DataPair) {
- }
-
- override fun track(event: String, vararg properties: DataPair) {
- }
-
- override fun startSession() {
- }
-
- override fun setUserInfo(vararg p: DataPair) {
- }
-
- override fun increment(name: String, amount: Double) {
- }
-
- /**
- * Send a google analytics screen view event
- */
- override fun sendScreenView(name: String) {
- }
-
- override fun endScreenView() {
- }
-}
diff --git a/app/src/fdroid/java/com/geeksville/mesh/android/GeeksvilleApplication.kt b/app/src/fdroid/java/com/geeksville/mesh/android/GeeksvilleApplication.kt
deleted file mode 100644
index f58046e30..000000000
--- a/app/src/fdroid/java/com/geeksville/mesh/android/GeeksvilleApplication.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.app.Application
-import android.content.Context
-import android.content.SharedPreferences
-import android.provider.Settings
-import androidx.appcompat.app.AppCompatActivity
-import androidx.core.content.edit
-import com.geeksville.mesh.analytics.AnalyticsProvider
-
-open class GeeksvilleApplication : Application(), Logging {
-
- companion object {
- lateinit var analytics: AnalyticsProvider
- }
-
- /// Are we running inside the testlab?
- val isInTestLab: Boolean
- get() {
- val testLabSetting =
- Settings.System.getString(contentResolver, "firebase.test.lab") ?: null
- if(testLabSetting != null)
- info("Testlab is $testLabSetting")
- return "true" == testLabSetting
- }
-
- private val analyticsPrefs: SharedPreferences by lazy {
- getSharedPreferences("analytics-prefs", Context.MODE_PRIVATE)
- }
-
- var isAnalyticsAllowed: Boolean
- get() = analyticsPrefs.getBoolean("allowed", true)
- set(value) {
- analyticsPrefs.edit {
- putBoolean("allowed", value)
- }
-
- // Change the flag with the providers
- analytics.setEnabled(value && !isInTestLab) // Never do analytics in the test lab
- }
-
- @Suppress("UNUSED_PARAMETER")
- fun askToRate(activity: AppCompatActivity) {
- // do nothing
- }
-
- override fun onCreate() {
- super.onCreate()
-
- val nopAnalytics = com.geeksville.mesh.analytics.NopAnalytics(this)
- analytics = nopAnalytics
- isAnalyticsAllowed = false
- }
-}
-
-fun Context.isGooglePlayAvailable(): Boolean = false
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/model/map/clustering/MarkerClusterer.java b/app/src/fdroid/java/org/meshtastic/app/map/cluster/MarkerClusterer.java
similarity index 87%
rename from app/src/main/java/com/geeksville/mesh/model/map/clustering/MarkerClusterer.java
rename to app/src/fdroid/java/org/meshtastic/app/map/cluster/MarkerClusterer.java
index 05d07d5cf..38e51da52 100644
--- a/app/src/main/java/com/geeksville/mesh/model/map/clustering/MarkerClusterer.java
+++ b/app/src/fdroid/java/org/meshtastic/app/map/cluster/MarkerClusterer.java
@@ -1,17 +1,32 @@
-package com.geeksville.mesh.model.map.clustering;
+/*
+ * Copyright (c) 2025 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package org.meshtastic.app.map.cluster;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;
import android.view.MotionEvent;
-import org.osmdroid.api.IGeoPoint;
-import org.osmdroid.bonuspack.kml.KmlFeature;
+import org.meshtastic.app.map.model.MarkerWithLabel;
+
import org.osmdroid.util.BoundingBox;
-import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;
import org.osmdroid.views.overlay.Overlay;
-import com.geeksville.mesh.model.map.MarkerWithLabel;
import java.util.ArrayList;
import java.util.Iterator;
diff --git a/app/src/main/java/com/geeksville/mesh/model/map/clustering/RadiusMarkerClusterer.java b/app/src/fdroid/java/org/meshtastic/app/map/cluster/RadiusMarkerClusterer.java
similarity index 88%
rename from app/src/main/java/com/geeksville/mesh/model/map/clustering/RadiusMarkerClusterer.java
rename to app/src/fdroid/java/org/meshtastic/app/map/cluster/RadiusMarkerClusterer.java
index 954551175..e2710352a 100644
--- a/app/src/main/java/com/geeksville/mesh/model/map/clustering/RadiusMarkerClusterer.java
+++ b/app/src/fdroid/java/org/meshtastic/app/map/cluster/RadiusMarkerClusterer.java
@@ -1,4 +1,21 @@
-package com.geeksville.mesh.model.map.clustering;
+/*
+ * Copyright (c) 2025 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package org.meshtastic.app.map.cluster;
import android.content.Context;
import android.graphics.Bitmap;
@@ -10,11 +27,12 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.view.MotionEvent;
+import org.meshtastic.app.map.model.MarkerWithLabel;
+
import org.osmdroid.bonuspack.R;
import org.osmdroid.util.BoundingBox;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;
-import com.geeksville.mesh.model.map.MarkerWithLabel;
import java.util.ArrayList;
import java.util.Iterator;
@@ -107,10 +125,10 @@ public class RadiusMarkerClusterer extends MarkerClusterer {
Iterator it = mClonedMarkers.iterator();
while (it.hasNext()) {
- MarkerWithLabel neighbour = it.next();
- double distance = clusterPosition.distanceToAsDouble(neighbour.getPosition());
+ MarkerWithLabel neighbor = it.next();
+ double distance = clusterPosition.distanceToAsDouble(neighbor.getPosition());
if (distance <= mRadiusInMeters) {
- cluster.add(neighbour);
+ cluster.add(neighbor);
it.remove();
}
}
diff --git a/app/src/main/java/com/geeksville/mesh/model/map/clustering/StaticCluster.java b/app/src/fdroid/java/org/meshtastic/app/map/cluster/StaticCluster.java
similarity index 67%
rename from app/src/main/java/com/geeksville/mesh/model/map/clustering/StaticCluster.java
rename to app/src/fdroid/java/org/meshtastic/app/map/cluster/StaticCluster.java
index 254020613..324a34b52 100644
--- a/app/src/main/java/com/geeksville/mesh/model/map/clustering/StaticCluster.java
+++ b/app/src/fdroid/java/org/meshtastic/app/map/cluster/StaticCluster.java
@@ -1,8 +1,26 @@
-package com.geeksville.mesh.model.map.clustering;
+/*
+ * Copyright (c) 2025 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package org.meshtastic.app.map.cluster;
+
+import org.meshtastic.app.map.model.MarkerWithLabel;
import org.osmdroid.util.BoundingBox;
import org.osmdroid.util.GeoPoint;
-import com.geeksville.mesh.model.map.MarkerWithLabel;
import java.util.ArrayList;
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/analytics/FdroidPlatformAnalytics.kt b/app/src/fdroid/kotlin/org/meshtastic/app/analytics/FdroidPlatformAnalytics.kt
new file mode 100644
index 000000000..7d0daab08
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/analytics/FdroidPlatformAnalytics.kt
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.analytics
+
+import co.touchlab.kermit.Logger
+import co.touchlab.kermit.Severity
+import org.koin.core.annotation.Single
+import org.meshtastic.app.BuildConfig
+import org.meshtastic.core.repository.DataPair
+import org.meshtastic.core.repository.PlatformAnalytics
+
+/**
+ * F-Droid specific implementation of [PlatformAnalytics]. This provides no-op implementations for analytics and other
+ * platform services.
+ */
+@Single
+class FdroidPlatformAnalytics : PlatformAnalytics {
+ init {
+ // For F-Droid builds we don't initialize external analytics services.
+ // In debug builds we attach a DebugTree for convenient local logging, but
+ // release builds rely on system logging only.
+ if (BuildConfig.DEBUG) {
+ Logger.setMinSeverity(Severity.Debug)
+ Logger.i { "F-Droid platform no-op analytics initialized (Debug mode)." }
+ } else {
+ Logger.setMinSeverity(Severity.Info)
+ Logger.i { "F-Droid platform no-op analytics initialized." }
+ }
+ }
+
+ override fun setDeviceAttributes(firmwareVersion: String, model: String) {
+ // No-op for F-Droid
+ Logger.d { "Set device attributes called: firmwareVersion=$firmwareVersion, deviceHardware=$model" }
+ }
+
+ override val isPlatformServicesAvailable: Boolean
+ get() = false
+
+ override fun track(event: String, vararg properties: DataPair) {
+ Logger.d { "Track called: event=$event, properties=${properties.toList()}" }
+ }
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/di/FDroidNetworkModule.kt b/app/src/fdroid/kotlin/org/meshtastic/app/di/FDroidNetworkModule.kt
new file mode 100644
index 000000000..fba7a417f
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/di/FDroidNetworkModule.kt
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.di
+
+import org.koin.core.annotation.Module
+import org.koin.core.annotation.Single
+import org.meshtastic.core.model.NetworkDeviceHardware
+import org.meshtastic.core.model.NetworkFirmwareReleases
+import org.meshtastic.core.network.service.ApiService
+
+@Module
+class FDroidNetworkModule {
+
+ @Single
+ fun provideApiService(): ApiService = object : ApiService {
+ override suspend fun getDeviceHardware(): List =
+ throw NotImplementedError("API calls to getDeviceHardware are not supported on Fdroid builds.")
+
+ override suspend fun getFirmwareReleases(): NetworkFirmwareReleases =
+ throw NotImplementedError("API calls to getFirmwareReleases are not supported on Fdroid builds.")
+ }
+}
diff --git a/app/src/main/java/com/geeksville/mesh/repository/radio/RadioServiceConnectionState.kt b/app/src/fdroid/kotlin/org/meshtastic/app/di/FlavorModule.kt
similarity index 76%
rename from app/src/main/java/com/geeksville/mesh/repository/radio/RadioServiceConnectionState.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/di/FlavorModule.kt
index a32465be4..5a192d437 100644
--- a/app/src/main/java/com/geeksville/mesh/repository/radio/RadioServiceConnectionState.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/di/FlavorModule.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,10 +14,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+package org.meshtastic.app.di
-package com.geeksville.mesh.repository.radio
+import org.koin.core.annotation.Module
-data class RadioServiceConnectionState(
- val isConnected: Boolean = false,
- val isPermanent: Boolean = false
-)
+@Module(includes = [FDroidNetworkModule::class])
+class FlavorModule
diff --git a/app/src/main/java/com/geeksville/mesh/repository/radio/IRadioInterface.kt b/app/src/fdroid/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt
similarity index 77%
rename from app/src/main/java/com/geeksville/mesh/repository/radio/IRadioInterface.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt
index f0f08f6da..a9065a24a 100644
--- a/app/src/main/java/com/geeksville/mesh/repository/radio/IRadioInterface.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,12 +14,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+package org.meshtastic.app.intro
-package com.geeksville.mesh.repository.radio
+import androidx.compose.runtime.Composable
-import java.io.Closeable
-
-interface IRadioInterface : Closeable {
- fun handleSendToRadio(p: ByteArray)
+@Composable
+fun AnalyticsIntro() {
+ // no-op for fdroid
}
-
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/FdroidMapViewProvider.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/FdroidMapViewProvider.kt
new file mode 100644
index 000000000..21c2d4fde
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/FdroidMapViewProvider.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.ui.Modifier
+import org.koin.compose.viewmodel.koinViewModel
+import org.koin.core.annotation.Single
+import org.meshtastic.core.ui.util.MapViewProvider
+
+/** OSMDroid implementation of [MapViewProvider]. */
+@Single
+class FdroidMapViewProvider : MapViewProvider {
+ @Composable
+ override fun MapView(modifier: Modifier, navigateToNodeDetails: (Int) -> Unit, waypointId: Int?) {
+ val mapViewModel: MapViewModel = koinViewModel()
+ LaunchedEffect(waypointId) { mapViewModel.setWaypointId(waypointId) }
+ org.meshtastic.app.map.MapView(
+ modifier = modifier,
+ mapViewModel = mapViewModel,
+ navigateToNodeDetails = navigateToNodeDetails,
+ )
+ }
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt
new file mode 100644
index 000000000..48b1aa7fc
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import org.meshtastic.core.ui.util.MapViewProvider
+
+fun getMapViewProvider(): MapViewProvider = FdroidMapViewProvider()
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/MapUtils.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapUtils.kt
new file mode 100644
index 000000000..1243fdc8a
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapUtils.kt
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import android.content.Context
+import android.util.TypedValue
+import org.osmdroid.util.BoundingBox
+import org.osmdroid.util.GeoPoint
+import kotlin.math.log2
+import kotlin.math.pow
+
+private const val DEGREES_IN_CIRCLE = 360.0
+private const val METERS_PER_DEGREE_LATITUDE = 111320.0
+private const val ZOOM_ADJUSTMENT_FACTOR = 0.8
+
+/**
+ * Calculates the zoom level required to fit the entire [BoundingBox] inside the map view.
+ *
+ * @return The zoom level as a Double value.
+ */
+fun BoundingBox.requiredZoomLevel(): Double {
+ val topLeft = GeoPoint(this.latNorth, this.lonWest)
+ val bottomRight = GeoPoint(this.latSouth, this.lonEast)
+ val latLonWidth = topLeft.distanceToAsDouble(GeoPoint(topLeft.latitude, bottomRight.longitude))
+ val latLonHeight = topLeft.distanceToAsDouble(GeoPoint(bottomRight.latitude, topLeft.longitude))
+ val requiredLatZoom = log2(DEGREES_IN_CIRCLE / (latLonHeight / METERS_PER_DEGREE_LATITUDE))
+ val requiredLonZoom = log2(DEGREES_IN_CIRCLE / (latLonWidth / METERS_PER_DEGREE_LATITUDE))
+ return maxOf(requiredLatZoom, requiredLonZoom) * ZOOM_ADJUSTMENT_FACTOR
+}
+
+/**
+ * Creates a new bounding box with adjusted dimensions based on the provided [zoomFactor].
+ *
+ * @return A new [BoundingBox] with added [zoomFactor]. Example:
+ * ```
+ * // Setting the zoom level directly using setZoom()
+ * map.setZoom(14.0)
+ * val boundingBoxZoom14 = map.boundingBox
+ *
+ * // Using zoomIn() results the equivalent BoundingBox with setZoom(15.0)
+ * val boundingBoxZoom15 = boundingBoxZoom14.zoomIn(1.0)
+ * ```
+ */
+fun BoundingBox.zoomIn(zoomFactor: Double): BoundingBox {
+ val center = GeoPoint((latNorth + latSouth) / 2, (lonWest + lonEast) / 2)
+ val latDiff = latNorth - latSouth
+ val lonDiff = lonEast - lonWest
+
+ val newLatDiff = latDiff / (2.0.pow(zoomFactor))
+ val newLonDiff = lonDiff / (2.0.pow(zoomFactor))
+
+ return BoundingBox(
+ center.latitude + newLatDiff / 2,
+ center.longitude + newLonDiff / 2,
+ center.latitude - newLatDiff / 2,
+ center.longitude - newLonDiff / 2,
+ )
+}
+
+// Converts SP to pixels.
+fun Context.spToPx(sp: Float): Int =
+ TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, resources.displayMetrics).toInt()
+
+// Converts DP to pixels.
+fun Context.dpToPx(dp: Float): Int =
+ TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, resources.displayMetrics).toInt()
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/MapView.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapView.kt
new file mode 100644
index 000000000..b4d0e1bbd
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapView.kt
@@ -0,0 +1,962 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import android.Manifest
+import androidx.appcompat.content.res.AppCompatResources
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ColumnScope
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.wrapContentHeight
+import androidx.compose.foundation.layout.wrapContentWidth
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material3.AlertDialogDefaults
+import androidx.compose.material3.BasicAlertDialog
+import androidx.compose.material3.Checkbox
+import androidx.compose.material3.DropdownMenu
+import androidx.compose.material3.DropdownMenuItem
+import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.HorizontalDivider
+import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Scaffold
+import androidx.compose.material3.Slider
+import androidx.compose.material3.Surface
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.derivedStateOf
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableDoubleStateOf
+import androidx.compose.runtime.mutableFloatStateOf
+import androidx.compose.runtime.mutableStateListOf
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.hapticfeedback.HapticFeedbackType
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.platform.LocalHapticFeedback
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import co.touchlab.kermit.Logger
+import com.google.accompanist.permissions.ExperimentalPermissionsApi
+import com.google.accompanist.permissions.rememberMultiplePermissionsState
+import com.google.android.material.dialog.MaterialAlertDialogBuilder
+import kotlinx.coroutines.launch
+import org.jetbrains.compose.resources.StringResource
+import org.jetbrains.compose.resources.stringResource
+import org.koin.compose.viewmodel.koinViewModel
+import org.meshtastic.app.R
+import org.meshtastic.app.map.cluster.RadiusMarkerClusterer
+import org.meshtastic.app.map.component.CacheLayout
+import org.meshtastic.app.map.component.DownloadButton
+import org.meshtastic.app.map.component.EditWaypointDialog
+import org.meshtastic.app.map.model.CustomTileSource
+import org.meshtastic.app.map.model.MarkerWithLabel
+import org.meshtastic.core.common.gpsDisabled
+import org.meshtastic.core.common.util.DateFormatter
+import org.meshtastic.core.common.util.nowMillis
+import org.meshtastic.core.common.util.nowSeconds
+import org.meshtastic.core.model.DataPacket
+import org.meshtastic.core.model.Node
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.calculating
+import org.meshtastic.core.resources.cancel
+import org.meshtastic.core.resources.clear
+import org.meshtastic.core.resources.close
+import org.meshtastic.core.resources.delete_for_everyone
+import org.meshtastic.core.resources.delete_for_me
+import org.meshtastic.core.resources.expires
+import org.meshtastic.core.resources.getString
+import org.meshtastic.core.resources.last_heard_filter_label
+import org.meshtastic.core.resources.location_disabled
+import org.meshtastic.core.resources.map_cache_info
+import org.meshtastic.core.resources.map_cache_manager
+import org.meshtastic.core.resources.map_cache_size
+import org.meshtastic.core.resources.map_cache_tiles
+import org.meshtastic.core.resources.map_clear_tiles
+import org.meshtastic.core.resources.map_download_complete
+import org.meshtastic.core.resources.map_download_errors
+import org.meshtastic.core.resources.map_download_region
+import org.meshtastic.core.resources.map_node_popup_details
+import org.meshtastic.core.resources.map_offline_manager
+import org.meshtastic.core.resources.map_purge_fail
+import org.meshtastic.core.resources.map_purge_success
+import org.meshtastic.core.resources.map_style_selection
+import org.meshtastic.core.resources.map_subDescription
+import org.meshtastic.core.resources.map_tile_source
+import org.meshtastic.core.resources.only_favorites
+import org.meshtastic.core.resources.show_precision_circle
+import org.meshtastic.core.resources.show_waypoints
+import org.meshtastic.core.resources.waypoint_delete
+import org.meshtastic.core.resources.you
+import org.meshtastic.core.ui.component.BasicListItem
+import org.meshtastic.core.ui.component.ListItem
+import org.meshtastic.core.ui.icon.Check
+import org.meshtastic.core.ui.icon.Favorite
+import org.meshtastic.core.ui.icon.Layers
+import org.meshtastic.core.ui.icon.Lens
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+import org.meshtastic.core.ui.icon.PinDrop
+import org.meshtastic.core.ui.util.formatAgo
+import org.meshtastic.core.ui.util.showToast
+import org.meshtastic.feature.map.BaseMapViewModel.MapFilterState
+import org.meshtastic.feature.map.LastHeardFilter
+import org.meshtastic.feature.map.component.MapButton
+import org.meshtastic.feature.map.component.MapControlsOverlay
+import org.meshtastic.proto.Config.DisplayConfig.DisplayUnits
+import org.meshtastic.proto.Waypoint
+import org.osmdroid.bonuspack.utils.BonusPackHelper.getBitmapFromVectorDrawable
+import org.osmdroid.config.Configuration
+import org.osmdroid.events.MapEventsReceiver
+import org.osmdroid.events.MapListener
+import org.osmdroid.events.ScrollEvent
+import org.osmdroid.events.ZoomEvent
+import org.osmdroid.tileprovider.cachemanager.CacheManager
+import org.osmdroid.tileprovider.modules.SqliteArchiveTileWriter
+import org.osmdroid.tileprovider.tilesource.ITileSource
+import org.osmdroid.tileprovider.tilesource.OnlineTileSourceBase
+import org.osmdroid.tileprovider.tilesource.TileSourcePolicyException
+import org.osmdroid.util.BoundingBox
+import org.osmdroid.util.GeoPoint
+import org.osmdroid.views.MapView
+import org.osmdroid.views.overlay.MapEventsOverlay
+import org.osmdroid.views.overlay.Marker
+import org.osmdroid.views.overlay.Polygon
+import org.osmdroid.views.overlay.infowindow.InfoWindow
+import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay
+import java.io.File
+import kotlin.math.roundToInt
+
+private fun MapView.updateMarkers(
+ nodeMarkers: List,
+ waypointMarkers: List,
+ nodeClusterer: RadiusMarkerClusterer,
+) {
+ Logger.d { "Showing on map: ${nodeMarkers.size} nodes ${waypointMarkers.size} waypoints" }
+
+ overlays.removeAll { overlay ->
+ overlay is MarkerWithLabel || (overlay is Marker && overlay !in nodeClusterer.items)
+ }
+
+ overlays.addAll(waypointMarkers)
+
+ nodeClusterer.items.clear()
+ nodeClusterer.items.addAll(nodeMarkers)
+ nodeClusterer.invalidate()
+}
+
+private fun cacheManagerCallback(onTaskComplete: () -> Unit, onTaskFailed: (Int) -> Unit) =
+ object : CacheManager.CacheManagerCallback {
+ override fun onTaskComplete() {
+ onTaskComplete()
+ }
+
+ override fun onTaskFailed(errors: Int) {
+ onTaskFailed(errors)
+ }
+
+ override fun updateProgress(progress: Int, currentZoomLevel: Int, zoomMin: Int, zoomMax: Int) {
+ // NOOP since we are using the build in UI
+ }
+
+ override fun downloadStarted() {
+ // NOOP since we are using the build in UI
+ }
+
+ override fun setPossibleTilesInArea(total: Int) {
+ // NOOP since we are using the build in UI
+ }
+ }
+
+/**
+ * Main composable for displaying the map view, including nodes, waypoints, and user location. It handles user
+ * interactions for map manipulation, filtering, and offline caching.
+ *
+ * @param mapViewModel The [MapViewModel] providing data and state for the map.
+ * @param navigateToNodeDetails Callback to navigate to the details screen of a selected node.
+ */
+@OptIn(ExperimentalPermissionsApi::class) // Added for Accompanist
+@Suppress("CyclomaticComplexMethod", "LongMethod")
+@Composable
+fun MapView(
+ modifier: Modifier = Modifier,
+ mapViewModel: MapViewModel = koinViewModel(),
+ navigateToNodeDetails: (Int) -> Unit,
+) {
+ var mapFilterExpanded by remember { mutableStateOf(false) }
+
+ val mapFilterState by mapViewModel.mapFilterStateFlow.collectAsStateWithLifecycle()
+ val isConnected by mapViewModel.isConnected.collectAsStateWithLifecycle()
+
+ var cacheEstimate by remember { mutableStateOf("") }
+
+ var zoomLevelMin by remember { mutableDoubleStateOf(0.0) }
+ var zoomLevelMax by remember { mutableDoubleStateOf(0.0) }
+
+ var downloadRegionBoundingBox: BoundingBox? by remember { mutableStateOf(null) }
+ var myLocationOverlay: MyLocationNewOverlay? by remember { mutableStateOf(null) }
+
+ var showDownloadButton: Boolean by remember { mutableStateOf(false) }
+ var showEditWaypointDialog by remember { mutableStateOf(null) }
+ var showCacheManagerDialog by remember { mutableStateOf(false) }
+ var showCurrentCacheInfo by remember { mutableStateOf(false) }
+ var showPurgeTileSourceDialog by remember { mutableStateOf(false) }
+ var showMapStyleDialog by remember { mutableStateOf(false) }
+
+ val scope = rememberCoroutineScope()
+ val context = LocalContext.current
+ val density = LocalDensity.current
+
+ val haptic = LocalHapticFeedback.current
+ fun performHapticFeedback() = haptic.performHapticFeedback(HapticFeedbackType.LongPress)
+
+ // Accompanist permissions state for location
+ val locationPermissionsState =
+ rememberMultiplePermissionsState(permissions = listOf(Manifest.permission.ACCESS_FINE_LOCATION))
+ var triggerLocationToggleAfterPermission by remember { mutableStateOf(false) }
+
+ fun loadOnlineTileSourceBase(): ITileSource {
+ val id = mapViewModel.mapStyleId
+ Logger.d { "mapStyleId from prefs: $id" }
+ return CustomTileSource.getTileSource(id).also {
+ zoomLevelMax = it.maximumZoomLevel.toDouble()
+ showDownloadButton = if (it is OnlineTileSourceBase) it.tileSourcePolicy.acceptsBulkDownload() else false
+ }
+ }
+
+ val initialCameraView = remember {
+ val nodes = mapViewModel.nodes.value
+ val nodesWithPosition = nodes.filter { it.validPosition != null }
+ val geoPoints = nodesWithPosition.map { GeoPoint(it.latitude, it.longitude) }
+ BoundingBox.fromGeoPoints(geoPoints)
+ }
+ val map =
+ rememberMapViewWithLifecycle(
+ applicationId = mapViewModel.applicationId,
+ box = initialCameraView,
+ tileSource = loadOnlineTileSourceBase(),
+ )
+
+ val nodeClusterer = remember { RadiusMarkerClusterer(context) }
+
+ fun MapView.toggleMyLocation() {
+ if (context.gpsDisabled()) {
+ Logger.d { "Telling user we need location turned on for MyLocationNewOverlay" }
+ scope.launch { context.showToast(Res.string.location_disabled) }
+ return
+ }
+
+ Logger.d { "user clicked MyLocationNewOverlay ${myLocationOverlay == null}" }
+ if (myLocationOverlay == null) {
+ myLocationOverlay =
+ MyLocationNewOverlay(this).apply {
+ enableMyLocation()
+ enableFollowLocation()
+ getBitmapFromVectorDrawable(context, R.drawable.ic_map_location_dot)?.let {
+ setPersonIcon(it)
+ setPersonAnchor(0.5f, 0.5f)
+ }
+ getBitmapFromVectorDrawable(context, R.drawable.ic_map_navigation)?.let {
+ setDirectionIcon(it)
+ setDirectionAnchor(0.5f, 0.5f)
+ }
+ }
+ overlays.add(myLocationOverlay)
+ } else {
+ myLocationOverlay?.apply {
+ disableMyLocation()
+ disableFollowLocation()
+ }
+ overlays.remove(myLocationOverlay)
+ myLocationOverlay = null
+ }
+ }
+
+ // Effect to toggle MyLocation after permission is granted
+ LaunchedEffect(locationPermissionsState.allPermissionsGranted) {
+ if (locationPermissionsState.allPermissionsGranted && triggerLocationToggleAfterPermission) {
+ map.toggleMyLocation()
+ triggerLocationToggleAfterPermission = false
+ }
+ }
+
+ // Keep screen on while location tracking is active
+ LaunchedEffect(myLocationOverlay) {
+ val activity = context as? android.app.Activity ?: return@LaunchedEffect
+ if (myLocationOverlay != null) {
+ activity.window.addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ } else {
+ activity.window.clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ }
+ }
+
+ val nodes by mapViewModel.nodes.collectAsStateWithLifecycle()
+ val waypoints by mapViewModel.waypoints.collectAsStateWithLifecycle(emptyMap())
+ val selectedWaypointId by mapViewModel.selectedWaypointId.collectAsStateWithLifecycle()
+ val myId by mapViewModel.myId.collectAsStateWithLifecycle()
+
+ LaunchedEffect(selectedWaypointId, waypoints) {
+ if (selectedWaypointId != null && waypoints.containsKey(selectedWaypointId)) {
+ waypoints[selectedWaypointId]?.waypoint?.let { pt ->
+ val geoPoint = GeoPoint((pt.latitude_i ?: 0) * 1e-7, (pt.longitude_i ?: 0) * 1e-7)
+ map.controller.setCenter(geoPoint)
+ map.controller.setZoom(WAYPOINT_ZOOM)
+ }
+ }
+ }
+
+ val markerIcon = remember { AppCompatResources.getDrawable(context, R.drawable.ic_location_on) }
+
+ fun MapView.onNodesChanged(nodes: Collection): List {
+ val nodesWithPosition = nodes.filter { it.validPosition != null }
+ val ourNode = mapViewModel.ourNodeInfo.value
+ val displayUnits = mapViewModel.config.display?.units ?: DisplayUnits.METRIC
+ val mapFilterStateValue = mapViewModel.mapFilterStateFlow.value // Access mapFilterState directly
+ return nodesWithPosition.mapNotNull { node ->
+ if (mapFilterStateValue.onlyFavorites && !node.isFavorite && !node.equals(ourNode)) {
+ return@mapNotNull null
+ }
+ if (
+ mapFilterStateValue.lastHeardFilter.seconds != 0L &&
+ (nowSeconds - node.lastHeard) > mapFilterStateValue.lastHeardFilter.seconds &&
+ node.num != ourNode?.num
+ ) {
+ return@mapNotNull null
+ }
+
+ val (p, u) = node.position to node.user
+ val nodePosition = GeoPoint(node.latitude, node.longitude)
+ MarkerWithLabel(mapView = this, label = "${u.short_name} ${formatAgo(p.time)}").apply {
+ id = u.id
+ title = u.long_name
+ snippet =
+ getString(
+ Res.string.map_node_popup_details,
+ node.gpsString(),
+ formatAgo(node.lastHeard),
+ formatAgo(p.time),
+ if (node.batteryStr != "") node.batteryStr else "?",
+ )
+ ourNode?.distanceStr(node, displayUnits)?.let { dist ->
+ ourNode.bearing(node)?.let { bearing ->
+ subDescription = getString(Res.string.map_subDescription, bearing, dist)
+ }
+ }
+ setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM)
+ position = nodePosition
+ icon = markerIcon
+ setNodeColors(node.colors)
+ if (!mapFilterStateValue.showPrecisionCircle) {
+ setPrecisionBits(0)
+ } else {
+ setPrecisionBits(p.precision_bits)
+ }
+ setOnLongClickListener {
+ navigateToNodeDetails(node.num)
+ true
+ }
+ }
+ }
+ }
+
+ fun showDeleteMarkerDialog(waypoint: Waypoint) {
+ val builder = MaterialAlertDialogBuilder(context)
+ builder.setTitle(getString(Res.string.waypoint_delete))
+ builder.setNeutralButton(getString(Res.string.cancel)) { _, _ ->
+ Logger.d { "User canceled marker delete dialog" }
+ }
+ builder.setNegativeButton(getString(Res.string.delete_for_me)) { _, _ ->
+ Logger.d { "User deleted waypoint ${waypoint.id} for me" }
+ mapViewModel.deleteWaypoint(waypoint.id)
+ }
+ if (waypoint.locked_to in setOf(0, mapViewModel.myNodeNum ?: 0) && isConnected) {
+ builder.setPositiveButton(getString(Res.string.delete_for_everyone)) { _, _ ->
+ Logger.d { "User deleted waypoint ${waypoint.id} for everyone" }
+ mapViewModel.sendWaypoint(waypoint.copy(expire = 1))
+ mapViewModel.deleteWaypoint(waypoint.id)
+ }
+ }
+ val dialog = builder.show()
+ for (
+ button in
+ setOf(
+ androidx.appcompat.app.AlertDialog.BUTTON_NEUTRAL,
+ androidx.appcompat.app.AlertDialog.BUTTON_NEGATIVE,
+ androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE,
+ )
+ ) {
+ with(dialog.getButton(button)) {
+ textSize = 12F
+ isAllCaps = false
+ }
+ }
+ }
+
+ fun showMarkerLongPressDialog(id: Int) {
+ performHapticFeedback()
+ Logger.d { "marker long pressed id=$id" }
+ val waypoint = waypoints[id]?.waypoint ?: return
+ // edit only when unlocked or lockedTo myNodeNum
+ if (waypoint.locked_to in setOf(0, mapViewModel.myNodeNum ?: 0) && isConnected) {
+ showEditWaypointDialog = waypoint
+ } else {
+ showDeleteMarkerDialog(waypoint)
+ }
+ }
+
+ fun getUsername(id: String?) = if (id == DataPacket.ID_LOCAL || (myId != null && id == myId)) {
+ getString(Res.string.you)
+ } else {
+ mapViewModel.getUser(id).long_name
+ }
+
+ @Suppress("MagicNumber")
+ fun MapView.onWaypointChanged(waypoints: Collection, selectedWaypointId: Int?): List {
+ return waypoints.mapNotNull { waypoint ->
+ val pt = waypoint.waypoint ?: return@mapNotNull null
+ if (!mapFilterState.showWaypoints) return@mapNotNull null // Use collected mapFilterState
+ val lock = if (pt.locked_to != 0) "\uD83D\uDD12" else ""
+ val time = DateFormatter.formatDateTime(waypoint.time)
+ val label = pt.name + " " + formatAgo((waypoint.time / 1000).toInt())
+ val emoji = String(Character.toChars(if (pt.icon == 0) 128205 else pt.icon))
+ val now = nowMillis
+ val expireTimeMillis = pt.expire * 1000L
+ val expireTimeStr =
+ when {
+ pt.expire == 0 || pt.expire == Int.MAX_VALUE -> "Never"
+ expireTimeMillis <= now -> "Expired"
+ else -> DateFormatter.formatRelativeTime(expireTimeMillis)
+ }
+ MarkerWithLabel(this, label, emoji).apply {
+ id = "${pt.id}"
+ title = "${pt.name} (${getUsername(waypoint.from)}$lock)"
+ snippet = "[$time] ${pt.description} " + getString(Res.string.expires) + ": $expireTimeStr"
+ position = GeoPoint((pt.latitude_i ?: 0) * 1e-7, (pt.longitude_i ?: 0) * 1e-7)
+ if (selectedWaypointId == pt.id) {
+ showInfoWindow()
+ }
+ setOnLongClickListener {
+ showMarkerLongPressDialog(pt.id)
+ true
+ }
+ }
+ }
+ }
+
+ val mapEventsReceiver =
+ object : MapEventsReceiver {
+ override fun singleTapConfirmedHelper(p: GeoPoint): Boolean {
+ InfoWindow.closeAllInfoWindowsOn(map)
+ return true
+ }
+
+ override fun longPressHelper(p: GeoPoint): Boolean {
+ performHapticFeedback()
+ val enabled = isConnected && downloadRegionBoundingBox == null
+
+ if (enabled) {
+ showEditWaypointDialog =
+ Waypoint(latitude_i = (p.latitude * 1e7).toInt(), longitude_i = (p.longitude * 1e7).toInt())
+ }
+ return true
+ }
+ }
+
+ fun MapView.drawOverlays() {
+ if (overlays.none { it is MapEventsOverlay }) {
+ overlays.add(0, MapEventsOverlay(mapEventsReceiver))
+ }
+ if (myLocationOverlay != null && overlays.none { it is MyLocationNewOverlay }) {
+ overlays.add(myLocationOverlay)
+ }
+ if (overlays.none { it is RadiusMarkerClusterer }) {
+ overlays.add(nodeClusterer)
+ }
+
+ addCopyright()
+ addScaleBarOverlay(density)
+ createLatLongGrid(false)
+
+ invalidate()
+ }
+
+ fun MapView.generateBoxOverlay() {
+ overlays.removeAll { it is Polygon }
+ val zoomFactor = 1.3
+ zoomLevelMin = minOf(zoomLevelDouble, zoomLevelMax)
+ downloadRegionBoundingBox = boundingBox.zoomIn(zoomFactor)
+ val polygon =
+ Polygon().apply {
+ points = Polygon.pointsAsRect(downloadRegionBoundingBox).map { GeoPoint(it.latitude, it.longitude) }
+ }
+ overlays.add(polygon)
+ invalidate()
+ val tileCount: Int =
+ CacheManager(this)
+ .possibleTilesInArea(downloadRegionBoundingBox, zoomLevelMin.toInt(), zoomLevelMax.toInt())
+ cacheEstimate = getString(Res.string.map_cache_tiles, tileCount)
+ }
+
+ val boxOverlayListener =
+ object : MapListener {
+ override fun onScroll(event: ScrollEvent): Boolean {
+ if (downloadRegionBoundingBox != null) {
+ event.source.generateBoxOverlay()
+ }
+ return true
+ }
+
+ override fun onZoom(event: ZoomEvent): Boolean = false
+ }
+
+ fun startDownload() {
+ val boundingBox = downloadRegionBoundingBox ?: return
+ try {
+ val outputName = buildString {
+ append(Configuration.getInstance().osmdroidBasePath.absolutePath)
+ append(File.separator)
+ append("mainFile.sqlite")
+ }
+ val writer = SqliteArchiveTileWriter(outputName)
+ val cacheManager = CacheManager(map, writer)
+ cacheManager.downloadAreaAsync(
+ context,
+ boundingBox,
+ zoomLevelMin.toInt(),
+ zoomLevelMax.toInt(),
+ cacheManagerCallback(
+ onTaskComplete = {
+ scope.launch { context.showToast(Res.string.map_download_complete) }
+ writer.onDetach()
+ },
+ onTaskFailed = { errors ->
+ scope.launch { context.showToast(Res.string.map_download_errors, errors) }
+ writer.onDetach()
+ },
+ ),
+ )
+ } catch (ex: TileSourcePolicyException) {
+ Logger.d { "Tile source does not allow archiving: ${ex.message}" }
+ } catch (ex: Exception) {
+ Logger.d { "Tile source exception: ${ex.message}" }
+ }
+ }
+
+ Scaffold(
+ modifier = modifier,
+ floatingActionButton = {
+ DownloadButton(showDownloadButton && downloadRegionBoundingBox == null) { showCacheManagerDialog = true }
+ },
+ ) { innerPadding ->
+ Box(modifier = Modifier.fillMaxSize().padding(innerPadding)) {
+ AndroidView(
+ factory = {
+ map.apply {
+ setDestroyMode(false)
+ addMapListener(boxOverlayListener)
+ }
+ },
+ modifier = Modifier.fillMaxSize(),
+ update = { mapView ->
+ with(mapView) {
+ updateMarkers(
+ onNodesChanged(nodes),
+ onWaypointChanged(waypoints.values, selectedWaypointId),
+ nodeClusterer,
+ )
+ }
+ mapView.drawOverlays()
+ }, // Renamed map to mapView to avoid conflict
+ )
+ if (downloadRegionBoundingBox != null) {
+ CacheLayout(
+ cacheEstimate = cacheEstimate,
+ onExecuteJob = { startDownload() },
+ onCancelDownload = {
+ downloadRegionBoundingBox = null
+ map.overlays.removeAll { it is Polygon }
+ map.invalidate()
+ },
+ modifier = Modifier.align(Alignment.BottomCenter),
+ )
+ } else {
+ MapControlsOverlay(
+ modifier = Modifier.align(Alignment.TopCenter).padding(top = 8.dp),
+ onToggleFilterMenu = { mapFilterExpanded = true },
+ filterDropdownContent = {
+ FdroidMainMapFilterDropdown(
+ expanded = mapFilterExpanded,
+ onDismissRequest = { mapFilterExpanded = false },
+ mapFilterState = mapFilterState,
+ mapViewModel = mapViewModel,
+ )
+ },
+ mapTypeContent = {
+ MapButton(
+ icon = MeshtasticIcons.Layers,
+ contentDescription = stringResource(Res.string.map_style_selection),
+ onClick = { showMapStyleDialog = true },
+ )
+ },
+ isLocationTrackingEnabled = myLocationOverlay != null,
+ onToggleLocationTracking = {
+ if (locationPermissionsState.allPermissionsGranted) {
+ map.toggleMyLocation()
+ } else {
+ triggerLocationToggleAfterPermission = true
+ locationPermissionsState.launchMultiplePermissionRequest()
+ }
+ },
+ )
+ }
+ }
+ }
+
+ if (showMapStyleDialog) {
+ MapStyleDialog(
+ selectedMapStyle = mapViewModel.mapStyleId,
+ onDismiss = { showMapStyleDialog = false },
+ onSelectMapStyle = {
+ mapViewModel.mapStyleId = it
+ map.setTileSource(loadOnlineTileSourceBase())
+ },
+ )
+ }
+
+ if (showCacheManagerDialog) {
+ CacheManagerDialog(
+ onClickOption = { option ->
+ when (option) {
+ CacheManagerOption.CurrentCacheSize -> {
+ scope.launch { context.showToast(Res.string.calculating) }
+ showCurrentCacheInfo = true
+ }
+ CacheManagerOption.DownloadRegion -> map.generateBoxOverlay()
+
+ CacheManagerOption.ClearTiles -> showPurgeTileSourceDialog = true
+ CacheManagerOption.Cancel -> Unit
+ }
+ showCacheManagerDialog = false
+ },
+ onDismiss = { showCacheManagerDialog = false },
+ )
+ }
+
+ if (showCurrentCacheInfo) {
+ CacheInfoDialog(mapView = map, onDismiss = { showCurrentCacheInfo = false })
+ }
+
+ if (showPurgeTileSourceDialog) {
+ PurgeTileSourceDialog(onDismiss = { showPurgeTileSourceDialog = false })
+ }
+
+ if (showEditWaypointDialog != null) {
+ EditWaypointDialog(
+ waypoint = showEditWaypointDialog ?: return, // Safe call
+ onSendClicked = { waypoint ->
+ Logger.d { "User clicked send waypoint ${waypoint.id}" }
+ showEditWaypointDialog = null
+
+ val newId = if (waypoint.id == 0) mapViewModel.generatePacketId() else waypoint.id
+ val newName = if (waypoint.name.isNullOrEmpty()) "Dropped Pin" else waypoint.name
+ val newExpire = if (waypoint.expire == 0) Int.MAX_VALUE else waypoint.expire
+ val newLockedTo = if (waypoint.locked_to != 0) mapViewModel.myNodeNum ?: 0 else 0
+ val newIcon = if (waypoint.icon == 0) 128205 else waypoint.icon
+
+ mapViewModel.sendWaypoint(
+ waypoint.copy(
+ id = newId,
+ name = newName,
+ expire = newExpire,
+ locked_to = newLockedTo,
+ icon = newIcon,
+ ),
+ )
+ },
+ onDeleteClicked = { waypoint ->
+ Logger.d { "User clicked delete waypoint ${waypoint.id}" }
+ showEditWaypointDialog = null
+ showDeleteMarkerDialog(waypoint)
+ },
+ onDismissRequest = {
+ Logger.d { "User clicked cancel marker edit dialog" }
+ showEditWaypointDialog = null
+ },
+ )
+ }
+}
+
+/** F-Droid main map filter dropdown — favorites, waypoints, precision circle, and last-heard time filter slider. */
+@Composable
+private fun FdroidMainMapFilterDropdown(
+ expanded: Boolean,
+ onDismissRequest: () -> Unit,
+ mapFilterState: MapFilterState,
+ mapViewModel: MapViewModel,
+) {
+ DropdownMenu(
+ expanded = expanded,
+ onDismissRequest = onDismissRequest,
+ modifier = Modifier.background(MaterialTheme.colorScheme.surface),
+ ) {
+ DropdownMenuItem(
+ text = {
+ Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
+ Icon(
+ imageVector = MeshtasticIcons.Favorite,
+ contentDescription = null,
+ modifier = Modifier.padding(end = 8.dp),
+ tint = MaterialTheme.colorScheme.onSurface,
+ )
+ Text(text = stringResource(Res.string.only_favorites), modifier = Modifier.weight(1f))
+ Checkbox(
+ checked = mapFilterState.onlyFavorites,
+ onCheckedChange = { mapViewModel.toggleOnlyFavorites() },
+ modifier = Modifier.padding(start = 8.dp),
+ )
+ }
+ },
+ onClick = { mapViewModel.toggleOnlyFavorites() },
+ )
+ DropdownMenuItem(
+ text = {
+ Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
+ Icon(
+ imageVector = MeshtasticIcons.PinDrop,
+ contentDescription = null,
+ modifier = Modifier.padding(end = 8.dp),
+ tint = MaterialTheme.colorScheme.onSurface,
+ )
+ Text(text = stringResource(Res.string.show_waypoints), modifier = Modifier.weight(1f))
+ Checkbox(
+ checked = mapFilterState.showWaypoints,
+ onCheckedChange = { mapViewModel.toggleShowWaypointsOnMap() },
+ modifier = Modifier.padding(start = 8.dp),
+ )
+ }
+ },
+ onClick = { mapViewModel.toggleShowWaypointsOnMap() },
+ )
+ DropdownMenuItem(
+ text = {
+ Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
+ Icon(
+ imageVector = MeshtasticIcons.Lens,
+ contentDescription = null,
+ modifier = Modifier.padding(end = 8.dp),
+ tint = MaterialTheme.colorScheme.onSurface,
+ )
+ Text(text = stringResource(Res.string.show_precision_circle), modifier = Modifier.weight(1f))
+ Checkbox(
+ checked = mapFilterState.showPrecisionCircle,
+ onCheckedChange = { mapViewModel.toggleShowPrecisionCircleOnMap() },
+ modifier = Modifier.padding(start = 8.dp),
+ )
+ }
+ },
+ onClick = { mapViewModel.toggleShowPrecisionCircleOnMap() },
+ )
+ HorizontalDivider()
+ Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
+ val filterOptions = LastHeardFilter.entries
+ val selectedIndex = filterOptions.indexOf(mapFilterState.lastHeardFilter)
+ var sliderPosition by remember(selectedIndex) { mutableFloatStateOf(selectedIndex.toFloat()) }
+ Text(
+ text =
+ stringResource(
+ Res.string.last_heard_filter_label,
+ stringResource(mapFilterState.lastHeardFilter.label),
+ ),
+ style = MaterialTheme.typography.labelLarge,
+ )
+ Slider(
+ value = sliderPosition,
+ onValueChange = { sliderPosition = it },
+ onValueChangeFinished = {
+ val newIndex = sliderPosition.roundToInt().coerceIn(0, filterOptions.size - 1)
+ mapViewModel.setLastHeardFilter(filterOptions[newIndex])
+ },
+ valueRange = 0f..(filterOptions.size - 1).toFloat(),
+ steps = filterOptions.size - 2,
+ )
+ }
+ }
+}
+
+@Composable
+private fun MapStyleDialog(selectedMapStyle: Int, onDismiss: () -> Unit, onSelectMapStyle: (Int) -> Unit) {
+ val selected = remember { mutableStateOf(selectedMapStyle) }
+
+ MapsDialog(onDismiss = onDismiss) {
+ CustomTileSource.mTileSources.values.forEachIndexed { index, style ->
+ ListItem(
+ text = style,
+ trailingIcon = if (index == selected.value) MeshtasticIcons.Check else null,
+ onClick = {
+ selected.value = index
+ onSelectMapStyle(index)
+ onDismiss()
+ },
+ )
+ }
+ }
+}
+
+private enum class CacheManagerOption(val label: StringResource) {
+ CurrentCacheSize(label = Res.string.map_cache_size),
+ DownloadRegion(label = Res.string.map_download_region),
+ ClearTiles(label = Res.string.map_clear_tiles),
+ Cancel(label = Res.string.cancel),
+}
+
+@Composable
+private fun CacheManagerDialog(onClickOption: (CacheManagerOption) -> Unit, onDismiss: () -> Unit) {
+ MapsDialog(title = stringResource(Res.string.map_offline_manager), onDismiss = onDismiss) {
+ CacheManagerOption.entries.forEach { option ->
+ ListItem(text = stringResource(option.label), trailingIcon = null) {
+ onClickOption(option)
+ onDismiss()
+ }
+ }
+ }
+}
+
+@Composable
+private fun CacheInfoDialog(mapView: MapView, onDismiss: () -> Unit) {
+ val (cacheCapacity, currentCacheUsage) =
+ remember(mapView) {
+ val cacheManager = CacheManager(mapView)
+ cacheManager.cacheCapacity() to cacheManager.currentCacheUsage()
+ }
+
+ MapsDialog(
+ title = stringResource(Res.string.map_cache_manager),
+ onDismiss = onDismiss,
+ negativeButton = { TextButton(onClick = { onDismiss() }) { Text(text = stringResource(Res.string.close)) } },
+ ) {
+ val capacityMb = (cacheCapacity / (1024 * 1024)).toLong()
+ val usageMb = (currentCacheUsage / (1024 * 1024)).toLong()
+ Text(modifier = Modifier.padding(16.dp), text = stringResource(Res.string.map_cache_info, capacityMb, usageMb))
+ }
+}
+
+@Composable
+private fun PurgeTileSourceDialog(onDismiss: () -> Unit) {
+ val scope = rememberCoroutineScope()
+ val context = LocalContext.current
+ val cache = SqlTileWriterExt()
+
+ val sourceList by derivedStateOf { cache.sources.map { it.source as String } }
+
+ val selected = remember { mutableStateListOf() }
+
+ MapsDialog(
+ title = stringResource(Res.string.map_tile_source),
+ positiveButton = {
+ TextButton(
+ enabled = selected.isNotEmpty(),
+ onClick = {
+ selected.forEach { selectedIndex ->
+ val source = sourceList[selectedIndex]
+ scope.launch {
+ context.showToast(
+ if (cache.purgeCache(source)) {
+ getString(Res.string.map_purge_success, source)
+ } else {
+ getString(Res.string.map_purge_fail)
+ },
+ )
+ }
+ }
+
+ onDismiss()
+ },
+ ) {
+ Text(text = stringResource(Res.string.clear))
+ }
+ },
+ negativeButton = { TextButton(onClick = onDismiss) { Text(text = stringResource(Res.string.cancel)) } },
+ onDismiss = onDismiss,
+ ) {
+ sourceList.forEachIndexed { index, source ->
+ val isSelected = selected.contains(index)
+ BasicListItem(
+ text = source,
+ trailingContent = { Checkbox(checked = isSelected, onCheckedChange = {}) },
+ onClick = {
+ if (isSelected) {
+ selected.remove(index)
+ } else {
+ selected.add(index)
+ }
+ },
+ ) {}
+ }
+ }
+}
+
+@OptIn(ExperimentalMaterial3Api::class)
+@Composable
+private fun MapsDialog(
+ title: String? = null,
+ onDismiss: () -> Unit,
+ positiveButton: (@Composable () -> Unit)? = null,
+ negativeButton: (@Composable () -> Unit)? = null,
+ content: @Composable ColumnScope.() -> Unit,
+) {
+ BasicAlertDialog(onDismissRequest = onDismiss) {
+ Surface(
+ modifier = Modifier.wrapContentWidth().wrapContentHeight(),
+ shape = MaterialTheme.shapes.large,
+ color = AlertDialogDefaults.containerColor,
+ tonalElevation = AlertDialogDefaults.TonalElevation,
+ ) {
+ Column {
+ title?.let {
+ Text(
+ modifier = Modifier.padding(start = 16.dp, top = 16.dp, end = 16.dp, bottom = 8.dp),
+ text = it,
+ style = MaterialTheme.typography.titleLarge,
+ )
+ }
+
+ Column(modifier = Modifier.verticalScroll(rememberScrollState())) { content() }
+ if (positiveButton != null || negativeButton != null) {
+ Row(Modifier.align(Alignment.End)) {
+ positiveButton?.invoke()
+ negativeButton?.invoke()
+ }
+ }
+ }
+ }
+ }
+}
+
+private const val WAYPOINT_ZOOM = 15.0
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewExtensions.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewExtensions.kt
new file mode 100644
index 000000000..3cc0dbaf0
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewExtensions.kt
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import android.graphics.Color
+import android.graphics.DashPathEffect
+import android.graphics.Paint
+import android.graphics.Typeface
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import androidx.core.content.ContextCompat
+import org.meshtastic.app.R
+import org.meshtastic.proto.Position
+import org.osmdroid.util.GeoPoint
+import org.osmdroid.views.MapView
+import org.osmdroid.views.overlay.CopyrightOverlay
+import org.osmdroid.views.overlay.Marker
+import org.osmdroid.views.overlay.Polyline
+import org.osmdroid.views.overlay.ScaleBarOverlay
+import org.osmdroid.views.overlay.advancedpolyline.MonochromaticPaintList
+import org.osmdroid.views.overlay.gridlines.LatLonGridlineOverlay2
+
+/** Adds copyright to map depending on what source is showing */
+fun MapView.addCopyright() {
+ if (overlays.none { it is CopyrightOverlay }) {
+ val copyrightNotice: String = tileProvider.tileSource.copyrightNotice ?: return
+ val copyrightOverlay = CopyrightOverlay(context)
+ copyrightOverlay.setCopyrightNotice(copyrightNotice)
+ overlays.add(copyrightOverlay)
+ }
+}
+
+/**
+ * Create LatLong Grid line overlay
+ *
+ * @param enabled: turn on/off gridlines
+ */
+fun MapView.createLatLongGrid(enabled: Boolean) {
+ val latLongGridOverlay = LatLonGridlineOverlay2()
+ latLongGridOverlay.isEnabled = enabled
+ if (latLongGridOverlay.isEnabled) {
+ val textPaint =
+ Paint().apply {
+ textSize = 40f
+ color = Color.GRAY
+ isAntiAlias = true
+ isFakeBoldText = true
+ textAlign = Paint.Align.CENTER
+ }
+ latLongGridOverlay.textPaint = textPaint
+ latLongGridOverlay.setBackgroundColor(Color.TRANSPARENT)
+ latLongGridOverlay.setLineWidth(3.0f)
+ latLongGridOverlay.setLineColor(Color.GRAY)
+ overlays.add(latLongGridOverlay)
+ }
+}
+
+fun MapView.addScaleBarOverlay(density: Density) {
+ if (overlays.none { it is ScaleBarOverlay }) {
+ val scaleBarOverlay =
+ ScaleBarOverlay(this).apply {
+ setAlignBottom(true)
+ with(density) {
+ setScaleBarOffset(15.dp.toPx().toInt(), 40.dp.toPx().toInt())
+ setTextSize(12.sp.toPx())
+ }
+ textPaint.apply {
+ isAntiAlias = true
+ typeface = Typeface.DEFAULT_BOLD
+ }
+ }
+ overlays.add(scaleBarOverlay)
+ }
+}
+
+fun MapView.addPolyline(density: Density, geoPoints: List, onClick: () -> Unit): Polyline {
+ val polyline =
+ Polyline(this).apply {
+ val borderPaint =
+ Paint().apply {
+ color = Color.BLACK
+ isAntiAlias = true
+ strokeWidth = with(density) { 10.dp.toPx() }
+ style = Paint.Style.STROKE
+ strokeJoin = Paint.Join.ROUND
+ strokeCap = Paint.Cap.ROUND
+ pathEffect = DashPathEffect(floatArrayOf(80f, 60f), 0f)
+ }
+ outlinePaintLists.add(MonochromaticPaintList(borderPaint))
+ val fillPaint =
+ Paint().apply {
+ color = Color.WHITE
+ isAntiAlias = true
+ strokeWidth = with(density) { 6.dp.toPx() }
+ style = Paint.Style.FILL_AND_STROKE
+ strokeJoin = Paint.Join.ROUND
+ strokeCap = Paint.Cap.ROUND
+ pathEffect = DashPathEffect(floatArrayOf(80f, 60f), 0f)
+ }
+ outlinePaintLists.add(MonochromaticPaintList(fillPaint))
+ setPoints(geoPoints)
+ setOnClickListener { _, _, _ ->
+ onClick()
+ true
+ }
+ }
+ overlays.add(polyline)
+
+ return polyline
+}
+
+fun MapView.addPositionMarkers(positions: List, onClick: (Int) -> Unit): List {
+ val navIcon = ContextCompat.getDrawable(context, R.drawable.ic_map_navigation)
+ val markers =
+ positions.map { pos ->
+ Marker(this).apply {
+ icon = navIcon
+ rotation = ((pos.ground_track ?: 0) * 1e-5).toFloat()
+ setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_CENTER)
+ position = GeoPoint((pos.latitude_i ?: 0) * 1e-7, (pos.longitude_i ?: 0) * 1e-7)
+ setOnMarkerClickListener { _, _ ->
+ onClick(pos.time)
+ true
+ }
+ }
+ }
+ overlays.addAll(markers)
+
+ return markers
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewModel.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewModel.kt
new file mode 100644
index 000000000..1ffe68aa1
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewModel.kt
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import androidx.lifecycle.SavedStateHandle
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import org.koin.core.annotation.KoinViewModel
+import org.meshtastic.core.common.BuildConfigProvider
+import org.meshtastic.core.model.RadioController
+import org.meshtastic.core.repository.MapPrefs
+import org.meshtastic.core.repository.NodeRepository
+import org.meshtastic.core.repository.PacketRepository
+import org.meshtastic.core.repository.RadioConfigRepository
+import org.meshtastic.core.ui.viewmodel.stateInWhileSubscribed
+import org.meshtastic.feature.map.BaseMapViewModel
+import org.meshtastic.proto.LocalConfig
+
+@Suppress("LongParameterList")
+@KoinViewModel
+class MapViewModel(
+ mapPrefs: MapPrefs,
+ packetRepository: PacketRepository,
+ nodeRepository: NodeRepository,
+ radioController: RadioController,
+ radioConfigRepository: RadioConfigRepository,
+ buildConfigProvider: BuildConfigProvider,
+ savedStateHandle: SavedStateHandle,
+) : BaseMapViewModel(mapPrefs, nodeRepository, packetRepository, radioController) {
+
+ private val _selectedWaypointId = MutableStateFlow(savedStateHandle.get("waypointId"))
+ val selectedWaypointId: StateFlow = _selectedWaypointId.asStateFlow()
+
+ fun setWaypointId(id: Int?) {
+ if (_selectedWaypointId.value != id) {
+ _selectedWaypointId.value = id
+ }
+ }
+
+ var mapStyleId: Int
+ get() = mapPrefs.mapStyle.value
+ set(value) {
+ mapPrefs.setMapStyle(value)
+ }
+
+ val localConfig = radioConfigRepository.localConfigFlow.stateInWhileSubscribed(initialValue = LocalConfig())
+
+ val config
+ get() = localConfig.value
+
+ val applicationId = buildConfigProvider.applicationId
+}
diff --git a/app/src/main/java/com/geeksville/mesh/ui/map/MapViewWithLifecycle.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewWithLifecycle.kt
similarity index 62%
rename from app/src/main/java/com/geeksville/mesh/ui/map/MapViewWithLifecycle.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewWithLifecycle.kt
index 8c0ee0342..c16d87163 100644
--- a/app/src/main/java/com/geeksville/mesh/ui/map/MapViewWithLifecycle.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewWithLifecycle.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,12 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+package org.meshtastic.app.map
-package com.geeksville.mesh.ui.map
-
-import android.annotation.SuppressLint
-import android.content.Context
-import android.os.PowerManager
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
@@ -33,9 +29,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.compose.LocalLifecycleOwner
-import com.geeksville.mesh.BuildConfig
-import com.geeksville.mesh.android.BuildUtils.errormsg
-import com.geeksville.mesh.util.requiredZoomLevel
import org.osmdroid.config.Configuration
import org.osmdroid.tileprovider.tilesource.ITileSource
import org.osmdroid.tileprovider.tilesource.TileSourceFactory
@@ -44,56 +37,51 @@ import org.osmdroid.util.GeoPoint
import org.osmdroid.views.CustomZoomButtonsController
import org.osmdroid.views.MapView
-@SuppressLint("WakelockTimeout")
-private fun PowerManager.WakeLock.safeAcquire() {
- if (!isHeld) try {
- acquire()
- } catch (e: SecurityException) {
- errormsg("WakeLock permission exception: ${e.message}")
- } catch (e: IllegalStateException) {
- errormsg("WakeLock acquire() exception: ${e.message}")
- }
-}
-
-private fun PowerManager.WakeLock.safeRelease() {
- if (isHeld) try {
- release()
- } catch (e: IllegalStateException) {
- errormsg("WakeLock release() exception: ${e.message}")
- }
-}
-
-const val MAP_STYLE_ID = "map_style_id"
-
-private const val MinZoomLevel = 1.5
-private const val MaxZoomLevel = 20.0
-private const val DefaultZoomLevel = 15.0
+private const val MIN_ZOOM_LEVEL = 1.5
+private const val MAX_ZOOM_LEVEL = 20.0
+private const val DEFAULT_ZOOM_LEVEL = 15.0
+@Suppress("MagicNumber")
@Composable
-internal fun rememberMapViewWithLifecycle(
+fun rememberMapViewWithLifecycle(
+ applicationId: String,
box: BoundingBox,
tileSource: ITileSource = TileSourceFactory.DEFAULT_TILE_SOURCE,
): MapView {
- val zoom = if (box.requiredZoomLevel().isFinite()) {
- box.requiredZoomLevel()
- } else {
- DefaultZoomLevel
- }
+ val zoom =
+ if (box.requiredZoomLevel().isFinite()) {
+ (box.requiredZoomLevel() - 0.5).coerceAtLeast(MIN_ZOOM_LEVEL)
+ } else {
+ DEFAULT_ZOOM_LEVEL
+ }
val center = GeoPoint(box.centerLatitude, box.centerLongitude)
- return rememberMapViewWithLifecycle(zoom, center, tileSource)
+ return rememberMapViewWithLifecycle(
+ applicationId = applicationId,
+ zoomLevel = zoom,
+ mapCenter = center,
+ tileSource = tileSource,
+ )
}
+@Suppress("LongMethod")
@Composable
internal fun rememberMapViewWithLifecycle(
- zoomLevel: Double = MinZoomLevel,
+ applicationId: String,
+ zoomLevel: Double = MIN_ZOOM_LEVEL,
mapCenter: GeoPoint = GeoPoint(0.0, 0.0),
tileSource: ITileSource = TileSourceFactory.DEFAULT_TILE_SOURCE,
): MapView {
var savedZoom by rememberSaveable { mutableDoubleStateOf(zoomLevel) }
- var savedCenter by rememberSaveable(stateSaver = Saver(
- save = { mapOf("latitude" to it.latitude, "longitude" to it.longitude) },
- restore = { GeoPoint(it["latitude"] ?: 0.0, it["longitude"] ?: .0) }
- )) { mutableStateOf(mapCenter) }
+ var savedCenter by
+ rememberSaveable(
+ stateSaver =
+ Saver(
+ save = { mapOf("latitude" to it.latitude, "longitude" to it.longitude) },
+ restore = { GeoPoint(it["latitude"] ?: 0.0, it["longitude"] ?: .0) },
+ ),
+ ) {
+ mutableStateOf(mapCenter)
+ }
val context = LocalContext.current
val mapView = remember {
@@ -101,7 +89,7 @@ internal fun rememberMapViewWithLifecycle(
clipToOutline = true
// Required to get online tiles
- Configuration.getInstance().userAgentValue = BuildConfig.APPLICATION_ID
+ Configuration.getInstance().userAgentValue = applicationId
setTileSource(tileSource)
isVerticalMapRepetitionEnabled = false // disables map repetition
setMultiTouchControls(true)
@@ -110,8 +98,8 @@ internal fun rememberMapViewWithLifecycle(
// scales the map tiles to the display density of the screen
isTilesScaledToDpi = true
// sets the minimum zoom level (the furthest out you can zoom)
- minZoomLevel = MinZoomLevel
- maxZoomLevel = MaxZoomLevel
+ minZoomLevel = MIN_ZOOM_LEVEL
+ maxZoomLevel = MAX_ZOOM_LEVEL
// Disables default +/- button for zooming
zoomController.setVisibility(CustomZoomButtonsController.Visibility.SHOW_AND_FADEOUT)
@@ -121,23 +109,13 @@ internal fun rememberMapViewWithLifecycle(
}
val lifecycle = LocalLifecycleOwner.current.lifecycle
DisposableEffect(lifecycle) {
- val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
-
- @Suppress("DEPRECATION")
- val wakeLock =
- powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "Meshtastic:MapViewLock")
-
- wakeLock.safeAcquire()
-
val observer = LifecycleEventObserver { _, event ->
when (event) {
Lifecycle.Event.ON_PAUSE -> {
- wakeLock.safeRelease()
mapView.onPause()
}
Lifecycle.Event.ON_RESUME -> {
- wakeLock.safeAcquire()
mapView.onResume()
}
@@ -152,11 +130,7 @@ internal fun rememberMapViewWithLifecycle(
lifecycle.addObserver(observer)
- onDispose {
- lifecycle.removeObserver(observer)
- wakeLock.safeRelease()
- mapView.onDetach()
- }
+ onDispose { lifecycle.removeObserver(observer) }
}
return mapView
}
diff --git a/app/src/main/java/com/geeksville/mesh/util/SqlTileWriterExt.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/SqlTileWriterExt.kt
similarity index 55%
rename from app/src/main/java/com/geeksville/mesh/util/SqlTileWriterExt.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/map/SqlTileWriterExt.kt
index 72b67c827..112449d1f 100644
--- a/app/src/main/java/com/geeksville/mesh/util/SqlTileWriterExt.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/SqlTileWriterExt.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,32 +14,35 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-package com.geeksville.mesh.util
+package org.meshtastic.app.map
import android.database.Cursor
+import org.meshtastic.core.common.util.nowMillis
import org.osmdroid.tileprovider.modules.DatabaseFileArchive
import org.osmdroid.tileprovider.modules.SqlTileWriter
-
/**
- * Extended the sqlite tile writer to have some additional query functions. A this point
- * it's unclear if there is a need to put these with the osmdroid-android library, thus they were
- * put here as more of an example.
- *
+ * Extended the sqlite tile writer to have some additional query functions. A this point it's unclear if there is a need
+ * to put these with the osmdroid-android library, thus they were put here as more of an example.
*
* created on 12/21/2016.
*
* @author Alex O'Ree
* @since 5.6.2
*/
-class SqlTileWriterExt() : SqlTileWriter() {
- fun select(rows: Int, offset: Int): Cursor? {
- return this.db?.rawQuery(
- "select " + DatabaseFileArchive.COLUMN_KEY + "," + COLUMN_EXPIRES + "," + DatabaseFileArchive.COLUMN_PROVIDER + " from " + DatabaseFileArchive.TABLE + " limit ? offset ?",
- arrayOf(rows.toString() + "", offset.toString() + "")
- )
- }
+class SqlTileWriterExt : SqlTileWriter() {
+ fun select(rows: Int, offset: Int): Cursor? = this.db?.rawQuery(
+ "select " +
+ DatabaseFileArchive.COLUMN_KEY +
+ "," +
+ COLUMN_EXPIRES +
+ "," +
+ DatabaseFileArchive.COLUMN_PROVIDER +
+ " from " +
+ DatabaseFileArchive.TABLE +
+ " limit ? offset ?",
+ arrayOf(rows.toString() + "", offset.toString() + ""),
+ )
/**
* gets all the tiles sources that we have tiles for in the cache database and their counts
@@ -55,16 +58,27 @@ class SqlTileWriterExt() : SqlTileWriter() {
}
var cur: Cursor? = null
try {
- cur = db.rawQuery(
- "select "
- + DatabaseFileArchive.COLUMN_PROVIDER
- + ",count(*) "
- + ",min(length(" + DatabaseFileArchive.COLUMN_TILE + ")) "
- + ",max(length(" + DatabaseFileArchive.COLUMN_TILE + ")) "
- + ",sum(length(" + DatabaseFileArchive.COLUMN_TILE + ")) "
- + "from " + DatabaseFileArchive.TABLE + " "
- + "group by " + DatabaseFileArchive.COLUMN_PROVIDER, null
- )
+ cur =
+ db.rawQuery(
+ "select " +
+ DatabaseFileArchive.COLUMN_PROVIDER +
+ ",count(*) " +
+ ",min(length(" +
+ DatabaseFileArchive.COLUMN_TILE +
+ ")) " +
+ ",max(length(" +
+ DatabaseFileArchive.COLUMN_TILE +
+ ")) " +
+ ",sum(length(" +
+ DatabaseFileArchive.COLUMN_TILE +
+ ")) " +
+ "from " +
+ DatabaseFileArchive.TABLE +
+ " " +
+ "group by " +
+ DatabaseFileArchive.COLUMN_PROVIDER,
+ null,
+ )
while (cur.moveToNext()) {
val c = SourceCount()
c.source = cur.getString(0)
@@ -82,12 +96,11 @@ class SqlTileWriterExt() : SqlTileWriter() {
}
return ret
}
- val rowCountExpired: Long
- get() = getRowCount(
- "$COLUMN_EXPIRES", arrayOf(System.currentTimeMillis().toString())
- )
- class SourceCount() {
+ val rowCountExpired: Long
+ get() = getRowCount("$COLUMN_EXPIRES", arrayOf(nowMillis.toString()))
+
+ class SourceCount {
var rowCount: Long = 0
var source: String? = null
var sizeTotal: Long = 0
@@ -95,4 +108,4 @@ class SqlTileWriterExt() : SqlTileWriter() {
var sizeMax: Long = 0
var sizeAvg: Long = 0
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/com/geeksville/mesh/ui/map/CacheLayout.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/component/CacheLayout.kt
similarity index 67%
rename from app/src/main/java/com/geeksville/mesh/ui/map/CacheLayout.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/map/component/CacheLayout.kt
index 1159d99d6..986918e06 100644
--- a/app/src/main/java/com/geeksville/mesh/ui/map/CacheLayout.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/component/CacheLayout.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,8 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-package com.geeksville.mesh.ui.map
+package org.meshtastic.app.map.component
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
@@ -32,29 +31,34 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
-import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
-import com.geeksville.mesh.R
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.cancel
+import org.meshtastic.core.resources.map_select_download_region
+import org.meshtastic.core.resources.map_start_download
+import org.meshtastic.core.resources.map_tile_download_estimate
@OptIn(ExperimentalLayoutApi::class)
@Composable
-internal fun CacheLayout(
+fun CacheLayout(
cacheEstimate: String,
onExecuteJob: () -> Unit,
onCancelDownload: () -> Unit,
modifier: Modifier = Modifier,
) {
Column(
- modifier = modifier
+ modifier =
+ modifier
.fillMaxWidth()
.wrapContentHeight()
.background(color = MaterialTheme.colorScheme.background)
.padding(8.dp),
) {
Text(
- text = stringResource(id = R.string.map_select_download_region),
+ text = stringResource(Res.string.map_select_download_region),
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.headlineSmall,
@@ -63,35 +67,21 @@ internal fun CacheLayout(
Spacer(modifier = Modifier.height(8.dp))
Text(
- text = stringResource(R.string.map_tile_download_estimate) + " " + cacheEstimate,
+ text = stringResource(Res.string.map_tile_download_estimate) + " " + cacheEstimate,
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodyLarge,
)
FlowRow(
- modifier = Modifier
- .fillMaxWidth()
- .padding(horizontal = 8.dp),
+ modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),
horizontalArrangement = Arrangement.spacedBy(space = 8.dp),
) {
- Button(
- onClick = onCancelDownload,
- modifier = Modifier.weight(1f),
- ) {
- Text(
- text = stringResource(id = R.string.cancel),
- color = MaterialTheme.colorScheme.onPrimary,
- )
+ Button(onClick = onCancelDownload, modifier = Modifier.weight(1f)) {
+ Text(text = stringResource(Res.string.cancel), color = MaterialTheme.colorScheme.onPrimary)
}
- Button(
- onClick = onExecuteJob,
- modifier = Modifier.weight(1f),
- ) {
- Text(
- text = stringResource(id = R.string.map_start_download),
- color = MaterialTheme.colorScheme.onPrimary,
- )
+ Button(onClick = onExecuteJob, modifier = Modifier.weight(1f)) {
+ Text(text = stringResource(Res.string.map_start_download), color = MaterialTheme.colorScheme.onPrimary)
}
}
}
@@ -100,9 +90,5 @@ internal fun CacheLayout(
@Preview(showBackground = true)
@Composable
private fun CacheLayoutPreview() {
- CacheLayout(
- cacheEstimate = "100 tiles",
- onExecuteJob = { },
- onCancelDownload = { },
- )
+ CacheLayout(cacheEstimate = "100 tiles", onExecuteJob = {}, onCancelDownload = {})
}
diff --git a/app/src/main/java/com/geeksville/mesh/ui/map/DownloadButton.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/component/DownloadButton.kt
similarity index 64%
rename from app/src/main/java/com/geeksville/mesh/ui/map/DownloadButton.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/map/component/DownloadButton.kt
index fc71e0a13..7568d695a 100644
--- a/app/src/main/java/com/geeksville/mesh/ui/map/DownloadButton.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/component/DownloadButton.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,56 +14,52 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-package com.geeksville.mesh.ui.map
+package org.meshtastic.app.map.component
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.animation.slideInHorizontally
import androidx.compose.animation.slideOutHorizontally
-import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.filled.Download
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale
-import androidx.compose.ui.res.stringResource
-import com.geeksville.mesh.R
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.map_download_region
+import org.meshtastic.core.ui.icon.Download
+import org.meshtastic.core.ui.icon.MeshtasticIcons
@Composable
-internal fun DownloadButton(
- enabled: Boolean,
- onClick: () -> Unit,
-) {
+fun DownloadButton(enabled: Boolean, onClick: () -> Unit) {
AnimatedVisibility(
visible = enabled,
- enter = slideInHorizontally(
+ enter =
+ slideInHorizontally(
initialOffsetX = { it },
- animationSpec = tween(durationMillis = 600, easing = FastOutSlowInEasing)
+ animationSpec = tween(durationMillis = 600, easing = FastOutSlowInEasing),
),
- exit = slideOutHorizontally(
+ exit =
+ slideOutHorizontally(
targetOffsetX = { it },
- animationSpec = tween(durationMillis = 600, easing = FastOutSlowInEasing)
- )
+ animationSpec = tween(durationMillis = 600, easing = FastOutSlowInEasing),
+ ),
) {
- FloatingActionButton(
- onClick = onClick,
- contentColor = MaterialTheme.colorScheme.primary,
- ) {
+ FloatingActionButton(onClick = onClick, contentColor = MaterialTheme.colorScheme.primary) {
Icon(
- imageVector = Icons.Default.Download,
- contentDescription = stringResource(R.string.map_download_region),
+ imageVector = MeshtasticIcons.Download,
+ contentDescription = stringResource(Res.string.map_download_region),
modifier = Modifier.scale(1.25f),
)
}
}
}
-//@Preview(showBackground = true)
-//@Composable
-//private fun DownloadButtonPreview() {
+// @Preview(showBackground = true)
+// @Composable
+// private fun DownloadButtonPreview() {
// DownloadButton(true, onClick = {})
-//}
+// }
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt
new file mode 100644
index 000000000..c41798bf0
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt
@@ -0,0 +1,357 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import android.app.DatePickerDialog
+import android.widget.DatePicker
+import android.widget.TimePicker
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ExperimentalLayoutApi
+import androidx.compose.foundation.layout.FlowRow
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.wrapContentWidth
+import androidx.compose.foundation.shape.CircleShape
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.foundation.text.KeyboardActions
+import androidx.compose.foundation.text.KeyboardOptions
+import androidx.compose.material3.AlertDialog
+import androidx.compose.material3.Button
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Switch
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.input.ImeAction
+import androidx.compose.ui.text.input.KeyboardType
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import kotlinx.datetime.LocalDateTime
+import kotlinx.datetime.Month
+import kotlinx.datetime.toInstant
+import kotlinx.datetime.toLocalDateTime
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.core.common.util.nowSeconds
+import org.meshtastic.core.common.util.systemTimeZone
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.cancel
+import org.meshtastic.core.resources.date
+import org.meshtastic.core.resources.delete
+import org.meshtastic.core.resources.description
+import org.meshtastic.core.resources.expires
+import org.meshtastic.core.resources.locked
+import org.meshtastic.core.resources.name
+import org.meshtastic.core.resources.send
+import org.meshtastic.core.resources.time
+import org.meshtastic.core.resources.waypoint_edit
+import org.meshtastic.core.resources.waypoint_new
+import org.meshtastic.core.ui.component.EditTextPreference
+import org.meshtastic.core.ui.emoji.EmojiPickerDialog
+import org.meshtastic.core.ui.icon.CalendarMonth
+import org.meshtastic.core.ui.icon.Lock
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+import org.meshtastic.core.ui.theme.AppTheme
+import org.meshtastic.proto.Waypoint
+import kotlin.time.Duration.Companion.hours
+import kotlin.time.Instant
+
+@Suppress("LongMethod", "CyclomaticComplexMethod")
+@OptIn(ExperimentalLayoutApi::class)
+@Composable
+fun EditWaypointDialog(
+ waypoint: Waypoint,
+ onSendClicked: (Waypoint) -> Unit,
+ onDeleteClicked: (Waypoint) -> Unit,
+ onDismissRequest: () -> Unit,
+ modifier: Modifier = Modifier,
+) {
+ var waypointInput by remember { mutableStateOf(waypoint) }
+ val title = if (waypoint.id == 0) Res.string.waypoint_new else Res.string.waypoint_edit
+
+ @Suppress("MagicNumber")
+ val emoji = if (waypointInput.icon == 0) 128205 else waypointInput.icon
+ var showEmojiPickerView by remember { mutableStateOf(false) }
+
+ // Get current context for dialogs
+ val context = LocalContext.current
+ val tz = systemTimeZone
+
+ // Determine locale-specific date format
+ val dateFormat = remember { android.text.format.DateFormat.getDateFormat(context) }
+ // Check if 24-hour format is preferred
+ val is24Hour = remember { android.text.format.DateFormat.is24HourFormat(context) }
+ val timeFormat = remember { android.text.format.DateFormat.getTimeFormat(context) }
+
+ val currentInstant =
+ remember(waypointInput.expire) {
+ val expire = waypointInput.expire
+ if (expire != 0 && expire != Int.MAX_VALUE) {
+ kotlin.time.Instant.fromEpochSeconds(expire.toLong())
+ } else {
+ kotlin.time.Clock.System.now() + 8.hours
+ }
+ }
+
+ // State to hold selected date and time
+ var selectedDate by
+ remember(currentInstant) {
+ mutableStateOf(
+ if (waypointInput.expire != 0 && waypointInput.expire != Int.MAX_VALUE) {
+ dateFormat.format(java.util.Date(currentInstant.toEpochMilliseconds()))
+ } else {
+ ""
+ },
+ )
+ }
+ var selectedTime by
+ remember(currentInstant) {
+ mutableStateOf(
+ if (waypointInput.expire != 0 && waypointInput.expire != Int.MAX_VALUE) {
+ timeFormat.format(java.util.Date(currentInstant.toEpochMilliseconds()))
+ } else {
+ ""
+ },
+ )
+ }
+
+ if (!showEmojiPickerView) {
+ AlertDialog(
+ onDismissRequest = onDismissRequest,
+ shape = RoundedCornerShape(16.dp),
+ text = {
+ Column(modifier = modifier.fillMaxWidth()) {
+ Text(
+ text = stringResource(title),
+ style =
+ MaterialTheme.typography.titleLarge.copy(
+ fontWeight = FontWeight.Bold,
+ textAlign = TextAlign.Center,
+ ),
+ modifier = Modifier.fillMaxWidth().padding(bottom = 16.dp),
+ )
+ EditTextPreference(
+ title = stringResource(Res.string.name),
+ value = waypointInput.name,
+ maxSize = 29,
+ enabled = true,
+ isError = false,
+ keyboardOptions =
+ KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text, imeAction = ImeAction.Done),
+ keyboardActions = KeyboardActions(onDone = {}),
+ onValueChanged = { waypointInput = waypointInput.copy(name = it) },
+ trailingIcon = {
+ IconButton(onClick = { showEmojiPickerView = true }) {
+ Text(
+ text = String(Character.toChars(emoji)),
+ modifier =
+ Modifier.background(MaterialTheme.colorScheme.background, CircleShape)
+ .padding(4.dp),
+ fontSize = 24.sp,
+ color = Color.Unspecified.copy(alpha = 1f),
+ )
+ }
+ },
+ )
+ EditTextPreference(
+ title = stringResource(Res.string.description),
+ value = waypointInput.description,
+ maxSize = 99,
+ enabled = true,
+ isError = false,
+ keyboardOptions =
+ KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text, imeAction = ImeAction.Done),
+ keyboardActions = KeyboardActions(onDone = {}),
+ onValueChanged = { waypointInput = waypointInput.copy(description = it) },
+ )
+ Row(
+ modifier = Modifier.fillMaxWidth().size(48.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Image(
+ imageVector = MeshtasticIcons.Lock,
+ contentDescription = stringResource(Res.string.locked),
+ )
+ Text(stringResource(Res.string.locked))
+ Switch(
+ modifier = Modifier.fillMaxWidth().wrapContentWidth(Alignment.End),
+ checked = waypointInput.locked_to != 0,
+ onCheckedChange = { waypointInput = waypointInput.copy(locked_to = if (it) 1 else 0) },
+ )
+ }
+
+ val ldt = currentInstant.toLocalDateTime(tz)
+ val datePickerDialog =
+ DatePickerDialog(
+ context,
+ { _: DatePicker, selectedYear: Int, selectedMonth: Int, selectedDay: Int ->
+ val newLdt =
+ LocalDateTime(
+ year = selectedYear,
+ month = Month(selectedMonth + 1),
+ day = selectedDay,
+ hour = ldt.hour,
+ minute = ldt.minute,
+ second = ldt.second,
+ nanosecond = ldt.nanosecond,
+ )
+ waypointInput = waypointInput.copy(expire = newLdt.toInstant(tz).epochSeconds.toInt())
+ },
+ ldt.year,
+ ldt.month.ordinal,
+ ldt.day,
+ )
+
+ val timePickerDialog =
+ android.app.TimePickerDialog(
+ context,
+ { _: TimePicker, selectedHour: Int, selectedMinute: Int ->
+ val newLdt =
+ LocalDateTime(
+ year = ldt.year,
+ month = ldt.month,
+ day = ldt.day,
+ hour = selectedHour,
+ minute = selectedMinute,
+ second = ldt.second,
+ nanosecond = ldt.nanosecond,
+ )
+ waypointInput = waypointInput.copy(expire = newLdt.toInstant(tz).epochSeconds.toInt())
+ },
+ ldt.hour,
+ ldt.minute,
+ is24Hour,
+ )
+
+ Row(
+ modifier = Modifier.fillMaxWidth().size(48.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Image(
+ imageVector = MeshtasticIcons.CalendarMonth,
+ contentDescription = stringResource(Res.string.expires),
+ )
+ Text(stringResource(Res.string.expires))
+ Switch(
+ modifier = Modifier.fillMaxWidth().wrapContentWidth(Alignment.End),
+ checked = waypointInput.expire != Int.MAX_VALUE && waypointInput.expire != 0,
+ onCheckedChange = { isChecked ->
+ if (isChecked) {
+ waypointInput = waypointInput.copy(expire = currentInstant.epochSeconds.toInt())
+ } else {
+ waypointInput = waypointInput.copy(expire = Int.MAX_VALUE)
+ }
+ },
+ )
+ }
+
+ if (waypointInput.expire != Int.MAX_VALUE && waypointInput.expire != 0) {
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Button(onClick = { datePickerDialog.show() }) { Text(stringResource(Res.string.date)) }
+ Text(
+ modifier = Modifier.padding(top = 4.dp),
+ text = selectedDate,
+ style = MaterialTheme.typography.bodyMedium,
+ textAlign = TextAlign.Center,
+ )
+ }
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Button(onClick = { timePickerDialog.show() }) { Text(stringResource(Res.string.time)) }
+ Text(
+ modifier = Modifier.padding(top = 4.dp),
+ text = selectedTime,
+ style = MaterialTheme.typography.bodyMedium,
+ textAlign = TextAlign.Center,
+ )
+ }
+ }
+ }
+ }
+ },
+ confirmButton = {
+ FlowRow(
+ modifier = modifier.padding(start = 20.dp, end = 20.dp, bottom = 16.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ verticalArrangement = Arrangement.Center,
+ ) {
+ TextButton(modifier = modifier.weight(1f), onClick = onDismissRequest) {
+ Text(stringResource(Res.string.cancel))
+ }
+ if (waypoint.id != 0) {
+ Button(
+ modifier = modifier.weight(1f),
+ onClick = { onDeleteClicked(waypointInput) },
+ enabled = !(waypointInput.name.isNullOrEmpty()),
+ ) {
+ Text(stringResource(Res.string.delete))
+ }
+ }
+ Button(modifier = modifier.weight(1f), onClick = { onSendClicked(waypointInput) }, enabled = true) {
+ Text(stringResource(Res.string.send))
+ }
+ }
+ },
+ )
+ } else {
+ EmojiPickerDialog(onDismiss = { showEmojiPickerView = false }) {
+ showEmojiPickerView = false
+ waypointInput = waypointInput.copy(icon = it.codePointAt(0))
+ }
+ }
+}
+
+@Preview(showBackground = true)
+@Composable
+@Suppress("MagicNumber")
+private fun EditWaypointFormPreview() {
+ AppTheme {
+ EditWaypointDialog(
+ waypoint =
+ Waypoint(
+ id = 123,
+ name = "Test 123",
+ description = "This is only a test",
+ icon = 128169,
+ expire = (nowSeconds.toInt() + 8 * 3600),
+ ),
+ onSendClicked = {},
+ onDeleteClicked = {},
+ onDismissRequest = {},
+ )
+ }
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt
new file mode 100644
index 000000000..de0f8c6c2
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.model
+
+import org.osmdroid.tileprovider.tilesource.ITileSource
+import org.osmdroid.tileprovider.tilesource.OnlineTileSourceBase
+import org.osmdroid.tileprovider.tilesource.TileSourceFactory
+import org.osmdroid.tileprovider.tilesource.TileSourcePolicy
+import org.osmdroid.util.MapTileIndex
+
+@Suppress("UnusedPrivateProperty")
+class CustomTileSource {
+
+ companion object {
+ val OPENWEATHER_RADAR =
+ OnlineTileSourceAuth(
+ "Open Weather Map",
+ 1,
+ 22,
+ 256,
+ ".png",
+ arrayOf("https://tile.openweathermap.org/map/"),
+ "Openweathermap",
+ TileSourcePolicy(
+ 4,
+ TileSourcePolicy.FLAG_NO_BULK or
+ TileSourcePolicy.FLAG_NO_PREVENTIVE or
+ TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
+ TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
+ ),
+ "precipitation",
+ "",
+ )
+ private val ESRI_IMAGERY =
+ object :
+ OnlineTileSourceBase(
+ "ESRI World Overview",
+ 1,
+ 20,
+ 256,
+ ".jpg",
+ arrayOf("https://clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/"),
+ "Esri, Maxar, Earthstar Geographics, and the GIS User Community",
+ TileSourcePolicy(
+ 4,
+ TileSourcePolicy.FLAG_NO_BULK or
+ TileSourcePolicy.FLAG_NO_PREVENTIVE or
+ TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
+ TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
+ ),
+ ) {
+ override fun getTileURLString(pMapTileIndex: Long): String = baseUrl +
+ (
+ MapTileIndex.getZoom(pMapTileIndex).toString() +
+ "/" +
+ MapTileIndex.getY(pMapTileIndex) +
+ "/" +
+ MapTileIndex.getX(pMapTileIndex) +
+ mImageFilenameEnding
+ )
+ }
+
+ private val ESRI_WORLD_TOPO =
+ object :
+ OnlineTileSourceBase(
+ "ESRI World TOPO",
+ 1,
+ 20,
+ 256,
+ ".jpg",
+ arrayOf("https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/"),
+ "Esri, HERE, Garmin, FAO, NOAA, USGS, © OpenStreetMap contributors, and the GIS User Community ",
+ TileSourcePolicy(
+ 4,
+ TileSourcePolicy.FLAG_NO_BULK or
+ TileSourcePolicy.FLAG_NO_PREVENTIVE or
+ TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
+ TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
+ ),
+ ) {
+ override fun getTileURLString(pMapTileIndex: Long): String = baseUrl +
+ (
+ MapTileIndex.getZoom(pMapTileIndex).toString() +
+ "/" +
+ MapTileIndex.getY(pMapTileIndex) +
+ "/" +
+ MapTileIndex.getX(pMapTileIndex) +
+ mImageFilenameEnding
+ )
+ }
+ private val USGS_HYDRO_CACHE =
+ object :
+ OnlineTileSourceBase(
+ "USGS Hydro Cache",
+ 0,
+ 18,
+ 256,
+ "",
+ arrayOf("https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/tile/"),
+ "USGS",
+ TileSourcePolicy(
+ 2,
+ TileSourcePolicy.FLAG_NO_PREVENTIVE or
+ TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
+ TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
+ ),
+ ) {
+ override fun getTileURLString(pMapTileIndex: Long): String = baseUrl +
+ (
+ MapTileIndex.getZoom(pMapTileIndex).toString() +
+ "/" +
+ MapTileIndex.getY(pMapTileIndex) +
+ "/" +
+ MapTileIndex.getX(pMapTileIndex) +
+ mImageFilenameEnding
+ )
+ }
+ private val USGS_SHADED_RELIEF =
+ object :
+ OnlineTileSourceBase(
+ "USGS Shaded Relief Only",
+ 0,
+ 18,
+ 256,
+ "",
+ arrayOf(
+ "https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/tile/",
+ ),
+ "USGS",
+ TileSourcePolicy(
+ 2,
+ TileSourcePolicy.FLAG_NO_PREVENTIVE or
+ TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
+ TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
+ ),
+ ) {
+ override fun getTileURLString(pMapTileIndex: Long): String = baseUrl +
+ (
+ MapTileIndex.getZoom(pMapTileIndex).toString() +
+ "/" +
+ MapTileIndex.getY(pMapTileIndex) +
+ "/" +
+ MapTileIndex.getX(pMapTileIndex) +
+ mImageFilenameEnding
+ )
+ }
+
+ /** WMS TILE SERVER More research is required to get this to function correctly with overlays */
+ val NOAA_RADAR_WMS =
+ NOAAWmsTileSource(
+ "Recent Weather Radar",
+ arrayOf(
+ "https://new.nowcoast.noaa.gov/arcgis/services/nowcoast/" +
+ "radar_meteo_imagery_nexrad_time/MapServer/WmsServer?",
+ ),
+ "1",
+ "1.1.0",
+ "",
+ "EPSG%3A3857",
+ "",
+ "image/png",
+ )
+
+ /** =============================================================================================== */
+ private val MAPNIK: OnlineTileSourceBase = TileSourceFactory.MAPNIK
+ private val USGS_TOPO: OnlineTileSourceBase = TileSourceFactory.USGS_TOPO
+ private val OPEN_TOPO: OnlineTileSourceBase = TileSourceFactory.OpenTopo
+ private val USGS_SAT: OnlineTileSourceBase = TileSourceFactory.USGS_SAT
+ private val SEAMAP: OnlineTileSourceBase = TileSourceFactory.OPEN_SEAMAP
+ val DEFAULT_TILE_SOURCE: OnlineTileSourceBase = TileSourceFactory.DEFAULT_TILE_SOURCE
+
+ /** Source for each available [ITileSource] and their display names. */
+ val mTileSources: Map =
+ mapOf(
+ MAPNIK to "OpenStreetMap",
+ USGS_TOPO to "USGS TOPO",
+ OPEN_TOPO to "Open TOPO",
+ ESRI_WORLD_TOPO to "ESRI World TOPO",
+ USGS_SAT to "USGS Satellite",
+ ESRI_IMAGERY to "ESRI World Overview",
+ )
+
+ fun getTileSource(index: Int): ITileSource = mTileSources.keys.elementAtOrNull(index) ?: DEFAULT_TILE_SOURCE
+
+ fun getTileSource(aName: String): ITileSource {
+ for (tileSource: ITileSource in mTileSources.keys) {
+ if (tileSource.name().equals(aName)) {
+ return tileSource
+ }
+ }
+ throw IllegalArgumentException("No such tile source: $aName")
+ }
+ }
+}
diff --git a/app/src/main/java/com/geeksville/mesh/model/map/MarkerWithLabel.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/MarkerWithLabel.kt
similarity index 63%
rename from app/src/main/java/com/geeksville/mesh/model/map/MarkerWithLabel.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/map/model/MarkerWithLabel.kt
index d8281a8d4..da94a7725 100644
--- a/app/src/main/java/com/geeksville/mesh/model/map/MarkerWithLabel.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/MarkerWithLabel.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,16 +14,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-package com.geeksville.mesh.model.map
+package org.meshtastic.app.map.model
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.RectF
import android.view.MotionEvent
-import com.geeksville.mesh.android.dpToPx
-import com.geeksville.mesh.android.spToPx
+import org.meshtastic.app.map.dpToPx
+import org.meshtastic.app.map.spToPx
import org.osmdroid.views.MapView
import org.osmdroid.views.overlay.Marker
import org.osmdroid.views.overlay.Polygon
@@ -37,39 +36,35 @@ class MarkerWithLabel(mapView: MapView?, label: String, emoji: String? = null) :
private const val EMOJI_FONT_SIZE_SP = 20f
}
- private val labelYOffsetPx by lazy {
- mapView?.context?.dpToPx(LABEL_Y_OFFSET_DP) ?: 100
- }
+ private val labelYOffsetPx by lazy { mapView?.context?.dpToPx(LABEL_Y_OFFSET_DP) ?: 100 }
- private val labelCornerRadiusPx by lazy {
- mapView?.context?.dpToPx(LABEL_CORNER_RADIUS_DP) ?: 12
- }
+ private val labelCornerRadiusPx by lazy { mapView?.context?.dpToPx(LABEL_CORNER_RADIUS_DP) ?: 12 }
private var nodeColor: Int = Color.GRAY
+
fun setNodeColors(colors: Pair) {
nodeColor = colors.second
}
private var precisionBits: Int? = null
+
fun setPrecisionBits(bits: Int) {
precisionBits = bits
}
@Suppress("MagicNumber")
- private fun getPrecisionMeters(): Double? {
- return when (precisionBits) {
- 10 -> 23345.484932
- 11 -> 11672.7369
- 12 -> 5836.36288
- 13 -> 2918.175876
- 14 -> 1459.0823719999053
- 15 -> 729.53562
- 16 -> 364.7622
- 17 -> 182.375556
- 18 -> 91.182212
- 19 -> 45.58554
- else -> null
- }
+ private fun getPrecisionMeters(): Double? = when (precisionBits) {
+ 10 -> 23345.484932
+ 11 -> 11672.7369
+ 12 -> 5836.36288
+ 13 -> 2918.175876
+ 14 -> 1459.0823719999053
+ 15 -> 729.53562
+ 16 -> 364.7622
+ 17 -> 182.375556
+ 18 -> 91.182212
+ 19 -> 45.58554
+ else -> null
}
private var onLongClickListener: (() -> Boolean)? = null
@@ -80,30 +75,27 @@ class MarkerWithLabel(mapView: MapView?, label: String, emoji: String? = null) :
private val mLabel = label
private val mEmoji = emoji
- private val textPaint = Paint().apply {
- textSize = mapView?.context?.spToPx(FONT_SIZE_SP)?.toFloat() ?: 40f
- color = Color.DKGRAY
- isAntiAlias = true
- isFakeBoldText = true
- textAlign = Paint.Align.CENTER
- }
- private val emojiPaint = Paint().apply {
- textSize = mapView?.context?.spToPx(EMOJI_FONT_SIZE_SP)?.toFloat() ?: 80f
- isAntiAlias = true
- textAlign = Paint.Align.CENTER
- }
+ private val textPaint =
+ Paint().apply {
+ textSize = mapView?.context?.spToPx(FONT_SIZE_SP)?.toFloat() ?: 40f
+ color = Color.DKGRAY
+ isAntiAlias = true
+ isFakeBoldText = true
+ textAlign = Paint.Align.CENTER
+ }
+ private val emojiPaint =
+ Paint().apply {
+ textSize = mapView?.context?.spToPx(EMOJI_FONT_SIZE_SP)?.toFloat() ?: 80f
+ isAntiAlias = true
+ textAlign = Paint.Align.CENTER
+ }
private val bgPaint = Paint().apply { color = Color.WHITE }
private fun getTextBackgroundSize(text: String, x: Float, y: Float): RectF {
val fontMetrics = textPaint.fontMetrics
val halfTextLength = textPaint.measureText(text) / 2 + 3
- return RectF(
- (x - halfTextLength),
- (y + fontMetrics.top),
- (x + halfTextLength),
- (y + fontMetrics.bottom)
- )
+ return RectF((x - halfTextLength), (y + fontMetrics.top), (x + halfTextLength), (y + fontMetrics.bottom))
}
override fun onLongPress(event: MotionEvent?, mapView: MapView?): Boolean {
@@ -128,20 +120,18 @@ class MarkerWithLabel(mapView: MapView?, label: String, emoji: String? = null) :
mEmoji?.let { c.drawText(it, (p.x - 0f), (p.y - 30f), emojiPaint) }
getPrecisionMeters()?.let { radius ->
- val polygon = Polygon(osmv).apply {
- points = Polygon.pointsAsCircle(
- position,
- radius
- )
- fillPaint.apply {
- color = nodeColor
- alpha = 48
+ val polygon =
+ Polygon(osmv).apply {
+ points = Polygon.pointsAsCircle(position, radius)
+ fillPaint.apply {
+ color = nodeColor
+ alpha = 48
+ }
+ outlinePaint.apply {
+ color = nodeColor
+ alpha = 64
+ }
}
- outlinePaint.apply {
- color = nodeColor
- alpha = 64
- }
- }
polygon.draw(c, osmv, false)
}
}
diff --git a/app/src/main/java/com/geeksville/mesh/model/map/NOAAWmsTileSource.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/NOAAWmsTileSource.kt
similarity index 57%
rename from app/src/main/java/com/geeksville/mesh/model/map/NOAAWmsTileSource.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/map/model/NOAAWmsTileSource.kt
index ea2d78035..ac438397a 100644
--- a/app/src/main/java/com/geeksville/mesh/model/map/NOAAWmsTileSource.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/NOAAWmsTileSource.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,11 +14,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-package com.geeksville.mesh.model.map
+package org.meshtastic.app.map.model
import android.content.res.Resources
-import android.util.Log
+import co.touchlab.kermit.Logger
import org.osmdroid.api.IMapView
import org.osmdroid.tileprovider.tilesource.OnlineTileSourceBase
import org.osmdroid.tileprovider.tilesource.TileSourcePolicy
@@ -37,33 +36,40 @@ open class NOAAWmsTileSource(
style: String?,
format: String,
) : OnlineTileSourceBase(
- aName, 0, 5, 256, "png", aBaseUrl, "", TileSourcePolicy(
+ aName,
+ 0,
+ 5,
+ 256,
+ "png",
+ aBaseUrl,
+ "",
+ TileSourcePolicy(
2,
- TileSourcePolicy.FLAG_NO_BULK
- or TileSourcePolicy.FLAG_NO_PREVENTIVE
- or TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL
- or TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED
- )
+ TileSourcePolicy.FLAG_NO_BULK or
+ TileSourcePolicy.FLAG_NO_PREVENTIVE or
+ TileSourcePolicy.FLAG_USER_AGENT_MEANINGFUL or
+ TileSourcePolicy.FLAG_USER_AGENT_NORMALIZED,
+ ),
) {
// array indexes for array to hold bounding boxes.
- private val MINX = 0
- private val MAXX = 1
- private val MINY = 2
- private val MAXY = 3
+ private val minX = 0
+ private val maxX = 1
+ private val minY = 2
+ private val maxY = 3
// Web Mercator n/w corner of the map.
- private val TILE_ORIGIN = doubleArrayOf(-20037508.34789244, 20037508.34789244)
+ private val tileOrigin = doubleArrayOf(-20037508.34789244, 20037508.34789244)
- //array indexes for that data
- private val ORIG_X = 0
- private val ORIG_Y = 1 // "
+ // array indexes for that data
+ private val origX = 0
+ private val origY = 1 // "
// Size of square world map in meters, using WebMerc projection.
- private val MAP_SIZE = 20037508.34789244 * 2
+ private val mapSize = 20037508.34789244 * 2
private var layer = ""
private var version = "1.1.0"
- private var srs = "EPSG%3A3857" //used by geo server
+ private var srs = "EPSG%3A3857" // used by geo server
private var format = ""
private var time = ""
private var style: String? = null
@@ -71,7 +77,7 @@ open class NOAAWmsTileSource(
private var forceHttp = false
init {
- Log.i(IMapView.LOGTAG, "WMS support is BETA. Please report any issues")
+ Logger.withTag(IMapView.LOGTAG).i { "WMS support is BETA. Please report any issues" }
layer = layername
this.version = version
this.srs = srs
@@ -80,26 +86,7 @@ open class NOAAWmsTileSource(
if (time != null) this.time = time
}
-// fun createFrom(endpoint: WMSEndpoint, layer: WMSLayer): WMSTileSource? {
-// var srs: String? = "EPSG:900913"
-// if (layer.srs.isNotEmpty()) {
-// srs = layer.srs[0]
-// }
-// return if (layer.styles.isEmpty()) {
-// WMSTileSource(
-// layer.name, arrayOf(endpoint.baseurl), layer.name,
-// endpoint.wmsVersion, srs, null, layer.pixelSize
-// )
-// } else WMSTileSource(
-// layer.name, arrayOf(endpoint.baseurl), layer.name,
-// endpoint.wmsVersion, srs, layer.styles[0], layer.pixelSize
-// )
-// }
-
-
- private fun tile2lon(x: Int, z: Int): Double {
- return x / 2.0.pow(z.toDouble()) * 360.0 - 180
- }
+ private fun tile2lon(x: Int, z: Int): Double = x / 2.0.pow(z.toDouble()) * 360.0 - 180
private fun tile2lat(y: Int, z: Int): Double {
val n = Math.PI - 2.0 * Math.PI * y / 2.0.pow(z.toDouble())
@@ -109,30 +96,26 @@ open class NOAAWmsTileSource(
// Return a web Mercator bounding box given tile x/y indexes and a zoom
// level.
private fun getBoundingBox(x: Int, y: Int, zoom: Int): DoubleArray {
- val tileSize = MAP_SIZE / 2.0.pow(zoom.toDouble())
- val minx = TILE_ORIGIN[ORIG_X] + x * tileSize
- val maxx = TILE_ORIGIN[ORIG_X] + (x + 1) * tileSize
- val miny = TILE_ORIGIN[ORIG_Y] - (y + 1) * tileSize
- val maxy = TILE_ORIGIN[ORIG_Y] - y * tileSize
+ val tileSize = mapSize / 2.0.pow(zoom.toDouble())
+ val minx = tileOrigin[origX] + x * tileSize
+ val maxx = tileOrigin[origX] + (x + 1) * tileSize
+ val miny = tileOrigin[origY] - (y + 1) * tileSize
+ val maxy = tileOrigin[origY] - y * tileSize
val bbox = DoubleArray(4)
- bbox[MINX] = minx
- bbox[MINY] = miny
- bbox[MAXX] = maxx
- bbox[MAXY] = maxy
+ bbox[minX] = minx
+ bbox[minY] = miny
+ bbox[maxX] = maxx
+ bbox[maxY] = maxy
return bbox
}
- fun isForceHttps(): Boolean {
- return forceHttps
- }
+ fun isForceHttps(): Boolean = forceHttps
fun setForceHttps(forceHttps: Boolean) {
this.forceHttps = forceHttps
}
- fun isForceHttp(): Boolean {
- return forceHttp
- }
+ fun isForceHttp(): Boolean = forceHttp
fun setForceHttp(forceHttp: Boolean) {
this.forceHttp = forceHttp
@@ -143,8 +126,7 @@ open class NOAAWmsTileSource(
if (forceHttps) baseUrl = baseUrl.replace("http://", "https://")
if (forceHttp) baseUrl = baseUrl.replace("https://", "http://")
val sb = StringBuilder(baseUrl)
- if (!baseUrl.endsWith("&"))
- sb.append("service=WMS")
+ if (!baseUrl.endsWith("&")) sb.append("service=WMS")
sb.append("&request=GetMap")
sb.append("&version=").append(version)
sb.append("&layers=").append(layer)
@@ -156,16 +138,17 @@ open class NOAAWmsTileSource(
sb.append("&srs=").append(srs)
sb.append("&size=").append(getSize())
sb.append("&bbox=")
- val bbox = getBoundingBox(
- MapTileIndex.getX(pMapTileIndex),
- MapTileIndex.getY(pMapTileIndex),
- MapTileIndex.getZoom(pMapTileIndex)
- )
- sb.append(bbox[MINX]).append(",")
- sb.append(bbox[MINY]).append(",")
- sb.append(bbox[MAXX]).append(",")
- sb.append(bbox[MAXY])
- Log.i(IMapView.LOGTAG, sb.toString())
+ val bbox =
+ getBoundingBox(
+ MapTileIndex.getX(pMapTileIndex),
+ MapTileIndex.getY(pMapTileIndex),
+ MapTileIndex.getZoom(pMapTileIndex),
+ )
+ sb.append(bbox[minX]).append(",")
+ sb.append(bbox[minY]).append(",")
+ sb.append(bbox[maxX]).append(",")
+ sb.append(bbox[maxY])
+ Logger.withTag(IMapView.LOGTAG).i { sb.toString() }
return sb.toString()
}
@@ -173,6 +156,5 @@ open class NOAAWmsTileSource(
val height = Resources.getSystem().displayMetrics.heightPixels
val width = Resources.getSystem().displayMetrics.widthPixels
return "$width,$height"
-
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/com/geeksville/mesh/model/map/OnlineTileSourceAuth.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/OnlineTileSourceAuth.kt
similarity index 57%
rename from app/src/main/java/com/geeksville/mesh/model/map/OnlineTileSourceAuth.kt
rename to app/src/fdroid/kotlin/org/meshtastic/app/map/model/OnlineTileSourceAuth.kt
index 57d48285a..3d51133bd 100644
--- a/app/src/main/java/com/geeksville/mesh/model/map/OnlineTileSourceAuth.kt
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/model/OnlineTileSourceAuth.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2025 Meshtastic LLC
+ * Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,36 +14,34 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-package com.geeksville.mesh.model.map
+package org.meshtastic.app.map.model
import org.osmdroid.tileprovider.tilesource.OnlineTileSourceBase
import org.osmdroid.tileprovider.tilesource.TileSourcePolicy
import org.osmdroid.util.MapTileIndex
+@Suppress("LongParameterList")
open class OnlineTileSourceAuth(
- aName: String,
- aZoomLevel: Int,
- aZoomMaxLevel: Int,
- aTileSizePixels: Int,
- aImageFileNameEnding: String,
- aBaseUrl: Array,
+ name: String,
+ zoomLevel: Int,
+ zoomMaxLevel: Int,
+ tileSizePixels: Int,
+ imageFileNameEnding: String,
+ baseUrl: Array,
pCopyright: String,
tileSourcePolicy: TileSourcePolicy,
layerName: String?,
- apiKey: String
-) :
- OnlineTileSourceBase(
- aName,
- aZoomLevel,
- aZoomMaxLevel,
- aTileSizePixels,
- aImageFileNameEnding,
- aBaseUrl,
- pCopyright,
- tileSourcePolicy
-
- ) {
+ apiKey: String,
+) : OnlineTileSourceBase(
+ name,
+ zoomLevel,
+ zoomMaxLevel,
+ tileSizePixels,
+ imageFileNameEnding,
+ baseUrl,
+ pCopyright,
+ tileSourcePolicy,
+) {
private var layerName = ""
private var apiKey = ""
@@ -52,13 +50,16 @@ open class OnlineTileSourceAuth(
this.layerName = layerName
}
this.apiKey = apiKey
-
}
- override fun getTileURLString(pMapTileIndex: Long): String {
- return "$baseUrl$layerName/" + (MapTileIndex.getZoom(pMapTileIndex)
- .toString() + "/" + MapTileIndex.getX(pMapTileIndex)
- .toString() + "/" + MapTileIndex.getY(pMapTileIndex)
- .toString()) + mImageFilenameEnding + "?appId=$apiKey"
- }
-}
\ No newline at end of file
+ override fun getTileURLString(pMapTileIndex: Long): String = "$baseUrl$layerName/" +
+ (
+ MapTileIndex.getZoom(pMapTileIndex).toString() +
+ "/" +
+ MapTileIndex.getX(pMapTileIndex).toString() +
+ "/" +
+ MapTileIndex.getY(pMapTileIndex).toString()
+ ) +
+ mImageFilenameEnding +
+ "?appId=$apiKey"
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt
new file mode 100644
index 000000000..b7795180f
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.node
+
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Scaffold
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.ui.Modifier
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import org.meshtastic.core.ui.component.MainAppBar
+import org.meshtastic.feature.map.node.NodeMapViewModel
+
+@Composable
+fun NodeMapScreen(nodeMapViewModel: NodeMapViewModel, onNavigateUp: () -> Unit) {
+ val node by nodeMapViewModel.node.collectAsStateWithLifecycle()
+ val positions by nodeMapViewModel.positionLogs.collectAsStateWithLifecycle()
+
+ Scaffold(
+ topBar = {
+ MainAppBar(
+ title = node?.user?.long_name ?: "",
+ ourNode = null,
+ showNodeChip = false,
+ canNavigateUp = true,
+ onNavigateUp = onNavigateUp,
+ actions = {},
+ onClickChip = {},
+ )
+ },
+ ) { paddingValues ->
+ NodeTrackOsmMap(
+ positions = positions,
+ applicationId = nodeMapViewModel.applicationId,
+ mapStyleId = nodeMapViewModel.mapStyleId,
+ modifier = Modifier.fillMaxSize().padding(paddingValues),
+ )
+ }
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeTrackMap.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeTrackMap.kt
new file mode 100644
index 000000000..77b595d88
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeTrackMap.kt
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.node
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import org.koin.compose.viewmodel.koinViewModel
+import org.meshtastic.feature.map.node.NodeMapViewModel
+import org.meshtastic.proto.Position
+
+/**
+ * Flavor-unified entry point for the embeddable node-track map. Resolves [destNum] to obtain
+ * [NodeMapViewModel.applicationId] and [NodeMapViewModel.mapStyleId], then delegates to the OSMDroid implementation
+ * ([NodeTrackOsmMap]).
+ *
+ * Supports optional synchronized selection via [selectedPositionTime] and [onPositionSelected].
+ */
+@Composable
+fun NodeTrackMap(
+ destNum: Int,
+ positions: List,
+ modifier: Modifier = Modifier,
+ selectedPositionTime: Int? = null,
+ onPositionSelected: ((Int) -> Unit)? = null,
+) {
+ val vm = koinViewModel()
+ vm.setDestNum(destNum)
+ NodeTrackOsmMap(
+ positions = positions,
+ applicationId = vm.applicationId,
+ mapStyleId = vm.mapStyleId,
+ modifier = modifier,
+ selectedPositionTime = selectedPositionTime,
+ onPositionSelected = onPositionSelected,
+ )
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeTrackOsmMap.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeTrackOsmMap.kt
new file mode 100644
index 000000000..a6aec4c2d
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeTrackOsmMap.kt
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.node
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.DropdownMenu
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Slider
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableFloatStateOf
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import org.jetbrains.compose.resources.stringResource
+import org.koin.compose.viewmodel.koinViewModel
+import org.meshtastic.app.map.MapViewModel
+import org.meshtastic.app.map.addCopyright
+import org.meshtastic.app.map.addPolyline
+import org.meshtastic.app.map.addPositionMarkers
+import org.meshtastic.app.map.addScaleBarOverlay
+import org.meshtastic.app.map.model.CustomTileSource
+import org.meshtastic.app.map.rememberMapViewWithLifecycle
+import org.meshtastic.core.common.util.nowSeconds
+import org.meshtastic.core.model.util.GeoConstants.DEG_D
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.last_heard_filter_label
+import org.meshtastic.feature.map.LastHeardFilter
+import org.meshtastic.feature.map.component.MapControlsOverlay
+import org.meshtastic.proto.Position
+import org.osmdroid.util.BoundingBox
+import org.osmdroid.util.GeoPoint
+import kotlin.math.roundToInt
+
+/**
+ * A focused OSMDroid map composable that renders **only** a node's position track — a dashed polyline with directional
+ * markers for each historical position.
+ *
+ * Applies the [lastHeardTrackFilter][org.meshtastic.feature.map.BaseMapViewModel.MapFilterState.lastHeardTrackFilter]
+ * from [MapViewModel] to filter positions by time, matching the behavior of the Google Maps implementation. Includes a
+ * minimal [MapControlsOverlay][org.meshtastic.feature.map.component.MapControlsOverlay] with a track time filter slider
+ * so users can adjust the time range directly from the map.
+ *
+ * Supports optional synchronized selection via [selectedPositionTime] and [onPositionSelected].
+ *
+ * Unlike the main [org.meshtastic.app.map.MapView], this composable does **not** include node clusters, waypoints, or
+ * location tracking. It is designed to be embedded inside the position-log adaptive layout.
+ */
+@Composable
+fun NodeTrackOsmMap(
+ positions: List,
+ applicationId: String,
+ mapStyleId: Int,
+ modifier: Modifier = Modifier,
+ selectedPositionTime: Int? = null,
+ onPositionSelected: ((Int) -> Unit)? = null,
+ mapViewModel: MapViewModel = koinViewModel(),
+) {
+ val density = LocalDensity.current
+ val mapFilterState by mapViewModel.mapFilterStateFlow.collectAsStateWithLifecycle()
+ val lastHeardTrackFilter = mapFilterState.lastHeardTrackFilter
+
+ val filteredPositions =
+ remember(positions, lastHeardTrackFilter) {
+ positions.filter {
+ lastHeardTrackFilter == LastHeardFilter.Any || it.time > nowSeconds - lastHeardTrackFilter.seconds
+ }
+ }
+
+ val geoPoints =
+ remember(filteredPositions) {
+ filteredPositions.map { GeoPoint((it.latitude_i ?: 0) * DEG_D, (it.longitude_i ?: 0) * DEG_D) }
+ }
+ val cameraView = remember(geoPoints) { BoundingBox.fromGeoPoints(geoPoints) }
+ val mapView =
+ rememberMapViewWithLifecycle(
+ applicationId = applicationId,
+ box = cameraView,
+ tileSource = CustomTileSource.getTileSource(mapStyleId),
+ )
+
+ var filterMenuExpanded by remember { mutableStateOf(false) }
+
+ Box(modifier = modifier) {
+ AndroidView(
+ modifier = Modifier.matchParentSize(),
+ factory = { mapView },
+ update = { map ->
+ map.overlays.clear()
+ map.addCopyright()
+ map.addScaleBarOverlay(density)
+ map.addPolyline(density, geoPoints) {}
+ map.addPositionMarkers(filteredPositions) { time -> onPositionSelected?.invoke(time) }
+ // Center on selected position
+ if (selectedPositionTime != null) {
+ val selected = filteredPositions.find { it.time == selectedPositionTime }
+ if (selected != null) {
+ val point = GeoPoint((selected.latitude_i ?: 0) * DEG_D, (selected.longitude_i ?: 0) * DEG_D)
+ map.controller.animateTo(point)
+ }
+ }
+ },
+ )
+
+ // Track filter controls overlay
+ MapControlsOverlay(
+ modifier = Modifier.align(Alignment.TopCenter).padding(top = 8.dp),
+ onToggleFilterMenu = { filterMenuExpanded = true },
+ filterDropdownContent = {
+ DropdownMenu(expanded = filterMenuExpanded, onDismissRequest = { filterMenuExpanded = false }) {
+ Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
+ val filterOptions = LastHeardFilter.entries
+ val selectedIndex = filterOptions.indexOf(lastHeardTrackFilter)
+ var sliderPosition by remember(selectedIndex) { mutableFloatStateOf(selectedIndex.toFloat()) }
+
+ Text(
+ text =
+ stringResource(
+ Res.string.last_heard_filter_label,
+ stringResource(lastHeardTrackFilter.label),
+ ),
+ style = MaterialTheme.typography.labelLarge,
+ )
+ Slider(
+ value = sliderPosition,
+ onValueChange = { sliderPosition = it },
+ onValueChangeFinished = {
+ val newIndex = sliderPosition.roundToInt().coerceIn(0, filterOptions.size - 1)
+ mapViewModel.setLastHeardTrackFilter(filterOptions[newIndex])
+ },
+ valueRange = 0f..(filterOptions.size - 1).toFloat(),
+ steps = filterOptions.size - 2,
+ )
+ }
+ }
+ },
+ )
+ }
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/traceroute/TracerouteMap.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/traceroute/TracerouteMap.kt
new file mode 100644
index 000000000..fcf1d47e9
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/traceroute/TracerouteMap.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.traceroute
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import org.meshtastic.core.model.TracerouteOverlay
+import org.meshtastic.proto.Position
+
+/**
+ * Flavor-unified entry point for the embeddable traceroute map. Delegates to the OSMDroid implementation
+ * ([TracerouteOsmMap]).
+ */
+@Composable
+fun TracerouteMap(
+ tracerouteOverlay: TracerouteOverlay?,
+ tracerouteNodePositions: Map,
+ onMappableCountChanged: (shown: Int, total: Int) -> Unit,
+ modifier: Modifier = Modifier,
+) {
+ TracerouteOsmMap(
+ tracerouteOverlay = tracerouteOverlay,
+ tracerouteNodePositions = tracerouteNodePositions,
+ onMappableCountChanged = onMappableCountChanged,
+ modifier = modifier,
+ )
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/map/traceroute/TracerouteOsmMap.kt b/app/src/fdroid/kotlin/org/meshtastic/app/map/traceroute/TracerouteOsmMap.kt
new file mode 100644
index 000000000..55b49154a
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/map/traceroute/TracerouteOsmMap.kt
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+@file:Suppress("MagicNumber")
+
+package org.meshtastic.app.map.traceroute
+
+import android.graphics.Paint
+import androidx.appcompat.content.res.AppCompatResources
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.toArgb
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import org.koin.compose.viewmodel.koinViewModel
+import org.meshtastic.app.R
+import org.meshtastic.app.map.MapViewModel
+import org.meshtastic.app.map.addCopyright
+import org.meshtastic.app.map.addScaleBarOverlay
+import org.meshtastic.app.map.model.CustomTileSource
+import org.meshtastic.app.map.model.MarkerWithLabel
+import org.meshtastic.app.map.rememberMapViewWithLifecycle
+import org.meshtastic.app.map.zoomIn
+import org.meshtastic.core.model.TracerouteOverlay
+import org.meshtastic.core.model.util.GeoConstants.EARTH_RADIUS_METERS
+import org.meshtastic.core.ui.theme.TracerouteColors
+import org.meshtastic.core.ui.util.formatAgo
+import org.meshtastic.feature.map.tracerouteNodeSelection
+import org.meshtastic.proto.Position
+import org.osmdroid.util.BoundingBox
+import org.osmdroid.util.GeoPoint
+import org.osmdroid.views.overlay.Marker
+import org.osmdroid.views.overlay.Polyline
+import kotlin.math.PI
+import kotlin.math.abs
+import kotlin.math.asin
+import kotlin.math.atan2
+import kotlin.math.cos
+import kotlin.math.sin
+
+private const val TRACEROUTE_OFFSET_METERS = 100.0
+private const val TRACEROUTE_SINGLE_POINT_ZOOM = 12.0
+private const val TRACEROUTE_ZOOM_OUT_LEVELS = 0.5
+
+/**
+ * A focused OSMDroid map composable that renders **only** traceroute visualization — node markers for each hop and
+ * forward/return offset polylines with auto-centering camera.
+ *
+ * Unlike the main `MapView`, this composable does **not** include node clusters, waypoints, location tracking, or any
+ * map controls. It is designed to be embedded inside `TracerouteMapScreen`'s scaffold.
+ */
+@Composable
+fun TracerouteOsmMap(
+ tracerouteOverlay: TracerouteOverlay?,
+ tracerouteNodePositions: Map,
+ onMappableCountChanged: (shown: Int, total: Int) -> Unit,
+ modifier: Modifier = Modifier,
+ mapViewModel: MapViewModel = koinViewModel(),
+) {
+ val context = LocalContext.current
+ val density = LocalDensity.current
+ val nodes by mapViewModel.nodes.collectAsStateWithLifecycle()
+ val markerIcon = remember { AppCompatResources.getDrawable(context, R.drawable.ic_location_on) }
+
+ // Resolve which nodes to display for the traceroute
+ val tracerouteSelection =
+ remember(tracerouteOverlay, tracerouteNodePositions, nodes) {
+ mapViewModel.tracerouteNodeSelection(
+ tracerouteOverlay = tracerouteOverlay,
+ tracerouteNodePositions = tracerouteNodePositions,
+ nodes = nodes,
+ )
+ }
+ val displayNodes = tracerouteSelection.nodesForMarkers
+ val nodeLookup = tracerouteSelection.nodeLookup
+
+ // Report mappable count
+ LaunchedEffect(tracerouteOverlay, displayNodes) {
+ if (tracerouteOverlay != null) {
+ onMappableCountChanged(displayNodes.size, tracerouteOverlay.relatedNodeNums.size)
+ }
+ }
+
+ // Compute polyline GeoPoints from node positions
+ val forwardPoints =
+ remember(tracerouteOverlay, nodeLookup) {
+ tracerouteOverlay?.forwardRoute?.mapNotNull {
+ nodeLookup[it]?.let { node -> GeoPoint(node.latitude, node.longitude) }
+ } ?: emptyList()
+ }
+ val returnPoints =
+ remember(tracerouteOverlay, nodeLookup) {
+ tracerouteOverlay?.returnRoute?.mapNotNull {
+ nodeLookup[it]?.let { node -> GeoPoint(node.latitude, node.longitude) }
+ } ?: emptyList()
+ }
+
+ // Compute offset polylines for visual separation
+ val headingReferencePoints =
+ remember(forwardPoints, returnPoints) {
+ when {
+ forwardPoints.size >= 2 -> forwardPoints
+ returnPoints.size >= 2 -> returnPoints
+ else -> emptyList()
+ }
+ }
+ val forwardOffsetPoints =
+ remember(forwardPoints, headingReferencePoints) {
+ offsetPolyline(
+ points = forwardPoints,
+ offsetMeters = TRACEROUTE_OFFSET_METERS,
+ headingReferencePoints = headingReferencePoints,
+ sideMultiplier = 1.0,
+ )
+ }
+ val returnOffsetPoints =
+ remember(returnPoints, headingReferencePoints) {
+ offsetPolyline(
+ points = returnPoints,
+ offsetMeters = TRACEROUTE_OFFSET_METERS,
+ headingReferencePoints = headingReferencePoints,
+ sideMultiplier = -1.0,
+ )
+ }
+
+ // Camera auto-center
+ var hasCentered by remember(tracerouteOverlay) { mutableStateOf(false) }
+
+ // Build initial camera from all traceroute points
+ val allPoints = remember(forwardPoints, returnPoints) { (forwardPoints + returnPoints).distinct() }
+ val initialCameraView =
+ remember(allPoints) { if (allPoints.isEmpty()) null else BoundingBox.fromGeoPoints(allPoints) }
+
+ val mapView =
+ rememberMapViewWithLifecycle(
+ applicationId = mapViewModel.applicationId,
+ box = initialCameraView ?: BoundingBox(),
+ tileSource = CustomTileSource.getTileSource(mapViewModel.mapStyleId),
+ )
+
+ // Center camera on traceroute bounds
+ LaunchedEffect(tracerouteOverlay, forwardPoints, returnPoints) {
+ if (tracerouteOverlay == null || hasCentered) return@LaunchedEffect
+ if (allPoints.isNotEmpty()) {
+ if (allPoints.size == 1) {
+ mapView.controller.setCenter(allPoints.first())
+ mapView.controller.setZoom(TRACEROUTE_SINGLE_POINT_ZOOM)
+ } else {
+ mapView.zoomToBoundingBox(
+ BoundingBox.fromGeoPoints(allPoints).zoomIn(-TRACEROUTE_ZOOM_OUT_LEVELS),
+ true,
+ )
+ }
+ hasCentered = true
+ }
+ }
+
+ AndroidView(
+ modifier = modifier,
+ factory = { mapView.apply { setDestroyMode(false) } },
+ update = { map ->
+ map.overlays.clear()
+ map.addCopyright()
+ map.addScaleBarOverlay(density)
+
+ // Render traceroute polylines
+ buildTraceroutePolylines(forwardOffsetPoints, returnOffsetPoints, density).forEach { map.overlays.add(it) }
+
+ // Render simple node markers
+ displayNodes.forEach { node ->
+ val position = GeoPoint(node.latitude, node.longitude)
+ val marker =
+ MarkerWithLabel(mapView = map, label = "${node.user.short_name} ${formatAgo(node.position.time)}")
+ .apply {
+ id = node.user.id
+ title = node.user.long_name
+ setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM)
+ this.position = position
+ icon = markerIcon
+ setNodeColors(node.colors)
+ }
+ map.overlays.add(marker)
+ }
+
+ map.invalidate()
+ },
+ )
+}
+
+private fun buildTraceroutePolylines(
+ forwardPoints: List,
+ returnPoints: List,
+ density: androidx.compose.ui.unit.Density,
+): List {
+ val polylines = mutableListOf()
+
+ fun buildPolyline(points: List, color: Int, strokeWidth: Float): Polyline = Polyline().apply {
+ setPoints(points)
+ outlinePaint.apply {
+ this.color = color
+ this.strokeWidth = strokeWidth
+ strokeCap = Paint.Cap.ROUND
+ strokeJoin = Paint.Join.ROUND
+ style = Paint.Style.STROKE
+ }
+ }
+
+ forwardPoints
+ .takeIf { it.size >= 2 }
+ ?.let { points ->
+ polylines.add(buildPolyline(points, TracerouteColors.OutgoingRoute.toArgb(), with(density) { 6.dp.toPx() }))
+ }
+ returnPoints
+ .takeIf { it.size >= 2 }
+ ?.let { points ->
+ polylines.add(buildPolyline(points, TracerouteColors.ReturnRoute.toArgb(), with(density) { 5.dp.toPx() }))
+ }
+ return polylines
+}
+
+// --- Haversine offset math for OSMDroid (no SphericalUtil available) ---
+
+private fun Double.toRad(): Double = this * PI / 180.0
+
+private fun bearingRad(from: GeoPoint, to: GeoPoint): Double {
+ val lat1 = from.latitude.toRad()
+ val lat2 = to.latitude.toRad()
+ val dLon = (to.longitude - from.longitude).toRad()
+ return atan2(sin(dLon) * cos(lat2), cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(dLon))
+}
+
+private fun GeoPoint.offsetPoint(headingRad: Double, offsetMeters: Double): GeoPoint {
+ val distanceByRadius = offsetMeters / EARTH_RADIUS_METERS
+ val lat1 = latitude.toRad()
+ val lon1 = longitude.toRad()
+ val lat2 = asin(sin(lat1) * cos(distanceByRadius) + cos(lat1) * sin(distanceByRadius) * cos(headingRad))
+ val lon2 =
+ lon1 + atan2(sin(headingRad) * sin(distanceByRadius) * cos(lat1), cos(distanceByRadius) - sin(lat1) * sin(lat2))
+ return GeoPoint(lat2 * 180.0 / PI, lon2 * 180.0 / PI)
+}
+
+private fun offsetPolyline(
+ points: List,
+ offsetMeters: Double,
+ headingReferencePoints: List = points,
+ sideMultiplier: Double = 1.0,
+): List {
+ val headingPoints = headingReferencePoints.takeIf { it.size >= 2 } ?: points
+ if (points.size < 2 || headingPoints.size < 2 || offsetMeters == 0.0) return points
+
+ val headings =
+ headingPoints.mapIndexed { index, _ ->
+ when (index) {
+ 0 -> bearingRad(headingPoints[0], headingPoints[1])
+ headingPoints.lastIndex ->
+ bearingRad(headingPoints[headingPoints.lastIndex - 1], headingPoints[headingPoints.lastIndex])
+
+ else -> bearingRad(headingPoints[index - 1], headingPoints[index + 1])
+ }
+ }
+
+ return points.mapIndexed { index, point ->
+ val heading = headings[index.coerceIn(0, headings.lastIndex)]
+ val perpendicularHeading = heading + (PI / 2 * sideMultiplier)
+ point.offsetPoint(perpendicularHeading, abs(offsetMeters))
+ }
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/node/component/InlineMap.kt b/app/src/fdroid/kotlin/org/meshtastic/app/node/component/InlineMap.kt
new file mode 100644
index 000000000..447765522
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/node/component/InlineMap.kt
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.node.component
+
+import android.view.ViewGroup
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.viewinterop.AndroidView
+import org.meshtastic.core.model.Node
+import org.osmdroid.tileprovider.tilesource.TileSourceFactory
+import org.osmdroid.util.GeoPoint
+import org.osmdroid.views.MapView
+import org.osmdroid.views.overlay.Marker
+
+@Composable
+fun InlineMap(node: Node, modifier: Modifier = Modifier) {
+ val context = androidx.compose.ui.platform.LocalContext.current
+
+ val map = remember {
+ MapView(context).apply {
+ layoutParams =
+ ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
+
+ // Default osmdroid tile source.
+ setTileSource(TileSourceFactory.MAPNIK)
+ setMultiTouchControls(false)
+
+ controller.setZoom(15.0)
+ }
+ }
+
+ LaunchedEffect(node.num) {
+ val point = GeoPoint(node.latitude, node.longitude)
+
+ map.overlays.clear()
+
+ val marker =
+ Marker(map).apply {
+ position = point
+ setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM)
+ }
+ map.overlays.add(marker)
+
+ map.controller.animateTo(point)
+ }
+
+ AndroidView(factory = { map }, modifier = modifier)
+}
diff --git a/app/src/fdroid/kotlin/org/meshtastic/app/node/metrics/TracerouteMapOverlayInsets.kt b/app/src/fdroid/kotlin/org/meshtastic/app/node/metrics/TracerouteMapOverlayInsets.kt
new file mode 100644
index 000000000..d6515eeb7
--- /dev/null
+++ b/app/src/fdroid/kotlin/org/meshtastic/app/node/metrics/TracerouteMapOverlayInsets.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.node.metrics
+
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.unit.dp
+import org.meshtastic.core.ui.util.TracerouteMapOverlayInsets
+
+fun getTracerouteMapOverlayInsets(): TracerouteMapOverlayInsets = TracerouteMapOverlayInsets(
+ overlayAlignment = Alignment.BottomEnd,
+ overlayPadding = PaddingValues(end = 16.dp, bottom = 16.dp),
+ contentHorizontalAlignment = Alignment.End,
+)
diff --git a/app/src/fdroid/res/drawable/ic_location_on.xml b/app/src/fdroid/res/drawable/ic_location_on.xml
new file mode 100644
index 000000000..b93f33174
--- /dev/null
+++ b/app/src/fdroid/res/drawable/ic_location_on.xml
@@ -0,0 +1,14 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/fdroid/res/drawable/ic_map_location_dot.xml b/app/src/fdroid/res/drawable/ic_map_location_dot.xml
new file mode 100644
index 000000000..2935f162e
--- /dev/null
+++ b/app/src/fdroid/res/drawable/ic_map_location_dot.xml
@@ -0,0 +1,11 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/fdroid/res/drawable/ic_map_navigation.xml b/app/src/fdroid/res/drawable/ic_map_navigation.xml
new file mode 100644
index 000000000..83d579f8a
--- /dev/null
+++ b/app/src/fdroid/res/drawable/ic_map_navigation.xml
@@ -0,0 +1,11 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/fdroidDebug/res/drawable-anydpi/ic_launcher_background.xml b/app/src/fdroidDebug/res/drawable-anydpi/ic_launcher_background.xml
new file mode 100644
index 000000000..170282ec9
--- /dev/null
+++ b/app/src/fdroidDebug/res/drawable-anydpi/ic_launcher_background.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/fdroidDebug/res/values/strings.xml
similarity index 53%
rename from app/src/main/res/values-night/colors.xml
rename to app/src/fdroidDebug/res/values/strings.xml
index 92129c9ae..2571a435c 100644
--- a/app/src/main/res/values-night/colors.xml
+++ b/app/src/fdroidDebug/res/values/strings.xml
@@ -1,5 +1,4 @@
-
-
-
- #141414
- #67EA94
- #141414
- #212121
- #28463C
- #141414
- #FFFFFF
- #67EA94
- #AAAAAA
- #039BE5
- #141414
- #67EA94
+ Fdroid Debug
diff --git a/app/src/google/AndroidManifest.xml b/app/src/google/AndroidManifest.xml
new file mode 100644
index 000000000..c4138cb0b
--- /dev/null
+++ b/app/src/google/AndroidManifest.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/google/java/com/geeksville/mesh/MeshUtilApplication.kt b/app/src/google/java/com/geeksville/mesh/MeshUtilApplication.kt
deleted file mode 100644
index 30e20331e..000000000
--- a/app/src/google/java/com/geeksville/mesh/MeshUtilApplication.kt
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import android.os.Debug
-import com.geeksville.mesh.android.AppPrefs
-import com.geeksville.mesh.android.BuildUtils.isEmulator
-import com.geeksville.mesh.android.GeeksvilleApplication
-import com.geeksville.mesh.android.Logging
-import com.geeksville.mesh.util.Exceptions
-import com.google.firebase.crashlytics.crashlytics
-import com.google.firebase.Firebase
-import dagger.hilt.android.HiltAndroidApp
-
-@HiltAndroidApp
-class MeshUtilApplication : GeeksvilleApplication() {
-
- override fun onCreate() {
- super.onCreate()
-
- Logging.showLogs = BuildConfig.DEBUG
-
- // We default to off in the manifest - we turn on here if the user approves
- // leave off when running in the debugger
- if (!isEmulator && (!BuildConfig.DEBUG || !Debug.isDebuggerConnected())) {
- val crashlytics = Firebase.crashlytics
- crashlytics.setCrashlyticsCollectionEnabled(isAnalyticsAllowed)
- crashlytics.setCustomKey("debug_build", BuildConfig.DEBUG)
-
- val pref = AppPrefs(this)
- crashlytics.setUserId(pref.getInstallId()) // be able to group all bugs per anonymous user
-
- // We always send our log messages to the crashlytics lib, but they only get sent to the server if we report an exception
- // This makes log messages work properly if someone turns on analytics just before they click report bug.
- // send all log messages through crashyltics, so if we do crash we'll have those in the report
- val standardLogger = Logging.printlog
- Logging.printlog = { level, tag, message ->
- crashlytics.log("$tag: $message")
- standardLogger(level, tag, message)
- }
-
- fun sendCrashReports() {
- if (isAnalyticsAllowed)
- crashlytics.sendUnsentReports()
- }
-
- // Send any old reports if user approves
- sendCrashReports()
-
- // Attach to our exception wrapper
- Exceptions.reporter = { exception, _, _ ->
- crashlytics.recordException(exception)
- sendCrashReports() // Send the new report
- }
- }
- }
-}
diff --git a/app/src/google/java/com/geeksville/mesh/analytics/FirebaseAnalytics.kt b/app/src/google/java/com/geeksville/mesh/analytics/FirebaseAnalytics.kt
deleted file mode 100644
index a8ed6a10f..000000000
--- a/app/src/google/java/com/geeksville/mesh/analytics/FirebaseAnalytics.kt
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.analytics
-
-import android.content.Context
-import android.os.Bundle
-import com.geeksville.mesh.android.AppPrefs
-import com.geeksville.mesh.android.Logging
-import com.google.firebase.analytics.FirebaseAnalytics
-import com.google.firebase.analytics.analytics
-import com.google.firebase.analytics.logEvent
-import com.google.firebase.Firebase
-
-class DataPair(val name: String, valueIn: Any?) {
- val value = valueIn ?: "null"
-
- /// An accumulating firebase event - only one allowed per event
- constructor(d: Double) : this(FirebaseAnalytics.Param.VALUE, d)
- constructor(d: Int) : this(FirebaseAnalytics.Param.VALUE, d)
-}
-
-/**
- * Implement our analytics API using Firebase Analytics
- */
-class FirebaseAnalytics(context: Context) : AnalyticsProvider, Logging {
-
- val t = Firebase.analytics
-
- init {
- val pref = AppPrefs(context)
- t.setUserId(pref.getInstallId())
- }
-
- override fun setEnabled(on: Boolean) {
- t.setAnalyticsCollectionEnabled(on)
- }
-
- override fun endSession() {
- track("End Session")
- // Mint.flush() // Send results now
- }
-
- override fun trackLowValue(event: String, vararg properties: DataPair) {
- track(event, *properties)
- }
-
- override fun track(event: String, vararg properties: DataPair) {
- debug("Analytics: track $event")
-
- val bundle = Bundle()
- properties.forEach {
- when (it.value) {
- is Double -> bundle.putDouble(it.name, it.value)
- is Int -> bundle.putLong(it.name, it.value.toLong())
- is Long -> bundle.putLong(it.name, it.value)
- is Float -> bundle.putDouble(it.name, it.value.toDouble())
- else -> bundle.putString(it.name, it.value.toString())
- }
- }
- t.logEvent(event, bundle)
- }
-
- override fun startSession() {
- debug("Analytics: start session")
- // automatic with firebase
- }
-
- override fun setUserInfo(vararg p: DataPair) {
- p.forEach { t.setUserProperty(it.name, it.value.toString()) }
- }
-
- override fun increment(name: String, amount: Double) {
- //Mint.logEvent("$name increment")
- }
-
- /**
- * Send a google analytics screen view event
- */
- override fun sendScreenView(name: String) {
- debug("Analytics: start screen $name")
- t.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW) {
- param(FirebaseAnalytics.Param.SCREEN_NAME, name)
- param(FirebaseAnalytics.Param.SCREEN_CLASS, "MainActivity")
- }
- }
-
- override fun endScreenView() {
- // debug("Analytics: end screen")
- }
-}
diff --git a/app/src/google/java/com/geeksville/mesh/android/GeeksvilleApplication.kt b/app/src/google/java/com/geeksville/mesh/android/GeeksvilleApplication.kt
deleted file mode 100644
index 8f4ac2d2d..000000000
--- a/app/src/google/java/com/geeksville/mesh/android/GeeksvilleApplication.kt
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.app.Application
-import android.content.Context
-import android.content.SharedPreferences
-import android.provider.Settings
-import androidx.appcompat.app.AppCompatActivity
-import androidx.core.content.edit
-import com.geeksville.mesh.analytics.AnalyticsProvider
-import com.geeksville.mesh.util.exceptionReporter
-import com.google.android.gms.common.ConnectionResult
-import com.google.android.gms.common.GoogleApiAvailabilityLight
-import com.suddenh4x.ratingdialog.AppRating
-
-/**
- * Created by kevinh on 1/4/15.
- */
-
-open class GeeksvilleApplication : Application(), Logging {
-
- companion object {
- lateinit var analytics: AnalyticsProvider
- }
-
- /// Are we running inside the testlab?
- val isInTestLab: Boolean
- get() {
- val testLabSetting =
- Settings.System.getString(contentResolver, "firebase.test.lab") ?: null
- if(testLabSetting != null)
- info("Testlab is $testLabSetting")
- return "true" == testLabSetting
- }
-
- private val analyticsPrefs: SharedPreferences by lazy {
- getSharedPreferences("analytics-prefs", Context.MODE_PRIVATE)
- }
-
- var isAnalyticsAllowed: Boolean
- get() = analyticsPrefs.getBoolean("allowed", true)
- set(value) {
- analyticsPrefs.edit {
- putBoolean("allowed", value)
- }
-
- // Change the flag with the providers
- analytics.setEnabled(value && !isInTestLab) // Never do analytics in the test lab
- }
-
- /** Ask user to rate in play store */
- fun askToRate(activity: AppCompatActivity) {
- if (!isGooglePlayAvailable()) return
-
- exceptionReporter { // we don't want to crash our app because of bugs in this optional feature
- AppRating.Builder(activity)
- .setMinimumLaunchTimes(10) // default is 5, 3 means app is launched 3 or more times
- .setMinimumDays(10) // default is 5, 0 means install day, 10 means app is launched 10 or more days later than installation
- .setMinimumLaunchTimesToShowAgain(5) // default is 5, 1 means app is launched 1 or more times after neutral button clicked
- .setMinimumDaysToShowAgain(14) // default is 14, 1 means app is launched 1 or more days after neutral button clicked
- .showIfMeetsConditions()
- }
- }
-
- override fun onCreate() {
- super.onCreate()
-
- val firebaseAnalytics = com.geeksville.mesh.analytics.FirebaseAnalytics(this)
- analytics = firebaseAnalytics
-
- // Set analytics per prefs
- isAnalyticsAllowed = isAnalyticsAllowed
- }
-}
-
-fun Context.isGooglePlayAvailable(): Boolean {
- return GoogleApiAvailabilityLight.getInstance()
- .isGooglePlayServicesAvailable(this)
- .let {
- it != ConnectionResult.SERVICE_MISSING &&
- it != ConnectionResult.SERVICE_INVALID
- }
-}
\ No newline at end of file
diff --git a/app/src/google/kotlin/org/meshtastic/app/analytics/GooglePlatformAnalytics.kt b/app/src/google/kotlin/org/meshtastic/app/analytics/GooglePlatformAnalytics.kt
new file mode 100644
index 000000000..0583dd78e
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/analytics/GooglePlatformAnalytics.kt
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.analytics
+
+import android.app.Application
+import android.content.Context
+import android.os.Bundle
+import android.provider.Settings
+import androidx.lifecycle.ProcessLifecycleOwner
+import androidx.lifecycle.lifecycleScope
+import co.touchlab.kermit.LogWriter
+import co.touchlab.kermit.Severity
+import com.datadog.android.Datadog
+import com.datadog.android.DatadogSite
+import com.datadog.android.core.configuration.Configuration
+import com.datadog.android.log.Logger
+import com.datadog.android.log.Logs
+import com.datadog.android.log.LogsConfiguration
+import com.datadog.android.privacy.TrackingConsent
+import com.datadog.android.rum.GlobalRumMonitor
+import com.datadog.android.rum.Rum
+import com.datadog.android.rum.RumActionType
+import com.datadog.android.rum.RumConfiguration
+import com.datadog.android.sessionreplay.SessionReplay
+import com.datadog.android.sessionreplay.SessionReplayConfiguration
+import com.datadog.android.sessionreplay.TextAndInputPrivacy
+import com.datadog.android.trace.Trace
+import com.datadog.android.trace.TraceConfiguration
+import com.datadog.android.trace.opentelemetry.DatadogOpenTelemetry
+import com.google.android.gms.common.ConnectionResult
+import com.google.android.gms.common.GoogleApiAvailabilityLight
+import com.google.firebase.Firebase
+import com.google.firebase.analytics.FirebaseAnalytics.ConsentStatus
+import com.google.firebase.analytics.FirebaseAnalytics.ConsentType
+import com.google.firebase.analytics.analytics
+import com.google.firebase.crashlytics.crashlytics
+import com.google.firebase.crashlytics.setCustomKeys
+import com.google.firebase.initialize
+import io.opentelemetry.api.GlobalOpenTelemetry
+import kotlinx.coroutines.CancellationException
+import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.onEach
+import org.koin.core.annotation.Single
+import org.meshtastic.app.BuildConfig
+import org.meshtastic.core.repository.AnalyticsPrefs
+import org.meshtastic.core.repository.DataPair
+import org.meshtastic.core.repository.PlatformAnalytics
+import co.touchlab.kermit.Logger as KermitLogger
+
+/**
+ * Google Play Services specific implementation of [PlatformAnalytics]. This helper initializes and manages Firebase and
+ * Datadog services, and subscribes to analytics preference changes to update consent accordingly.
+ *
+ * This implementation delays initialization of SDKs until user consent is granted to reduce tracking "noise" and
+ * respect privacy-focused environments.
+ */
+@Single
+class GooglePlatformAnalytics(private val context: Context, private val analyticsPrefs: AnalyticsPrefs) :
+ PlatformAnalytics {
+
+ private val sampleRate = 100f // Match Apple: 100% sampling for cross-platform DataDog comparison
+
+ private var datadogLogger: Logger? = null
+ private var isFirebaseInitialized = false
+
+ private val isInTestLab: Boolean
+ get() {
+ val testLabSetting = Settings.System.getString(context.contentResolver, "firebase.test.lab")
+ return "true" == testLabSetting
+ }
+
+ companion object {
+ private const val TAG = "GooglePlatformAnalytics"
+ private const val SERVICE_NAME = "org.meshtastic"
+
+ private const val KEY_PRIORITY = "priority"
+ private const val KEY_TAG = "tag"
+ private const val KEY_MESSAGE = "message"
+ }
+
+ init {
+ // Setup Kermit log writers immediately, they will handle delayed SDK initialization gracefully.
+ val writers = buildList {
+ add(DatadogLogWriter())
+ add(CrashlyticsLogWriter())
+ if (BuildConfig.DEBUG) {
+ add(co.touchlab.kermit.LogcatWriter())
+ }
+ }
+ KermitLogger.setLogWriters(writers)
+ KermitLogger.setMinSeverity(if (BuildConfig.DEBUG) Severity.Debug else Severity.Info)
+
+ // Initial consent state
+ updateAnalyticsConsent(analyticsPrefs.analyticsAllowed.value)
+
+ // Subscribe to analytics preference changes
+ analyticsPrefs.analyticsAllowed
+ .onEach { allowed -> updateAnalyticsConsent(allowed) }
+ .launchIn(ProcessLifecycleOwner.get().lifecycleScope)
+ }
+
+ /**
+ * Ensures that Datadog and Firebase SDKs are initialized if allowed. This is called lazily when consent is granted.
+ */
+ private fun ensureInitialized() {
+ if (!analyticsPrefs.analyticsAllowed.value || isInTestLab) return
+
+ if (!Datadog.isInitialized()) {
+ initDatadog(context as Application)
+ datadogLogger =
+ Logger.Builder()
+ .setService(SERVICE_NAME)
+ .setNetworkInfoEnabled(false) // Disable to avoid collecting Local IP/SSID
+ .setRemoteSampleRate(sampleRate)
+ .setBundleWithTraceEnabled(true)
+ .setBundleWithRumEnabled(true)
+ .build()
+ }
+
+ if (!isFirebaseInitialized) {
+ initCrashlytics(context as Application)
+ isFirebaseInitialized = true
+ }
+ }
+
+ private fun initDatadog(application: Application) {
+ val configuration =
+ Configuration.Builder(
+ clientToken = BuildConfig.datadogClientToken,
+ env = if (BuildConfig.DEBUG) "Local" else "Production",
+ variant = BuildConfig.FLAVOR,
+ )
+ .useSite(DatadogSite.US5)
+ .setCrashReportsEnabled(true)
+ .setUseDeveloperModeWhenDebuggable(true)
+ .build()
+ // Initialize with PENDING, consent will be updated via updateAnalyticsConsent
+ Datadog.initialize(application, configuration, TrackingConsent.PENDING)
+ Datadog.setVerbosity(if (BuildConfig.DEBUG) android.util.Log.DEBUG else android.util.Log.WARN)
+
+ val rumConfiguration =
+ RumConfiguration.Builder(BuildConfig.datadogApplicationId)
+ .trackAnonymousUser(true)
+ .trackBackgroundEvents(true) // Match Apple: track background events for cross-platform parity
+ .trackFrustrations(false) // Disable click-tracking based frustration detection
+ .trackLongTasks()
+ .trackNonFatalAnrs(true)
+ .setSessionSampleRate(sampleRate)
+ .build()
+ Rum.enable(rumConfiguration)
+
+ val logsConfig = LogsConfiguration.Builder().build()
+ Logs.enable(logsConfig)
+
+ val traceConfig = TraceConfiguration.Builder().setNetworkInfoEnabled(true).build()
+ Trace.enable(traceConfig)
+
+ // Session Replay for debug builds only, matching Apple's TestFlight-only gating.
+ // Masks all text inputs to protect message content.
+ if (BuildConfig.DEBUG) {
+ val sessionReplayConfig =
+ SessionReplayConfiguration.Builder(sampleRate)
+ .setTextAndInputPrivacy(TextAndInputPrivacy.MASK_ALL_INPUTS)
+ .build()
+ SessionReplay.enable(sessionReplayConfig)
+ }
+
+ GlobalOpenTelemetry.set(DatadogOpenTelemetry(serviceName = SERVICE_NAME))
+ }
+
+ private fun initCrashlytics(application: Application) {
+ Firebase.initialize(application)
+
+ // Deny all ad-related consent types by default to minimize tracking noise
+ Firebase.analytics.setConsent(
+ mapOf(
+ ConsentType.AD_STORAGE to ConsentStatus.DENIED,
+ ConsentType.AD_USER_DATA to ConsentStatus.DENIED,
+ ConsentType.AD_PERSONALIZATION to ConsentStatus.DENIED,
+ ConsentType.ANALYTICS_STORAGE to ConsentStatus.DENIED,
+ ),
+ )
+
+ // Explicitly disable analytics collection until we confirm user consent
+ Firebase.analytics.setAnalyticsCollectionEnabled(false)
+ }
+
+ /**
+ * Updates the consent status for analytics, performance, and crash reporting services.
+ *
+ * @param allowed True if analytics are allowed, false otherwise.
+ */
+ fun updateAnalyticsConsent(allowed: Boolean) {
+ if (isInTestLab) return
+
+ if (allowed) {
+ ensureInitialized()
+ }
+
+ KermitLogger.i { if (allowed) "Analytics enabled" else "Analytics disabled" }
+
+ if (Datadog.isInitialized()) {
+ Datadog.setTrackingConsent(if (allowed) TrackingConsent.GRANTED else TrackingConsent.NOT_GRANTED)
+ }
+
+ if (isFirebaseInitialized) {
+ Firebase.crashlytics.isCrashlyticsCollectionEnabled = allowed
+ Firebase.analytics.setAnalyticsCollectionEnabled(allowed)
+
+ if (allowed) {
+ Firebase.crashlytics.sendUnsentReports()
+ // Ensure ad-related PII collection remains disabled even if analytics is allowed
+ Firebase.analytics.setUserProperty("allow_personalized_ads", "false")
+ }
+
+ // Manage Analytics Storage consent for Advanced Consent Mode
+ val consentStatus = if (allowed) ConsentStatus.GRANTED else ConsentStatus.DENIED
+ Firebase.analytics.setConsent(
+ mapOf(
+ ConsentType.ANALYTICS_STORAGE to consentStatus,
+ // Keep ad-related types explicitly denied
+ ConsentType.AD_STORAGE to ConsentStatus.DENIED,
+ ConsentType.AD_USER_DATA to ConsentStatus.DENIED,
+ ConsentType.AD_PERSONALIZATION to ConsentStatus.DENIED,
+ ),
+ )
+ }
+ }
+
+ override fun setDeviceAttributes(firmwareVersion: String, model: String) {
+ if (!Datadog.isInitialized() || !GlobalRumMonitor.isRegistered()) return
+ GlobalRumMonitor.get().addAttribute("firmware_version", firmwareVersion.extractSemanticVersion())
+ GlobalRumMonitor.get().addAttribute("device_hardware", model)
+ }
+
+ override fun trackConnect(
+ firmwareVersion: String?,
+ transportType: String?,
+ hardwareModel: String?,
+ nodes: Int,
+ connectionRestored: Boolean,
+ ) {
+ if (!Datadog.isInitialized() || !GlobalRumMonitor.isRegistered()) return
+ val attributes = buildMap {
+ firmwareVersion?.let { put("firmwareVersion", it) }
+ transportType?.let { put("transportType", it) }
+ hardwareModel?.let { put("hardwareModel", it) }
+ put("nodes", nodes)
+ if (connectionRestored) put("connectionRestored", true)
+ }
+ GlobalRumMonitor.get().addAction(RumActionType.CUSTOM, "connect", attributes)
+ }
+
+ private val isGooglePlayAvailable: Boolean
+ get() =
+ GoogleApiAvailabilityLight.getInstance().isGooglePlayServicesAvailable(context).let {
+ it != ConnectionResult.SERVICE_MISSING && it != ConnectionResult.SERVICE_INVALID
+ }
+
+ override val isPlatformServicesAvailable: Boolean
+ get() = isGooglePlayAvailable
+
+ private inner class CrashlyticsLogWriter : LogWriter() {
+ override fun log(severity: Severity, message: String, tag: String, throwable: Throwable?) {
+ if (!isFirebaseInitialized) return
+ if (!Firebase.crashlytics.isCrashlyticsCollectionEnabled) return
+
+ // Add the log to the Crashlytics log buffer so it appears in reports
+ Firebase.crashlytics.log("$severity/$tag: $message")
+
+ // Filter out normal coroutine cancellations
+ if (throwable is CancellationException) return
+
+ // Only record non-fatal exceptions for actual Errors (Severity.Error or Severity.Assert)
+ if (severity >= Severity.Error) {
+ if (throwable != null) {
+ Firebase.crashlytics.recordException(throwable)
+ } else {
+ Firebase.crashlytics.setCustomKeys {
+ key(KEY_PRIORITY, severity.ordinal)
+ key(KEY_TAG, tag)
+ key(KEY_MESSAGE, message)
+ }
+ Firebase.crashlytics.recordException(Exception(message))
+ }
+ }
+ }
+ }
+
+ private inner class DatadogLogWriter : LogWriter() {
+ override fun log(severity: Severity, message: String, tag: String, throwable: Throwable?) {
+ val logger = datadogLogger ?: return
+ val datadogPriority =
+ when (severity) {
+ Severity.Verbose -> android.util.Log.VERBOSE
+ Severity.Debug -> android.util.Log.DEBUG
+ Severity.Info -> android.util.Log.INFO
+ Severity.Warn -> android.util.Log.WARN
+ Severity.Error -> android.util.Log.ERROR
+ Severity.Assert -> android.util.Log.ASSERT
+ }
+ logger.log(datadogPriority, message, throwable, mapOf("tag" to tag))
+ }
+ }
+
+ private fun String.extractSemanticVersion(): String {
+ val regex = "^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?$".toRegex()
+ val matchResult = regex.find(this)
+ return matchResult?.groupValues?.drop(1)?.filter { it.isNotEmpty() }?.joinToString(".") ?: this
+ }
+
+ override fun track(event: String, vararg properties: DataPair) {
+ if (!isFirebaseInitialized) return
+ val bundle = Bundle()
+ properties.forEach {
+ val value = it.value
+ when (value) {
+ is Double -> bundle.putDouble(it.name, value)
+ is Int -> bundle.putLong(it.name, value.toLong()) // Firebase expects Long for integer values in bundles
+ is Long -> bundle.putLong(it.name, value)
+ is Float -> bundle.putDouble(it.name, value.toDouble())
+ is String -> bundle.putString(it.name, value) // Explicitly handle String
+ else -> bundle.putString(it.name, value.toString()) // Fallback for other types
+ }
+ KermitLogger.withTag(TAG).d { "Analytics: track $event (${it.name} : $value)" }
+ }
+ Firebase.analytics.logEvent(event, bundle)
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/di/FlavorModule.kt b/app/src/google/kotlin/org/meshtastic/app/di/FlavorModule.kt
new file mode 100644
index 000000000..802f3b150
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/di/FlavorModule.kt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.di
+
+import org.koin.core.annotation.Module
+import org.meshtastic.app.map.prefs.di.GoogleMapsKoinModule
+
+@Module(includes = [GoogleNetworkModule::class, GoogleMapsKoinModule::class])
+class FlavorModule
diff --git a/app/src/google/kotlin/org/meshtastic/app/di/GoogleNetworkModule.kt b/app/src/google/kotlin/org/meshtastic/app/di/GoogleNetworkModule.kt
new file mode 100644
index 000000000..eede9d6e3
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/di/GoogleNetworkModule.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.di
+
+import org.koin.core.annotation.Module
+import org.koin.core.annotation.Single
+import org.meshtastic.core.network.service.ApiService
+import org.meshtastic.core.network.service.ApiServiceImpl
+
+@Module
+class GoogleNetworkModule {
+
+ @Single fun bindApiService(apiServiceImpl: ApiServiceImpl): ApiService = apiServiceImpl
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt b/app/src/google/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt
new file mode 100644
index 000000000..fdad2c363
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.intro
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.analytics_notice
+import org.meshtastic.core.resources.analytics_platforms
+import org.meshtastic.core.resources.datadog_link
+import org.meshtastic.core.resources.firebase_link
+import org.meshtastic.core.resources.for_more_information_see_our_privacy_policy
+import org.meshtastic.core.resources.privacy_url
+import org.meshtastic.core.ui.component.AutoLinkText
+
+@Composable
+fun AnalyticsIntro(modifier: Modifier = Modifier) {
+ Column(
+ modifier = modifier.fillMaxWidth().padding(top = 24.dp),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.spacedBy(4.dp),
+ ) {
+ Text(
+ modifier = Modifier.fillMaxWidth(),
+ textAlign = TextAlign.Center,
+ text = stringResource(Res.string.analytics_notice),
+ style = MaterialTheme.typography.bodySmall,
+ color = MaterialTheme.colorScheme.onSurfaceVariant,
+ )
+ Text(
+ modifier = Modifier.fillMaxWidth().padding(top = 8.dp),
+ textAlign = TextAlign.Center,
+ text = stringResource(Res.string.analytics_platforms),
+ style = MaterialTheme.typography.labelMedium,
+ color = MaterialTheme.colorScheme.onSurface,
+ )
+ AutoLinkText(
+ text = stringResource(Res.string.firebase_link),
+ style = MaterialTheme.typography.bodySmall,
+ modifier = Modifier.fillMaxWidth(),
+ textAlign = TextAlign.Center,
+ )
+ AutoLinkText(
+ text = stringResource(Res.string.datadog_link),
+ style = MaterialTheme.typography.bodySmall,
+ modifier = Modifier.fillMaxWidth(),
+ textAlign = TextAlign.Center,
+ )
+
+ Text(
+ modifier = Modifier.fillMaxWidth().padding(top = 8.dp),
+ textAlign = TextAlign.Center,
+ text = stringResource(Res.string.for_more_information_see_our_privacy_policy),
+ style = MaterialTheme.typography.bodySmall,
+ color = MaterialTheme.colorScheme.onSurfaceVariant,
+ )
+ AutoLinkText(
+ text = stringResource(Res.string.privacy_url),
+ style = MaterialTheme.typography.bodySmall,
+ modifier = Modifier.fillMaxWidth(),
+ textAlign = TextAlign.Center,
+ )
+ }
+}
+
+@Preview(showBackground = true)
+@Composable
+private fun AnalyticsIntroPreview() {
+ AnalyticsIntro()
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt b/app/src/google/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt
new file mode 100644
index 000000000..8a441fa70
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import org.meshtastic.core.ui.util.MapViewProvider
+
+fun getMapViewProvider(): MapViewProvider = GoogleMapViewProvider()
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/GoogleMapViewProvider.kt b/app/src/google/kotlin/org/meshtastic/app/map/GoogleMapViewProvider.kt
new file mode 100644
index 000000000..940c4ab5a
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/GoogleMapViewProvider.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.ui.Modifier
+import org.koin.compose.viewmodel.koinViewModel
+import org.koin.core.annotation.Single
+import org.meshtastic.core.ui.util.MapViewProvider
+
+/** Google Maps implementation of [MapViewProvider]. */
+@Single
+class GoogleMapViewProvider : MapViewProvider {
+ @Composable
+ override fun MapView(modifier: Modifier, navigateToNodeDetails: (Int) -> Unit, waypointId: Int?) {
+ val mapViewModel: MapViewModel = koinViewModel()
+ LaunchedEffect(waypointId) { mapViewModel.setWaypointId(waypointId) }
+ org.meshtastic.app.map.MapView(
+ modifier = modifier,
+ mapViewModel = mapViewModel,
+ navigateToNodeDetails = navigateToNodeDetails,
+ )
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/LocationHandler.kt b/app/src/google/kotlin/org/meshtastic/app/map/LocationHandler.kt
new file mode 100644
index 000000000..1aa4a7bab
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/LocationHandler.kt
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import android.Manifest
+import android.app.Activity
+import android.content.ActivityNotFoundException
+import android.content.pm.PackageManager
+import androidx.activity.compose.rememberLauncherForActivityResult
+import androidx.activity.result.IntentSenderRequest
+import androidx.activity.result.contract.ActivityResultContracts
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.platform.LocalContext
+import androidx.core.content.ContextCompat
+import co.touchlab.kermit.Logger
+import com.google.android.gms.common.api.ResolvableApiException
+import com.google.android.gms.location.LocationRequest
+import com.google.android.gms.location.LocationServices
+import com.google.android.gms.location.LocationSettingsRequest
+import com.google.android.gms.location.Priority
+
+private const val INTERVAL_MILLIS = 10000L
+
+@Suppress("LongMethod")
+@Composable
+fun LocationPermissionsHandler(onPermissionResult: (Boolean) -> Unit) {
+ val context = LocalContext.current
+ var localHasPermission by remember {
+ mutableStateOf(
+ ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) ==
+ PackageManager.PERMISSION_GRANTED,
+ )
+ }
+
+ val requestLocationPermissionLauncher =
+ rememberLauncherForActivityResult(contract = ActivityResultContracts.RequestPermission()) { isGranted ->
+ localHasPermission = isGranted
+ // Defer to the LaunchedEffect(localHasPermission) to check settings before confirming via
+ // onPermissionResult
+ // if permission is granted. If not granted, immediately report false.
+ if (!isGranted) {
+ onPermissionResult(false)
+ }
+ }
+
+ val locationSettingsLauncher =
+ rememberLauncherForActivityResult(contract = ActivityResultContracts.StartIntentSenderForResult()) { result ->
+ if (result.resultCode == Activity.RESULT_OK) {
+ Logger.d { "Location settings changed by user." }
+ // User has enabled location services or improved accuracy.
+ onPermissionResult(true) // Settings are now adequate, and permission was already granted.
+ } else {
+ Logger.d { "Location settings change cancelled by user." }
+ // User chose not to change settings. The permission itself is still granted,
+ // but the experience might be degraded. For the purpose of enabling map features,
+ // we consider this as success if the core permission is there.
+ // If stricter handling is needed (e.g., block feature if settings not optimal),
+ // this logic might change.
+ onPermissionResult(localHasPermission)
+ }
+ }
+
+ LaunchedEffect(Unit) {
+ // Initial permission check
+ when (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)) {
+ PackageManager.PERMISSION_GRANTED -> {
+ if (!localHasPermission) {
+ localHasPermission = true
+ }
+ // If permission is already granted, proceed to check location settings.
+ // The LaunchedEffect(localHasPermission) will handle this.
+ // No need to call onPermissionResult(true) here yet, let settings check complete.
+ }
+
+ else -> {
+ // Request permission if not granted. The launcher's callback will update localHasPermission.
+ requestLocationPermissionLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION)
+ }
+ }
+ }
+
+ LaunchedEffect(localHasPermission) {
+ // Handles logic after permission status is known/updated
+ if (localHasPermission) {
+ // Permission is granted, now check location settings
+ val locationRequest = LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, INTERVAL_MILLIS).build()
+
+ val builder = LocationSettingsRequest.Builder().addLocationRequest(locationRequest)
+
+ val client = LocationServices.getSettingsClient(context)
+ val task = client.checkLocationSettings(builder.build())
+
+ task.addOnSuccessListener {
+ Logger.d { "Location settings are satisfied." }
+ onPermissionResult(true) // Permission granted and settings are good
+ }
+
+ task.addOnFailureListener { exception ->
+ if (exception is ResolvableApiException) {
+ try {
+ val intentSenderRequest = IntentSenderRequest.Builder(exception.resolution).build()
+ locationSettingsLauncher.launch(intentSenderRequest)
+ // Result of this launch will be handled by locationSettingsLauncher's callback
+ } catch (sendEx: ActivityNotFoundException) {
+ Logger.d { "Error launching location settings resolution ${sendEx.message}." }
+ onPermissionResult(true) // Permission is granted, but settings dialog failed. Proceed.
+ }
+ } else {
+ Logger.d { "Location settings are not satisfiable.${exception.message}" }
+ onPermissionResult(true) // Permission is granted, but settings not ideal. Proceed.
+ }
+ }
+ } else {
+ // If permission is not granted, report false.
+ // This case is primarily handled by the requestLocationPermissionLauncher's callback
+ // if the initial state was denied, or if user denies it.
+ onPermissionResult(false)
+ }
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/MBTilesProvider.kt b/app/src/google/kotlin/org/meshtastic/app/map/MBTilesProvider.kt
new file mode 100644
index 000000000..6ac756f6b
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/MBTilesProvider.kt
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import android.database.sqlite.SQLiteDatabase
+import com.google.android.gms.maps.model.Tile
+import com.google.android.gms.maps.model.TileProvider
+import java.io.File
+
+class MBTilesProvider(private val file: File) :
+ TileProvider,
+ AutoCloseable {
+ private var database: SQLiteDatabase? = null
+
+ init {
+ openDatabase()
+ }
+
+ private fun openDatabase() {
+ if (database == null && file.exists()) {
+ database = SQLiteDatabase.openDatabase(file.absolutePath, null, SQLiteDatabase.OPEN_READONLY)
+ }
+ }
+
+ override fun getTile(x: Int, y: Int, zoom: Int): Tile? {
+ val db = database ?: return null
+
+ var tile: Tile? = null
+ // Convert Google Maps y coordinate to standard TMS y coordinate
+ val tmsY = (1 shl zoom) - 1 - y
+
+ val cursor =
+ db.rawQuery(
+ "SELECT tile_data FROM tiles WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?",
+ arrayOf(zoom.toString(), x.toString(), tmsY.toString()),
+ )
+
+ if (cursor.moveToFirst()) {
+ val tileData = cursor.getBlob(0)
+ tile = Tile(256, 256, tileData)
+ }
+ cursor.close()
+
+ return tile ?: TileProvider.NO_TILE
+ }
+
+ override fun close() {
+ database?.close()
+ database = null
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/MapView.kt b/app/src/google/kotlin/org/meshtastic/app/map/MapView.kt
new file mode 100644
index 000000000..c8f2f3fee
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/MapView.kt
@@ -0,0 +1,1125 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+@file:Suppress("MagicNumber")
+
+package org.meshtastic.app.map
+
+import android.Manifest
+import android.app.Activity
+import android.content.Intent
+import android.net.Uri
+import android.view.WindowManager
+import androidx.activity.compose.rememberLauncherForActivityResult
+import androidx.activity.result.contract.ActivityResultContracts
+import androidx.appcompat.app.AppCompatDelegate
+import androidx.compose.foundation.isSystemInDarkTheme
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.width
+import androidx.compose.material3.Card
+import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.ModalBottomSheet
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.key
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.unit.dp
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import co.touchlab.kermit.Logger
+import com.google.accompanist.permissions.ExperimentalPermissionsApi
+import com.google.accompanist.permissions.rememberMultiplePermissionsState
+import com.google.android.gms.location.LocationCallback
+import com.google.android.gms.location.LocationRequest
+import com.google.android.gms.location.LocationResult
+import com.google.android.gms.location.LocationServices
+import com.google.android.gms.location.Priority
+import com.google.android.gms.maps.CameraUpdateFactory
+import com.google.android.gms.maps.model.CameraPosition
+import com.google.android.gms.maps.model.JointType
+import com.google.android.gms.maps.model.LatLng
+import com.google.android.gms.maps.model.LatLngBounds
+import com.google.maps.android.SphericalUtil
+import com.google.maps.android.compose.CameraPositionState
+import com.google.maps.android.compose.ComposeMapColorScheme
+import com.google.maps.android.compose.GoogleMap
+import com.google.maps.android.compose.MapEffect
+import com.google.maps.android.compose.MapProperties
+import com.google.maps.android.compose.MapType
+import com.google.maps.android.compose.MapUiSettings
+import com.google.maps.android.compose.MapsComposeExperimentalApi
+import com.google.maps.android.compose.MarkerComposable
+import com.google.maps.android.compose.MarkerInfoWindowComposable
+import com.google.maps.android.compose.Polyline
+import com.google.maps.android.compose.TileOverlay
+import com.google.maps.android.compose.rememberCameraPositionState
+import com.google.maps.android.compose.rememberUpdatedMarkerState
+import com.google.maps.android.compose.widgets.ScaleBar
+import com.google.maps.android.data.Layer
+import com.google.maps.android.data.geojson.GeoJsonLayer
+import com.google.maps.android.data.kml.KmlLayer
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
+import org.jetbrains.compose.resources.stringResource
+import org.json.JSONObject
+import org.koin.compose.viewmodel.koinViewModel
+import org.meshtastic.app.map.component.ClusterItemsListDialog
+import org.meshtastic.app.map.component.CustomMapLayersSheet
+import org.meshtastic.app.map.component.CustomTileProviderManagerSheet
+import org.meshtastic.app.map.component.EditWaypointDialog
+import org.meshtastic.app.map.component.MapFilterDropdown
+import org.meshtastic.app.map.component.MapTypeDropdown
+import org.meshtastic.app.map.component.NodeClusterMarkers
+import org.meshtastic.app.map.component.NodeMapFilterDropdown
+import org.meshtastic.app.map.component.WaypointMarkers
+import org.meshtastic.app.map.model.NodeClusterItem
+import org.meshtastic.core.common.util.nowMillis
+import org.meshtastic.core.common.util.nowSeconds
+import org.meshtastic.core.model.Node
+import org.meshtastic.core.model.TracerouteOverlay
+import org.meshtastic.core.model.util.GeoConstants.DEG_D
+import org.meshtastic.core.model.util.GeoConstants.HEADING_DEG
+import org.meshtastic.core.model.util.metersIn
+import org.meshtastic.core.model.util.mpsToKmph
+import org.meshtastic.core.model.util.mpsToMph
+import org.meshtastic.core.model.util.toString
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.alt
+import org.meshtastic.core.resources.heading
+import org.meshtastic.core.resources.latitude
+import org.meshtastic.core.resources.longitude
+import org.meshtastic.core.resources.manage_map_layers
+import org.meshtastic.core.resources.map_tile_source
+import org.meshtastic.core.resources.position
+import org.meshtastic.core.resources.sats
+import org.meshtastic.core.resources.speed
+import org.meshtastic.core.resources.timestamp
+import org.meshtastic.core.resources.track_point
+import org.meshtastic.core.ui.component.NodeChip
+import org.meshtastic.core.ui.icon.Layers
+import org.meshtastic.core.ui.icon.Map
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+import org.meshtastic.core.ui.icon.TripOrigin
+import org.meshtastic.core.ui.theme.TracerouteColors
+import org.meshtastic.core.ui.util.formatAgo
+import org.meshtastic.core.ui.util.formatPositionTime
+import org.meshtastic.feature.map.BaseMapViewModel.MapFilterState
+import org.meshtastic.feature.map.LastHeardFilter
+import org.meshtastic.feature.map.component.MapButton
+import org.meshtastic.feature.map.component.MapControlsOverlay
+import org.meshtastic.feature.map.tracerouteNodeSelection
+import org.meshtastic.proto.Config.DisplayConfig.DisplayUnits
+import org.meshtastic.proto.Position
+import org.meshtastic.proto.Waypoint
+import kotlin.math.abs
+import kotlin.math.max
+
+// region --- Map Mode ---
+
+/**
+ * Discriminated mode for [MapView] — replaces the original pile of nullable parameters with a type-safe sealed
+ * hierarchy. Each mode carries only the data it needs; the shared infrastructure (location tracking, tile providers,
+ * controls overlay) is available in every mode.
+ */
+sealed interface GoogleMapMode {
+ /** Standard map: node clusters, waypoints, custom layers, waypoint editing. */
+ data object Main : GoogleMapMode
+
+ /** Focused node position track: polyline + gradient markers for historical positions. */
+ data class NodeTrack(
+ val focusedNode: Node?,
+ val positions: List,
+ val selectedPositionTime: Int? = null,
+ val onPositionSelected: ((Int) -> Unit)? = null,
+ ) : GoogleMapMode
+
+ /** Traceroute visualization: offset forward/return polylines + hop markers. */
+ data class Traceroute(
+ val overlay: TracerouteOverlay?,
+ val nodePositions: Map,
+ val onMappableCountChanged: (shown: Int, total: Int) -> Unit,
+ ) : GoogleMapMode
+}
+
+// endregion
+
+private const val TRACEROUTE_OFFSET_METERS = 100.0
+private const val TRACEROUTE_BOUNDS_PADDING_PX = 120
+
+@Suppress("CyclomaticComplexMethod", "LongMethod")
+@OptIn(MapsComposeExperimentalApi::class, ExperimentalMaterial3Api::class, ExperimentalPermissionsApi::class)
+@Composable
+fun MapView(
+ modifier: Modifier = Modifier,
+ mapViewModel: MapViewModel = koinViewModel(),
+ navigateToNodeDetails: (Int) -> Unit = {},
+ mode: GoogleMapMode = GoogleMapMode.Main,
+) {
+ val context = LocalContext.current
+ val coroutineScope = rememberCoroutineScope()
+ val mapLayers by mapViewModel.mapLayers.collectAsStateWithLifecycle()
+
+ // --- Location permissions ---
+ val locationPermissionsState =
+ rememberMultiplePermissionsState(permissions = listOf(Manifest.permission.ACCESS_FINE_LOCATION))
+ var triggerLocationToggleAfterPermission by remember { mutableStateOf(false) }
+
+ // --- Location tracking ---
+ var isLocationTrackingEnabled by remember { mutableStateOf(false) }
+ var followPhoneBearing by remember { mutableStateOf(false) }
+
+ LaunchedEffect(locationPermissionsState.allPermissionsGranted) {
+ if (locationPermissionsState.allPermissionsGranted && triggerLocationToggleAfterPermission) {
+ isLocationTrackingEnabled = true
+ triggerLocationToggleAfterPermission = false
+ }
+ }
+
+ // --- File picker for map layers (Main mode) ---
+ val filePickerLauncher =
+ rememberLauncherForActivityResult(contract = ActivityResultContracts.StartActivityForResult()) { result ->
+ if (result.resultCode == Activity.RESULT_OK) {
+ result.data?.data?.let { uri ->
+ val fileName = uri.getFileName(context)
+ mapViewModel.addMapLayer(uri, fileName)
+ }
+ }
+ }
+
+ // --- UI state ---
+ var mapFilterMenuExpanded by remember { mutableStateOf(false) }
+ val mapFilterState by mapViewModel.mapFilterStateFlow.collectAsStateWithLifecycle()
+ val ourNodeInfo by mapViewModel.ourNodeInfo.collectAsStateWithLifecycle()
+ var editingWaypoint by remember { mutableStateOf(null) }
+
+ val selectedGoogleMapType by mapViewModel.selectedGoogleMapType.collectAsStateWithLifecycle()
+ val currentCustomTileProviderUrl by mapViewModel.selectedCustomTileProviderUrl.collectAsStateWithLifecycle()
+
+ var mapTypeMenuExpanded by remember { mutableStateOf(false) }
+ var showCustomTileManagerSheet by remember { mutableStateOf(false) }
+
+ // --- Camera ---
+ // Main mode persists camera; NodeTrack/Traceroute use ephemeral state with auto-centering.
+ val cameraPositionState =
+ if (mode is GoogleMapMode.Main) mapViewModel.cameraPositionState else rememberCameraPositionState()
+
+ if (mode is GoogleMapMode.Main) {
+ LaunchedEffect(cameraPositionState.isMoving) {
+ if (!cameraPositionState.isMoving) {
+ mapViewModel.saveCameraPosition(cameraPositionState.position)
+ }
+ }
+ }
+
+ // --- FusedLocation ---
+ val fusedLocationClient = remember { LocationServices.getFusedLocationProviderClient(context) }
+ val locationCallback = remember {
+ object : LocationCallback() {
+ override fun onLocationResult(locationResult: LocationResult) {
+ if (isLocationTrackingEnabled) {
+ locationResult.lastLocation?.let { location ->
+ val latLng = LatLng(location.latitude, location.longitude)
+ val cameraUpdate =
+ if (followPhoneBearing) {
+ val bearing =
+ if (location.hasBearing()) {
+ location.bearing
+ } else {
+ cameraPositionState.position.bearing
+ }
+ CameraUpdateFactory.newCameraPosition(
+ CameraPosition.Builder()
+ .target(latLng)
+ .zoom(cameraPositionState.position.zoom)
+ .bearing(bearing)
+ .build(),
+ )
+ } else {
+ CameraUpdateFactory.newLatLngZoom(latLng, cameraPositionState.position.zoom)
+ }
+ coroutineScope.launch {
+ try {
+ cameraPositionState.animate(cameraUpdate)
+ } catch (e: IllegalStateException) {
+ Logger.d { "Error animating camera to location: ${e.message}" }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ LaunchedEffect(isLocationTrackingEnabled, locationPermissionsState.allPermissionsGranted) {
+ if (isLocationTrackingEnabled && locationPermissionsState.allPermissionsGranted) {
+ val locationRequest =
+ LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 5000L)
+ .setMinUpdateIntervalMillis(2000L)
+ .build()
+ try {
+ @Suppress("MissingPermission")
+ fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null)
+ Logger.d { "Started location tracking" }
+ } catch (e: SecurityException) {
+ Logger.d { "Location permission not available: ${e.message}" }
+ isLocationTrackingEnabled = false
+ }
+ } else {
+ fusedLocationClient.removeLocationUpdates(locationCallback)
+ Logger.d { "Stopped location tracking" }
+ }
+ }
+
+ DisposableEffect(Unit) { onDispose { fusedLocationClient.removeLocationUpdates(locationCallback) } }
+
+ // --- Node & waypoint data ---
+ val allNodes by mapViewModel.nodesWithPosition.collectAsStateWithLifecycle(listOf())
+ val waypoints by mapViewModel.waypoints.collectAsStateWithLifecycle(emptyMap())
+ val displayableWaypoints = waypoints.values.mapNotNull { it.waypoint }
+ val selectedWaypointId by mapViewModel.selectedWaypointId.collectAsStateWithLifecycle()
+
+ val filteredNodes =
+ allNodes
+ .filter { node -> !mapFilterState.onlyFavorites || node.isFavorite || node.num == ourNodeInfo?.num }
+ .filter { node ->
+ mapFilterState.lastHeardFilter.seconds == 0L ||
+ (nowSeconds - node.lastHeard) <= mapFilterState.lastHeardFilter.seconds ||
+ node.num == ourNodeInfo?.num
+ }
+
+ val myNodeNum = mapViewModel.myNodeNum
+ val isConnected by mapViewModel.isConnected.collectAsStateWithLifecycle()
+ val theme by mapViewModel.theme.collectAsStateWithLifecycle()
+ val dark =
+ when (theme) {
+ AppCompatDelegate.MODE_NIGHT_YES -> true
+ AppCompatDelegate.MODE_NIGHT_NO -> false
+ AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM -> isSystemInDarkTheme()
+ else -> isSystemInDarkTheme()
+ }
+ val mapColorScheme = if (dark) ComposeMapColorScheme.DARK else ComposeMapColorScheme.LIGHT
+
+ // --- Mode-specific data ---
+ // Node track: apply time filter
+ val sortedTrackPositions =
+ if (mode is GoogleMapMode.NodeTrack) {
+ val lastHeardTrackFilter = mapFilterState.lastHeardTrackFilter
+ remember(mode.positions, lastHeardTrackFilter) {
+ mode.positions
+ .filter {
+ lastHeardTrackFilter == LastHeardFilter.Any ||
+ it.time > nowSeconds - lastHeardTrackFilter.seconds
+ }
+ .sortedBy { it.time }
+ }
+ } else {
+ emptyList()
+ }
+
+ // Traceroute: resolve node selection + polylines. Collected unconditionally per Compose rules
+ // (composable calls cannot be conditional), but only consumed in Traceroute mode. Uses all
+ // nodes, not just those with positions, so getNodeOrFallback can resolve metadata for hops
+ // whose positions come from snapshots.
+ val allNodesForTraceroute by mapViewModel.nodes.collectAsStateWithLifecycle(listOf())
+ val tracerouteSelection =
+ if (mode is GoogleMapMode.Traceroute) {
+ remember(mode.overlay, mode.nodePositions, allNodesForTraceroute) {
+ mapViewModel.tracerouteNodeSelection(
+ tracerouteOverlay = mode.overlay,
+ tracerouteNodePositions = mode.nodePositions,
+ nodes = allNodesForTraceroute,
+ )
+ }
+ } else {
+ null
+ }
+ val tracerouteDisplayNodes = tracerouteSelection?.nodesForMarkers ?: emptyList()
+
+ if (mode is GoogleMapMode.Traceroute) {
+ LaunchedEffect(mode.overlay, tracerouteDisplayNodes) {
+ if (mode.overlay != null) {
+ mode.onMappableCountChanged(tracerouteDisplayNodes.size, mode.overlay.relatedNodeNums.size)
+ }
+ }
+ }
+
+ val tracerouteForwardPoints: List =
+ if (mode is GoogleMapMode.Traceroute && tracerouteSelection != null) {
+ val nodeLookup = tracerouteSelection.nodeLookup
+ remember(mode.overlay, nodeLookup) {
+ mode.overlay?.forwardRoute?.mapNotNull { nodeLookup[it]?.position?.toLatLng() } ?: emptyList()
+ }
+ } else {
+ emptyList()
+ }
+ val tracerouteReturnPoints: List =
+ if (mode is GoogleMapMode.Traceroute && tracerouteSelection != null) {
+ val nodeLookup = tracerouteSelection.nodeLookup
+ remember(mode.overlay, nodeLookup) {
+ mode.overlay?.returnRoute?.mapNotNull { nodeLookup[it]?.position?.toLatLng() } ?: emptyList()
+ }
+ } else {
+ emptyList()
+ }
+ val tracerouteHeadingReferencePoints =
+ remember(tracerouteForwardPoints, tracerouteReturnPoints) {
+ when {
+ tracerouteForwardPoints.size >= 2 -> tracerouteForwardPoints
+ tracerouteReturnPoints.size >= 2 -> tracerouteReturnPoints
+ else -> emptyList()
+ }
+ }
+ val tracerouteForwardOffsetPoints =
+ remember(tracerouteForwardPoints, tracerouteHeadingReferencePoints) {
+ offsetPolyline(tracerouteForwardPoints, TRACEROUTE_OFFSET_METERS, tracerouteHeadingReferencePoints, 1.0)
+ }
+ val tracerouteReturnOffsetPoints =
+ remember(tracerouteReturnPoints, tracerouteHeadingReferencePoints) {
+ offsetPolyline(tracerouteReturnPoints, TRACEROUTE_OFFSET_METERS, tracerouteHeadingReferencePoints, -1.0)
+ }
+
+ // Auto-centering for NodeTrack / Traceroute modes
+ var hasCentered by remember(mode) { mutableStateOf(false) }
+
+ if (mode is GoogleMapMode.NodeTrack) {
+ LaunchedEffect(sortedTrackPositions, hasCentered) {
+ if (hasCentered || sortedTrackPositions.isEmpty()) return@LaunchedEffect
+ val points = sortedTrackPositions.map { it.toLatLng() }
+ val cameraUpdate =
+ if (points.size == 1) {
+ CameraUpdateFactory.newLatLngZoom(points.first(), max(cameraPositionState.position.zoom, 12f))
+ } else {
+ val bounds = LatLngBounds.builder()
+ points.forEach { bounds.include(it) }
+ CameraUpdateFactory.newLatLngBounds(bounds.build(), 80)
+ }
+ try {
+ cameraPositionState.animate(cameraUpdate)
+ hasCentered = true
+ } catch (e: IllegalStateException) {
+ Logger.d { "Error centering track map: ${e.message}" }
+ }
+ }
+
+ // Animate to selected position marker when card is tapped in the list
+ LaunchedEffect(mode.selectedPositionTime) {
+ val selectedTime = mode.selectedPositionTime ?: return@LaunchedEffect
+ val selectedPos = sortedTrackPositions.find { it.time == selectedTime } ?: return@LaunchedEffect
+ try {
+ cameraPositionState.animate(CameraUpdateFactory.newLatLng(selectedPos.toLatLng()))
+ } catch (e: IllegalStateException) {
+ Logger.d { "Error animating to selected position: ${e.message}" }
+ }
+ }
+ }
+
+ if (mode is GoogleMapMode.Traceroute) {
+ LaunchedEffect(mode.overlay, tracerouteForwardPoints, tracerouteReturnPoints) {
+ if (mode.overlay == null || hasCentered) return@LaunchedEffect
+ val allPoints = (tracerouteForwardPoints + tracerouteReturnPoints).distinct()
+ if (allPoints.isNotEmpty()) {
+ val cameraUpdate =
+ if (allPoints.size == 1) {
+ CameraUpdateFactory.newLatLngZoom(
+ allPoints.first(),
+ max(cameraPositionState.position.zoom, 12f),
+ )
+ } else {
+ val bounds = LatLngBounds.builder()
+ allPoints.forEach { bounds.include(it) }
+ CameraUpdateFactory.newLatLngBounds(bounds.build(), TRACEROUTE_BOUNDS_PADDING_PX)
+ }
+ try {
+ cameraPositionState.animate(cameraUpdate)
+ hasCentered = true
+ } catch (e: IllegalStateException) {
+ Logger.d { "Error centering traceroute overlay: ${e.message}" }
+ }
+ }
+ }
+ }
+
+ // --- Tile & layers state ---
+ var showLayersBottomSheet by remember { mutableStateOf(false) }
+
+ val onAddLayerClicked = {
+ val intent =
+ Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
+ addCategory(Intent.CATEGORY_OPENABLE)
+ type = "*/*"
+ val mimeTypes =
+ arrayOf(
+ "application/vnd.google-earth.kml+xml",
+ "application/vnd.google-earth.kmz",
+ "application/vnd.geo+json",
+ "application/geo+json",
+ "application/json",
+ )
+ putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes)
+ }
+ filePickerLauncher.launch(intent)
+ }
+ val onRemoveLayer = { layerId: String -> mapViewModel.removeMapLayer(layerId) }
+ val onToggleVisibility = { layerId: String -> mapViewModel.toggleLayerVisibility(layerId) }
+
+ val effectiveGoogleMapType = if (currentCustomTileProviderUrl != null) MapType.NONE else selectedGoogleMapType
+
+ var showClusterItemsDialog by remember { mutableStateOf?>(null) }
+
+ // --- Keep screen on while location tracking ---
+ LaunchedEffect(isLocationTrackingEnabled) {
+ val activity = context as? Activity ?: return@LaunchedEffect
+ val window = activity.window
+ if (isLocationTrackingEnabled) {
+ window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ } else {
+ window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ }
+ }
+
+ // --- Main UI ---
+ val isMainMode = mode is GoogleMapMode.Main
+
+ Box(modifier = modifier) {
+ GoogleMap(
+ mapColorScheme = mapColorScheme,
+ modifier = Modifier.fillMaxSize(),
+ cameraPositionState = cameraPositionState,
+ uiSettings =
+ MapUiSettings(
+ zoomControlsEnabled = true,
+ mapToolbarEnabled = isMainMode,
+ compassEnabled = false,
+ myLocationButtonEnabled = false,
+ rotationGesturesEnabled = true,
+ scrollGesturesEnabled = true,
+ tiltGesturesEnabled = isMainMode,
+ zoomGesturesEnabled = true,
+ ),
+ properties =
+ MapProperties(
+ mapType = effectiveGoogleMapType,
+ isMyLocationEnabled = isLocationTrackingEnabled && locationPermissionsState.allPermissionsGranted,
+ ),
+ onMapLongClick = { latLng ->
+ if (isMainMode && isConnected) {
+ editingWaypoint =
+ Waypoint(
+ latitude_i = (latLng.latitude / DEG_D).toInt(),
+ longitude_i = (latLng.longitude / DEG_D).toInt(),
+ )
+ }
+ },
+ ) {
+ // Custom tile overlay (all modes)
+ key(currentCustomTileProviderUrl) {
+ currentCustomTileProviderUrl?.let { url ->
+ val config =
+ mapViewModel.customTileProviderConfigs.collectAsStateWithLifecycle().value.find {
+ it.urlTemplate == url || it.localUri == url
+ }
+ mapViewModel.getTileProvider(config)?.let { tileProvider ->
+ TileOverlay(tileProvider = tileProvider, fadeIn = true, transparency = 0f, zIndex = -1f)
+ }
+ }
+ }
+
+ when (mode) {
+ is GoogleMapMode.Main ->
+ MainMapContent(
+ nodeClusterItems =
+ filteredNodes.map { node ->
+ val latLng =
+ LatLng(
+ (node.position.latitude_i ?: 0) * DEG_D,
+ (node.position.longitude_i ?: 0) * DEG_D,
+ )
+ NodeClusterItem(
+ node = node,
+ nodePosition = latLng,
+ nodeTitle = "${node.user.short_name} ${formatAgo(node.position.time)}",
+ nodeSnippet = "${node.user.long_name}",
+ myNodeNum = myNodeNum,
+ )
+ },
+ mapFilterState = mapFilterState,
+ navigateToNodeDetails = navigateToNodeDetails,
+ displayableWaypoints = displayableWaypoints,
+ myNodeNum = myNodeNum,
+ isConnected = isConnected,
+ onEditWaypointRequest = { editingWaypoint = it },
+ selectedWaypointId = selectedWaypointId,
+ mapLayers = mapLayers,
+ mapViewModel = mapViewModel,
+ cameraPositionState = cameraPositionState,
+ coroutineScope = coroutineScope,
+ onShowClusterItemsDialog = { showClusterItemsDialog = it },
+ )
+
+ is GoogleMapMode.NodeTrack -> {
+ val displayUnits by mapViewModel.displayUnits.collectAsStateWithLifecycle()
+ if (mode.focusedNode != null && sortedTrackPositions.isNotEmpty()) {
+ NodeTrackOverlay(
+ focusedNode = mode.focusedNode,
+ sortedPositions = sortedTrackPositions,
+ displayUnits = displayUnits,
+ myNodeNum = myNodeNum,
+ selectedPositionTime = mode.selectedPositionTime,
+ onPositionSelected = mode.onPositionSelected,
+ )
+ }
+ }
+
+ is GoogleMapMode.Traceroute ->
+ TracerouteMapContent(
+ forwardOffsetPoints = tracerouteForwardOffsetPoints,
+ returnOffsetPoints = tracerouteReturnOffsetPoints,
+ forwardPointCount = tracerouteForwardPoints.size,
+ returnPointCount = tracerouteReturnPoints.size,
+ displayNodes = tracerouteDisplayNodes,
+ )
+ }
+ }
+
+ // Scale bar
+ ScaleBar(
+ cameraPositionState = cameraPositionState,
+ modifier = Modifier.align(Alignment.BottomStart).padding(bottom = if (isMainMode) 48.dp else 16.dp),
+ )
+
+ // Waypoint edit dialog (Main mode only)
+ if (isMainMode) {
+ editingWaypoint?.let { waypointToEdit ->
+ EditWaypointDialog(
+ waypoint = waypointToEdit,
+ onSendClicked = { updatedWp ->
+ var finalWp = updatedWp
+ if (updatedWp.id == 0) {
+ finalWp = finalWp.copy(id = mapViewModel.generatePacketId() ?: 0)
+ }
+ if ((updatedWp.icon ?: 0) == 0) {
+ finalWp = finalWp.copy(icon = 0x1F4CD)
+ }
+ mapViewModel.sendWaypoint(finalWp)
+ editingWaypoint = null
+ },
+ onDeleteClicked = { wpToDelete ->
+ if ((wpToDelete.locked_to ?: 0) == 0 && isConnected && wpToDelete.id != 0) {
+ mapViewModel.sendWaypoint(wpToDelete.copy(expire = 1))
+ }
+ mapViewModel.deleteWaypoint(wpToDelete.id)
+ editingWaypoint = null
+ },
+ onDismissRequest = { editingWaypoint = null },
+ )
+ }
+ }
+
+ // Controls overlay
+ val visibleNetworkLayers = mapLayers.filter { it.isNetwork && it.isVisible }
+ val showRefresh = visibleNetworkLayers.isNotEmpty()
+ val isRefreshingLayers = visibleNetworkLayers.any { it.isRefreshing }
+
+ MapControlsOverlay(
+ modifier = Modifier.align(Alignment.TopCenter).padding(top = 8.dp),
+ onToggleFilterMenu = { mapFilterMenuExpanded = true },
+ filterDropdownContent = {
+ if (mode is GoogleMapMode.NodeTrack) {
+ NodeMapFilterDropdown(
+ expanded = mapFilterMenuExpanded,
+ onDismissRequest = { mapFilterMenuExpanded = false },
+ mapViewModel = mapViewModel,
+ )
+ } else {
+ MapFilterDropdown(
+ expanded = mapFilterMenuExpanded,
+ onDismissRequest = { mapFilterMenuExpanded = false },
+ mapViewModel = mapViewModel,
+ )
+ }
+ },
+ mapTypeContent = {
+ Box {
+ MapButton(
+ icon = MeshtasticIcons.Map,
+ contentDescription = stringResource(Res.string.map_tile_source),
+ onClick = { mapTypeMenuExpanded = true },
+ )
+ MapTypeDropdown(
+ expanded = mapTypeMenuExpanded,
+ onDismissRequest = { mapTypeMenuExpanded = false },
+ mapViewModel = mapViewModel,
+ onManageCustomTileProvidersClicked = {
+ mapTypeMenuExpanded = false
+ showCustomTileManagerSheet = true
+ },
+ )
+ }
+ },
+ layersContent = {
+ MapButton(
+ icon = MeshtasticIcons.Layers,
+ contentDescription = stringResource(Res.string.manage_map_layers),
+ onClick = { showLayersBottomSheet = true },
+ )
+ },
+ isLocationTrackingEnabled = isLocationTrackingEnabled,
+ onToggleLocationTracking = {
+ if (locationPermissionsState.allPermissionsGranted) {
+ isLocationTrackingEnabled = !isLocationTrackingEnabled
+ if (!isLocationTrackingEnabled) {
+ followPhoneBearing = false
+ }
+ } else {
+ triggerLocationToggleAfterPermission = true
+ locationPermissionsState.launchMultiplePermissionRequest()
+ }
+ },
+ bearing = cameraPositionState.position.bearing,
+ onCompassClick = {
+ if (isLocationTrackingEnabled) {
+ followPhoneBearing = !followPhoneBearing
+ } else {
+ coroutineScope.launch {
+ try {
+ val currentPosition = cameraPositionState.position
+ val newCameraPosition = CameraPosition.Builder(currentPosition).bearing(0f).build()
+ cameraPositionState.animate(CameraUpdateFactory.newCameraPosition(newCameraPosition))
+ Logger.d { "Oriented map to north" }
+ } catch (e: IllegalStateException) {
+ Logger.d { "Error orienting map to north: ${e.message}" }
+ }
+ }
+ }
+ },
+ followPhoneBearing = followPhoneBearing,
+ showRefresh = showRefresh,
+ isRefreshing = isRefreshingLayers,
+ onRefresh = { mapViewModel.refreshAllVisibleNetworkLayers() },
+ )
+ }
+
+ // --- Bottom sheets & dialogs ---
+ if (showLayersBottomSheet) {
+ ModalBottomSheet(onDismissRequest = { showLayersBottomSheet = false }) {
+ CustomMapLayersSheet(
+ mapLayers = mapLayers,
+ onToggleVisibility = onToggleVisibility,
+ onRemoveLayer = onRemoveLayer,
+ onAddLayerClicked = onAddLayerClicked,
+ onRefreshLayer = { mapViewModel.refreshMapLayer(it) },
+ onAddNetworkLayer = { name, url -> mapViewModel.addNetworkMapLayer(name, url) },
+ )
+ }
+ }
+ showClusterItemsDialog?.let {
+ ClusterItemsListDialog(
+ items = it,
+ onDismiss = { showClusterItemsDialog = null },
+ onItemClick = { item ->
+ navigateToNodeDetails(item.node.num)
+ showClusterItemsDialog = null
+ },
+ )
+ }
+ if (showCustomTileManagerSheet) {
+ ModalBottomSheet(onDismissRequest = { showCustomTileManagerSheet = false }) {
+ CustomTileProviderManagerSheet(mapViewModel = mapViewModel)
+ }
+ }
+}
+
+// region --- Main Map Content ---
+
+@Suppress("LongParameterList")
+@OptIn(MapsComposeExperimentalApi::class)
+@Composable
+private fun MainMapContent(
+ nodeClusterItems: List,
+ mapFilterState: MapFilterState,
+ navigateToNodeDetails: (Int) -> Unit,
+ displayableWaypoints: List,
+ myNodeNum: Int?,
+ isConnected: Boolean,
+ onEditWaypointRequest: (Waypoint) -> Unit,
+ selectedWaypointId: Int?,
+ mapLayers: List,
+ mapViewModel: MapViewModel,
+ cameraPositionState: CameraPositionState,
+ coroutineScope: CoroutineScope,
+ onShowClusterItemsDialog: (List?) -> Unit,
+) {
+ NodeClusterMarkers(
+ nodeClusterItems = nodeClusterItems,
+ mapFilterState = mapFilterState,
+ navigateToNodeDetails = navigateToNodeDetails,
+ onClusterClick = { cluster ->
+ val items = cluster.items.toList()
+ val allSameLocation = items.size > 1 && items.all { it.position == items.first().position }
+ if (allSameLocation) {
+ onShowClusterItemsDialog(items)
+ } else {
+ val bounds = LatLngBounds.builder()
+ cluster.items.forEach { bounds.include(it.position) }
+ coroutineScope.launch {
+ cameraPositionState.animate(
+ CameraUpdateFactory.newCameraPosition(
+ CameraPosition.Builder()
+ .target(bounds.build().center)
+ .zoom(cameraPositionState.position.zoom + 1)
+ .build(),
+ ),
+ )
+ }
+ Logger.d { "Cluster clicked! $cluster" }
+ }
+ true
+ },
+ )
+
+ WaypointMarkers(
+ displayableWaypoints = displayableWaypoints,
+ mapFilterState = mapFilterState,
+ myNodeNum = myNodeNum ?: 0,
+ isConnected = isConnected,
+ onEditWaypointRequest = onEditWaypointRequest,
+ selectedWaypointId = selectedWaypointId,
+ )
+
+ mapLayers.forEach { layerItem -> key(layerItem.id) { MapLayerOverlay(layerItem, mapViewModel) } }
+}
+
+// endregion
+
+// region --- Node Track Overlay ---
+
+/**
+ * Renders the position track polyline segments and markers inside a [GoogleMap] content scope. Each marker fades from
+ * transparent (oldest) to opaque (newest). The newest position shows the node's [NodeChip]; older positions show a
+ * [TripOrigin] dot with an info-window on tap.
+ *
+ * When [selectedPositionTime] matches a marker's `Position.time`, that marker is highlighted with the primary color and
+ * elevated z-index. Tapping a marker invokes [onPositionSelected] for list synchronization.
+ */
+@OptIn(MapsComposeExperimentalApi::class)
+@Composable
+@Suppress("LongMethod")
+private fun NodeTrackOverlay(
+ focusedNode: Node,
+ sortedPositions: List,
+ displayUnits: DisplayUnits,
+ myNodeNum: Int?,
+ selectedPositionTime: Int? = null,
+ onPositionSelected: ((Int) -> Unit)? = null,
+) {
+ val isHighPriority = focusedNode.num == myNodeNum || focusedNode.isFavorite
+ val activeNodeZIndex = if (isHighPriority) 5f else 4f
+ val selectedColor = MaterialTheme.colorScheme.primary
+
+ sortedPositions.forEachIndexed { index, position ->
+ key(position.time) {
+ val markerState = rememberUpdatedMarkerState(position = position.toLatLng())
+ val alpha =
+ if (sortedPositions.size > 1) {
+ index.toFloat() / (sortedPositions.size.toFloat() - 1)
+ } else {
+ 1f
+ }
+ val isSelected = position.time == selectedPositionTime
+ val color =
+ if (isSelected) {
+ selectedColor
+ } else {
+ Color(focusedNode.colors.second).copy(alpha = alpha)
+ }
+
+ if (index == sortedPositions.lastIndex) {
+ MarkerComposable(
+ state = markerState,
+ zIndex = activeNodeZIndex,
+ alpha = if (isHighPriority) 1.0f else 0.9f,
+ onClick = {
+ onPositionSelected?.invoke(position.time)
+ false // Allow default info window behavior
+ },
+ ) {
+ NodeChip(node = focusedNode)
+ }
+ } else {
+ MarkerInfoWindowComposable(
+ state = markerState,
+ title = stringResource(Res.string.position),
+ snippet = formatAgo(position.time),
+ zIndex = if (isSelected) activeNodeZIndex - 0.5f else 1f + alpha,
+ onClick = {
+ onPositionSelected?.invoke(position.time)
+ false // Allow default info window behavior
+ },
+ infoContent = { PositionInfoWindowContent(position = position, displayUnits = displayUnits) },
+ ) {
+ Icon(
+ imageVector = MeshtasticIcons.TripOrigin,
+ contentDescription = stringResource(Res.string.track_point),
+ tint = color,
+ modifier = if (isSelected) Modifier.size(32.dp) else Modifier,
+ )
+ }
+ }
+ }
+ }
+
+ // Gradient polyline segments
+ if (sortedPositions.size > 1) {
+ val segments = sortedPositions.windowed(size = 2, step = 1, partialWindows = false)
+ segments.forEachIndexed { index, segmentPoints ->
+ val alpha = index.toFloat() / (segments.size.toFloat() - 1)
+ Polyline(
+ points = segmentPoints.map { it.toLatLng() },
+ jointType = JointType.ROUND,
+ color = Color(focusedNode.colors.second).copy(alpha = alpha),
+ width = 8f,
+ zIndex = 0.6f,
+ )
+ }
+ }
+}
+
+@Composable
+@Suppress("LongMethod")
+private fun PositionInfoWindowContent(position: Position, displayUnits: DisplayUnits = DisplayUnits.METRIC) {
+ @Composable
+ fun PositionRow(label: String, value: String) {
+ Row(modifier = Modifier.padding(horizontal = 8.dp), verticalAlignment = Alignment.CenterVertically) {
+ Text(label, style = MaterialTheme.typography.labelMedium)
+ Spacer(modifier = Modifier.width(16.dp))
+ Text(value, style = MaterialTheme.typography.labelMedium)
+ }
+ }
+
+ Card {
+ Column(modifier = Modifier.padding(8.dp)) {
+ PositionRow(
+ label = stringResource(Res.string.latitude),
+ value = "%.5f".format((position.latitude_i ?: 0) * DEG_D),
+ )
+ PositionRow(
+ label = stringResource(Res.string.longitude),
+ value = "%.5f".format((position.longitude_i ?: 0) * DEG_D),
+ )
+ PositionRow(label = stringResource(Res.string.sats), value = position.sats_in_view.toString())
+ PositionRow(
+ label = stringResource(Res.string.alt),
+ value = (position.altitude ?: 0).metersIn(displayUnits).toString(displayUnits),
+ )
+ PositionRow(label = stringResource(Res.string.speed), value = speedFromPosition(position, displayUnits))
+ PositionRow(
+ label = stringResource(Res.string.heading),
+ value = "%.0f°".format((position.ground_track ?: 0) * HEADING_DEG),
+ )
+ PositionRow(label = stringResource(Res.string.timestamp), value = position.formatPositionTime())
+ }
+ }
+}
+
+@Composable
+private fun speedFromPosition(position: Position, displayUnits: DisplayUnits): String {
+ val speedInMps = position.ground_speed ?: 0
+ val mpsText = "%d m/s".format(speedInMps)
+ return if (speedInMps > 10) {
+ when (displayUnits) {
+ DisplayUnits.METRIC -> "%.1f Km/h".format(speedInMps.mpsToKmph())
+ DisplayUnits.IMPERIAL -> "%.1f mph".format(speedInMps.mpsToMph())
+ else -> mpsText
+ }
+ } else {
+ mpsText
+ }
+}
+
+// endregion
+
+// region --- Traceroute Map Content ---
+
+@OptIn(MapsComposeExperimentalApi::class)
+@Composable
+private fun TracerouteMapContent(
+ forwardOffsetPoints: List,
+ returnOffsetPoints: List,
+ forwardPointCount: Int,
+ returnPointCount: Int,
+ displayNodes: List,
+) {
+ if (forwardPointCount >= 2) {
+ Polyline(
+ points = forwardOffsetPoints,
+ jointType = JointType.ROUND,
+ color = TracerouteColors.OutgoingRoute,
+ width = 9f,
+ zIndex = 3.0f,
+ )
+ }
+ if (returnPointCount >= 2) {
+ Polyline(
+ points = returnOffsetPoints,
+ jointType = JointType.ROUND,
+ color = TracerouteColors.ReturnRoute,
+ width = 7f,
+ zIndex = 2.5f,
+ )
+ }
+ displayNodes.forEach { node ->
+ val markerState = rememberUpdatedMarkerState(position = node.position.toLatLng())
+ MarkerComposable(state = markerState, zIndex = 4f) { NodeChip(node = node) }
+ }
+}
+
+private fun offsetPolyline(
+ points: List,
+ offsetMeters: Double,
+ headingReferencePoints: List = points,
+ sideMultiplier: Double = 1.0,
+): List {
+ val headingPoints = headingReferencePoints.takeIf { it.size >= 2 } ?: points
+ if (points.size < 2 || headingPoints.size < 2 || offsetMeters == 0.0) return points
+
+ val headings =
+ headingPoints.mapIndexed { index, _ ->
+ when (index) {
+ 0 -> SphericalUtil.computeHeading(headingPoints[0], headingPoints[1])
+ headingPoints.lastIndex ->
+ SphericalUtil.computeHeading(
+ headingPoints[headingPoints.lastIndex - 1],
+ headingPoints[headingPoints.lastIndex],
+ )
+
+ else -> SphericalUtil.computeHeading(headingPoints[index - 1], headingPoints[index + 1])
+ }
+ }
+
+ return points.mapIndexed { index, point ->
+ val heading = headings[index.coerceIn(0, headings.lastIndex)]
+ val perpendicularHeading = heading + (90.0 * sideMultiplier)
+ SphericalUtil.computeOffset(point, abs(offsetMeters), perpendicularHeading)
+ }
+}
+
+// endregion
+
+// region --- Map Layers ---
+
+@Composable
+private fun MapLayerOverlay(layerItem: MapLayerItem, mapViewModel: MapViewModel) {
+ val context = LocalContext.current
+ var currentLayer by remember { mutableStateOf(null) }
+
+ MapEffect(layerItem.id, layerItem.isRefreshing) { map ->
+ currentLayer?.safeRemoveLayerFromMap()
+ currentLayer = null
+ val inputStream = mapViewModel.getInputStreamFromUri(layerItem) ?: return@MapEffect
+ val layer =
+ try {
+ when (layerItem.layerType) {
+ LayerType.KML -> KmlLayer(map, inputStream, context)
+ LayerType.GEOJSON ->
+ GeoJsonLayer(map, JSONObject(inputStream.bufferedReader().use { it.readText() }))
+ }
+ } catch (e: Exception) {
+ Logger.withTag("MapView").e(e) { "Error loading map layer: ${layerItem.name}" }
+ null
+ }
+ layer?.let {
+ if (layerItem.isVisible) it.safeAddLayerToMap()
+ currentLayer = it
+ }
+ }
+
+ DisposableEffect(layerItem.id) {
+ onDispose {
+ currentLayer?.safeRemoveLayerFromMap()
+ currentLayer = null
+ }
+ }
+
+ LaunchedEffect(layerItem.isVisible) {
+ val layer = currentLayer ?: return@LaunchedEffect
+ if (layerItem.isVisible) layer.safeAddLayerToMap() else layer.safeRemoveLayerFromMap()
+ }
+}
+
+private fun Layer.safeRemoveLayerFromMap() {
+ try {
+ removeLayerFromMap()
+ } catch (e: Exception) {
+ Logger.withTag("MapView").e(e) { "Error removing map layer" }
+ }
+}
+
+private fun Layer.safeAddLayerToMap() {
+ try {
+ if (!isLayerOnMap) addLayerToMap()
+ } catch (e: Exception) {
+ Logger.withTag("MapView").e(e) { "Error adding map layer" }
+ }
+}
+
+// endregion
+
+// region --- Utilities ---
+
+internal fun convertIntToEmoji(unicodeCodePoint: Int): String = try {
+ String(Character.toChars(unicodeCodePoint))
+} catch (e: IllegalArgumentException) {
+ Logger.w(e) { "Invalid unicode code point: $unicodeCodePoint" }
+ "\uD83D\uDCCD"
+}
+
+@Suppress("NestedBlockDepth")
+fun Uri.getFileName(context: android.content.Context): String {
+ var name = this.lastPathSegment ?: "layer_$nowMillis"
+ if (this.scheme == "content") {
+ context.contentResolver.query(this, null, null, null, null)?.use { cursor ->
+ if (cursor.moveToFirst()) {
+ val displayNameIndex = cursor.getColumnIndex(android.provider.OpenableColumns.DISPLAY_NAME)
+ if (displayNameIndex != -1) {
+ name = cursor.getString(displayNameIndex)
+ }
+ }
+ }
+ }
+ return name
+}
+
+/** Converts protobuf [Position] integer coordinates to a Google Maps [LatLng]. */
+internal fun Position.toLatLng(): LatLng = LatLng((this.latitude_i ?: 0) * DEG_D, (this.longitude_i ?: 0) * DEG_D)
+
+// endregion
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/MapViewModel.kt b/app/src/google/kotlin/org/meshtastic/app/map/MapViewModel.kt
new file mode 100644
index 000000000..e4eabbb76
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/MapViewModel.kt
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map
+
+import android.app.Application
+import android.net.Uri
+import androidx.core.net.toFile
+import androidx.lifecycle.SavedStateHandle
+import androidx.lifecycle.viewModelScope
+import co.touchlab.kermit.Logger
+import com.google.android.gms.maps.model.CameraPosition
+import com.google.android.gms.maps.model.LatLng
+import com.google.android.gms.maps.model.TileProvider
+import com.google.android.gms.maps.model.UrlTileProvider
+import com.google.maps.android.compose.CameraPositionState
+import com.google.maps.android.compose.MapType
+import io.ktor.client.HttpClient
+import io.ktor.client.request.get
+import io.ktor.client.statement.bodyAsChannel
+import io.ktor.http.isSuccess
+import io.ktor.utils.io.jvm.javaio.toInputStream
+import kotlinx.coroutines.flow.MutableSharedFlow
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.SharedFlow
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.asSharedFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.mapNotNull
+import kotlinx.coroutines.flow.update
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+import kotlinx.serialization.Serializable
+import org.koin.core.annotation.KoinViewModel
+import org.meshtastic.app.map.model.CustomTileProviderConfig
+import org.meshtastic.app.map.prefs.map.GoogleMapsPrefs
+import org.meshtastic.app.map.repository.CustomTileProviderRepository
+import org.meshtastic.core.di.CoroutineDispatchers
+import org.meshtastic.core.model.RadioController
+import org.meshtastic.core.repository.MapPrefs
+import org.meshtastic.core.repository.NodeRepository
+import org.meshtastic.core.repository.PacketRepository
+import org.meshtastic.core.repository.RadioConfigRepository
+import org.meshtastic.core.repository.UiPrefs
+import org.meshtastic.core.ui.viewmodel.stateInWhileSubscribed
+import org.meshtastic.feature.map.BaseMapViewModel
+import org.meshtastic.proto.Config
+import java.io.File
+import java.io.FileOutputStream
+import java.io.IOException
+import java.io.InputStream
+import java.net.MalformedURLException
+import java.net.URL
+import kotlin.uuid.Uuid
+
+private const val TILE_SIZE = 256
+
+@Serializable
+data class MapCameraPosition(
+ val targetLat: Double,
+ val targetLng: Double,
+ val zoom: Float,
+ val tilt: Float,
+ val bearing: Float,
+)
+
+@Suppress("TooManyFunctions", "LongParameterList")
+@KoinViewModel
+class MapViewModel(
+ private val application: Application,
+ private val dispatchers: CoroutineDispatchers,
+ private val httpClient: HttpClient,
+ mapPrefs: MapPrefs,
+ private val googleMapsPrefs: GoogleMapsPrefs,
+ nodeRepository: NodeRepository,
+ packetRepository: PacketRepository,
+ radioConfigRepository: RadioConfigRepository,
+ radioController: RadioController,
+ private val customTileProviderRepository: CustomTileProviderRepository,
+ uiPrefs: UiPrefs,
+ savedStateHandle: SavedStateHandle,
+) : BaseMapViewModel(mapPrefs, nodeRepository, packetRepository, radioController) {
+
+ private val _selectedWaypointId = MutableStateFlow(savedStateHandle.get("waypointId"))
+ val selectedWaypointId: StateFlow = _selectedWaypointId.asStateFlow()
+
+ fun setWaypointId(id: Int?) {
+ if (_selectedWaypointId.value != id) {
+ _selectedWaypointId.value = id
+ if (id != null) {
+ viewModelScope.launch {
+ val wpMap = waypoints.first { it.containsKey(id) }
+ wpMap[id]?.let { packet ->
+ val waypoint = packet.waypoint!!
+ val latLng = LatLng((waypoint.latitude_i ?: 0) / 1e7, (waypoint.longitude_i ?: 0) / 1e7)
+ cameraPositionState.position = CameraPosition.fromLatLngZoom(latLng, 15f)
+ }
+ }
+ }
+ }
+ }
+
+ private val targetLatLng =
+ googleMapsPrefs.cameraTargetLat.value
+ .takeIf { it != 0.0 }
+ ?.let { lat -> googleMapsPrefs.cameraTargetLng.value.takeIf { it != 0.0 }?.let { lng -> LatLng(lat, lng) } }
+ ?: ourNodeInfo.value?.position?.toLatLng()
+ ?: LatLng(0.0, 0.0)
+
+ val cameraPositionState =
+ CameraPositionState(
+ position =
+ CameraPosition(
+ targetLatLng,
+ googleMapsPrefs.cameraZoom.value,
+ googleMapsPrefs.cameraTilt.value,
+ googleMapsPrefs.cameraBearing.value,
+ ),
+ )
+
+ val theme: StateFlow = uiPrefs.theme
+
+ private val _errorFlow = MutableSharedFlow()
+ val errorFlow: SharedFlow = _errorFlow.asSharedFlow()
+
+ val customTileProviderConfigs: StateFlow> =
+ customTileProviderRepository.getCustomTileProviders().stateInWhileSubscribed(initialValue = emptyList())
+
+ private val _selectedCustomTileProviderUrl = MutableStateFlow(null)
+ val selectedCustomTileProviderUrl: StateFlow = _selectedCustomTileProviderUrl.asStateFlow()
+
+ private val _selectedGoogleMapType = MutableStateFlow(MapType.NORMAL)
+ val selectedGoogleMapType: StateFlow = _selectedGoogleMapType.asStateFlow()
+
+ val displayUnits =
+ radioConfigRepository.deviceProfileFlow
+ .mapNotNull { it.config?.display?.units }
+ .stateInWhileSubscribed(initialValue = Config.DisplayConfig.DisplayUnits.METRIC)
+
+ fun addCustomTileProvider(name: String, urlTemplate: String, localUri: String? = null) {
+ viewModelScope.launch {
+ if (
+ name.isBlank() ||
+ (urlTemplate.isBlank() && localUri == null) ||
+ (localUri == null && !isValidTileUrlTemplate(urlTemplate))
+ ) {
+ _errorFlow.emit("Invalid name, URL template, or local URI for custom tile provider.")
+ return@launch
+ }
+ if (customTileProviderConfigs.value.any { it.name.equals(name, ignoreCase = true) }) {
+ _errorFlow.emit("Custom tile provider with name '$name' already exists.")
+ return@launch
+ }
+
+ var finalLocalUri = localUri
+ if (localUri != null) {
+ try {
+ val uri = Uri.parse(localUri)
+ val extension = "mbtiles"
+ val finalFileName = "mbtiles_${Uuid.random()}.$extension"
+ val copiedUri = copyFileToInternalStorage(uri, finalFileName)
+ if (copiedUri != null) {
+ finalLocalUri = copiedUri.toString()
+ } else {
+ _errorFlow.emit("Failed to copy MBTiles file to internal storage.")
+ return@launch
+ }
+ } catch (e: Exception) {
+ Logger.withTag("MapViewModel").e(e) { "Error processing local URI" }
+ _errorFlow.emit("Error processing local URI for MBTiles.")
+ return@launch
+ }
+ }
+
+ val newConfig = CustomTileProviderConfig(name = name, urlTemplate = urlTemplate, localUri = finalLocalUri)
+ customTileProviderRepository.addCustomTileProvider(newConfig)
+ }
+ }
+
+ fun updateCustomTileProvider(configToUpdate: CustomTileProviderConfig) {
+ viewModelScope.launch {
+ if (
+ configToUpdate.name.isBlank() ||
+ (configToUpdate.urlTemplate.isBlank() && configToUpdate.localUri == null) ||
+ (configToUpdate.localUri == null && !isValidTileUrlTemplate(configToUpdate.urlTemplate))
+ ) {
+ _errorFlow.emit("Invalid name, URL template, or local URI for updating custom tile provider.")
+ return@launch
+ }
+ val existingConfigs = customTileProviderConfigs.value
+ if (
+ existingConfigs.any {
+ it.id != configToUpdate.id && it.name.equals(configToUpdate.name, ignoreCase = true)
+ }
+ ) {
+ _errorFlow.emit("Another custom tile provider with name '${configToUpdate.name}' already exists.")
+ return@launch
+ }
+
+ customTileProviderRepository.updateCustomTileProvider(configToUpdate)
+
+ val originalConfig = customTileProviderRepository.getCustomTileProviderById(configToUpdate.id)
+ if (
+ _selectedCustomTileProviderUrl.value != null &&
+ originalConfig?.urlTemplate == _selectedCustomTileProviderUrl.value
+ ) {
+ // No change needed if URL didn't change, or handle if it did
+ } else if (originalConfig != null && _selectedCustomTileProviderUrl.value != originalConfig.urlTemplate) {
+ val currentlySelectedConfig =
+ customTileProviderConfigs.value.find { it.urlTemplate == _selectedCustomTileProviderUrl.value }
+ if (currentlySelectedConfig?.id == configToUpdate.id) {
+ _selectedCustomTileProviderUrl.value = configToUpdate.urlTemplate
+ }
+ }
+ }
+ }
+
+ fun removeCustomTileProvider(configId: String) {
+ viewModelScope.launch {
+ val configToRemove = customTileProviderRepository.getCustomTileProviderById(configId)
+ customTileProviderRepository.deleteCustomTileProvider(configId)
+
+ if (configToRemove != null) {
+ if (
+ _selectedCustomTileProviderUrl.value == configToRemove.urlTemplate ||
+ _selectedCustomTileProviderUrl.value == configToRemove.localUri
+ ) {
+ _selectedCustomTileProviderUrl.value = null
+ // Also clear from prefs
+ googleMapsPrefs.setSelectedCustomTileUrl(null)
+ }
+
+ if (configToRemove.localUri != null) {
+ val uri = Uri.parse(configToRemove.localUri)
+ deleteFileToInternalStorage(uri)
+ }
+ }
+ }
+ }
+
+ fun selectCustomTileProvider(config: CustomTileProviderConfig?) {
+ if (config != null) {
+ if (!config.isLocal && !isValidTileUrlTemplate(config.urlTemplate)) {
+ Logger.withTag("MapViewModel").w("Attempted to select invalid URL template: ${config.urlTemplate}")
+ _selectedCustomTileProviderUrl.value = null
+ googleMapsPrefs.setSelectedCustomTileUrl(null)
+ return
+ }
+ // Use localUri if present, otherwise urlTemplate
+ val selectedUrl = config.localUri ?: config.urlTemplate
+ _selectedCustomTileProviderUrl.value = selectedUrl
+ _selectedGoogleMapType.value = MapType.NONE
+ googleMapsPrefs.setSelectedCustomTileUrl(selectedUrl)
+ googleMapsPrefs.setSelectedGoogleMapType(null)
+ } else {
+ _selectedCustomTileProviderUrl.value = null
+ _selectedGoogleMapType.value = MapType.NORMAL
+ googleMapsPrefs.setSelectedCustomTileUrl(null)
+ googleMapsPrefs.setSelectedGoogleMapType(MapType.NORMAL.name)
+ }
+ }
+
+ fun setSelectedGoogleMapType(mapType: MapType) {
+ _selectedGoogleMapType.value = mapType
+ _selectedCustomTileProviderUrl.value = null // Clear custom selection
+ googleMapsPrefs.setSelectedGoogleMapType(mapType.name)
+ googleMapsPrefs.setSelectedCustomTileUrl(null)
+ }
+
+ private var currentTileProvider: TileProvider? = null
+
+ fun getTileProvider(config: CustomTileProviderConfig?): TileProvider? {
+ if (config == null) {
+ (currentTileProvider as? MBTilesProvider)?.close()
+ currentTileProvider = null
+ return null
+ }
+
+ val selectedUrl = config.localUri ?: config.urlTemplate
+ if (currentTileProvider != null && _selectedCustomTileProviderUrl.value == selectedUrl) {
+ return currentTileProvider
+ }
+
+ // Close previous if it was a local provider
+ (currentTileProvider as? MBTilesProvider)?.close()
+
+ val newProvider =
+ if (config.isLocal) {
+ val uri = Uri.parse(config.localUri)
+ val file =
+ try {
+ uri.toFile()
+ } catch (e: Exception) {
+ File(uri.path ?: "")
+ }
+ if (file.exists()) {
+ MBTilesProvider(file)
+ } else {
+ Logger.withTag("MapViewModel").e("Local MBTiles file does not exist: ${config.localUri}")
+ null
+ }
+ } else {
+ val urlString = config.urlTemplate
+ if (!isValidTileUrlTemplate(urlString)) {
+ Logger.withTag("MapViewModel")
+ .e("Tile URL does not contain valid {x}, {y}, and {z} placeholders: $urlString")
+ null
+ } else {
+ object : UrlTileProvider(TILE_SIZE, TILE_SIZE) {
+ override fun getTileUrl(x: Int, y: Int, zoom: Int): URL? {
+ val subdomains = listOf("a", "b", "c")
+ val subdomain = subdomains[(x + y) % subdomains.size]
+ val formattedUrl =
+ urlString
+ .replace("{s}", subdomain, ignoreCase = true)
+ .replace("{z}", zoom.toString(), ignoreCase = true)
+ .replace("{x}", x.toString(), ignoreCase = true)
+ .replace("{y}", y.toString(), ignoreCase = true)
+ return try {
+ URL(formattedUrl)
+ } catch (e: MalformedURLException) {
+ Logger.withTag("MapViewModel").e(e) { "Malformed URL: $formattedUrl" }
+ null
+ }
+ }
+ }
+ }
+ }
+
+ currentTileProvider = newProvider
+ return newProvider
+ }
+
+ private fun isValidTileUrlTemplate(urlTemplate: String): Boolean = urlTemplate.contains("{z}", ignoreCase = true) &&
+ urlTemplate.contains("{x}", ignoreCase = true) &&
+ urlTemplate.contains("{y}", ignoreCase = true)
+
+ private val _mapLayers = MutableStateFlow>(emptyList())
+ val mapLayers: StateFlow> = _mapLayers.asStateFlow()
+
+ init {
+ viewModelScope.launch {
+ customTileProviderRepository.getCustomTileProviders().first()
+ loadPersistedMapType()
+ }
+ loadPersistedLayers()
+
+ selectedWaypointId.value?.let { wpId ->
+ viewModelScope.launch {
+ val wpMap = waypoints.first { it.containsKey(wpId) }
+ wpMap[wpId]?.let { packet ->
+ val waypoint = packet.waypoint!!
+ val latLng = LatLng((waypoint.latitude_i ?: 0) / 1e7, (waypoint.longitude_i ?: 0) / 1e7)
+ cameraPositionState.position = CameraPosition.fromLatLngZoom(latLng, 15f)
+ }
+ }
+ }
+ }
+
+ fun saveCameraPosition(cameraPosition: CameraPosition) {
+ viewModelScope.launch {
+ googleMapsPrefs.setCameraTargetLat(cameraPosition.target.latitude)
+ googleMapsPrefs.setCameraTargetLng(cameraPosition.target.longitude)
+ googleMapsPrefs.setCameraZoom(cameraPosition.zoom)
+ googleMapsPrefs.setCameraTilt(cameraPosition.tilt)
+ googleMapsPrefs.setCameraBearing(cameraPosition.bearing)
+ }
+ }
+
+ private fun loadPersistedMapType() {
+ val savedCustomUrl = googleMapsPrefs.selectedCustomTileUrl.value
+ if (savedCustomUrl != null) {
+ // Check if this custom provider still exists
+ if (
+ customTileProviderConfigs.value.any { it.urlTemplate == savedCustomUrl } &&
+ isValidTileUrlTemplate(savedCustomUrl)
+ ) {
+ _selectedCustomTileProviderUrl.value = savedCustomUrl
+ _selectedGoogleMapType.value =
+ MapType.NONE // MapType.NONE to hide google basemap when using custom provider
+ } else {
+ // The saved custom URL is no longer valid or doesn't exist, remove preference
+ googleMapsPrefs.setSelectedCustomTileUrl(null)
+ // Fallback to default Google Map type
+ _selectedGoogleMapType.value = MapType.NORMAL
+ }
+ } else {
+ val savedGoogleMapTypeName = googleMapsPrefs.selectedGoogleMapType.value
+ try {
+ _selectedGoogleMapType.value = MapType.valueOf(savedGoogleMapTypeName ?: MapType.NORMAL.name)
+ } catch (e: IllegalArgumentException) {
+ Logger.e(e) { "Invalid saved Google Map type: $savedGoogleMapTypeName" }
+ _selectedGoogleMapType.value = MapType.NORMAL // Fallback in case of invalid stored name
+ googleMapsPrefs.setSelectedGoogleMapType(null)
+ }
+ }
+ }
+
+ private fun loadPersistedLayers() {
+ viewModelScope.launch(dispatchers.io) {
+ try {
+ val layersDir = File(application.filesDir, "map_layers")
+ if (layersDir.exists() && layersDir.isDirectory) {
+ val persistedLayerFiles = layersDir.listFiles()
+
+ if (persistedLayerFiles != null) {
+ val hiddenLayerUrls = googleMapsPrefs.hiddenLayerUrls.value
+ val loadedItems =
+ persistedLayerFiles.mapNotNull { file ->
+ if (file.isFile) {
+ val layerType =
+ when (file.extension.lowercase()) {
+ "kml",
+ "kmz",
+ -> LayerType.KML
+ "geojson",
+ "json",
+ -> LayerType.GEOJSON
+ else -> null
+ }
+
+ layerType?.let {
+ val uri = Uri.fromFile(file)
+ MapLayerItem(
+ name = file.nameWithoutExtension,
+ uri = uri,
+ isVisible = !hiddenLayerUrls.contains(uri.toString()),
+ layerType = it,
+ )
+ }
+ } else {
+ null
+ }
+ }
+
+ val networkItems =
+ googleMapsPrefs.networkMapLayers.value.mapNotNull { networkString ->
+ try {
+ val parts = networkString.split("|:|")
+ if (parts.size == 3) {
+ val id = parts[0]
+ val name = parts[1]
+ val uri = Uri.parse(parts[2])
+ MapLayerItem(
+ id = id,
+ name = name,
+ uri = uri,
+ isVisible = !hiddenLayerUrls.contains(uri.toString()),
+ layerType = LayerType.KML,
+ isNetwork = true,
+ )
+ } else {
+ null
+ }
+ } catch (e: Exception) {
+ null
+ }
+ }
+
+ _mapLayers.value = loadedItems + networkItems
+ if (_mapLayers.value.isNotEmpty()) {
+ Logger.withTag("MapViewModel").i("Loaded ${_mapLayers.value.size} persisted map layers.")
+ }
+ }
+ } else {
+ Logger.withTag("MapViewModel").i("Map layers directory does not exist. No layers loaded.")
+ }
+ } catch (e: Exception) {
+ Logger.withTag("MapViewModel").e(e) { "Error loading persisted map layers" }
+ _mapLayers.value = emptyList()
+ }
+ }
+ }
+
+ fun addMapLayer(uri: Uri, fileName: String?) {
+ viewModelScope.launch {
+ val layerName = fileName?.substringBeforeLast('.') ?: "Layer ${mapLayers.value.size + 1}"
+
+ val extension =
+ fileName?.substringAfterLast('.', "")?.lowercase()
+ ?: application.contentResolver.getType(uri)?.split('/')?.last()
+
+ val kmlExtensions = listOf("kml", "kmz", "vnd.google-earth.kml+xml", "vnd.google-earth.kmz")
+ val geoJsonExtensions = listOf("geojson", "json")
+
+ val layerType =
+ when (extension) {
+ in kmlExtensions -> LayerType.KML
+ in geoJsonExtensions -> LayerType.GEOJSON
+ else -> null
+ }
+
+ if (layerType == null) {
+ Logger.withTag("MapViewModel").e("Unsupported map layer file type: $extension")
+ return@launch
+ }
+
+ val finalFileName =
+ if (fileName != null) {
+ "$layerName.$extension"
+ } else {
+ "layer_${Uuid.random()}.$extension"
+ }
+
+ val localFileUri = copyFileToInternalStorage(uri, finalFileName)
+
+ if (localFileUri != null) {
+ val newItem = MapLayerItem(name = layerName, uri = localFileUri, layerType = layerType)
+ _mapLayers.value = _mapLayers.value + newItem
+ } else {
+ Logger.withTag("MapViewModel").e("Failed to copy file to internal storage.")
+ }
+ }
+ }
+
+ fun addNetworkMapLayer(name: String, url: String) {
+ viewModelScope.launch {
+ if (name.isBlank() || url.isBlank()) {
+ _errorFlow.emit("Invalid name or URL for network layer.")
+ return@launch
+ }
+ try {
+ val uri = Uri.parse(url)
+ if (uri.scheme != "http" && uri.scheme != "https") {
+ _errorFlow.emit("URL must be http or https.")
+ return@launch
+ }
+
+ val path = uri.path?.lowercase() ?: ""
+ val layerType =
+ when {
+ path.endsWith(".geojson") || path.endsWith(".json") -> LayerType.GEOJSON
+ else -> LayerType.KML // Default to KML
+ }
+
+ val newItem = MapLayerItem(name = name, uri = uri, layerType = layerType, isNetwork = true)
+ _mapLayers.value = _mapLayers.value + newItem
+
+ val networkLayerString = "${newItem.id}|:|${newItem.name}|:|${newItem.uri}"
+ googleMapsPrefs.setNetworkMapLayers(googleMapsPrefs.networkMapLayers.value + networkLayerString)
+ } catch (e: Exception) {
+ _errorFlow.emit("Invalid URL.")
+ }
+ }
+ }
+
+ private suspend fun copyFileToInternalStorage(uri: Uri, fileName: String): Uri? = withContext(dispatchers.io) {
+ try {
+ val inputStream = application.contentResolver.openInputStream(uri)
+ val directory = File(application.filesDir, "map_layers")
+ if (!directory.exists()) {
+ directory.mkdirs()
+ }
+ val outputFile = File(directory, fileName)
+ val outputStream = FileOutputStream(outputFile)
+
+ inputStream?.use { input -> outputStream.use { output -> input.copyTo(output) } }
+ Uri.fromFile(outputFile)
+ } catch (e: IOException) {
+ Logger.withTag("MapViewModel").e(e) { "Error copying file to internal storage" }
+ null
+ }
+ }
+
+ fun toggleLayerVisibility(layerId: String) {
+ var toggledLayer: MapLayerItem? = null
+ val updatedLayers =
+ _mapLayers.value.map {
+ if (it.id == layerId) {
+ toggledLayer = it.copy(isVisible = !it.isVisible)
+ toggledLayer
+ } else {
+ it
+ }
+ }
+ _mapLayers.value = updatedLayers
+
+ toggledLayer?.let {
+ if (it.isVisible) {
+ googleMapsPrefs.setHiddenLayerUrls(googleMapsPrefs.hiddenLayerUrls.value - it.uri.toString())
+ } else {
+ googleMapsPrefs.setHiddenLayerUrls(googleMapsPrefs.hiddenLayerUrls.value + it.uri.toString())
+ }
+ }
+ }
+
+ fun removeMapLayer(layerId: String) {
+ viewModelScope.launch {
+ val layerToRemove = _mapLayers.value.find { it.id == layerId }
+ layerToRemove?.uri?.let { uri ->
+ if (layerToRemove.isNetwork) {
+ googleMapsPrefs.setNetworkMapLayers(
+ googleMapsPrefs.networkMapLayers.value.filterNot { it.startsWith("$layerId|:|") }.toSet(),
+ )
+ } else {
+ deleteFileToInternalStorage(uri)
+ }
+ googleMapsPrefs.setHiddenLayerUrls(googleMapsPrefs.hiddenLayerUrls.value - uri.toString())
+ }
+ _mapLayers.value = _mapLayers.value.filterNot { it.id == layerId }
+ }
+ }
+
+ fun refreshMapLayer(layerId: String) {
+ viewModelScope.launch {
+ _mapLayers.update { layers -> layers.map { if (it.id == layerId) it.copy(isRefreshing = true) else it } }
+ // By resetting the layer data in the UI (implied by just refreshing),
+ // we trigger a reload in the Composable.
+ _mapLayers.update { layers -> layers.map { if (it.id == layerId) it.copy(isRefreshing = false) else it } }
+ }
+ }
+
+ fun refreshAllVisibleNetworkLayers() {
+ _mapLayers.value.filter { it.isNetwork && it.isVisible }.forEach { refreshMapLayer(it.id) }
+ }
+
+ private suspend fun deleteFileToInternalStorage(uri: Uri) {
+ withContext(dispatchers.io) {
+ try {
+ val file = uri.toFile()
+ if (file.exists()) {
+ file.delete()
+ }
+ } catch (e: Exception) {
+ Logger.withTag("MapViewModel").e(e) { "Error deleting file from internal storage" }
+ }
+ }
+ }
+
+ @Suppress("Recycle")
+ suspend fun getInputStreamFromUri(layerItem: MapLayerItem): InputStream? {
+ val uriToLoad = layerItem.uri ?: return null
+ return withContext(dispatchers.io) {
+ try {
+ if (layerItem.isNetwork && (uriToLoad.scheme == "http" || uriToLoad.scheme == "https")) {
+ val response = httpClient.get(uriToLoad.toString())
+ if (!response.status.isSuccess()) {
+ Logger.withTag("MapViewModel").e { "HTTP ${response.status} fetching layer: $uriToLoad" }
+ return@withContext null
+ }
+ response.bodyAsChannel().toInputStream()
+ } else {
+ application.contentResolver.openInputStream(uriToLoad)
+ }
+ } catch (e: Exception) {
+ Logger.withTag("MapViewModel").e(e) { "Error opening InputStream from URI: $uriToLoad" }
+ null
+ }
+ }
+ }
+
+ override fun onCleared() {
+ super.onCleared()
+ (currentTileProvider as? MBTilesProvider)?.close()
+ }
+
+ override fun getUser(userId: String?) =
+ nodeRepository.getUser(userId ?: org.meshtastic.core.model.DataPacket.ID_BROADCAST)
+}
+
+enum class LayerType {
+ KML,
+ GEOJSON,
+}
+
+data class MapLayerItem(
+ val id: String = Uuid.random().toString(),
+ val name: String,
+ val uri: Uri? = null,
+ val isVisible: Boolean = true,
+ val layerType: LayerType,
+ val isNetwork: Boolean = false,
+ val isRefreshing: Boolean = false,
+)
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/ClusterItemsListDialog.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/ClusterItemsListDialog.kt
new file mode 100644
index 000000000..5c5e325ac
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/ClusterItemsListDialog.kt
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
+import androidx.compose.material3.AlertDialog
+import androidx.compose.material3.ListItem
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.app.map.model.NodeClusterItem
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.nodes_at_this_location
+import org.meshtastic.core.resources.okay
+import org.meshtastic.core.ui.component.NodeChip
+
+@Composable
+fun ClusterItemsListDialog(
+ items: List,
+ onDismiss: () -> Unit,
+ onItemClick: (NodeClusterItem) -> Unit,
+) {
+ AlertDialog(
+ onDismissRequest = onDismiss,
+ title = { Text(text = stringResource(Res.string.nodes_at_this_location)) },
+ text = {
+ // Use a LazyColumn for potentially long lists of items
+ LazyColumn(contentPadding = PaddingValues(vertical = 8.dp)) {
+ items(items, key = { it.node.num }) { item ->
+ ClusterDialogListItem(item = item, onClick = { onItemClick(item) })
+ }
+ }
+ },
+ confirmButton = { TextButton(onClick = onDismiss) { Text(stringResource(Res.string.okay)) } },
+ )
+}
+
+@Composable
+private fun ClusterDialogListItem(item: NodeClusterItem, onClick: () -> Unit, modifier: Modifier = Modifier) {
+ ListItem(
+ leadingContent = { NodeChip(node = item.node) },
+ headlineContent = { Text(item.nodeTitle) },
+ supportingContent = {
+ if (item.nodeSnippet.isNotBlank()) {
+ Text(item.nodeSnippet)
+ }
+ },
+ modifier =
+ modifier
+ .fillMaxWidth()
+ .clickable(onClick = onClick)
+ .padding(horizontal = 8.dp, vertical = 4.dp), // Add some padding around list items
+ )
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/CustomMapLayersSheet.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/CustomMapLayersSheet.kt
new file mode 100644
index 000000000..fd9272579
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/CustomMapLayersSheet.kt
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
+import androidx.compose.material3.Button
+import androidx.compose.material3.CircularProgressIndicator
+import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.HorizontalDivider
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.IconToggleButton
+import androidx.compose.material3.ListItem
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.OutlinedTextField
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.app.map.MapLayerItem
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.add_layer
+import org.meshtastic.core.resources.add_network_layer
+import org.meshtastic.core.resources.cancel
+import org.meshtastic.core.resources.hide_layer
+import org.meshtastic.core.resources.manage_map_layers
+import org.meshtastic.core.resources.map_layer_formats
+import org.meshtastic.core.resources.name
+import org.meshtastic.core.resources.network_layer_url_hint
+import org.meshtastic.core.resources.no_map_layers_loaded
+import org.meshtastic.core.resources.refresh
+import org.meshtastic.core.resources.remove_layer
+import org.meshtastic.core.resources.save
+import org.meshtastic.core.resources.show_layer
+import org.meshtastic.core.resources.url
+import org.meshtastic.core.ui.component.MeshtasticDialog
+import org.meshtastic.core.ui.icon.Delete
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+import org.meshtastic.core.ui.icon.Refresh
+import org.meshtastic.core.ui.icon.Visibility
+import org.meshtastic.core.ui.icon.VisibilityOff
+
+@Suppress("LongMethod")
+@Composable
+@OptIn(ExperimentalMaterial3Api::class)
+fun CustomMapLayersSheet(
+ mapLayers: List,
+ onToggleVisibility: (String) -> Unit,
+ onRemoveLayer: (String) -> Unit,
+ onAddLayerClicked: () -> Unit,
+ onRefreshLayer: (String) -> Unit,
+ onAddNetworkLayer: (String, String) -> Unit,
+) {
+ var showAddNetworkLayerDialog by remember { mutableStateOf(false) }
+ LazyColumn(contentPadding = PaddingValues(bottom = 16.dp)) {
+ item {
+ Text(
+ modifier = Modifier.padding(16.dp),
+ text = stringResource(Res.string.manage_map_layers),
+ style = MaterialTheme.typography.headlineSmall,
+ )
+ HorizontalDivider()
+ }
+ item {
+ Text(
+ modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 8.dp, bottom = 0.dp),
+ text = stringResource(Res.string.map_layer_formats),
+ style = MaterialTheme.typography.bodySmall,
+ )
+ }
+
+ if (mapLayers.isEmpty()) {
+ item {
+ Text(
+ modifier = Modifier.padding(16.dp),
+ text = stringResource(Res.string.no_map_layers_loaded),
+ style = MaterialTheme.typography.bodyMedium,
+ )
+ }
+ } else {
+ items(mapLayers, key = { it.id }) { layer ->
+ ListItem(
+ headlineContent = { Text(layer.name) },
+ trailingContent = {
+ Row(verticalAlignment = Alignment.CenterVertically) {
+ if (layer.isNetwork) {
+ if (layer.isRefreshing) {
+ CircularProgressIndicator(
+ modifier = Modifier.size(24.dp).padding(4.dp),
+ strokeWidth = 2.dp,
+ )
+ } else {
+ IconButton(onClick = { onRefreshLayer(layer.id) }) {
+ Icon(
+ imageVector = MeshtasticIcons.Refresh,
+ contentDescription = stringResource(Res.string.refresh),
+ )
+ }
+ }
+ }
+ IconToggleButton(
+ checked = layer.isVisible,
+ onCheckedChange = { onToggleVisibility(layer.id) },
+ ) {
+ Icon(
+ imageVector =
+ if (layer.isVisible) {
+ MeshtasticIcons.Visibility
+ } else {
+ MeshtasticIcons.VisibilityOff
+ },
+ contentDescription =
+ stringResource(
+ if (layer.isVisible) {
+ Res.string.hide_layer
+ } else {
+ Res.string.show_layer
+ },
+ ),
+ )
+ }
+ IconButton(onClick = { onRemoveLayer(layer.id) }) {
+ Icon(
+ imageVector = MeshtasticIcons.Delete,
+ contentDescription = stringResource(Res.string.remove_layer),
+ )
+ }
+ }
+ },
+ )
+ HorizontalDivider()
+ }
+ }
+ item {
+ Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
+ Button(modifier = Modifier.fillMaxWidth(), onClick = onAddLayerClicked) {
+ Text(stringResource(Res.string.add_layer))
+ }
+ Button(modifier = Modifier.fillMaxWidth(), onClick = { showAddNetworkLayerDialog = true }) {
+ Text(stringResource(Res.string.add_network_layer))
+ }
+ }
+ }
+ }
+
+ if (showAddNetworkLayerDialog) {
+ AddNetworkLayerDialog(
+ onDismiss = { showAddNetworkLayerDialog = false },
+ onConfirm = { name, url ->
+ onAddNetworkLayer(name, url)
+ showAddNetworkLayerDialog = false
+ },
+ )
+ }
+}
+
+@Composable
+fun AddNetworkLayerDialog(onDismiss: () -> Unit, onConfirm: (String, String) -> Unit) {
+ var name by remember { mutableStateOf("") }
+ var url by remember { mutableStateOf("") }
+
+ MeshtasticDialog(
+ onDismiss = onDismiss,
+ title = stringResource(Res.string.add_network_layer),
+ text = {
+ Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
+ OutlinedTextField(
+ value = name,
+ onValueChange = { name = it },
+ label = { Text(stringResource(Res.string.name)) },
+ singleLine = true,
+ modifier = Modifier.fillMaxWidth(),
+ )
+ OutlinedTextField(
+ value = url,
+ onValueChange = { url = it },
+ label = { Text(stringResource(Res.string.url)) },
+ placeholder = { Text(stringResource(Res.string.network_layer_url_hint)) },
+ singleLine = true,
+ modifier = Modifier.fillMaxWidth(),
+ )
+ }
+ },
+ onConfirm = { onConfirm(name, url) },
+ confirmTextRes = Res.string.save,
+ dismissTextRes = Res.string.cancel,
+ )
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/CustomTileProviderManagerSheet.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/CustomTileProviderManagerSheet.kt
new file mode 100644
index 000000000..8082e40d1
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/CustomTileProviderManagerSheet.kt
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import android.content.Intent
+import androidx.activity.compose.rememberLauncherForActivityResult
+import androidx.activity.result.contract.ActivityResultContracts
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
+import androidx.compose.material3.Button
+import androidx.compose.material3.HorizontalDivider
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.ListItem
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.OutlinedTextField
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.unit.dp
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import kotlinx.coroutines.flow.collectLatest
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.app.map.MapViewModel
+import org.meshtastic.app.map.model.CustomTileProviderConfig
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.add_custom_tile_source
+import org.meshtastic.core.resources.add_local_mbtiles_file
+import org.meshtastic.core.resources.cancel
+import org.meshtastic.core.resources.delete_custom_tile_source
+import org.meshtastic.core.resources.edit_custom_tile_source
+import org.meshtastic.core.resources.local_mbtiles_file
+import org.meshtastic.core.resources.manage_custom_tile_sources
+import org.meshtastic.core.resources.name
+import org.meshtastic.core.resources.name_cannot_be_empty
+import org.meshtastic.core.resources.no_custom_tile_sources_found
+import org.meshtastic.core.resources.provider_name_exists
+import org.meshtastic.core.resources.save
+import org.meshtastic.core.resources.url_cannot_be_empty
+import org.meshtastic.core.resources.url_must_contain_placeholders
+import org.meshtastic.core.resources.url_template
+import org.meshtastic.core.resources.url_template_hint
+import org.meshtastic.core.ui.component.MeshtasticDialog
+import org.meshtastic.core.ui.icon.Delete
+import org.meshtastic.core.ui.icon.Edit
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+import org.meshtastic.core.ui.util.showToast
+
+@Suppress("LongMethod")
+@Composable
+fun CustomTileProviderManagerSheet(mapViewModel: MapViewModel) {
+ val customTileProviders by mapViewModel.customTileProviderConfigs.collectAsStateWithLifecycle()
+ var editingConfig by remember { mutableStateOf(null) }
+ var showEditDialog by remember { mutableStateOf(false) }
+ val context = LocalContext.current
+
+ val mbtilesPickerLauncher =
+ rememberLauncherForActivityResult(contract = ActivityResultContracts.StartActivityForResult()) { result ->
+ if (result.resultCode == android.app.Activity.RESULT_OK) {
+ result.data?.data?.let { uri ->
+ val fileName = uri.getFileName(context)
+ val baseName = fileName.substringBeforeLast('.')
+ mapViewModel.addCustomTileProvider(
+ name = baseName,
+ urlTemplate = "", // Empty for local
+ localUri = uri.toString(),
+ )
+ }
+ }
+ }
+
+ LaunchedEffect(Unit) { mapViewModel.errorFlow.collectLatest { errorMessage -> context.showToast(errorMessage) } }
+
+ if (showEditDialog) {
+ AddEditCustomTileProviderDialog(
+ config = editingConfig,
+ onDismiss = { showEditDialog = false },
+ onSave = { name, url ->
+ if (editingConfig == null) { // Adding new
+ mapViewModel.addCustomTileProvider(name, url)
+ } else { // Editing existing
+ mapViewModel.updateCustomTileProvider(editingConfig!!.copy(name = name, urlTemplate = url))
+ }
+ showEditDialog = false
+ },
+ mapViewModel = mapViewModel,
+ )
+ }
+
+ LazyColumn(contentPadding = PaddingValues(bottom = 16.dp)) {
+ item {
+ Text(
+ text = stringResource(Res.string.manage_custom_tile_sources),
+ style = MaterialTheme.typography.headlineSmall,
+ modifier = Modifier.padding(16.dp),
+ )
+ HorizontalDivider()
+ }
+
+ if (customTileProviders.isEmpty()) {
+ item {
+ Text(
+ text = stringResource(Res.string.no_custom_tile_sources_found),
+ modifier = Modifier.padding(16.dp),
+ style = MaterialTheme.typography.bodyMedium,
+ )
+ }
+ } else {
+ items(customTileProviders, key = { it.id }) { config ->
+ ListItem(
+ headlineContent = { Text(config.name) },
+ supportingContent = {
+ if (config.isLocal) {
+ Text(
+ stringResource(Res.string.local_mbtiles_file),
+ style = MaterialTheme.typography.bodySmall,
+ )
+ } else {
+ Text(config.urlTemplate, style = MaterialTheme.typography.bodySmall)
+ }
+ },
+ trailingContent = {
+ Row {
+ IconButton(
+ onClick = {
+ editingConfig = config
+ showEditDialog = true
+ },
+ ) {
+ Icon(
+ MeshtasticIcons.Edit,
+ contentDescription = stringResource(Res.string.edit_custom_tile_source),
+ )
+ }
+ IconButton(onClick = { mapViewModel.removeCustomTileProvider(config.id) }) {
+ Icon(
+ MeshtasticIcons.Delete,
+ contentDescription = stringResource(Res.string.delete_custom_tile_source),
+ )
+ }
+ }
+ },
+ )
+ HorizontalDivider()
+ }
+ }
+
+ item {
+ Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
+ Button(
+ onClick = {
+ editingConfig = null
+ showEditDialog = true
+ },
+ modifier = Modifier.fillMaxWidth(),
+ ) {
+ Text(stringResource(Res.string.add_custom_tile_source))
+ }
+
+ Button(
+ onClick = {
+ val intent =
+ Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
+ addCategory(Intent.CATEGORY_OPENABLE)
+ type = "*/*"
+ }
+ mbtilesPickerLauncher.launch(intent)
+ },
+ modifier = Modifier.fillMaxWidth(),
+ ) {
+ Text(stringResource(Res.string.add_local_mbtiles_file))
+ }
+ }
+ }
+ }
+}
+
+@Suppress("LongMethod")
+@Composable
+private fun AddEditCustomTileProviderDialog(
+ config: CustomTileProviderConfig?,
+ onDismiss: () -> Unit,
+ onSave: (String, String) -> Unit,
+ mapViewModel: MapViewModel,
+) {
+ var name by rememberSaveable { mutableStateOf(config?.name ?: "") }
+ var url by rememberSaveable { mutableStateOf(config?.urlTemplate ?: "") }
+ var nameError by remember { mutableStateOf(null) }
+ var urlError by remember { mutableStateOf(null) }
+ val customTileProviders by mapViewModel.customTileProviderConfigs.collectAsStateWithLifecycle()
+
+ val emptyNameError = stringResource(Res.string.name_cannot_be_empty)
+ val providerNameExistsError = stringResource(Res.string.provider_name_exists)
+ val urlCannotBeEmptyError = stringResource(Res.string.url_cannot_be_empty)
+ val urlMustContainPlaceholdersError = stringResource(Res.string.url_must_contain_placeholders)
+
+ fun validateAndSave() {
+ val currentNameError =
+ validateName(name, customTileProviders, config?.id, emptyNameError, providerNameExistsError)
+ val currentUrlError = validateUrl(url, urlCannotBeEmptyError, urlMustContainPlaceholdersError)
+
+ nameError = currentNameError
+ urlError = currentUrlError
+
+ if (currentNameError == null && currentUrlError == null) {
+ onSave(name, url)
+ }
+ }
+
+ MeshtasticDialog(
+ onDismiss = onDismiss,
+ title =
+ if (config == null) {
+ stringResource(Res.string.add_custom_tile_source)
+ } else {
+ stringResource(Res.string.edit_custom_tile_source)
+ },
+ text = {
+ Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
+ OutlinedTextField(
+ value = name,
+ onValueChange = {
+ name = it
+ nameError = null
+ },
+ label = { Text(stringResource(Res.string.name)) },
+ isError = nameError != null,
+ supportingText = { nameError?.let { Text(it) } },
+ singleLine = true,
+ )
+ OutlinedTextField(
+ value = url,
+ onValueChange = {
+ url = it
+ urlError = null
+ },
+ label = { Text(stringResource(Res.string.url_template)) },
+ isError = urlError != null,
+ supportingText = {
+ if (urlError != null) {
+ Text(urlError!!)
+ } else {
+ Text(stringResource(Res.string.url_template_hint))
+ }
+ },
+ singleLine = false,
+ maxLines = 2,
+ )
+ }
+ },
+ onConfirm = { validateAndSave() },
+ confirmTextRes = Res.string.save,
+ dismissTextRes = Res.string.cancel,
+ )
+}
+
+private fun validateName(
+ name: String,
+ providers: List,
+ currentId: String?,
+ emptyNameError: String,
+ nameExistsError: String,
+): String? = if (name.isBlank()) {
+ emptyNameError
+} else if (providers.any { it.name.equals(name, ignoreCase = true) && it.id != currentId }) {
+ nameExistsError
+} else {
+ null
+}
+
+private fun validateUrl(url: String, emptyUrlError: String, mustContainPlaceholdersError: String): String? =
+ if (url.isBlank()) {
+ emptyUrlError
+ } else if (
+ !url.contains("{z}", ignoreCase = true) ||
+ !url.contains("{x}", ignoreCase = true) ||
+ !url.contains("{y}", ignoreCase = true)
+ ) {
+ mustContainPlaceholdersError
+ } else {
+ null
+ }
+
+private fun android.net.Uri.getFileName(context: android.content.Context): String {
+ var name = this.lastPathSegment ?: "mbtiles_file"
+ if (this.scheme == "content") {
+ context.contentResolver.query(this, null, null, null, null)?.use { cursor ->
+ if (cursor.moveToFirst()) {
+ val displayNameIndex = cursor.getColumnIndex(android.provider.OpenableColumns.DISPLAY_NAME)
+ if (displayNameIndex != -1) {
+ name = cursor.getString(displayNameIndex)
+ }
+ }
+ }
+ }
+ return name
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt
new file mode 100644
index 000000000..18eb0ac83
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt
@@ -0,0 +1,375 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import android.app.DatePickerDialog
+import android.app.TimePickerDialog
+import android.widget.DatePicker
+import android.widget.TimePicker
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.shape.CircleShape
+import androidx.compose.foundation.text.KeyboardActions
+import androidx.compose.foundation.text.KeyboardOptions
+import androidx.compose.material3.AlertDialog
+import androidx.compose.material3.Button
+import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.OutlinedTextField
+import androidx.compose.material3.Switch
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.input.ImeAction
+import androidx.compose.ui.text.input.KeyboardType
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import kotlinx.datetime.LocalDate
+import kotlinx.datetime.Month
+import kotlinx.datetime.atTime
+import kotlinx.datetime.number
+import kotlinx.datetime.toInstant
+import kotlinx.datetime.toLocalDateTime
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.core.common.util.systemTimeZone
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.cancel
+import org.meshtastic.core.resources.date
+import org.meshtastic.core.resources.delete
+import org.meshtastic.core.resources.description
+import org.meshtastic.core.resources.expires
+import org.meshtastic.core.resources.locked
+import org.meshtastic.core.resources.name
+import org.meshtastic.core.resources.send
+import org.meshtastic.core.resources.time
+import org.meshtastic.core.resources.waypoint_edit
+import org.meshtastic.core.resources.waypoint_new
+import org.meshtastic.core.ui.emoji.EmojiPickerDialog
+import org.meshtastic.core.ui.icon.CalendarMonth
+import org.meshtastic.core.ui.icon.Lock
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+import org.meshtastic.proto.Waypoint
+import kotlin.time.Duration.Companion.hours
+
+@OptIn(ExperimentalMaterial3Api::class)
+@Suppress("LongMethod", "CyclomaticComplexMethod", "MagicNumber")
+@Composable
+fun EditWaypointDialog(
+ waypoint: Waypoint,
+ onSendClicked: (Waypoint) -> Unit,
+ onDeleteClicked: (Waypoint) -> Unit,
+ onDismissRequest: () -> Unit,
+ modifier: Modifier = Modifier,
+) {
+ var waypointInput by remember { mutableStateOf(waypoint) }
+ val title = if (waypoint.id == 0) Res.string.waypoint_new else Res.string.waypoint_edit
+ val defaultEmoji = 0x1F4CD // 📍 Round Pushpin
+ val currentEmojiCodepoint = if ((waypointInput.icon ?: 0) == 0) defaultEmoji else waypointInput.icon!!
+ var showEmojiPickerView by remember { mutableStateOf(false) }
+
+ val context = LocalContext.current
+ val tz = systemTimeZone
+
+ // Initialize date and time states from waypointInput.expire
+ var selectedDateString by remember { mutableStateOf("") }
+ var selectedTimeString by remember { mutableStateOf("") }
+ var isExpiryEnabled by remember {
+ mutableStateOf((waypointInput.expire ?: 0) != 0 && waypointInput.expire != Int.MAX_VALUE)
+ }
+
+ val dateFormat = remember { android.text.format.DateFormat.getDateFormat(context) }
+ val timeFormat = remember { android.text.format.DateFormat.getTimeFormat(context) }
+ dateFormat.timeZone = java.util.TimeZone.getDefault()
+ timeFormat.timeZone = java.util.TimeZone.getDefault()
+
+ LaunchedEffect(waypointInput.expire, isExpiryEnabled) {
+ val expireValue = waypointInput.expire ?: 0
+ if (isExpiryEnabled) {
+ if (expireValue != 0 && expireValue != Int.MAX_VALUE) {
+ val instant = kotlin.time.Instant.fromEpochSeconds(expireValue.toLong())
+ val date = java.util.Date(instant.toEpochMilliseconds())
+ selectedDateString = dateFormat.format(date)
+ selectedTimeString = timeFormat.format(date)
+ } else { // If enabled but not set, default to 8 hours from now
+ val futureInstant = kotlin.time.Clock.System.now() + 8.hours
+ val date = java.util.Date(futureInstant.toEpochMilliseconds())
+ selectedDateString = dateFormat.format(date)
+ selectedTimeString = timeFormat.format(date)
+ waypointInput = waypointInput.copy(expire = futureInstant.epochSeconds.toInt())
+ }
+ } else {
+ selectedDateString = ""
+ selectedTimeString = ""
+ }
+ }
+
+ if (!showEmojiPickerView) {
+ AlertDialog(
+ onDismissRequest = onDismissRequest,
+ title = {
+ Text(
+ text = stringResource(title),
+ style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold),
+ textAlign = TextAlign.Center,
+ modifier = Modifier.fillMaxWidth(),
+ )
+ },
+ text = {
+ Column(modifier = modifier.fillMaxWidth()) {
+ OutlinedTextField(
+ value = waypointInput.name ?: "",
+ onValueChange = { waypointInput = waypointInput.copy(name = it.take(29)) },
+ label = { Text(stringResource(Res.string.name)) },
+ singleLine = true,
+ keyboardOptions =
+ KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text, imeAction = ImeAction.Next),
+ modifier = Modifier.fillMaxWidth(),
+ trailingIcon = {
+ IconButton(onClick = { showEmojiPickerView = true }) {
+ Text(
+ text = String(Character.toChars(currentEmojiCodepoint)),
+ modifier =
+ Modifier.background(MaterialTheme.colorScheme.surfaceVariant, CircleShape)
+ .padding(6.dp),
+ fontSize = 20.sp,
+ )
+ }
+ },
+ )
+ Spacer(modifier = Modifier.size(8.dp))
+ OutlinedTextField(
+ value = waypointInput.description ?: "",
+ onValueChange = { waypointInput = waypointInput.copy(description = it.take(99)) },
+ label = { Text(stringResource(Res.string.description)) },
+ keyboardOptions =
+ KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text, imeAction = ImeAction.Done),
+ keyboardActions = KeyboardActions(onDone = { /* Handle next/done focus */ }),
+ modifier = Modifier.fillMaxWidth(),
+ minLines = 2,
+ maxLines = 3,
+ )
+ Spacer(modifier = Modifier.size(8.dp))
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ verticalAlignment = Alignment.CenterVertically,
+ horizontalArrangement = Arrangement.SpaceBetween,
+ ) {
+ Row(verticalAlignment = Alignment.CenterVertically) {
+ Image(
+ imageVector = MeshtasticIcons.Lock,
+ contentDescription = stringResource(Res.string.locked),
+ )
+ Spacer(modifier = Modifier.width(8.dp))
+ Text(stringResource(Res.string.locked))
+ }
+ Switch(
+ checked = (waypointInput.locked_to ?: 0) != 0,
+ onCheckedChange = { waypointInput = waypointInput.copy(locked_to = if (it) 1 else 0) },
+ )
+ }
+ Spacer(modifier = Modifier.size(8.dp))
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ verticalAlignment = Alignment.CenterVertically,
+ horizontalArrangement = Arrangement.SpaceBetween,
+ ) {
+ Row(verticalAlignment = Alignment.CenterVertically) {
+ Image(
+ imageVector = MeshtasticIcons.CalendarMonth,
+ contentDescription = stringResource(Res.string.expires),
+ )
+ Spacer(modifier = Modifier.width(8.dp))
+ Text(stringResource(Res.string.expires))
+ }
+ Switch(
+ checked = isExpiryEnabled,
+ onCheckedChange = { checked ->
+ isExpiryEnabled = checked
+ if (checked) {
+ val expireValue = waypointInput.expire ?: 0
+ // Default to 8 hours from now if not already set
+ if (expireValue == 0 || expireValue == Int.MAX_VALUE) {
+ val futureInstant = kotlin.time.Clock.System.now() + 8.hours
+ waypointInput = waypointInput.copy(expire = futureInstant.epochSeconds.toInt())
+ }
+ } else {
+ waypointInput = waypointInput.copy(expire = Int.MAX_VALUE)
+ }
+ },
+ )
+ }
+
+ if (isExpiryEnabled) {
+ val currentInstant =
+ (waypointInput.expire ?: 0).let {
+ if (it != 0 && it != Int.MAX_VALUE) {
+ kotlin.time.Instant.fromEpochSeconds(it.toLong())
+ } else {
+ kotlin.time.Clock.System.now() + 8.hours
+ }
+ }
+ val ldt = currentInstant.toLocalDateTime(tz)
+
+ val datePickerDialog =
+ DatePickerDialog(
+ context,
+ { _: DatePicker, selectedYear: Int, selectedMonth: Int, selectedDay: Int ->
+ val currentLdt =
+ (waypointInput.expire ?: 0)
+ .let {
+ if (it != 0 && it != Int.MAX_VALUE) {
+ kotlin.time.Instant.fromEpochSeconds(it.toLong())
+ } else {
+ kotlin.time.Clock.System.now() + 8.hours
+ }
+ }
+ .toLocalDateTime(tz)
+
+ val newLdt =
+ LocalDate(
+ year = selectedYear,
+ month = Month(selectedMonth + 1),
+ day = selectedDay,
+ )
+ .atTime(
+ hour = currentLdt.hour,
+ minute = currentLdt.minute,
+ second = currentLdt.second,
+ nanosecond = currentLdt.nanosecond,
+ )
+ waypointInput =
+ waypointInput.copy(expire = newLdt.toInstant(tz).epochSeconds.toInt())
+ },
+ ldt.year,
+ ldt.month.number - 1,
+ ldt.day,
+ )
+
+ val timePickerDialog =
+ TimePickerDialog(
+ context,
+ { _: TimePicker, selectedHour: Int, selectedMinute: Int ->
+ val currentLdt =
+ (waypointInput.expire ?: 0)
+ .let {
+ if (it != 0 && it != Int.MAX_VALUE) {
+ kotlin.time.Instant.fromEpochSeconds(it.toLong())
+ } else {
+ kotlin.time.Clock.System.now() + 8.hours
+ }
+ }
+ .toLocalDateTime(tz)
+
+ val newLdt =
+ LocalDate(
+ year = currentLdt.year,
+ month = currentLdt.month,
+ day = currentLdt.day,
+ )
+ .atTime(
+ hour = selectedHour,
+ minute = selectedMinute,
+ second = currentLdt.second,
+ nanosecond = currentLdt.nanosecond,
+ )
+ waypointInput =
+ waypointInput.copy(expire = newLdt.toInstant(tz).epochSeconds.toInt())
+ },
+ ldt.hour,
+ ldt.minute,
+ android.text.format.DateFormat.is24HourFormat(context),
+ )
+ Spacer(modifier = Modifier.size(8.dp))
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.SpaceEvenly,
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Button(onClick = { datePickerDialog.show() }) { Text(stringResource(Res.string.date)) }
+ Text(
+ modifier = Modifier.padding(top = 4.dp),
+ text = selectedDateString,
+ style = MaterialTheme.typography.bodyMedium,
+ )
+ }
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Button(onClick = { timePickerDialog.show() }) { Text(stringResource(Res.string.time)) }
+ Text(
+ modifier = Modifier.padding(top = 4.dp),
+ text = selectedTimeString,
+ style = MaterialTheme.typography.bodyMedium,
+ )
+ }
+ }
+ }
+ }
+ },
+ confirmButton = {
+ Row(
+ modifier = Modifier.fillMaxWidth().padding(start = 8.dp, end = 8.dp, bottom = 8.dp),
+ horizontalArrangement = Arrangement.End,
+ ) {
+ if (waypoint.id != 0) {
+ TextButton(
+ onClick = { onDeleteClicked(waypointInput) },
+ modifier = Modifier.padding(end = 8.dp),
+ ) {
+ Text(stringResource(Res.string.delete), color = MaterialTheme.colorScheme.error)
+ }
+ }
+ Spacer(modifier = Modifier.weight(1f)) // Pushes delete to left and cancel/send to right
+ TextButton(onClick = onDismissRequest, modifier = Modifier.padding(end = 8.dp)) {
+ Text(stringResource(Res.string.cancel))
+ }
+ Button(
+ onClick = { onSendClicked(waypointInput) },
+ enabled = (waypointInput.name ?: "").isNotBlank(),
+ ) {
+ Text(stringResource(Res.string.send))
+ }
+ }
+ },
+ dismissButton = null, // Using custom buttons in confirmButton Row
+ modifier = modifier,
+ )
+ } else {
+ EmojiPickerDialog(onDismiss = { showEmojiPickerView = false }) { selectedEmoji ->
+ showEmojiPickerView = false
+ waypointInput = waypointInput.copy(icon = selectedEmoji.codePointAt(0))
+ }
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/MapFilterDropdown.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/MapFilterDropdown.kt
new file mode 100644
index 000000000..d8e29120e
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/MapFilterDropdown.kt
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Checkbox
+import androidx.compose.material3.DropdownMenu
+import androidx.compose.material3.DropdownMenuItem
+import androidx.compose.material3.HorizontalDivider
+import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Slider
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableFloatStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.app.map.MapViewModel
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.last_heard_filter_label
+import org.meshtastic.core.resources.only_favorites
+import org.meshtastic.core.resources.show_precision_circle
+import org.meshtastic.core.resources.show_waypoints
+import org.meshtastic.core.ui.icon.Favorite
+import org.meshtastic.core.ui.icon.Lens
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+import org.meshtastic.core.ui.icon.PinDrop
+import org.meshtastic.feature.map.LastHeardFilter
+import kotlin.math.roundToInt
+
+@Composable
+internal fun MapFilterDropdown(expanded: Boolean, onDismissRequest: () -> Unit, mapViewModel: MapViewModel) {
+ val mapFilterState by mapViewModel.mapFilterStateFlow.collectAsStateWithLifecycle()
+ DropdownMenu(expanded = expanded, onDismissRequest = onDismissRequest) {
+ DropdownMenuItem(
+ text = { Text(stringResource(Res.string.only_favorites)) },
+ onClick = { mapViewModel.toggleOnlyFavorites() },
+ leadingIcon = {
+ Icon(
+ imageVector = MeshtasticIcons.Favorite,
+ contentDescription = stringResource(Res.string.only_favorites),
+ )
+ },
+ trailingIcon = {
+ Checkbox(
+ checked = mapFilterState.onlyFavorites,
+ onCheckedChange = { mapViewModel.toggleOnlyFavorites() },
+ )
+ },
+ )
+ DropdownMenuItem(
+ text = { Text(stringResource(Res.string.show_waypoints)) },
+ onClick = { mapViewModel.toggleShowWaypointsOnMap() },
+ leadingIcon = {
+ Icon(
+ imageVector = MeshtasticIcons.PinDrop,
+ contentDescription = stringResource(Res.string.show_waypoints),
+ )
+ },
+ trailingIcon = {
+ Checkbox(
+ checked = mapFilterState.showWaypoints,
+ onCheckedChange = { mapViewModel.toggleShowWaypointsOnMap() },
+ )
+ },
+ )
+ DropdownMenuItem(
+ text = { Text(stringResource(Res.string.show_precision_circle)) },
+ onClick = { mapViewModel.toggleShowPrecisionCircleOnMap() },
+ leadingIcon = {
+ Icon(
+ imageVector = MeshtasticIcons.Lens,
+ contentDescription = stringResource(Res.string.show_precision_circle),
+ )
+ },
+ trailingIcon = {
+ Checkbox(
+ checked = mapFilterState.showPrecisionCircle,
+ onCheckedChange = { mapViewModel.toggleShowPrecisionCircleOnMap() },
+ )
+ },
+ )
+ HorizontalDivider()
+ Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
+ val filterOptions = LastHeardFilter.entries
+ val selectedIndex = filterOptions.indexOf(mapFilterState.lastHeardFilter)
+ var sliderPosition by remember(selectedIndex) { mutableFloatStateOf(selectedIndex.toFloat()) }
+
+ Text(
+ text =
+ stringResource(
+ Res.string.last_heard_filter_label,
+ stringResource(mapFilterState.lastHeardFilter.label),
+ ),
+ style = MaterialTheme.typography.labelLarge,
+ )
+ Slider(
+ value = sliderPosition,
+ onValueChange = { sliderPosition = it },
+ onValueChangeFinished = {
+ val newIndex = sliderPosition.roundToInt().coerceIn(0, filterOptions.size - 1)
+ mapViewModel.setLastHeardFilter(filterOptions[newIndex])
+ },
+ valueRange = 0f..(filterOptions.size - 1).toFloat(),
+ steps = filterOptions.size - 2,
+ )
+ }
+ }
+}
+
+@Composable
+internal fun NodeMapFilterDropdown(expanded: Boolean, onDismissRequest: () -> Unit, mapViewModel: MapViewModel) {
+ val mapFilterState by mapViewModel.mapFilterStateFlow.collectAsStateWithLifecycle()
+ DropdownMenu(expanded = expanded, onDismissRequest = onDismissRequest) {
+ Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) {
+ val filterOptions = LastHeardFilter.entries
+ val selectedIndex = filterOptions.indexOf(mapFilterState.lastHeardTrackFilter)
+ var sliderPosition by remember(selectedIndex) { mutableFloatStateOf(selectedIndex.toFloat()) }
+
+ Text(
+ text =
+ stringResource(
+ Res.string.last_heard_filter_label,
+ stringResource(mapFilterState.lastHeardTrackFilter.label),
+ ),
+ style = MaterialTheme.typography.labelLarge,
+ )
+ Slider(
+ value = sliderPosition,
+ onValueChange = { sliderPosition = it },
+ onValueChangeFinished = {
+ val newIndex = sliderPosition.roundToInt().coerceIn(0, filterOptions.size - 1)
+ mapViewModel.setLastHeardTrackFilter(filterOptions[newIndex])
+ },
+ valueRange = 0f..(filterOptions.size - 1).toFloat(),
+ steps = filterOptions.size - 2,
+ )
+ }
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/MapTypeDropdown.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/MapTypeDropdown.kt
new file mode 100644
index 000000000..ad4bd58bb
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/MapTypeDropdown.kt
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import androidx.compose.material3.DropdownMenu
+import androidx.compose.material3.DropdownMenuItem
+import androidx.compose.material3.HorizontalDivider
+import androidx.compose.material3.Icon
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import com.google.maps.android.compose.MapType
+import org.jetbrains.compose.resources.stringResource
+import org.meshtastic.app.map.MapViewModel
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.manage_custom_tile_sources
+import org.meshtastic.core.resources.map_type_hybrid
+import org.meshtastic.core.resources.map_type_normal
+import org.meshtastic.core.resources.map_type_satellite
+import org.meshtastic.core.resources.map_type_terrain
+import org.meshtastic.core.resources.selected_map_type
+import org.meshtastic.core.ui.icon.Check
+import org.meshtastic.core.ui.icon.MeshtasticIcons
+
+@Suppress("LongMethod")
+@Composable
+internal fun MapTypeDropdown(
+ expanded: Boolean,
+ onDismissRequest: () -> Unit,
+ mapViewModel: MapViewModel,
+ onManageCustomTileProvidersClicked: () -> Unit,
+) {
+ val customTileProviders by mapViewModel.customTileProviderConfigs.collectAsStateWithLifecycle()
+ val selectedCustomUrl by mapViewModel.selectedCustomTileProviderUrl.collectAsStateWithLifecycle()
+ val selectedGoogleMapType by mapViewModel.selectedGoogleMapType.collectAsStateWithLifecycle()
+
+ val googleMapTypes =
+ listOf(
+ stringResource(Res.string.map_type_normal) to MapType.NORMAL,
+ stringResource(Res.string.map_type_satellite) to MapType.SATELLITE,
+ stringResource(Res.string.map_type_terrain) to MapType.TERRAIN,
+ stringResource(Res.string.map_type_hybrid) to MapType.HYBRID,
+ )
+
+ DropdownMenu(expanded = expanded, onDismissRequest = onDismissRequest) {
+ googleMapTypes.forEach { (name, type) ->
+ DropdownMenuItem(
+ text = { Text(name) },
+ onClick = {
+ mapViewModel.setSelectedGoogleMapType(type)
+ onDismissRequest() // Close menu
+ },
+ trailingIcon =
+ if (selectedCustomUrl == null && selectedGoogleMapType == type) {
+ {
+ Icon(
+ MeshtasticIcons.Check,
+ contentDescription = stringResource(Res.string.selected_map_type),
+ )
+ }
+ } else {
+ null
+ },
+ )
+ }
+
+ if (customTileProviders.isNotEmpty()) {
+ HorizontalDivider()
+ customTileProviders.forEach { config ->
+ DropdownMenuItem(
+ text = { Text(config.name) },
+ onClick = {
+ mapViewModel.selectCustomTileProvider(config)
+ onDismissRequest() // Close menu
+ },
+ trailingIcon =
+ if (selectedCustomUrl == config.urlTemplate) {
+ {
+ Icon(
+ MeshtasticIcons.Check,
+ contentDescription = stringResource(Res.string.selected_map_type),
+ )
+ }
+ } else {
+ null
+ },
+ )
+ }
+ }
+ HorizontalDivider()
+ DropdownMenuItem(
+ text = { Text(stringResource(Res.string.manage_custom_tile_sources)) },
+ onClick = {
+ onManageCustomTileProvidersClicked()
+ onDismissRequest()
+ },
+ )
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/NodeClusterMarkers.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/NodeClusterMarkers.kt
new file mode 100644
index 000000000..32e250475
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/NodeClusterMarkers.kt
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalView
+import androidx.lifecycle.compose.LocalLifecycleOwner
+import androidx.lifecycle.findViewTreeLifecycleOwner
+import androidx.lifecycle.setViewTreeLifecycleOwner
+import androidx.savedstate.compose.LocalSavedStateRegistryOwner
+import androidx.savedstate.findViewTreeSavedStateRegistryOwner
+import androidx.savedstate.setViewTreeSavedStateRegistryOwner
+import com.google.maps.android.clustering.Cluster
+import com.google.maps.android.clustering.view.DefaultClusterRenderer
+import com.google.maps.android.compose.Circle
+import com.google.maps.android.compose.MapsComposeExperimentalApi
+import com.google.maps.android.compose.clustering.Clustering
+import com.google.maps.android.compose.clustering.ClusteringMarkerProperties
+import org.meshtastic.app.map.model.NodeClusterItem
+import org.meshtastic.feature.map.BaseMapViewModel
+
+@OptIn(MapsComposeExperimentalApi::class)
+@Suppress("NestedBlockDepth")
+@Composable
+fun NodeClusterMarkers(
+ nodeClusterItems: List,
+ mapFilterState: BaseMapViewModel.MapFilterState,
+ navigateToNodeDetails: (Int) -> Unit,
+ onClusterClick: (Cluster) -> Boolean,
+) {
+ val view = LocalView.current
+ val lifecycleOwner = LocalLifecycleOwner.current
+ val savedStateRegistryOwner = LocalSavedStateRegistryOwner.current
+
+ // Workaround for https://github.com/googlemaps/android-maps-compose/issues/858
+ // The maps clustering library creates an internal ComposeView to snapshot markers.
+ // If that view is not attached to the hierarchy (which it often isn't during rendering),
+ // it fails to find the Lifecycle and SavedState owners. We propagate them to the root view
+ // so the internal snapshot view can find them when walking up the tree.
+ LaunchedEffect(view, lifecycleOwner, savedStateRegistryOwner) {
+ val root = view.rootView
+ if (root.findViewTreeLifecycleOwner() == null) {
+ root.setViewTreeLifecycleOwner(lifecycleOwner)
+ }
+ if (root.findViewTreeSavedStateRegistryOwner() == null) {
+ root.setViewTreeSavedStateRegistryOwner(savedStateRegistryOwner)
+ }
+ }
+
+ Clustering(
+ items = nodeClusterItems,
+ onClusterClick = onClusterClick,
+ onClusterItemInfoWindowClick = { item ->
+ navigateToNodeDetails(item.node.num)
+ false
+ },
+ clusterItemContent = { clusterItem -> PulsingNodeChip(node = clusterItem.node) },
+ onClusterManager = { clusterManager ->
+ (clusterManager.renderer as DefaultClusterRenderer).minClusterSize = 10
+ },
+ clusterItemDecoration = { clusterItem ->
+ if (mapFilterState.showPrecisionCircle) {
+ clusterItem.getPrecisionMeters()?.let { precisionMeters ->
+ if (precisionMeters > 0) {
+ Circle(
+ center = clusterItem.position,
+ radius = precisionMeters,
+ fillColor = Color(clusterItem.node.colors.second).copy(alpha = 0.2f),
+ strokeColor = Color(clusterItem.node.colors.second),
+ strokeWidth = 2f,
+ zIndex = 0f,
+ )
+ }
+ }
+ }
+ // Use the item's own priority-based zIndex (5f for My Node/Favorites, 4f for others)
+ ClusteringMarkerProperties(zIndex = clusterItem.getZIndex())
+ },
+ )
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/PulsingNodeChip.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/PulsingNodeChip.kt
new file mode 100644
index 000000000..5403b8c11
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/PulsingNodeChip.kt
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import androidx.compose.animation.core.Animatable
+import androidx.compose.animation.core.LinearEasing
+import androidx.compose.animation.core.tween
+import androidx.compose.foundation.layout.Box
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.drawWithContent
+import androidx.compose.ui.geometry.CornerRadius
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.unit.dp
+import kotlinx.coroutines.launch
+import org.meshtastic.core.common.util.nowSeconds
+import org.meshtastic.core.model.Node
+import org.meshtastic.core.ui.component.NodeChip
+
+@Composable
+fun PulsingNodeChip(node: Node, modifier: Modifier = Modifier) {
+ val animatedProgress = remember { Animatable(0f) }
+
+ LaunchedEffect(node) {
+ if ((nowSeconds - node.lastHeard) <= 5) {
+ launch {
+ animatedProgress.snapTo(0f)
+ animatedProgress.animateTo(
+ targetValue = 1f,
+ animationSpec = tween(durationMillis = 1000, easing = LinearEasing),
+ )
+ }
+ }
+ }
+
+ Box(
+ modifier =
+ modifier.drawWithContent {
+ drawContent()
+ if (animatedProgress.value > 0 && animatedProgress.value < 1f) {
+ val alpha = (1f - animatedProgress.value) * 0.3f
+ drawRoundRect(
+ size = size,
+ cornerRadius = CornerRadius(8.dp.toPx()),
+ color = Color.White.copy(alpha = alpha),
+ )
+ }
+ },
+ ) {
+ NodeChip(node = node)
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/component/WaypointMarkers.kt b/app/src/google/kotlin/org/meshtastic/app/map/component/WaypointMarkers.kt
new file mode 100644
index 000000000..61cdab9f1
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/component/WaypointMarkers.kt
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.component
+
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import com.google.android.gms.maps.model.LatLng
+import com.google.maps.android.compose.MapsComposeExperimentalApi
+import com.google.maps.android.compose.Marker
+import com.google.maps.android.compose.rememberComposeBitmapDescriptor
+import com.google.maps.android.compose.rememberUpdatedMarkerState
+import kotlinx.coroutines.launch
+import org.meshtastic.app.map.convertIntToEmoji
+import org.meshtastic.core.model.util.GeoConstants.DEG_D
+import org.meshtastic.core.resources.Res
+import org.meshtastic.core.resources.locked
+import org.meshtastic.core.ui.util.showToast
+import org.meshtastic.feature.map.BaseMapViewModel
+import org.meshtastic.proto.Waypoint
+
+@OptIn(MapsComposeExperimentalApi::class)
+@Composable
+fun WaypointMarkers(
+ displayableWaypoints: List,
+ mapFilterState: BaseMapViewModel.MapFilterState,
+ myNodeNum: Int,
+ isConnected: Boolean,
+ onEditWaypointRequest: (Waypoint) -> Unit,
+ selectedWaypointId: Int? = null,
+) {
+ val scope = rememberCoroutineScope()
+ val context = LocalContext.current
+ if (mapFilterState.showWaypoints) {
+ displayableWaypoints.forEach { waypoint ->
+ val markerState =
+ rememberUpdatedMarkerState(
+ position = LatLng((waypoint.latitude_i ?: 0) * DEG_D, (waypoint.longitude_i ?: 0) * DEG_D),
+ )
+
+ LaunchedEffect(selectedWaypointId) {
+ if (selectedWaypointId == waypoint.id) {
+ markerState.showInfoWindow()
+ }
+ }
+
+ val iconCodePoint = if ((waypoint.icon ?: 0) == 0) PUSHPIN else waypoint.icon!!
+ val emojiText = convertIntToEmoji(iconCodePoint)
+ val icon =
+ rememberComposeBitmapDescriptor(iconCodePoint) {
+ Text(text = emojiText, fontSize = 32.sp, modifier = Modifier.padding(2.dp))
+ }
+
+ Marker(
+ state = markerState,
+ icon = icon,
+ title = (waypoint.name ?: "").replace('\n', ' ').replace('\b', ' '),
+ snippet = (waypoint.description ?: "").replace('\n', ' ').replace('\b', ' '),
+ visible = true,
+ onInfoWindowClick = {
+ if ((waypoint.locked_to ?: 0) == 0 || waypoint.locked_to == myNodeNum || !isConnected) {
+ onEditWaypointRequest(waypoint)
+ } else {
+ scope.launch { context.showToast(Res.string.locked) }
+ }
+ },
+ )
+ }
+ }
+}
+
+private const val PUSHPIN = 0x1F4CD // Unicode for Round Pushpin
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileProviderConfig.kt b/app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileProviderConfig.kt
new file mode 100644
index 000000000..a28b3b6c1
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileProviderConfig.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.model
+
+import kotlinx.serialization.Serializable
+import kotlin.uuid.Uuid
+
+@Serializable
+data class CustomTileProviderConfig(
+ val id: String = Uuid.random().toString(),
+ val name: String,
+ val urlTemplate: String,
+ val localUri: String? = null,
+) {
+ val isLocal: Boolean
+ get() = localUri != null
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt b/app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt
new file mode 100644
index 000000000..4adb7d97d
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.model
+
+class CustomTileSource {
+
+ companion object {
+ fun getTileSource(index: Int) {
+ index
+ }
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/model/NodeClusterItem.kt b/app/src/google/kotlin/org/meshtastic/app/map/model/NodeClusterItem.kt
new file mode 100644
index 000000000..943d2c826
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/model/NodeClusterItem.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.model
+
+import com.google.android.gms.maps.model.LatLng
+import com.google.maps.android.clustering.ClusterItem
+import org.meshtastic.core.model.Node
+
+data class NodeClusterItem(
+ val node: Node,
+ val nodePosition: LatLng,
+ val nodeTitle: String,
+ val nodeSnippet: String,
+ val myNodeNum: Int? = null,
+) : ClusterItem {
+ override fun getPosition(): LatLng = nodePosition
+
+ override fun getTitle(): String = nodeTitle
+
+ override fun getSnippet(): String = nodeSnippet
+
+ override fun getZIndex(): Float = when {
+ node.num == myNodeNum -> 5.0f // My node is always highest
+ node.isFavorite -> 5.0f // Favorites are equally high priority
+ else -> 4.0f
+ }
+
+ fun getPrecisionMeters(): Double? {
+ val precisionMap =
+ mapOf(
+ 10 to 23345.484932,
+ 11 to 11672.7369,
+ 12 to 5836.36288,
+ 13 to 2918.175876,
+ 14 to 1459.0823719999053,
+ 15 to 729.53562,
+ 16 to 364.7622,
+ 17 to 182.375556,
+ 18 to 91.182212,
+ 19 to 45.58554,
+ )
+ return precisionMap[this.node.position.precision_bits ?: 0]
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt b/app/src/google/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt
new file mode 100644
index 000000000..fa17fedbf
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.node
+
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Scaffold
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.ui.Modifier
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import org.meshtastic.app.map.GoogleMapMode
+import org.meshtastic.app.map.MapView
+import org.meshtastic.core.ui.component.MainAppBar
+import org.meshtastic.feature.map.node.NodeMapViewModel
+
+@Composable
+fun NodeMapScreen(nodeMapViewModel: NodeMapViewModel, onNavigateUp: () -> Unit) {
+ val node by nodeMapViewModel.node.collectAsStateWithLifecycle()
+ val positions by nodeMapViewModel.positionLogs.collectAsStateWithLifecycle()
+
+ Scaffold(
+ topBar = {
+ MainAppBar(
+ title = node?.user?.long_name ?: "",
+ ourNode = null,
+ showNodeChip = false,
+ canNavigateUp = true,
+ onNavigateUp = onNavigateUp,
+ actions = {},
+ onClickChip = {},
+ )
+ },
+ ) { paddingValues ->
+ MapView(
+ modifier = Modifier.fillMaxSize().padding(paddingValues),
+ mode = GoogleMapMode.NodeTrack(focusedNode = node, positions = positions),
+ )
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/node/NodeTrackMap.kt b/app/src/google/kotlin/org/meshtastic/app/map/node/NodeTrackMap.kt
new file mode 100644
index 000000000..2f7244b97
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/node/NodeTrackMap.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.node
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.ui.Modifier
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import org.koin.compose.viewmodel.koinViewModel
+import org.meshtastic.app.map.GoogleMapMode
+import org.meshtastic.app.map.MapView
+import org.meshtastic.feature.map.node.NodeMapViewModel
+import org.meshtastic.proto.Position
+
+/**
+ * Flavor-unified entry point for the embeddable node-track map. Resolves [destNum] to a
+ * [org.meshtastic.core.model.Node] via [NodeMapViewModel] and delegates to [MapView] in [GoogleMapMode.NodeTrack] mode,
+ * which provides the full shared map infrastructure (location tracking, tile providers, controls overlay with track
+ * filter).
+ *
+ * Supports optional synchronized selection via [selectedPositionTime] and [onPositionSelected].
+ */
+@Composable
+fun NodeTrackMap(
+ destNum: Int,
+ positions: List,
+ modifier: Modifier = Modifier,
+ selectedPositionTime: Int? = null,
+ onPositionSelected: ((Int) -> Unit)? = null,
+) {
+ val vm = koinViewModel()
+ vm.setDestNum(destNum)
+ val focusedNode by vm.node.collectAsStateWithLifecycle()
+ MapView(
+ modifier = modifier,
+ mode =
+ GoogleMapMode.NodeTrack(
+ focusedNode = focusedNode,
+ positions = positions,
+ selectedPositionTime = selectedPositionTime,
+ onPositionSelected = onPositionSelected,
+ ),
+ )
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/prefs/di/GoogleMapsKoinModule.kt b/app/src/google/kotlin/org/meshtastic/app/map/prefs/di/GoogleMapsKoinModule.kt
new file mode 100644
index 000000000..668dedbaa
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/prefs/di/GoogleMapsKoinModule.kt
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.prefs.di
+
+import android.content.Context
+import androidx.datastore.core.DataStore
+import androidx.datastore.preferences.SharedPreferencesMigration
+import androidx.datastore.preferences.core.PreferenceDataStoreFactory
+import androidx.datastore.preferences.core.Preferences
+import androidx.datastore.preferences.preferencesDataStoreFile
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.SupervisorJob
+import org.koin.core.annotation.ComponentScan
+import org.koin.core.annotation.Module
+import org.koin.core.annotation.Named
+import org.koin.core.annotation.Single
+import org.meshtastic.core.di.CoroutineDispatchers
+
+@Module
+@ComponentScan("org.meshtastic.app.map")
+class GoogleMapsKoinModule {
+
+ @Single
+ @Named("GoogleMapsDataStore")
+ fun provideGoogleMapsDataStore(context: Context, dispatchers: CoroutineDispatchers): DataStore =
+ PreferenceDataStoreFactory.create(
+ migrations = listOf(SharedPreferencesMigration(context, "google_maps_prefs")),
+ scope = CoroutineScope(dispatchers.io + SupervisorJob()),
+ produceFile = { context.preferencesDataStoreFile("google_maps_ds") },
+ )
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/prefs/map/GoogleMapsPrefs.kt b/app/src/google/kotlin/org/meshtastic/app/map/prefs/map/GoogleMapsPrefs.kt
new file mode 100644
index 000000000..6cf6091b1
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/prefs/map/GoogleMapsPrefs.kt
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.prefs.map
+
+import androidx.datastore.core.DataStore
+import androidx.datastore.preferences.core.Preferences
+import androidx.datastore.preferences.core.doublePreferencesKey
+import androidx.datastore.preferences.core.edit
+import androidx.datastore.preferences.core.floatPreferencesKey
+import androidx.datastore.preferences.core.stringPreferencesKey
+import androidx.datastore.preferences.core.stringSetPreferencesKey
+import com.google.maps.android.compose.MapType
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.SupervisorJob
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.flow.stateIn
+import kotlinx.coroutines.launch
+import org.koin.core.annotation.Named
+import org.koin.core.annotation.Single
+import org.meshtastic.core.di.CoroutineDispatchers
+
+/** Interface for prefs specific to Google Maps. For general map prefs, see MapPrefs. */
+interface GoogleMapsPrefs {
+ val selectedGoogleMapType: StateFlow
+
+ fun setSelectedGoogleMapType(value: String?)
+
+ val selectedCustomTileUrl: StateFlow
+
+ fun setSelectedCustomTileUrl(value: String?)
+
+ val hiddenLayerUrls: StateFlow>
+
+ fun setHiddenLayerUrls(value: Set)
+
+ val cameraTargetLat: StateFlow
+
+ fun setCameraTargetLat(value: Double)
+
+ val cameraTargetLng: StateFlow
+
+ fun setCameraTargetLng(value: Double)
+
+ val cameraZoom: StateFlow
+
+ fun setCameraZoom(value: Float)
+
+ val cameraTilt: StateFlow
+
+ fun setCameraTilt(value: Float)
+
+ val cameraBearing: StateFlow
+
+ fun setCameraBearing(value: Float)
+
+ val networkMapLayers: StateFlow>
+
+ fun setNetworkMapLayers(value: Set)
+}
+
+@Single
+class GoogleMapsPrefsImpl(
+ @Named("GoogleMapsDataStore") private val dataStore: DataStore,
+ dispatchers: CoroutineDispatchers,
+) : GoogleMapsPrefs {
+ private val scope = CoroutineScope(SupervisorJob() + dispatchers.default)
+
+ override val selectedGoogleMapType: StateFlow =
+ dataStore.data
+ .map { it[KEY_SELECTED_GOOGLE_MAP_TYPE_PREF] ?: MapType.NORMAL.name }
+ .stateIn(scope, SharingStarted.Eagerly, MapType.NORMAL.name)
+
+ override fun setSelectedGoogleMapType(value: String?) {
+ scope.launch {
+ dataStore.edit { prefs ->
+ if (value == null) {
+ prefs.remove(KEY_SELECTED_GOOGLE_MAP_TYPE_PREF)
+ } else {
+ prefs[KEY_SELECTED_GOOGLE_MAP_TYPE_PREF] = value
+ }
+ }
+ }
+ }
+
+ override val selectedCustomTileUrl: StateFlow =
+ dataStore.data.map { it[KEY_SELECTED_CUSTOM_TILE_URL_PREF] }.stateIn(scope, SharingStarted.Eagerly, null)
+
+ override fun setSelectedCustomTileUrl(value: String?) {
+ scope.launch {
+ dataStore.edit { prefs ->
+ if (value == null) {
+ prefs.remove(KEY_SELECTED_CUSTOM_TILE_URL_PREF)
+ } else {
+ prefs[KEY_SELECTED_CUSTOM_TILE_URL_PREF] = value
+ }
+ }
+ }
+ }
+
+ override val hiddenLayerUrls: StateFlow> =
+ dataStore.data
+ .map { it[KEY_HIDDEN_LAYER_URLS_PREF] ?: emptySet() }
+ .stateIn(scope, SharingStarted.Eagerly, emptySet())
+
+ override fun setHiddenLayerUrls(value: Set) {
+ scope.launch { dataStore.edit { it[KEY_HIDDEN_LAYER_URLS_PREF] = value } }
+ }
+
+ override val cameraTargetLat: StateFlow =
+ dataStore.data
+ .map {
+ try {
+ it[KEY_CAMERA_TARGET_LAT_PREF] ?: 0.0
+ } catch (_: ClassCastException) {
+ it[floatPreferencesKey(KEY_CAMERA_TARGET_LAT_PREF.name)]?.toDouble() ?: 0.0
+ }
+ }
+ .stateIn(scope, SharingStarted.Eagerly, 0.0)
+
+ override fun setCameraTargetLat(value: Double) {
+ scope.launch { dataStore.edit { it[KEY_CAMERA_TARGET_LAT_PREF] = value } }
+ }
+
+ override val cameraTargetLng: StateFlow =
+ dataStore.data
+ .map {
+ try {
+ it[KEY_CAMERA_TARGET_LNG_PREF] ?: 0.0
+ } catch (_: ClassCastException) {
+ it[floatPreferencesKey(KEY_CAMERA_TARGET_LNG_PREF.name)]?.toDouble() ?: 0.0
+ }
+ }
+ .stateIn(scope, SharingStarted.Eagerly, 0.0)
+
+ override fun setCameraTargetLng(value: Double) {
+ scope.launch { dataStore.edit { it[KEY_CAMERA_TARGET_LNG_PREF] = value } }
+ }
+
+ override val cameraZoom: StateFlow =
+ dataStore.data.map { it[KEY_CAMERA_ZOOM_PREF] ?: 7f }.stateIn(scope, SharingStarted.Eagerly, 7f)
+
+ override fun setCameraZoom(value: Float) {
+ scope.launch { dataStore.edit { it[KEY_CAMERA_ZOOM_PREF] = value } }
+ }
+
+ override val cameraTilt: StateFlow =
+ dataStore.data.map { it[KEY_CAMERA_TILT_PREF] ?: 0f }.stateIn(scope, SharingStarted.Eagerly, 0f)
+
+ override fun setCameraTilt(value: Float) {
+ scope.launch { dataStore.edit { it[KEY_CAMERA_TILT_PREF] = value } }
+ }
+
+ override val cameraBearing: StateFlow =
+ dataStore.data.map { it[KEY_CAMERA_BEARING_PREF] ?: 0f }.stateIn(scope, SharingStarted.Eagerly, 0f)
+
+ override fun setCameraBearing(value: Float) {
+ scope.launch { dataStore.edit { it[KEY_CAMERA_BEARING_PREF] = value } }
+ }
+
+ override val networkMapLayers: StateFlow> =
+ dataStore.data
+ .map { it[KEY_NETWORK_MAP_LAYERS_PREF] ?: emptySet() }
+ .stateIn(scope, SharingStarted.Eagerly, emptySet())
+
+ override fun setNetworkMapLayers(value: Set) {
+ scope.launch { dataStore.edit { it[KEY_NETWORK_MAP_LAYERS_PREF] = value } }
+ }
+
+ companion object {
+ val KEY_SELECTED_GOOGLE_MAP_TYPE_PREF = stringPreferencesKey("selected_google_map_type")
+ val KEY_SELECTED_CUSTOM_TILE_URL_PREF = stringPreferencesKey("selected_custom_tile_url")
+ val KEY_HIDDEN_LAYER_URLS_PREF = stringSetPreferencesKey("hidden_layer_urls")
+ val KEY_CAMERA_TARGET_LAT_PREF = doublePreferencesKey("camera_target_lat")
+ val KEY_CAMERA_TARGET_LNG_PREF = doublePreferencesKey("camera_target_lng")
+ val KEY_CAMERA_ZOOM_PREF = floatPreferencesKey("camera_zoom")
+ val KEY_CAMERA_TILT_PREF = floatPreferencesKey("camera_tilt")
+ val KEY_CAMERA_BEARING_PREF = floatPreferencesKey("camera_bearing")
+ val KEY_NETWORK_MAP_LAYERS_PREF = stringSetPreferencesKey("network_map_layers")
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/repository/CustomTileProviderRepository.kt b/app/src/google/kotlin/org/meshtastic/app/map/repository/CustomTileProviderRepository.kt
new file mode 100644
index 000000000..6840cb17d
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/repository/CustomTileProviderRepository.kt
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.repository
+
+import co.touchlab.kermit.Logger
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.withContext
+import kotlinx.serialization.SerializationException
+import kotlinx.serialization.json.Json
+import org.koin.core.annotation.Single
+import org.meshtastic.app.map.model.CustomTileProviderConfig
+import org.meshtastic.core.di.CoroutineDispatchers
+import org.meshtastic.core.repository.MapTileProviderPrefs
+
+interface CustomTileProviderRepository {
+ fun getCustomTileProviders(): Flow>
+
+ suspend fun addCustomTileProvider(config: CustomTileProviderConfig)
+
+ suspend fun updateCustomTileProvider(config: CustomTileProviderConfig)
+
+ suspend fun deleteCustomTileProvider(configId: String)
+
+ suspend fun getCustomTileProviderById(configId: String): CustomTileProviderConfig?
+}
+
+@Single
+class CustomTileProviderRepositoryImpl(
+ private val json: Json,
+ private val dispatchers: CoroutineDispatchers,
+ private val mapTileProviderPrefs: MapTileProviderPrefs,
+) : CustomTileProviderRepository {
+
+ private val customTileProvidersStateFlow = MutableStateFlow>(emptyList())
+
+ init {
+ loadDataFromPrefs()
+ }
+
+ override fun getCustomTileProviders(): Flow> =
+ customTileProvidersStateFlow.asStateFlow()
+
+ override suspend fun addCustomTileProvider(config: CustomTileProviderConfig) {
+ val newList = customTileProvidersStateFlow.value + config
+ customTileProvidersStateFlow.value = newList
+ saveDataToPrefs(newList)
+ }
+
+ override suspend fun updateCustomTileProvider(config: CustomTileProviderConfig) {
+ val newList = customTileProvidersStateFlow.value.map { if (it.id == config.id) config else it }
+ customTileProvidersStateFlow.value = newList
+ saveDataToPrefs(newList)
+ }
+
+ override suspend fun deleteCustomTileProvider(configId: String) {
+ val newList = customTileProvidersStateFlow.value.filterNot { it.id == configId }
+ customTileProvidersStateFlow.value = newList
+ saveDataToPrefs(newList)
+ }
+
+ override suspend fun getCustomTileProviderById(configId: String): CustomTileProviderConfig? =
+ customTileProvidersStateFlow.value.find { it.id == configId }
+
+ private fun loadDataFromPrefs() {
+ val jsonString = mapTileProviderPrefs.customTileProviders.value
+ if (jsonString != null) {
+ try {
+ customTileProvidersStateFlow.value = json.decodeFromString>(jsonString)
+ } catch (e: SerializationException) {
+ Logger.e(e) { "Error deserializing tile providers" }
+ customTileProvidersStateFlow.value = emptyList()
+ }
+ } else {
+ customTileProvidersStateFlow.value = emptyList()
+ }
+ }
+
+ private suspend fun saveDataToPrefs(providers: List) {
+ withContext(dispatchers.io) {
+ try {
+ val jsonString = json.encodeToString(providers)
+ mapTileProviderPrefs.setCustomTileProviders(jsonString)
+ } catch (e: SerializationException) {
+ Logger.e(e) { "Error serializing tile providers" }
+ }
+ }
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/map/traceroute/TracerouteMap.kt b/app/src/google/kotlin/org/meshtastic/app/map/traceroute/TracerouteMap.kt
new file mode 100644
index 000000000..d725537c8
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/map/traceroute/TracerouteMap.kt
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.map.traceroute
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import org.meshtastic.app.map.GoogleMapMode
+import org.meshtastic.app.map.MapView
+import org.meshtastic.core.model.TracerouteOverlay
+import org.meshtastic.proto.Position
+
+/**
+ * Flavor-unified entry point for the embeddable traceroute map. Delegates to [MapView] in [GoogleMapMode.Traceroute]
+ * mode, which provides the full shared map infrastructure (location tracking, tile providers, controls overlay).
+ */
+@Composable
+fun TracerouteMap(
+ tracerouteOverlay: TracerouteOverlay?,
+ tracerouteNodePositions: Map,
+ onMappableCountChanged: (shown: Int, total: Int) -> Unit,
+ modifier: Modifier = Modifier,
+) {
+ MapView(
+ modifier = modifier,
+ mode =
+ GoogleMapMode.Traceroute(
+ overlay = tracerouteOverlay,
+ nodePositions = tracerouteNodePositions,
+ onMappableCountChanged = onMappableCountChanged,
+ ),
+ )
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/node/component/InlineMap.kt b/app/src/google/kotlin/org/meshtastic/app/node/component/InlineMap.kt
new file mode 100644
index 000000000..c86e7a78c
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/node/component/InlineMap.kt
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.node.component
+
+import androidx.compose.foundation.isSystemInDarkTheme
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.key
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import com.google.android.gms.maps.model.CameraPosition
+import com.google.android.gms.maps.model.LatLng
+import com.google.maps.android.compose.Circle
+import com.google.maps.android.compose.ComposeMapColorScheme
+import com.google.maps.android.compose.GoogleMap
+import com.google.maps.android.compose.MapUiSettings
+import com.google.maps.android.compose.MapsComposeExperimentalApi
+import com.google.maps.android.compose.MarkerComposable
+import com.google.maps.android.compose.rememberCameraPositionState
+import com.google.maps.android.compose.rememberUpdatedMarkerState
+import org.meshtastic.core.model.Node
+import org.meshtastic.core.ui.component.NodeChip
+import org.meshtastic.core.ui.component.precisionBitsToMeters
+
+private const val DEFAULT_ZOOM = 15f
+
+@OptIn(MapsComposeExperimentalApi::class)
+@Composable
+fun InlineMap(node: Node, modifier: Modifier = Modifier) {
+ val dark = isSystemInDarkTheme()
+ val mapColorScheme =
+ when (dark) {
+ true -> ComposeMapColorScheme.DARK
+ else -> ComposeMapColorScheme.LIGHT
+ }
+ key(node.num) {
+ val location = LatLng(node.latitude, node.longitude)
+ val cameraState = rememberCameraPositionState {
+ position = CameraPosition.fromLatLngZoom(location, DEFAULT_ZOOM)
+ }
+
+ GoogleMap(
+ mapColorScheme = mapColorScheme,
+ modifier = modifier,
+ uiSettings =
+ MapUiSettings(
+ zoomControlsEnabled = true,
+ mapToolbarEnabled = false,
+ compassEnabled = false,
+ myLocationButtonEnabled = false,
+ rotationGesturesEnabled = false,
+ scrollGesturesEnabled = false,
+ tiltGesturesEnabled = false,
+ zoomGesturesEnabled = false,
+ ),
+ cameraPositionState = cameraState,
+ ) {
+ val precisionMeters = precisionBitsToMeters(node.position.precision_bits ?: 0)
+ val latLng = LatLng(node.latitude, node.longitude)
+ if (precisionMeters > 0) {
+ Circle(
+ center = latLng,
+ radius = precisionMeters,
+ fillColor = Color(node.colors.second).copy(alpha = 0.2f),
+ strokeColor = Color(node.colors.second),
+ strokeWidth = 2f,
+ )
+ }
+ MarkerComposable(state = rememberUpdatedMarkerState(position = latLng)) { NodeChip(node = node) }
+ }
+ }
+}
diff --git a/app/src/google/kotlin/org/meshtastic/app/node/metrics/TracerouteMapOverlayInsets.kt b/app/src/google/kotlin/org/meshtastic/app/node/metrics/TracerouteMapOverlayInsets.kt
new file mode 100644
index 000000000..992edf588
--- /dev/null
+++ b/app/src/google/kotlin/org/meshtastic/app/node/metrics/TracerouteMapOverlayInsets.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025-2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.meshtastic.app.node.metrics
+
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.unit.dp
+import org.meshtastic.core.ui.util.TracerouteMapOverlayInsets
+
+fun getTracerouteMapOverlayInsets(): TracerouteMapOverlayInsets = TracerouteMapOverlayInsets(
+ overlayAlignment = Alignment.BottomCenter,
+ overlayPadding = PaddingValues(bottom = 16.dp),
+ contentHorizontalAlignment = Alignment.CenterHorizontally,
+)
diff --git a/app/src/googleDebug/res/drawable-anydpi/ic_launcher_background.xml b/app/src/googleDebug/res/drawable-anydpi/ic_launcher_background.xml
new file mode 100644
index 000000000..1a564c2ab
--- /dev/null
+++ b/app/src/googleDebug/res/drawable-anydpi/ic_launcher_background.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/app/src/googleDebug/res/values/strings.xml b/app/src/googleDebug/res/values/strings.xml
new file mode 100644
index 000000000..dccab15c7
--- /dev/null
+++ b/app/src/googleDebug/res/values/strings.xml
@@ -0,0 +1,19 @@
+
+
+ Google Debug
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index bf2db4f91..f7d2ce900 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,20 +1,20 @@
+ ~ Copyright (c) 2025 Meshtastic LLC
+ ~
+ ~ This program is free software: you can redistribute it and/or modify
+ ~ it under the terms of the GNU General Public License as published by
+ ~ the Free Software Foundation, either version 3 of the License, or
+ ~ (at your option) any later version.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with this program. If not, see .
+ -->
+
+
+
-
+
+
+
+
@@ -81,6 +87,10 @@
android:name="android.hardware.bluetooth_le"
android:required="false" />
+
+
-
+ android:theme="@style/SplashTheme"
+ android:localeConfig="@xml/locales_config"
+ android:networkSecurityConfig="@xml/network_security_config"
+ android:enableOnBackInvokedCallback="true">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -137,13 +174,8 @@
-
-
@@ -163,20 +195,20 @@
-
-
-
-
-
+
-
+
@@ -189,6 +221,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -199,7 +252,7 @@
android:resource="@xml/device_filter" />
-
@@ -223,9 +276,20 @@
android:path="com.geeksville.mesh" /> -->
+
+
+
-
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/assets/device_bootloader_ota_quirks.json b/app/src/main/assets/device_bootloader_ota_quirks.json
new file mode 100644
index 000000000..960c63101
--- /dev/null
+++ b/app/src/main/assets/device_bootloader_ota_quirks.json
@@ -0,0 +1,22 @@
+{
+ "devices": [
+ {
+ "hwModel": 18,
+ "hwModelSlug": "NANO_G2_ULTRA",
+ "requiresBootloaderUpgradeForOta": true,
+ "infoUrl": "https://meshtastic.org/docs/getting-started/flashing-firmware/nrf52/update-nrf52-bootloader/"
+ },
+ {
+ "hwModel": 9,
+ "hwModelSlug": "RAK4631",
+ "requiresBootloaderUpgradeForOta": true,
+ "infoUrl": "https://meshtastic.org/docs/getting-started/flashing-firmware/nrf52/update-nrf52-bootloader/"
+ },
+ {
+ "hwModel": 96,
+ "hwModelSlug": "NOMADSTAR_METEOR_PRO",
+ "requiresBootloaderUpgradeForOta": true,
+ "infoUrl": "https://meshtastic.org/docs/getting-started/flashing-firmware/nrf52/update-nrf52-bootloader/"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/app/src/main/assets/device_hardware.json b/app/src/main/assets/device_hardware.json
index 16c6675b6..b4e3550eb 100644
--- a/app/src/main/assets/device_hardware.json
+++ b/app/src/main/assets/device_hardware.json
@@ -27,7 +27,7 @@
"platformioTarget": "tlora-v2-1-1_6",
"architecture": "esp32",
"activelySupported": true,
- "supportLevel": 1,
+ "supportLevel": 3,
"displayName": "LILYGO T-LoRa V2.1-1.6",
"tags": [
"LilyGo"
@@ -42,7 +42,7 @@
"platformioTarget": "tbeam",
"architecture": "esp32",
"activelySupported": true,
- "supportLevel": 1,
+ "supportLevel": 3,
"displayName": "LILYGO T-Beam",
"tags": [
"LilyGo"
@@ -163,6 +163,7 @@
"platformioTarget": "rak11200",
"architecture": "esp32",
"activelySupported": true,
+ "supportLevel": 3,
"displayName": "RAK WisBlock 11200",
"tags": [
"RAK"
@@ -189,7 +190,7 @@
"platformioTarget": "tlora-v2-1-1_8",
"architecture": "esp32",
"activelySupported": true,
- "supportLevel": 2,
+ "supportLevel": 3,
"displayName": "LILYGO T-LoRa V2.1-1.8",
"tags": [
"LilyGo",
@@ -266,7 +267,7 @@
"platformioTarget": "wio-tracker-wm1110",
"architecture": "nrf52840",
"activelySupported": true,
- "supportLevel": 1,
+ "supportLevel": 3,
"displayName": "Seeed Wio WM1110 Tracker",
"tags": [
"Seeed"
@@ -347,6 +348,23 @@
],
"partitionScheme": "16MB"
},
+ {
+ "hwModel": 33,
+ "hwModelSlug": "T_ECHO_PLUS",
+ "platformioTarget": "t-echo-plus",
+ "architecture": "nrf52840",
+ "supportLevel": 1,
+ "activelySupported": true,
+ "displayName": "LILYGO T-Echo Plus",
+ "tags": [
+ "LilyGo"
+ ],
+ "images": [
+ "t-echo_plus.svg"
+ ],
+ "requiresDfu": true,
+ "hasInkHud": true
+ },
{
"hwModel": 39,
"hwModelSlug": "DIY_V1",
@@ -536,7 +554,7 @@
"platformioTarget": "t-watch-s3",
"architecture": "esp32-s3",
"activelySupported": true,
- "supportLevel": 1,
+ "supportLevel": 3,
"displayName": "LILYGO T-Watch S3",
"tags": [
"LilyGo"
@@ -766,7 +784,7 @@
"platformioTarget": "seeed-xiao-s3",
"architecture": "esp32-s3",
"activelySupported": true,
- "supportLevel": 1,
+ "supportLevel": 3,
"displayName": "Seeed Xiao ESP32-S3",
"tags": [
"Seeed"
@@ -777,6 +795,22 @@
"requiresDfu": true,
"partitionScheme": "8MB"
},
+ {
+ "hwModel": 105,
+ "hwModelSlug": "WISMESH_TAG",
+ "platformioTarget": "rak_wismeshtag",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "RAK WisMesh Tag",
+ "tags": [
+ "RAK"
+ ],
+ "images": [
+ "rak_wismesh_tag.svg"
+ ],
+ "requiresDfu": true
+ },
{
"hwModel": 84,
"hwModelSlug": "WISMESH_TAP",
@@ -858,6 +892,23 @@
],
"hasInkHud": true
},
+ {
+ "hwModel": 107,
+ "hwModelSlug": "THINKNODE_M5",
+ "platformioTarget": "thinknode_m5",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "ThinkNode M5",
+ "tags": [
+ "Elecrow"
+ ],
+ "requiresDfu": false,
+ "images": [
+ "thinknode_m1.svg"
+ ],
+ "hasInkHud": true
+ },
{
"hwModel": 90,
"hwModelSlug": "THINKNODE_M2",
@@ -874,30 +925,478 @@
"thinknode_m2.svg"
]
},
+ {
+ "hwModel": 93,
+ "hwModelSlug": "MUZI_BASE",
+ "platformioTarget": "muzi-base",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "muzi BASE DUO/UNO",
+ "tags": [
+ "muzi"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "muzi_base.svg"
+ ]
+ },
{
"hwModel": 94,
"hwModelSlug": "HELTEC_MESH_POCKET",
- "platformioTarget": "heltec_mesh_pocket",
+ "platformioTarget": "heltec-mesh-pocket-10000",
"architecture": "nrf52840",
- "activelySupported": false,
+ "activelySupported": true,
"supportLevel": 1,
"displayName": "Heltec MeshPocket",
"tags": [
"Heltec"
],
- "requiresDfu": true
+ "images": [
+ "heltec_mesh_pocket.svg"
+ ],
+ "requiresDfu": true,
+ "hasInkHud": true,
+ "key": "HELTEC_MESH_POCKET",
+ "variant": "10000mAh"
+ },
+ {
+ "hwModel": 94,
+ "hwModelSlug": "HELTEC_MESH_POCKET",
+ "platformioTarget": "heltec-mesh-pocket-5000",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Heltec MeshPocket",
+ "tags": [
+ "Heltec"
+ ],
+ "images": [
+ "heltec_mesh_pocket.svg"
+ ],
+ "requiresDfu": true,
+ "hasInkHud": true,
+ "key": "HELTEC_MESH_POCKET",
+ "variant": "5000mAh"
},
{
"hwModel": 95,
"hwModelSlug": "SEEED_SOLAR_NODE",
"platformioTarget": "seeed_solar_node",
"architecture": "nrf52840",
- "activelySupported": false,
+ "activelySupported": true,
"supportLevel": 1,
- "displayName": "SenseCAP Solar Node",
+ "displayName": "Seeed SenseCAP Solar Node",
"tags": [
"Seeed"
],
+ "images": [
+ "seeed_solar.svg"
+ ],
"requiresDfu": true
+ },
+ {
+ "hwModel": 99,
+ "hwModelSlug": "SEEED_WIO_TRACKER_L1",
+ "platformioTarget": "seeed_wio_tracker_L1",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Seeed Wio Tracker L1",
+ "tags": [
+ "Seeed"
+ ],
+ "images": [
+ "wio_tracker_l1_case.svg"
+ ],
+ "requiresDfu": true
+ },
+ {
+ "hwModel": 100,
+ "hwModelSlug": "SEEED_WIO_TRACKER_L1_EINK",
+ "platformioTarget": "seeed_wio_tracker_L1_eink",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Seeed Wio Tracker L1 E-Ink",
+ "tags": [
+ "Seeed"
+ ],
+ "requiresDfu": true,
+ "hasInkHud": true,
+ "images": [
+ "wio_tracker_l1_eink.svg"
+ ]
+ },
+ {
+ "hwModel": 96,
+ "hwModelSlug": "NOMADSTAR_METEOR_PRO",
+ "platformioTarget": "rak4631_nomadstar_meteor_pro",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "NomadStar Meteor Pro",
+ "tags": [
+ "NomadStar"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "meteor_pro.svg"
+ ]
+ },
+ {
+ "hwModel": 97,
+ "hwModelSlug": "CROWPANEL",
+ "platformioTarget": "elecrow-adv1-43-50-70-tft",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Crowpanel Adv 4.3/5.0/7.0 TFT",
+ "tags": [
+ "Elecrow"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "crowpanel_5_0.svg",
+ "crowpanel_7_0.svg"
+ ],
+ "partitionScheme": "16MB",
+ "hasMui": true
+ },
+ {
+ "hwModel": 97,
+ "hwModelSlug": "CROWPANEL",
+ "platformioTarget": "elecrow-adv-24-28-tft",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Crowpanel Adv 2.4/2.8 TFT",
+ "tags": [
+ "Elecrow"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "crowpanel_2_4.svg",
+ "crowpanel_2_8.svg"
+ ],
+ "partitionScheme": "16MB",
+ "hasMui": true
+ },
+ {
+ "hwModel": 97,
+ "hwModelSlug": "CROWPANEL",
+ "platformioTarget": "elecrow-adv-35-tft",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Crowpanel Adv 3.5 TFT",
+ "tags": [
+ "Elecrow"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "crowpanel_3_5.svg"
+ ],
+ "partitionScheme": "16MB",
+ "hasMui": true
+ },
+ {
+ "hwModel": 101,
+ "hwModelSlug": "MUZI_R1_NEO",
+ "platformioTarget": "r1-neo",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "muzi R1 Neo",
+ "tags": [
+ "muzi"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "muzi_r1_neo.svg"
+ ]
+ },
+ {
+ "hwModel": 102,
+ "hwModelSlug": "T_DECK_PRO",
+ "platformioTarget": "t-deck-pro",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "LILYGO T-Deck Pro",
+ "tags": [
+ "LilyGo"
+ ],
+ "images": [
+ "tdeck_pro.svg"
+ ],
+ "requiresDfu": true,
+ "hasMui": false,
+ "partitionScheme": "16MB"
+ },
+ {
+ "hwModel": 103,
+ "hwModelSlug": "T_LORA_PAGER",
+ "platformioTarget": "tlora-pager",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "LILYGO T-LoRa Pager",
+ "tags": [
+ "LilyGo"
+ ],
+ "requiresDfu": true,
+ "hasMui": false,
+ "partitionScheme": "16MB",
+ "images": [
+ "lilygo-tlora-pager.svg"
+ ]
+ },
+ {
+ "hwModel": 108,
+ "hwModelSlug": "HELTEC_MESH_SOLAR",
+ "platformioTarget": "heltec-mesh-solar",
+ "architecture": "nrf52840",
+ "activelySupported": false,
+ "supportLevel": 1,
+ "displayName": "Heltec MeshSolar",
+ "tags": [
+ "Heltec"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "heltec-mesh-solar.svg"
+ ]
+ },
+ {
+ "hwModel": 109,
+ "hwModelSlug": "T_ECHO_LITE",
+ "platformioTarget": "t-echo-lite",
+ "architecture": "nrf52840",
+ "activelySupported": false,
+ "supportLevel": 1,
+ "displayName": "LILYGO T-Echo Lite",
+ "tags": [
+ "LilyGo"
+ ],
+ "requiresDfu": true,
+ "hasInkHud": false,
+ "images": [
+ "techo_lite.svg"
+ ]
+ },
+ {
+ "hwModel": 111,
+ "hwModelSlug": "M5STACK_C6L",
+ "platformioTarget": "m5stack-unitc6l",
+ "architecture": "esp32-c6",
+ "supportLevel": 1,
+ "activelySupported": true,
+ "displayName": "M5Stack Unit C6L",
+ "tags": [
+ "M5Stack"
+ ],
+ "images": [
+ "m5_c6l.svg"
+ ]
+ },
+ {
+ "hwModel": 110,
+ "hwModelSlug": "HELTEC_V4",
+ "platformioTarget": "heltec-v4",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Heltec V4",
+ "tags": [
+ "Heltec"
+ ],
+ "requiresDfu": true,
+ "hasMui": true,
+ "partitionScheme": "16MB",
+ "images": [
+ "heltec_v4.svg"
+ ]
+ },
+ {
+ "hwModel": 106,
+ "hwModelSlug": "RAK3312",
+ "platformioTarget": "rak3312",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "RAK3312",
+ "tags": [
+ "RAK"
+ ],
+ "requiresDfu": false,
+ "hasMui": false,
+ "partitionScheme": "16MB",
+ "images": [
+ "rak_3312.svg"
+ ]
+ },
+ {
+ "hwModel": 112,
+ "hwModelSlug": "M5STACK_CARDPUTER_ADV",
+ "platformioTarget": "m5stack-cardputer-adv",
+ "architecture": "esp32-s3",
+ "activelySupported": false,
+ "supportLevel": 1,
+ "displayName": "Cardputer Mesh Kit",
+ "tags": [
+ "M5Stack"
+ ],
+ "images": [
+ "m5stack_cardputer.svg"
+ ],
+ "partitionScheme": "8MB"
+ },
+ {
+ "hwModel": 113,
+ "hwModelSlug": "HELTEC_WIRELESS_TRACKER_V2",
+ "platformioTarget": "heltec-wireless-tracker-v2",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "Heltec Wireless Tracker V2",
+ "tags": [
+ "Heltec"
+ ],
+ "images": [
+ "heltec_wireless_tracker_v2.svg"
+ ],
+ "partitionScheme": "8MB"
+ },
+ {
+ "hwModel": 115,
+ "hwModelSlug": "THINKNODE_M3",
+ "platformioTarget": "thinknode_m3",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "ThinkNode M3",
+ "tags": [
+ "Elecrow"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "thinknode_m3.svg"
+ ]
+ },
+ {
+ "hwModel": 116,
+ "hwModelSlug": "WISMESH_TAP_V2",
+ "platformioTarget": "rak_wismesh_tap_v2",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "RAK WisMesh Tap V2",
+ "tags": [
+ "RAK"
+ ],
+ "hasMui": true,
+ "partitionScheme": "8MB",
+ "images": [
+ "rak-wismesh-tap-v2.svg"
+ ]
+ },
+ {
+ "hwModel": 117,
+ "hwModelSlug": "RAK3401",
+ "platformioTarget": "rak3401-1watt",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "RAK3401 1W",
+ "tags": [
+ "RAK"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "rak3401.svg"
+ ]
+ },
+ {
+ "hwModel": 119,
+ "hwModelSlug": "THINKNODE_M4",
+ "platformioTarget": "thinknode_m4",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "ThinkNode M4",
+ "tags": [
+ "Elecrow"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "thinknode_m4.svg"
+ ]
+ },
+ {
+ "hwModel": 120,
+ "hwModelSlug": "THINKNODE_M6",
+ "platformioTarget": "thinknode_m6",
+ "architecture": "nrf52840",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "ThinkNode M6",
+ "tags": [
+ "Elecrow"
+ ],
+ "requiresDfu": true,
+ "images": [
+ "thinknode_m6.svg"
+ ]
+ },
+ {
+ "hwModel": 122,
+ "hwModelSlug": "TBEAM_1_WATT",
+ "platformioTarget": "t-beam-1w",
+ "architecture": "esp32-s3",
+ "activelySupported": true,
+ "supportLevel": 1,
+ "displayName": "LilyGo T-Beam 1W",
+ "tags": [
+ "LilyGo"
+ ],
+ "hasMui": false,
+ "partitionScheme": "8MB",
+ "images": [
+ "tbeam-1w.svg"
+ ]
+ },
+ {
+ "hwModel": 123,
+ "hwModelSlug": "T5_S3_EPAPER_PRO",
+ "platformioTarget": "t5-epaper-s3",
+ "architecture": "esp32-s3",
+ "activelySupported": false,
+ "supportLevel": 1,
+ "displayName": "LilyGo T5 E-paper S3 Pro",
+ "tags": [
+ "LilyGo"
+ ],
+ "hasMui": false,
+ "partitionScheme": "8MB",
+ "images": [
+ "t5s3_epaper.svg"
+ ]
+ },
+ {
+ "hwModel": 125,
+ "hwModelSlug": "MINI_EPAPER_S3",
+ "platformioTarget": "mini-epaper-s3",
+ "architecture": "esp32-s3",
+ "activelySupported": false,
+ "supportLevel": 1,
+ "displayName": "LilyGo Mini E-paper S3",
+ "tags": [
+ "LilyGo"
+ ],
+ "hasMui": false,
+ "images": [
+ "mini-epaper-s3.svg"
+ ]
}
]
\ No newline at end of file
diff --git a/app/src/main/assets/firmware_releases.json b/app/src/main/assets/firmware_releases.json
index 33907e6f8..ffdb465d6 100644
--- a/app/src/main/assets/firmware_releases.json
+++ b/app/src/main/assets/firmware_releases.json
@@ -2,195 +2,188 @@
"releases": {
"stable": [
{
- "id": "v2.6.4.b89355f",
- "title": "Meshtastic Firmware 2.6.4.b89355f Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.4.b89355f",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.4.b89355f/firmware-stm32-2.6.4.b89355f.zip",
- "release_notes": "> [!CAUTION] \r\n> Updating from a previous version of firmware to 2.6, **will wipe** your device. Please remember to [backup your keys](https://meshtastic.org/docs/configuration/radio/security/#security-keys---backup-and-restore) and important [configurations](https://meshtastic.org/docs/software/python/cli/usage/#export-device-config-with---export-config) before proceeding!\r\n\r\n> [!WARNING] \r\nFor Seeed Sensecap Indicator devices _stuck_ in bluetooth pairing mode, we recommend doing a full erase / flash.\r\n\r\n## ⚠️ Known issues:\r\nLegacy ESP32 devices such as T-LoRA V2 1.6 may experience more crashes on Wifi. This should be fixed in 2.6.5.\r\nT-Echos may start with backlight on by default. Fixed in 2.6.5\r\n\r\n## 🚀 Enhancements\r\n* CrowPanel e-Ink Updates for 4.2 and 2.9 inch by @markbirss in https://github.com/meshtastic/firmware/pull/6401\r\n* Update lora-Adafruit-RFM9x by @markbirss in https://github.com/meshtastic/firmware/pull/6402\r\n* Add Thinknode-M1 by @caveman99 in https://github.com/meshtastic/firmware/pull/6435\r\n* Portduino: Return CH341 Product String by @vidplace7 in https://github.com/meshtastic/firmware/pull/6436\r\n* UDP-multicast: error handling support by @Jorropo in https://github.com/meshtastic/firmware/pull/6433\r\n* Add ThinkNode M2 Support by @caveman99 in https://github.com/meshtastic/firmware/pull/6354\r\n* Try-fix ESP32 wifi disconnects by @thebentern in https://github.com/meshtastic/firmware/pull/6363\r\n* MUI: node list <-> map navigation by @mverch67 in https://github.com/meshtastic/firmware/pull/6456\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Fix: T-Watch-S3 has 8MB Flash by @vidplace7 in https://github.com/meshtastic/firmware/pull/6407\r\n* Fix USERPREFS_EVENT_MODE compile error by @vidplace7 in https://github.com/meshtastic/firmware/pull/6408\r\n* Add missing board definition for MESHLINK by @macvenez in https://github.com/meshtastic/firmware/pull/6404\r\n* FIX: SenseCAP Indicator sporadic touch crash by @mverch67 in https://github.com/meshtastic/firmware/pull/6432\r\n* Revert \"TCA8418 initial config + basic 3x4 keypad config\" by @thebentern in https://github.com/meshtastic/firmware/pull/6410\r\n* Speed up builds by referencing github zips for shallow checkouts by @caveman99 in https://github.com/meshtastic/firmware/pull/6441\r\n* Fix a couple of warnings by @caveman99 in https://github.com/meshtastic/firmware/pull/6445\r\n* Fix Bold and Inverted Displays to actually show Uptime by @Xaositek in https://github.com/meshtastic/firmware/pull/6413\r\n* Fix STM32 build by @thebentern in https://github.com/meshtastic/firmware/pull/6455\r\n\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.3.640e731...v2.6.4.b89355f"
+ "id": "v2.7.15.567b8ea",
+ "title": "Meshtastic Firmware 2.7.15.567b8ea Beta",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.15.567b8ea",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.15.567b8ea/firmware-esp32-2.7.15.567b8ea.zip",
+ "release_notes": "> [!WARNING]\r\n> If you experience immediate bluetooth pairing failures or failure to fully boot after updating, this likely indicates that you need to perform a full erase and flash. Consider backing up your settings before updating.\r\n\r\n> [!IMPORTANT]\r\n> This release marks the end of legacy (non-private) DMs. Direct messages will only be allowed using PKI going forward.\r\n> This release also disables device telemetry broadcasts over the mesh by default. If you want to opt back in, you will need to re-enable this in the apps. \r\n\r\n## 🚀 What's Changed\r\n* Clean up GPS toggle logging by @jp-bennett in https://github.com/meshtastic/firmware/pull/8629\r\n* Reset the calibration data back to 0 when doing a compass calibration by @jp-bennett in https://github.com/meshtastic/firmware/pull/8648\r\n* Chore(deps): update dorny/test-reporter action to v2.2.0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8637\r\n* Fix RPM builds by @vidplace7 in https://github.com/meshtastic/firmware/pull/8659\r\n* Linux: Fix silly EPEL9 mistake by @vidplace7 in https://github.com/meshtastic/firmware/pull/8660\r\n* Fix ble rssi crash by @thebentern in https://github.com/meshtastic/firmware/pull/8661\r\n* Mqtt: do not try to send packets when it disconnected by @omgbebebe in https://github.com/meshtastic/firmware/pull/8658\r\n* Persist favourites on NodeDB reset by @ford-jones in https://github.com/meshtastic/firmware/pull/8292\r\n* Don't ack messages when mqtt client proxy is on but only uplink by @RCGV1 in https://github.com/meshtastic/firmware/pull/8578\r\n* Add API types, state, and log message in Debug screen. Added persistent \"Connected\" icon by @jp-bennett in https://github.com/meshtastic/firmware/pull/8576\r\n* Drop PKI acks if there is no downlink on MQTTClientProxy by @RCGV1 in https://github.com/meshtastic/firmware/pull/8580\r\n* Add the Heltec v4 expansion box. by @Quency-D in https://github.com/meshtastic/firmware/pull/8539\r\n* Update to Pro-micro variants by @NomDeTom in https://github.com/meshtastic/firmware/pull/8600\r\n* Cleanup unnecessary global dereferencing in CryptoEngine by @jasonbcox in https://github.com/meshtastic/firmware/pull/8611\r\n* Fix null pointer dereference in radio chip region check by @Andrik45719 in https://github.com/meshtastic/firmware/pull/8613\r\n* Feat/6704 neighbor info on demand by @DaneEvans in https://github.com/meshtastic/firmware/pull/8523\r\n* Remove fixed scaling in Digital Clock by @Xaositek in https://github.com/meshtastic/firmware/pull/8620\r\n* Allow Preserving Favorites in BaseUI menus by @Xaositek in https://github.com/meshtastic/firmware/pull/8647\r\n* native: Try to look for a config file based on Raspberry Pi HAT vendor by @Stary2001 in https://github.com/meshtastic/firmware/pull/8608\r\n* Remove gating for Display Options by @Xaositek in https://github.com/meshtastic/firmware/pull/8651\r\n* mqtt: do not try to send packets when it disconnected by @omgbebebe in https://github.com/meshtastic/firmware/pull/8658\r\n\r\n## New Contributors\r\n* @weebl2000 made their first contribution in https://github.com/meshtastic/firmware/pull/8560\r\n* @omgbebebe made their first contribution in https://github.com/meshtastic/firmware/pull/8658\r\n* @viric made their first contribution in https://github.com/meshtastic/firmware/pull/7882\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.13.597fa0b...v2.7.15.567b8ea"
},
{
- "id": "v2.5.20.4c97351",
- "title": "Meshtastic Firmware 2.5.20.4c97351 Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.20.4c97351",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.20.4c97351/firmware-stm32-2.5.20.4c97351.zip",
- "release_notes": "> [!IMPORTANT] \r\n> Linux packages have been migrated from GitHub Releases to distro-specific build services.\r\n> For additional information see: [Installing meshtasticd](https://meshtastic.org/docs/hardware/devices/linux-native-hardware/#installing-meshtasticd)\r\n\r\n## ⚠️ Known issues \r\n* We are cautiously optimistic that many of the intrinsic file system (LittleFS) issues on NRF52 based devices and instability should be resolved in this release. A [full flash erase](https://meshtastic.org/docs/getting-started/flashing-firmware/nrf52/nrf52-erase/) may be required if you are experiencing LFS assert issues.\r\n* Bluetooth was inadvertently disabled for T-Deck and T-Watch devices, preventing pairing with client apps. This issue will be resolved in the next alpha release after 2.5.21.\r\n\r\n## 🚀 Enhancements\r\n* Canned messages: allow GPIO0 with \"scan and select\" input by @todd-herbert in https://github.com/meshtastic/firmware/pull/5838\r\n* COPR: Switch from hook to `copr_cli` by @vidplace7 in https://github.com/meshtastic/firmware/pull/5864\r\n* Initiate magnetometer based compass calibration from button presses by @danwelch3 in https://github.com/meshtastic/firmware/pull/5553\r\n* Slight rework of CH341 HAL by @psiegl in https://github.com/meshtastic/firmware/pull/5848\r\n* Alert app messages should be treated as text by @thebentern in https://github.com/meshtastic/firmware/pull/5878\r\n* COPR: Switch to forked GitHub Action by @vidplace7 in https://github.com/meshtastic/firmware/pull/5871\r\n* Initial commit of a fuzzer for Meshtastic by @esev in https://github.com/meshtastic/firmware/pull/5790\r\n* Build docker images with other linux release channels by @vidplace7 in https://github.com/meshtastic/firmware/pull/5837\r\n* No focus on new messages if auto-carousel is off by @isseysandei in https://github.com/meshtastic/firmware/pull/5881\r\n* Create BananaPi-BPI-R4-sx1262.yaml by @markbirss in https://github.com/meshtastic/firmware/pull/5897\r\n* Update RAK2560 code by @caveman99 in https://github.com/meshtastic/firmware/pull/5844\r\n* Docker: tag intermediate containers by @vidplace7 in https://github.com/meshtastic/firmware/pull/5910\r\n* Debian: Switch OBS repo to `network:Meshtastic` by @vidplace7 in https://github.com/meshtastic/firmware/pull/5912\r\n* Docker: Switch tags to newline-seperated by @vidplace7 in https://github.com/meshtastic/firmware/pull/5919\r\n\r\n## 🐛 Bug fixes and maintenance\r\n\r\n* Changed GPS buad rate to 9600 by @SignalMedic in https://github.com/meshtastic/firmware/pull/5786\r\n* Fixed localization on bigger screens by @kyberpunk in https://github.com/meshtastic/firmware/pull/5695\r\n* Small fix: Reference COPR group correctly (with `@`) by @vidplace7 in https://github.com/meshtastic/firmware/pull/5872\r\n* Fix detection of lark weather station and add rain sensor by @caveman99 in https://github.com/meshtastic/firmware/pull/5874\r\n* Reboot before formatting LittleFS by @esev in https://github.com/meshtastic/firmware/pull/5900\r\n* Fix possible memory leak for `ROUTER_LATE` by @GUVWAF in https://github.com/meshtastic/firmware/pull/5901\r\n* Move OpenWRT configs to subdir by @vidplace7 in https://github.com/meshtastic/firmware/pull/5902\r\n* Add quotes around ${platformio.build_dir} to avoid invalid paths by @esev in https://github.com/meshtastic/firmware/pull/5906\r\n* NRF52 - Remove file totally before opening write by @thebentern in https://github.com/meshtastic/firmware/pull/5916\r\n* Peg NRF52 arduino to meshtastic fork with LFS bluetooth fix by @thebentern in https://github.com/meshtastic/firmware/pull/5924\r\n* TFT Cherrypick: WiFi.persistent(false) by @fifieldt in https://github.com/meshtastic/firmware/pull/5925\r\n\r\n## New Contributors\r\n* @danwelch3 made their first contribution in https://github.com/meshtastic/firmware/pull/5553\r\n* @SignalMedic made their first contribution in https://github.com/meshtastic/firmware/pull/5786\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.19.f9876cf...v2.5.20.4c97351"
+ "id": "v2.6.11.60ec05e",
+ "title": "Meshtastic Firmware 2.6.11.60ec05e Beta",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.11.60ec05e",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.11.60ec05e/firmware-esp32-2.6.11.60ec05e.zip",
+ "release_notes": "> [!CAUTION] \r\n> In older firmware, generated public/private keys may have insufficient entropy, resulting in the possibility of key reuse across devices. This release delays key generation until the user sets a LoRa region, and also mixes in additional sources of randomness. Additionally, if one of the known key collisions are detected, the user is notified, and should regenerate keys as soon as possible.\r\n\r\n## 🚀 Enhancements\r\n* Add --1200bps-reset param to device-install/update scripts by @ThatKalle in https://github.com/meshtastic/firmware/pull/6752\r\n* Generate keys when Lora Region is set by @jp-bennett in https://github.com/meshtastic/firmware/pull/6951\r\n* Seeed_xiao_nrf52840_kit improvements by @ndoo in https://github.com/meshtastic/firmware/pull/6930\r\n* Add InkHUD driver for WeAct Studio 2.9\" display module by @todd-herbert in https://github.com/meshtastic/firmware/pull/6963\r\n* [Variant] nomadstar meteor pro by @CypressXt in https://github.com/meshtastic/firmware/pull/6742\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* fix: Respect LED_STATE_ON for power and user LED by @ndoo in https://github.com/meshtastic/firmware/pull/6976\r\n* Chore(deps): update platformio/espressif32 to v6.11.0 by @renovate in https://github.com/meshtastic/firmware/pull/6900\r\n* Update Alpine to 3.22 by @vidplace7 in https://github.com/meshtastic/firmware/pull/6927\r\n* Clean up install & update shell scripts by @roens in https://github.com/meshtastic/firmware/pull/6839\r\n* Addition of Device Role inside of userPrefs.jsonc by @Crank-Git in https://github.com/meshtastic/firmware/pull/6972\r\n* Chore(deps): update platformio/ststm32 to v19.2.0 by @renovate in https://github.com/meshtastic/firmware/pull/6901\r\n* Chore(deps): update meshtastic/device-ui digest to 2fd19f8 by @renovate in https://github.com/meshtastic/firmware/pull/6982\r\n* Add note to hydra to note that the button pin has no pull-up by @NomDeTom in https://github.com/meshtastic/firmware/pull/6979\r\n* Chore(deps): update meshtastic/device-ui digest to 1b520fc by @renovate in https://github.com/meshtastic/firmware/pull/6991\r\n* Update heltec t114 URL by @dieseltravis in https://github.com/meshtastic/firmware/pull/7004\r\n* Update URL for ThinkNode M1 by @dieseltravis in https://github.com/meshtastic/firmware/pull/7005\r\n* Improve support for Heltec Wireless Bridge by @berlincount in https://github.com/meshtastic/firmware/pull/6647\r\n* Warn users about low entropy keys by @jp-bennett in https://github.com/meshtastic/firmware/pull/7003\r\n* T-watch screen misalignment fix by @HarukiToreda in https://github.com/meshtastic/firmware/pull/6996\r\n* Fix for T-Deck Plus: disable touch IRQ / enable custom touch driver by @mverch67 in https://github.com/meshtastic/firmware/pull/6988\r\n* Create lora-piggystick-lr1121.yaml by @markbirss in https://github.com/meshtastic/firmware/pull/7010\r\n\r\n## New Contributors\r\n* @roens made their first contribution in https://github.com/meshtastic/firmware/pull/6839\r\n* @Crank-Git made their first contribution in https://github.com/meshtastic/firmware/pull/6972\r\n* @dieseltravis made their first contribution in https://github.com/meshtastic/firmware/pull/7004\r\n* @berlincount made their first contribution in https://github.com/meshtastic/firmware/pull/6647\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.10.9ce4455...v2.6.11.60ec05e"
},
{
- "id": "v2.5.18.89ebafc",
- "title": "Meshtastic Firmware 2.5.18.89ebafc Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.18.89ebafc",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.18.89ebafc/firmware-stm32-2.5.18.89ebafc.zip",
- "release_notes": "## ⚠️ Known issues \r\n* The new `ROUTER_LATE` role has some known issues with delaying rebroadcasts beyond the desired window. It is recommended to avoid this role on this release version.\r\n* For NRF52 devices, there are additional fixes for filesystem corruption available in 2.5.20 onwards. If you have an NRF52-based device we recommend you select a later release.\r\n\r\n## 🚀 Enhancements\r\n* Synchronize test workflow packages with native by @esev in https://github.com/meshtastic/firmware/pull/5664\r\n* More accurately determine if MQTT uses the default server by @esev in https://github.com/meshtastic/firmware/pull/5663\r\n* Generate a coverage report for End to end tests by @esev in https://github.com/meshtastic/firmware/pull/5667\r\n* Include log messages in unit tests by @esev in https://github.com/meshtastic/firmware/pull/5666\r\n* Add czech oled localization by @kyberpunk in https://github.com/meshtastic/firmware/pull/5661\r\n* Meshtasticd-docker: simplify, add USB compose by @vidplace7 in https://github.com/meshtastic/firmware/pull/5662\r\n* Alpine Docker image (musl CI target) by @vidplace7 in https://github.com/meshtastic/firmware/pull/5659\r\n* Cherry-pick: device-ui persistency by @fifieldt in https://github.com/meshtastic/firmware/pull/5570\r\n* Add packet length to printPacket() by @jp-bennett in https://github.com/meshtastic/firmware/pull/5672\r\n* Enable the autoconf settings for MPR121 based keyboards by @aussieklutz in https://github.com/meshtastic/firmware/pull/5680\r\n\r\n## 🐛 Bug fixes & maintenance\r\n* Unset received SNR/RSSI values upon receiving packet via MQTT by @GUVWAF in https://github.com/meshtastic/firmware/pull/5668\r\n* Fix for nrf52 lfs assert boot loop by @tavdog in https://github.com/meshtastic/firmware/pull/5670\r\n* Remove remaining \\n from log lines. by @fifieldt in https://github.com/meshtastic/firmware/pull/5675\r\n* TFT branch - minor cherry picks by @fifieldt in https://github.com/meshtastic/firmware/pull/5676\r\n* Cherry-pick: Mesh-tab by @fifieldt in https://github.com/meshtastic/firmware/pull/5674\r\n* Fix RP2040 crash issue #5665. by @Mictronics in https://github.com/meshtastic/firmware/pull/5678\r\n* Exclude health telemetry by macro by @thebentern in https://github.com/meshtastic/firmware/pull/5679\r\n* Add new ROUTER_LATE role by @erayd in https://github.com/meshtastic/firmware/pull/5528\r\n* More meshtab cherry-pick by @fifieldt in https://github.com/meshtastic/firmware/pull/5681\r\n* TFT branch synch grab-bag by @fifieldt in https://github.com/meshtastic/firmware/pull/5683\r\n* Minor TFT branch cherry-picks by @fifieldt in https://github.com/meshtastic/firmware/pull/5682\r\n\r\n## New Contributors\r\n* @kyberpunk made their first contribution in https://github.com/meshtastic/firmware/pull/5661\r\n* @erayd made their first contribution in https://github.com/meshtastic/firmware/pull/5528\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.17.b4b2fd6...v2.5.18.89ebafc"
- },
- {
- "id": "v2.5.15.79da236",
- "title": "Meshtastic Firmware 2.5.15.79da236 Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.15.79da236",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.15.79da236/firmware-esp32c3-2.5.15.79da236.zip",
- "release_notes": "## 🚀 Enhancements\r\n* Support for the ClimateGuard RadSens Geiger-Muller tube by @jake-b in https://github.com/meshtastic/firmware/pull/5425\r\n* Enable MQTT with TLS on RPi picow by @tomasdubec in https://github.com/meshtastic/firmware/pull/5442\r\n* Don't powersave on Wifi by @thebentern in https://github.com/meshtastic/firmware/pull/5443\r\n\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Fixes https://github.com/meshtastic/firmware/issues/5434 by @caveman99 in https://github.com/meshtastic/firmware/pull/5435\r\n* Fix memory leaks by adding missing `free()` calls before early returns in `MQTT::onReceive` by @CTassisF in https://github.com/meshtastic/firmware/pull/5439\r\n* Clean up some inline functions by @thebentern in https://github.com/meshtastic/firmware/pull/5454\r\n* Use isWithinTimespanMs to avoid refererence to NodeDb instance inside of NodeDb by @thebentern in https://github.com/meshtastic/firmware/pull/5453\r\n* Fixes CORS for meshtasticd to allow use of clients on other origins by @liamcottle in https://github.com/meshtastic/firmware/pull/5463\r\n* Remove ATECC crypto chip placeholder code by @thebentern in https://github.com/meshtastic/firmware/pull/5461\r\n* GPS.h cleanups round 3. by @charlieh0tel in https://github.com/meshtastic/firmware/pull/5447\r\n* Fix ukrainian fonts by @panaceya in https://github.com/meshtastic/firmware/pull/5468\r\n* Disable lightsleep for indicator by @Wvirgil123 in https://github.com/meshtastic/firmware/pull/5470\r\n* Warnings and log cleanup by @thebentern in https://github.com/meshtastic/firmware/pull/5472\r\n* Revert \"Seems like the last DIY board that's not \"extra\"\" by @thebentern in https://github.com/meshtastic/firmware/pull/5446\r\n* Removing 1.0 legacy boards from releases and completely removing Heltec wireless capsule from support by @thebentern in https://github.com/meshtastic/firmware/pull/5436\r\n* A second round of cleanup on GPS.h by @charlieh0tel in https://github.com/meshtastic/firmware/pull/5433\r\n* Actually gunzip all the files when building a .deb by @jp-bennett in https://github.com/meshtastic/firmware/pull/5449\r\n* Cleanup i2c scan logs and macro to save some bytes and remain consistent by @thebentern in https://github.com/meshtastic/firmware/pull/5455\r\n\r\n## New Contributors\r\n* @jake-b made their first contribution in https://github.com/meshtastic/firmware/pull/5425\r\n* @CTassisF made their first contribution in https://github.com/meshtastic/firmware/pull/5439\r\n* @tomasdubec made their first contribution in https://github.com/meshtastic/firmware/pull/5442\r\n* @liamcottle made their first contribution in https://github.com/meshtastic/firmware/pull/5463\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.14.f2ee0df...v2.5.15.79da236"
- },
- {
- "id": "v2.5.14.f2ee0df",
- "title": "Meshtastic Firmware 2.5.14.f2ee0df Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.14.f2ee0df",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.14.f2ee0df/firmware-stm32-2.5.14.f2ee0df.zip",
- "release_notes": "> [!IMPORTANT] \r\n> When we initially released the 2.5 version of the firmware, [we added a new bit `OkToMqtt` to packets to express the intent of users to opt-in to their packets being uplinked to an MQTT broker](https://meshtastic.org/docs/configuration/radio/lora/#ok-to-mqtt\r\n). \r\n>\r\n>Prior to this, uplinking of packets was just implicit fact, which was not fair to users wishing to remain off of any public brokers, maps, etc. However, in order to not immediately begin dumping all of the traffic from previous firmware versions from going to MQTT, we allowed for a grace period to transition folks to the newer 2.5.X firmware, where they can now opt-in, or remain off (by default). This grace period has concluded. The firmware will now enforce that the `OkToMqtt` bit is both present and opted into before uplinking any packets to MQTT. \r\n\r\n## 🚀 Enhancements \r\n* Minimize time between channel scan and actual transmit by @GUVWAF in https://github.com/meshtastic/firmware/pull/5383\r\n* Allows all 3 PKI keys to be added to userPrefs.h (#4969) and a tool. by @gjelsoe in https://github.com/meshtastic/firmware/pull/5368\r\n* Check for OkToMqtt flag presence before uplinking to MQTT by @thebentern in https://github.com/meshtastic/firmware/pull/5413\r\n* Telemetry can respond to want-response for LocalStats variant by @thebentern in https://github.com/meshtastic/firmware/pull/5414\r\n* Add canned message and keyboard in indicator board by @Dylanliacc in https://github.com/meshtastic/firmware/pull/5410\r\n* Add smiley emoji by @jcyrio in https://github.com/meshtastic/firmware/pull/5391\r\n* Enable trace route function on rak wismeshtap platform by @DanielCao0 in https://github.com/meshtastic/firmware/pull/5389\r\n* Add GPS in indicator board by @Dylanliacc in https://github.com/meshtastic/firmware/pull/5411\r\n* /api/v1/fromradio: add OPTIONS handler for CORS. by @cpatulea in https://github.com/meshtastic/firmware/pull/5386\r\n* Create a specific hw_model for WisMesh Tap by @thebentern in https://github.com/meshtastic/firmware/pull/5400\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Make heart emoji usable by @jcyrio in https://github.com/meshtastic/firmware/pull/5403\r\n* Fix RTC time injection and consolidate position logic by @thebentern in https://github.com/meshtastic/firmware/pull/5396\r\n* Update arduino-pico core to fix sporadic hangs by @GUVWAF in https://github.com/meshtastic/firmware/pull/5406\r\n* Update platform-raspberrypi also by @GUVWAF in https://github.com/meshtastic/firmware/pull/5407\r\n* --web added to device-install(.sh/.bat) by @gjelsoe in https://github.com/meshtastic/firmware/pull/5405\r\n* Fixed NMEA sentence issue in CalTopo as well as bug with no printing all of the nodes by @thebentern in https://github.com/meshtastic/firmware/pull/5412\r\n* --web littlefswebui-* typo fix by @gjelsoe in https://github.com/meshtastic/firmware/pull/5416\r\n* Temporarily disable MDNS when MQTT is enabled on RP2040 by @GUVWAF in https://github.com/meshtastic/firmware/pull/5418\r\n* Seems like the last DIY board that's not \"extra\" by @jp-bennett in https://github.com/meshtastic/firmware/pull/5420\r\n* Cherry pick tdeck fixes by @thebentern in https://github.com/meshtastic/firmware/pull/5422\r\n* Update build-native.sh by @madeofstown in https://github.com/meshtastic/firmware/pull/5415\r\n* Cleans up visibility in GPS.h by @charlieh0tel in https://github.com/meshtastic/firmware/pull/5426\r\n* Fix admin key loading from userPrefs.h by @Mictronics in https://github.com/meshtastic/firmware/pull/5417\r\n* Try to detect dfrobot station to tell it apart from an ublox gps. by @caveman99 in https://github.com/meshtastic/firmware/pull/5393\r\n* Remove BMA-423 and STK8X by default by @thebentern in https://github.com/meshtastic/firmware/pull/5429\r\n\r\n## New Contributors\r\n* @cpatulea made their first contribution in https://github.com/meshtastic/firmware/pull/5386\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.13.1a06f88...v2.5.14.f2ee0df"
- },
- {
- "id": "v2.5.13.1a06f88",
- "title": "Meshtastic Firmware 2.5.13.1a06f88 Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.13.1a06f88",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.13.1a06f88/firmware-esp32c6-2.5.13.1a06f88.zip",
- "release_notes": "> [!WARNING]\r\n> ### We are making the Web UI on ESP32 optional going forward: [the full details](https://github.com/meshtastic/firmware/discussions/5381).\r\n> This is a re-cut release of 2.5.13. If you performed an erase and install of `2.5.13.295278b` on an ESP32 based device and experienced panic and reboot on saving to the filesystem, performing a fresh install of this release should resolve the issue.\r\n\r\n## 🚀 Enhancements\r\n* Add setting to transmit NeighborInfo over LoRa by @GUVWAF in https://github.com/meshtastic/firmware/pull/5286\r\n* Fix non-primary channel usage for non-PKC packets by @GUVWAF in https://github.com/meshtastic/firmware/pull/5287\r\n* Remove scary warning about full NodeDB by @fifieldt in https://github.com/meshtastic/firmware/pull/5292\r\n* Pin library versions in platform.io by @jp-bennett in https://github.com/meshtastic/firmware/pull/5293\r\n* Update dependency versions by @fifieldt in https://github.com/meshtastic/firmware/pull/5299\r\n* Exclude some niche modules by default and populate exclude_modules by @thebentern in https://github.com/meshtastic/firmware/pull/5300\r\n* Rak10701 (rak wismeshtap) optimization by @DanielCao0 in https://github.com/meshtastic/firmware/pull/5280\r\n* Coerce minimum neighborinfo interval on startup by @thebentern in https://github.com/meshtastic/firmware/pull/5314\r\n* Add back some details to the PhoneAPI logs by @thebentern in https://github.com/meshtastic/firmware/pull/5313\r\n* Radiolib update by @caveman99 in https://github.com/meshtastic/firmware/pull/5246\r\n* Fix sending duplicate packets to PhoneAPI/MQTT by @GUVWAF in https://github.com/meshtastic/firmware/pull/5315\r\n* Don't send to public channel by @gjelsoe in https://github.com/meshtastic/firmware/pull/5310\r\n* Portduino packaging: Move meshtastic/web out of `/usr/share/doc` by @vidplace7 in https://github.com/meshtastic/firmware/pull/5323\r\n* Reduce the flash usage of wismeshtap platform by @DanielCao0 in https://github.com/meshtastic/firmware/pull/5322\r\n* Add support for ignoring nodes with `is_ignored` field in NodeInfo by @mdesmedt in https://github.com/meshtastic/firmware/pull/5319\r\n* RP2040: Update core; add mDNS support by @GUVWAF in https://github.com/meshtastic/firmware/pull/5355\r\n\r\n## 🐛 Bug fixes\r\n* Fix memory leak in MQTT by @GUVWAF in https://github.com/meshtastic/firmware/pull/5311\r\n* Don't attempt to save NodeDB on low-batt shutdown to prevent FS corruption by @thebentern in https://github.com/meshtastic/firmware/pull/5312\r\n* Fix syntax error with package builds by @fifieldt in https://github.com/meshtastic/firmware/pull/5302\r\n* Package file move - include dotfiles by @fifieldt in https://github.com/meshtastic/firmware/pull/5303\r\n* Fix another heap leak by @GUVWAF in https://github.com/meshtastic/firmware/pull/5328\r\n* Handle repeated packet after potentially canceling previous Tx by @GUVWAF in https://github.com/meshtastic/firmware/pull/5330\r\n* Read voltage during init fixes #5276 by @Blake-Latchford in https://github.com/meshtastic/firmware/pull/5332\r\n* Only allow 30 seconds minimum for power.on_battery_shutdown_after_secs by @thebentern in https://github.com/meshtastic/firmware/pull/5337\r\n* Decrease max nodes for NRF52 to 80 as workaround to prevent FS blowouts by @thebentern in https://github.com/meshtastic/firmware/pull/5338\r\n* Revert \"Decrease max nodes for NRF52 to 80 as workaround to prevent FS blowouts\" by @thebentern in https://github.com/meshtastic/firmware/pull/5340\r\n* Remove log spam when reading INA sensor. by @Mictronics in https://github.com/meshtastic/firmware/pull/5345\r\n* Migrate NRF52 devices max nodes down to 80 for now to prevent file system blowouts by @thebentern in https://github.com/meshtastic/firmware/pull/5346\r\n* Adds fixed GPS, BUTTON_PIN and BLE code to userPrefs.h by @gjelsoe in https://github.com/meshtastic/firmware/pull/5341\r\n* Add sudo to apt-get commands for Raspbian Build by @fifieldt in https://github.com/meshtastic/firmware/pull/5364\r\n* Typo fix in build_raspbian.yml by @fifieldt in https://github.com/meshtastic/firmware/pull/5365\r\n* Bug fixed in ExternalNotificationModule by @gjelsoe in https://github.com/meshtastic/firmware/pull/5375\r\n* Cleanup static files from bad Web UI bundle on 2.5.13 release by @thebentern in https://github.com/meshtastic/firmware/pull/5376\r\n\r\n## New Contributors\r\n* @mdesmedt made their first contribution in https://github.com/meshtastic/firmware/pull/5319\r\n* @Blake-Latchford made their first contribution in https://github.com/meshtastic/firmware/pull/5332\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.12.aa184e6...v2.5.13.1a06f88"
- },
- {
- "id": "v2.5.11.8e2a3e5",
- "title": "Meshtastic Firmware 2.5.11.8e2a3e5 Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.11.8e2a3e5",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.11.8e2a3e5/firmware-stm32-2.5.11.8e2a3e5.zip",
- "release_notes": "## ⚠️ Known issues \r\n* In some cases, connected apps may show duplicate received packets. This issue will be fixed in version 2.5.13.\r\n\r\n## 🚀 Enhancements \r\n* PIO_ENV by @caveman99 in https://github.com/meshtastic/firmware/pull/5239\r\n* Spell check all Code by @Technologyman00 in https://github.com/meshtastic/firmware/pull/5228\r\n* Improve ACK logic for responses and repeated packets by @GUVWAF in https://github.com/meshtastic/firmware/pull/5232\r\n* Musl compatibility by @vidplace7 in https://github.com/meshtastic/firmware/pull/5219\r\n* Disable automatic NodeInfo request when NodeDB is full by @GUVWAF in https://github.com/meshtastic/firmware/pull/5255\r\n* Exclude preferred routing roles from nodeinfo interrogation behavior by @thebentern in https://github.com/meshtastic/firmware/pull/5242\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Fix displays showing \"GPS Not Present\" until first lock by @fifieldt in https://github.com/meshtastic/firmware/pull/5229\r\n* LR1110 - remove old comment referring to non-existent function. by @fifieldt in https://github.com/meshtastic/firmware/pull/5233\r\n* Log cleanups by @fifieldt in https://github.com/meshtastic/firmware/pull/5135\r\n* Fix cppcheck HIGH error by @fifieldt in https://github.com/meshtastic/firmware/pull/5250\r\n* More configs by @jp-bennett in https://github.com/meshtastic/firmware/pull/5253\r\n* Pass#2: Lots more savings in logs and string reduction surgery by @thebentern in https://github.com/meshtastic/firmware/pull/5251\r\n* Release no-LoRa packet after sending to phone by @GUVWAF in https://github.com/meshtastic/firmware/pull/5254\r\n* More reduction by @thebentern in https://github.com/meshtastic/firmware/pull/5256\r\n* Fix display of more Unicode symbols by @timo-mart in https://github.com/meshtastic/firmware/pull/5252\r\n\r\n## New Contributors\r\n* @timo-mart made their first contribution in https://github.com/meshtastic/firmware/pull/5252\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.10.0fc5c9b...v2.5.11.8e2a3e5"
- },
- {
- "id": "v2.5.9.936260f",
- "title": "Meshtastic Firmware 2.5.9.936260f Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.9.936260f",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.9.936260f/firmware-stm32-2.5.9.936260f.zip",
- "release_notes": "## ⚠️ Known issues \r\n* Enabling NeighborInfo module can cause device crashes #5235\r\n\r\n## 🚀 Enhancements\r\n* Default rebroadcast mode for Router and Repeater to ignore problematic portnums by @thebentern in https://github.com/meshtastic/firmware/pull/5178\r\n* Added PA1616S GPS module by @Megaceryle-alcyon in https://github.com/meshtastic/firmware/pull/5157\r\n* Icarus - Custom PCB by @Babyyoda777 in https://github.com/meshtastic/firmware/pull/5155\r\n* Native config.d by @jp-bennett in https://github.com/meshtastic/firmware/pull/5165\r\n\r\n## 🐛 Bug fixes & maintenance\r\n* Fix missing includes by @mverch67 in https://github.com/meshtastic/firmware/pull/5138\r\n* Update variant.h fix sx1280 power by @markbirss in https://github.com/meshtastic/firmware/pull/5140\r\n* T1000-E Peripherals by @caveman99 in https://github.com/meshtastic/firmware/pull/5141\r\n* Cherry-picks by @jp-bennett in https://github.com/meshtastic/firmware/pull/5166\r\n* Cherry-pick: diy mesh-tab initial files by @fifieldt in https://github.com/meshtastic/firmware/pull/5169\r\n* Cherry-pick: unphone support by @fifieldt in https://github.com/meshtastic/firmware/pull/5174\r\n* Cherry-pick: fix nrf builds by @fifieldt in https://github.com/meshtastic/firmware/pull/5172\r\n* Cherry-pick bin/config-dist.yml from TFT-GUI-Work by @fifieldt in https://github.com/meshtastic/firmware/pull/5168\r\n* Fix long lock-times by @spiffysec in https://github.com/meshtastic/firmware/pull/5160\r\n* De-duplicate Ambient LED management code by @fifieldt in https://github.com/meshtastic/firmware/pull/5156\r\n* De-duplicate log-level determination by @fifieldt in https://github.com/meshtastic/firmware/pull/5148\r\n* Remove unused AXP debug code by @fifieldt in https://github.com/meshtastic/firmware/pull/5149\r\n* Fix tracker build by @caveman99 in https://github.com/meshtastic/firmware/pull/5151\r\n\r\n\r\n## New Contributors\r\n* @Babyyoda777 made their first contribution in https://github.com/meshtastic/firmware/pull/5155\r\n* @spiffysec made their first contribution in https://github.com/meshtastic/firmware/pull/5160\r\n* @Megaceryle-alcyon made their first contribution in https://github.com/meshtastic/firmware/pull/5157\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.8.6485f03...v2.5.9.936260f"
- },
- {
- "id": "v2.5.8.6485f03",
- "title": "Meshtastic Firmware 2.5.8.6485f03 Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.8.6485f03",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.8.6485f03/firmware-stm32-2.5.8.6485f03.zip",
- "release_notes": "## ⚠️ Known issues \r\n* Enabling NeighborInfo module can cause device crashes #5235\r\n\r\n## 🚀 Enhancements\r\n* Coerce minimum telemetry interval of 30 minutes on defaults and make new default interval one hour by @thebentern in https://github.com/meshtastic/firmware/pull/5086\r\n* Add buzzer feedback on GPS toggle by @Technologyman00 in https://github.com/meshtastic/firmware/pull/5090\r\n* Add `-p` flag by @madeofstown in https://github.com/meshtastic/firmware/pull/5093\r\n* Initial NODENUM_BROADCAST_NO_LORA implementation with NeighborInfo module by @thebentern in https://github.com/meshtastic/firmware/pull/5087\r\n* Move 115200 baud GNSS probe earlier by @thebentern in https://github.com/meshtastic/firmware/pull/5101\r\n* MPR121 Touch IC Based Keypad Input Module by @aussieklutz in https://github.com/meshtastic/firmware/pull/5103\r\n* Add RFC 3927 IP address space to private IP checks by @rbrtio in https://github.com/meshtastic/firmware/pull/5115\r\n* Update meshtasticd.service by @yNosGR in https://github.com/meshtastic/firmware/pull/5118\r\n* Add Configurable UPLINK_ENABLED and DOWNLINK_ENABLED in userPrefs.h by @panaceya in https://github.com/meshtastic/firmware/pull/5120\r\n* Add device unique id by @thebentern in https://github.com/meshtastic/firmware/pull/5092\r\n* Account for port number in MQTT server by @JohnathonMohr in https://github.com/meshtastic/firmware/pull/5084\r\n\r\n## 🐛 Bug fixes & maintenance\r\n* Revert \"Permanently engage !CTRL\" by @caveman99 in https://github.com/meshtastic/firmware/pull/5095\r\n* Fix GPS_DEBUG output by @fifieldt in https://github.com/meshtastic/firmware/pull/5100\r\n* Wide_Lora uses 12 symbols to be compatible with SX1280 by @caveman99 in https://github.com/meshtastic/firmware/pull/5112\r\n* Fix rebroadcasting encrypted packets when `KNOWN_ONLY`/`LOCAL_ONLY` is used by @GUVWAF in https://github.com/meshtastic/firmware/pull/5109\r\n\r\n\r\n## New Contributors\r\n* @Technologyman00 made their first contribution in https://github.com/meshtastic/firmware/pull/5090\r\n* @madeofstown made their first contribution in https://github.com/meshtastic/firmware/pull/5093\r\n* @aussieklutz made their first contribution in https://github.com/meshtastic/firmware/pull/5103\r\n* @rbrtio made their first contribution in https://github.com/meshtastic/firmware/pull/5115\r\n* @yNosGR made their first contribution in https://github.com/meshtastic/firmware/pull/5118\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.7.f77c87d...v2.5.8.6485f03"
- },
- {
- "id": "v2.5.7.f77c87d",
- "title": "Meshtastic Firmware 2.5.7.f77c87d Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.7.f77c87d",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.7.f77c87d/firmware-stm32-2.5.7.f77c87d.zip",
- "release_notes": "## Enhancements\r\n* Remove waypoint and text message frames on NodeDB reset as well by @thebentern in https://github.com/meshtastic/firmware/pull/5029\r\n* Fix SH1107 - Set Geometry 128x128 by @markbirss in https://github.com/meshtastic/firmware/pull/5033\r\n* Implement rebroadcast mode NONE by @thebentern in https://github.com/meshtastic/firmware/pull/5040\r\n* Remove newline from logging statements. by @caveman99 in https://github.com/meshtastic/firmware/pull/5022\r\n* [Board]: Support for M5Stack CoreS3 (Part 1: radio) by @lboue in https://github.com/meshtastic/firmware/pull/5049\r\n* Add in RF95 support to Pro-micro DIY by @Nestpebble in https://github.com/meshtastic/firmware/pull/5055\r\n* Drop oem.proto support in favor of userprefs by @caveman99 in https://github.com/meshtastic/firmware/pull/5061\r\n* Ws85 updates : set want_ack, high_priority, add temperature. by @tavdog in https://github.com/meshtastic/firmware/pull/5052\r\n* Add MQTT exception for private IP address server by @JohnathonMohr in https://github.com/meshtastic/firmware/pull/5072\r\n* Ensure the MQTT address is an IPv4 before determining it's private by @JohnathonMohr in https://github.com/meshtastic/firmware/pull/5081\r\n\r\n## Bug fixes\r\n* Remove waypoint and text message frames on NodeDB reset as well by @thebentern in https://github.com/meshtastic/firmware/pull/5029\r\n* Retain `fixed_position` during reset-nodedb by @andrekir in https://github.com/meshtastic/firmware/pull/5067\r\n* Fix incorrect va_start calls by @jepler in https://github.com/meshtastic/firmware/pull/5076\r\n* Permanently engage !CTRL by @caveman99 in https://github.com/meshtastic/firmware/pull/5036\r\n\r\n\r\n## New Contributors\r\n* @jepler made their first contribution in https://github.com/meshtastic/firmware/pull/5076\r\n* @JohnathonMohr made their first contribution in https://github.com/meshtastic/firmware/pull/5072\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.6.d55c08d...v2.5.7.f77c87d"
- },
- {
- "id": "v2.5.6.d55c08d",
- "title": "Meshtastic Firmware 2.5.6.d55c08d Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.6.d55c08d",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.6.d55c08d/firmware-stm32-2.5.6.d55c08d.zip",
- "release_notes": "> [!WARNING]\r\n> This is a re-cut release of 2.5.6. If you performed an erase and install of 2.5.6.ad8747d on an ESP32 based device and experienced boot issues. Performing a fresh install of this release should resolve the issue.\r\n\r\n## Enhancements\r\n* UserPrefs - Preconfigure up to 3 channels, GPS Mode by @medentem in https://github.com/meshtastic/firmware/pull/4930\r\n* Start of generating json manifest of macros in userPrefs.h by @thebentern in https://github.com/meshtastic/firmware/pull/4946\r\n* Coalesce duplicated method GetTimeSinceMeshPacket by @fifieldt in https://github.com/meshtastic/firmware/pull/4968\r\n* Which Module wants a UI Frame? by @fifieldt in https://github.com/meshtastic/firmware/pull/4967\r\n* Upgrade nanopb by @thebentern in https://github.com/meshtastic/firmware/pull/4973\r\n* Add RAK4631 Ethernet Gateway with working JSON output to MQTT by @beegee-tokyo in https://github.com/meshtastic/firmware/pull/4661\r\n* Preliminary Othernet Dreamcatcher Support by @caveman99 in https://github.com/meshtastic/firmware/pull/4933\r\n* Toggle Bluetooth with Fn+b shortcut by @HarukiToreda in https://github.com/meshtastic/firmware/pull/4977\r\n* Add health telemetry module by @fifieldt @thebentern in https://github.com/meshtastic/firmware/pull/4927\r\n* First version of a DeepSleep state for the RP2040 by @TheMalkavien in https://github.com/meshtastic/firmware/pull/4976\r\n* Add frequencies for Philippines by @fifieldt in https://github.com/meshtastic/firmware/pull/4951\r\n* Set TZ config from string if unset by @jp-bennett in https://github.com/meshtastic/firmware/pull/4979\r\n* Switch Environment Telemetry to use UnitConversions by @fifieldt in https://github.com/meshtastic/firmware/pull/4972\r\n\r\n## Bug fixes and maintenance\r\n* Remove unused Jlink monitoring files by @fifieldt in https://github.com/meshtastic/firmware/pull/4953\r\n* Retire PPR Boards by @fifieldt in https://github.com/meshtastic/firmware/pull/4956\r\n* Retire lora-relay boards by @fifieldt in https://github.com/meshtastic/firmware/pull/4957\r\n* Remove support for pca10056-rc-clock by @fifieldt in https://github.com/meshtastic/firmware/pull/4955\r\n* Remove unused headers by @fifieldt in https://github.com/meshtastic/firmware/pull/4954\r\n* Remove has_rx * on installDefaultDeviceState by @thebentern in https://github.com/meshtastic/firmware/pull/4982\r\n* Fix storage of admin key when installing default config. by @Mictronics in https://github.com/meshtastic/firmware/pull/4995\r\n* On T114 do no wake into loader instead of application. by @jhps in https://github.com/meshtastic/firmware/pull/4997\r\n* Ignore packets coming from the broadcast address by @GUVWAF in https://github.com/meshtastic/firmware/pull/4998\r\n* Possibly forward PKC DMs over MQTT by @jp-bennett in https://github.com/meshtastic/firmware/pull/5012\r\n* Fixes critical error rendering before screen thread is running by @thebentern in https://github.com/meshtastic/firmware/pull/5024\r\n* Uplink DMs not to us if MQTT encryption enabled by @GUVWAF in https://github.com/meshtastic/firmware/pull/5025\r\n\r\n## New Contributors\r\n* @medentem made their first contribution in https://github.com/meshtastic/firmware/pull/4930\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.5.e182ae7...v2.5.6.d55c08d"
- },
- {
- "id": "v2.5.5.e182ae7",
- "title": "Meshtastic Firmware 2.5.5.e182ae7 Beta",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.5.e182ae7",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.5.e182ae7/firmware-stm32-2.5.5.e182ae7.zip",
- "release_notes": "> [!WARNING]\r\n> This release does not come bundled with the web client interface due to a transient issue with the build pipeline. If that is an important feature for your use case, please consider either grabbing a later release or rolling back to 2.5.4.\r\n\r\n## Enhancements \r\n* Save a couple of bytes by @caveman99 in https://github.com/meshtastic/firmware/pull/4922\r\n* Consolidate and shrink down the re-used strings in logs by @thebentern in https://github.com/meshtastic/firmware/pull/4907\r\n* Userprefs prefix macros for clarity and consistency by @thebentern in https://github.com/meshtastic/firmware/pull/4923\r\n* Add a Userprefs Timezone String, to be replaced in the web flasher by @jp-bennett in https://github.com/meshtastic/firmware/pull/4938\r\n* Add `rxDupe`, `txRelay` and `txRelayCanceled` to LocalStats by @GUVWAF in https://github.com/meshtastic/firmware/pull/4936\r\n* Leave the build epoch commented and uncomment when CI runs by @thebentern in https://github.com/meshtastic/firmware/pull/4943\r\n* Add Panel_ILI9342 to TFTDisplay.cpp by @lboue in https://github.com/meshtastic/firmware/pull/4822\r\n\r\n## Bug fixes\r\n* Enabling Ve pin on T114 by @HarukiToreda in https://github.com/meshtastic/firmware/pull/4940\r\n* CleanupNeighbors() time difference fix by @gitbisector in https://github.com/meshtastic/firmware/pull/4941\r\n* Don't use a static decleration in a header file by @jp-bennett in https://github.com/meshtastic/firmware/pull/4944\r\n* Move ifndef to fix test by @jp-bennett in https://github.com/meshtastic/firmware/pull/4950\r\n* Remove ancient .gitignore lines by @fifieldt in https://github.com/meshtastic/firmware/pull/4952\r\n* Adjust dimensions for Canned Message popup screen by @todd-herbert in https://github.com/meshtastic/firmware/pull/4924\r\n\r\n## New Contributors\r\n* @lboue made their first contribution in https://github.com/meshtastic/firmware/pull/4822\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.4.8d288d5...v2.5.5.e182ae7"
+ "id": "v2.6.10.9ce4455",
+ "title": "Meshtastic Firmware 2.6.10.9ce4455 Beta",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.10.9ce4455",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.10.9ce4455/firmware-esp32-2.6.10.9ce4455.zip",
+ "release_notes": "## 🚀 Enhancements\r\n* Don't cancel sending ReTx for relayer if we're ROUTER(_LATE)/REPEATER by @GUVWAF in https://github.com/meshtastic/firmware/pull/6904\r\n* Add LINK32 (Lilygo) Board with Light+Environment sensors by @caveman99 in https://github.com/meshtastic/firmware/pull/6899\r\n* Add support for seeed wio tracker L1 by @Dylanliacc in https://github.com/meshtastic/firmware/pull/6907\r\n* Added full support for LTR390UV readings of UV and Lux by @dmarman in https://github.com/meshtastic/firmware/pull/6872\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Linux: Adjust udev rules for gpio by @vidplace7 in https://github.com/meshtastic/firmware/pull/6891\r\n* Coerce user.id to always be derive from the nodenum by @thebentern in https://github.com/meshtastic/firmware/pull/6906\r\n* Parse own short name on InkHUD shutdown screen by @todd-herbert in https://github.com/meshtastic/firmware/pull/6913\r\n* Don't cancel sending ReTx for relayer if we're ROUTER(_LATE)/REPEATER by @GUVWAF in https://github.com/meshtastic/firmware/pull/6904\r\n* Fix renovate for Adafruit PCT2075 by @vidplace7 in https://github.com/meshtastic/firmware/pull/6919\r\n* Update TSL2591 gain and timing by @ArgoNavi in https://github.com/meshtastic/firmware/pull/6921\r\n\r\n## New Contributors\r\n* @dmarman made their first contribution in https://github.com/meshtastic/firmware/pull/6872\r\n* @ArgoNavi made their first contribution in https://github.com/meshtastic/firmware/pull/6921\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.9.f223b8a...v2.6.10.9ce4455"
}
],
"alpha": [
+ {
+ "id": "v2.7.22.96dd647",
+ "title": "Meshtastic Firmware 2.7.22.96dd647 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.22.96dd647",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.22.96dd647/firmware-2.7.22.96dd647.json",
+ "release_notes": "## 🐛 Bug fixes and maintenance\r\n\r\n- Fix(native): implement BinarySemaphorePosix with proper pthread synchronization by @iannucci in https://github.com/meshtastic/firmware/pull/9895\r\n- Meshtasticd: Add configs for ebyte-ecb41-pge (mPWRD-OS) by @vidplace7 in https://github.com/meshtastic/firmware/pull/10086\r\n- Meshtasticd: Add configs for forlinx-ok3506-s12 (mPWRD-OS) by @vidplace7 in https://github.com/meshtastic/firmware/pull/10087\r\n- Fix Linux Input enable logic by @jp-bennett in https://github.com/meshtastic/firmware/pull/10093\r\n- PPA: Use SFTP method for uploads by @vidplace7 in https://github.com/meshtastic/firmware/pull/10138\r\n- Switch PlatformIO deps from PIO Registry to tagged GitHub zips by @vidplace7 in https://github.com/meshtastic/firmware/pull/10142\r\n- Fix display method to use const qualifier for previousBuffer pointer by @vidplace7 in https://github.com/meshtastic/firmware/pull/10146\r\n- Fix last cppcheck issue by @caveman99 in https://github.com/meshtastic/firmware/pull/10154\r\n- Fix heap blowout on TBeams by @thebentern in https://github.com/meshtastic/firmware/pull/10155\r\n\r\n## ⚙️ Dependencies\r\n\r\n- Update meshtastic-esp32_https_server digest to 0c71f38 by @app/renovate in https://github.com/meshtastic/firmware/pull/10081\r\n- Update meshtastic-st7789 digest to 222554e by @app/renovate in https://github.com/meshtastic/firmware/pull/10121\r\n- Update actions/github-script action to v9 by @app/renovate in https://github.com/meshtastic/firmware/pull/10122\r\n- Update meshtastic-st7789 digest to 7228c49 by @app/renovate in https://github.com/meshtastic/firmware/pull/10131\r\n- Update pnpm/action-setup action to v6 by @app/renovate in https://github.com/meshtastic/firmware/pull/10132\r\n- Update meshtastic-st7789 digest to 4d957e7 by @app/renovate in https://github.com/meshtastic/firmware/pull/10134\r\n- Update meshtastic-st7789 digest to a787bee by @app/renovate in https://github.com/meshtastic/firmware/pull/10147\r\n- Update softprops/action-gh-release action to v3 by @app/renovate in https://github.com/meshtastic/firmware/pull/10150\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.21.1370b23...v2.7.22.96dd647"
+ },
+ {
+ "id": "v2.7.21.1370b23",
+ "title": "Meshtastic Firmware 2.7.21.1370b23 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.21.1370b23",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.21.1370b23/firmware-2.7.21.1370b23.json",
+ "release_notes": "> [!WARNING]\r\n> Due to resource constraints, the HTTP server is deprecated on original-generation ESP32 devices and should not be relied on going forward. \r\n> Support continues on ESP32-S3 and other newer ESP32 generations.\r\n\r\n## 🚀 Enhancements\r\n\r\n- Add T5-4.7-S3 Epaper Pro support. #6625\r\n- Apply Thailand NBTC 920-925 MHz limits (27 dBm, 10% duty cycle). #9827\r\n- Switch nRF52840 builds to C++17. #9874\r\n- Clean up SEN5X warnings. #9884\r\n- Refactor BaseUI emotes. #9896\r\n- Add spoof detection in `UdpMulticastHandler`. #9905\r\n- Enable LNA by default on Heltec v4.3. #9906\r\n- Rotate MUI for the Heltec V4 + TFT expansion kit. #9938\r\n- Make `hexDump()` take a `const` buffer. #9944\r\n- Add `meshtasticd` config metadata. #10001\r\n- Add `MESHTASTIC_EXCLUDE_ACCELEROMETER`. #10004\r\n- Adapt MUI WiFi map tile downloads for Heltec V4. #10011\r\n- Fix Mesh-tab WiFi map and exclude-screen behavior. #10038\r\n- Include Thinknode M5 minor fixes. #10049\r\n\r\n## 🐛 Bug fixes and maintenance\r\n\r\n- Remove GPS baudrate locking on the Seeed Xiao S3 kit. #9374\r\n- Fix RAK4631 Ethernet gateway API connection loss after W5100S brownouts. #9754\r\n- Fix W5100S socket exhaustion blocking MQTT and additional TCP clients. #9770\r\n- Fix traceroute over MQTT when the uplink node is encrypted. #9798\r\n- Extend Debian sourcedeb cache expiration. #9858\r\n- Fix T-LoRA Pager SPI bus sharing between SX1262 and the SD card. #9870\r\n- Update `ESP8266Audio` to the Meshtastic fork for compatibility. #9872\r\n- Fix `rak_wismeshtag` low-voltage reboot hangs after app configuration. #9897\r\n- Preserve `pki_encrypted` and `public_key` when relaying UDP multicast packets to radio. #9916\r\n- Add the new RAK 13302 power curve. #9929\r\n- Fix MQTT settings not persisting when the broker is unreachable. #9934\r\n- Fix BMP detection by not returning early during BME address scans. #9935\r\n- Enforce infrastructure-role minimums even when scaling is disabled. #9937\r\n- Fix traceroute hop rendering for `ffff` / unknown-dB hops. #9945\r\n- Fix NodeInfo suppression so it only applies to external requests. #9947\r\n- Enable touch-to-backlight on T-Echo, not just T-Echo Plus. #9953\r\n- Prevent licensed users from rebroadcasting packets to or from unlicensed users. #9958\r\n- Add the `heltec_mesh_node_t096` board. #9960\r\n- Add Cardputer-Adv I2S audio support. #9963\r\n- Fix the Cyrillic OLED double-space issue. #9971\r\n- Add `LED_BUILTIN` for `tlora_v1`. #9973\r\n- Add a timeout for PPA uploads. #9989\r\n- Exclude the web server, Paxcounter, and a few other components on original ESP32 boards to avoid IRAM overflow. #10005\r\n- Rework External Notifications logic. #10006\r\n- Improve STM32WL support. #10015\r\n- Configure NFC pins as GPIO for older bootloaders. #10016\r\n- Fix `TransmitHistory` epoch handling. #10017\r\n- Inherit `build_unflags` for `wio-sdk-wm1110`. #10034\r\n- Remove PSRAM from `tbeam` boards to reclaim IRAM. #10036\r\n- Move `t5s3_epaper_inkhud` to `extra`. #10037\r\n\r\n## ⚙️ Dependencies\r\n\r\n- Update `meshtastic-esp32_https_server` to digest `b78f12c`. #9851\r\n- Update `meshtastic/device-ui` through digests `622b034`, `f36d2a9`, `7b1485b`, and `1897dd1`. #9864 #9940 #10023 #10044 #10050\r\n- Update `GxEPD2` to `v1.6.8`. #9918\r\n- Update `pnpm/action-setup` to `v5`. #9926\r\n- Update `dorny/test-reporter` to `v3`. #9981\r\n- Clean up LewisHe library references and dependency matching, and tighten Renovate scheduling. #10007 #10008 #10039\r\n- Update `Adafruit_BME680` to `v2.0.6`. #10009\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.20.6658ec2...v2.7.21.1370b23\r\n"
+ },
+ {
+ "id": "v2.7.20.6658ec2",
+ "title": "Meshtastic Firmware 2.7.20.6658ec2 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.20.6658ec2",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.20.6658ec2/firmware-2.7.20.6658ec2.json",
+ "release_notes": "## 🚀 Enhancements\r\n\r\n- Xiao NRF - define suitable i2c pins for the sub-variants by @NomDeTom in https://github.com/meshtastic/firmware/pull/8866\r\n- Fix(MQTT): Send first MapReport as soon as possible by @ndoo in https://github.com/meshtastic/firmware/pull/8872\r\n- Feat/add sfa30 by @oscgonfer in https://github.com/meshtastic/firmware/pull/9372\r\n- Improved Periodic class by @harry-iii-lord in https://github.com/meshtastic/firmware/pull/9501\r\n- InkHUD: Allow non-system applets to subscribe to input events by @Vortetty in https://github.com/meshtastic/firmware/pull/9514\r\n- Cardputer Kit by @caveman99 in https://github.com/meshtastic/firmware/pull/9540\r\n- Skip header items when enabling the InkHUD menu cursor by @zeropt in https://github.com/meshtastic/firmware/pull/9552\r\n- ExternalNotification and StatusLED now call AmbientLighting to update… by @jp-bennett in https://github.com/meshtastic/firmware/pull/9554\r\n- BaseUI: Favorite Screen Signal Quality improvement by @HarukiToreda in https://github.com/meshtastic/firmware/pull/9566\r\n- Add battery curve for T-Beam 1 watt by @jp-bennett in https://github.com/meshtastic/firmware/pull/9585\r\n- Add sdl libs for native builds by @jp-bennett in https://github.com/meshtastic/firmware/pull/9595\r\n- Log `rxBad` PacketHeaders with more info (`id`, `relay_node`) like `printPacket` by @compumike in https://github.com/meshtastic/firmware/pull/9614\r\n- Develop to master by @thebentern in https://github.com/meshtastic/firmware/pull/9618\r\n- Fix a lot of low level cppcheck warnings by @caveman99 in https://github.com/meshtastic/firmware/pull/9623\r\n- Convert `GPS*` global and some new in gps.cpp to `unique_ptr` by @Jorropo in https://github.com/meshtastic/firmware/pull/9628\r\n- Replace delete in RedirectablePrint.cpp with std::unique_ptr by @Jorropo in https://github.com/meshtastic/firmware/pull/9642\r\n- Replace delete in EInkDynamicDisplay.{cpp,h} with std::unique_ptr by @Jorropo in https://github.com/meshtastic/firmware/pull/9643\r\n- Replace delete in RadioInterface.cpp with std::unique_ptr by @Jorropo in https://github.com/meshtastic/firmware/pull/9645\r\n- Replace delete in CryptoEngine.{cpp,h} with std::unique_ptr by @Jorropo in https://github.com/meshtastic/firmware/pull/9649\r\n- Replace delete in AudioThread.h with std::unique_ptr by @Jorropo in https://github.com/meshtastic/firmware/pull/9651\r\n- Scaling tweaks by @NomDeTom in https://github.com/meshtastic/firmware/pull/9653\r\n- InkHUD: Favorite Map Applet by @HarukiToreda in https://github.com/meshtastic/firmware/pull/9654\r\n- Fake IAQ values on Non-BSEC2 platforms like Platformio and the original ESP32 by @caveman99 in https://github.com/meshtastic/firmware/pull/9663\r\n- #9623 resolved a local shadow of next_key by converting it to int. by @caveman99 in https://github.com/meshtastic/firmware/pull/9665\r\n- Zip a few gitrefs down by @caveman99 in https://github.com/meshtastic/firmware/pull/9672\r\n- Limit http connections and add free heap check before allocating for SSL by @thebentern in https://github.com/meshtastic/firmware/pull/9693\r\n- Split module includes for AQ module by @oscgonfer in https://github.com/meshtastic/firmware/pull/9711\r\n- Align telemetry broadcast want_response behavior with traceroute by @thebentern in https://github.com/meshtastic/firmware/pull/9717\r\n- InkHUD: Nodelist cleanup by @HarukiToreda in https://github.com/meshtastic/firmware/pull/9737\r\n- Add GPIO_DETECT_PA portduino config, and support 13302 detection with it by @jp-bennett in https://github.com/meshtastic/firmware/pull/9741\r\n- Remove unused global rIf that shadows locals and fails cppcheck by @weebl2000 in https://github.com/meshtastic/firmware/pull/9743\r\n- Add Transmit history persistence for respecting traffic intervals between reboots by @thebentern in https://github.com/meshtastic/firmware/pull/9748\r\n- Unlock 0x8B5 register macro guard for SX162 by @thebentern in https://github.com/meshtastic/firmware/pull/9777\r\n- Enhancement(mesh): remove late packets from tx queue when full by @m1nl in https://github.com/meshtastic/firmware/pull/9779\r\n- Add json file rotation option by @jp-bennett in https://github.com/meshtastic/firmware/pull/9783\r\n- PPA: Remove Ubuntu 25.04, Add 26.04 by @vidplace7 in https://github.com/meshtastic/firmware/pull/9789\r\n- Deb: Handle offline builds more gracefully by @vidplace7 in https://github.com/meshtastic/firmware/pull/9791\r\n- Remove \"x\" permission bits from some source files by @ldoolitt in https://github.com/meshtastic/firmware/pull/9794\r\n- Add some lora parameter clamping logic to coalesce to defaults and enforce some bounds by @thebentern in https://github.com/meshtastic/firmware/pull/9808\r\n- Add back FEM LNA mode configuration for LoRa by @thebentern in https://github.com/meshtastic/firmware/pull/9809\r\n- More RAK6421 work by @jp-bennett in https://github.com/meshtastic/firmware/pull/9813\r\n- Add ROUTER_LATE and TAK_TRACKER to congestion scaling exemption by @h3lix1 in https://github.com/meshtastic/firmware/pull/9818\r\n- Add ROUTER_LATE to telemetry impolite role check by @h3lix1 in https://github.com/meshtastic/firmware/pull/9819\r\n- Add ROUTER_LATE to infrastructure init and config preservation by @h3lix1 in https://github.com/meshtastic/firmware/pull/9820\r\n- Update Heltec Tracker v2 to version KCT8103L. by @Quency-D in https://github.com/meshtastic/firmware/pull/9822\r\n- Add APIPort to native config by @pdxlocations in https://github.com/meshtastic/firmware/pull/9840\r\n\r\n## 🐛 Bug fixes and maintenance\r\n\r\n- Add agc reset attempt by @jp-bennett in https://github.com/meshtastic/firmware/pull/8163\r\n- Support mini ePaper S3 Kit by @mverch67 in https://github.com/meshtastic/firmware/pull/9335\r\n- Fix heltec v4 tft dependency by @Quency-D in https://github.com/meshtastic/firmware/pull/9507\r\n- Apply SX1262 register 0x8B5 patch for improved GC1109 RX sensitivity by @weebl2000 in https://github.com/meshtastic/firmware/pull/9571\r\n- Hold GC1109 FEM power during deep sleep for LNA RX wake by @weebl2000 in https://github.com/meshtastic/firmware/pull/9572\r\n- Fix some random compiler warnings by @caveman99 in https://github.com/meshtastic/firmware/pull/9596\r\n- Add missing openocd_target to custom nrf52 boards by @Stary2001 in https://github.com/meshtastic/firmware/pull/9603\r\n- Fixes on SCD4X admin comands by @oscgonfer in https://github.com/meshtastic/firmware/pull/9607\r\n- Feat/add scd30 by @oscgonfer in https://github.com/meshtastic/firmware/pull/9609\r\n- Zero entire public key array instead of only first byte by @weebl2000 in https://github.com/meshtastic/firmware/pull/9619\r\n- Respect DontMqttMeBro flag regardless of channel PSK by @weebl2000 in https://github.com/meshtastic/firmware/pull/9626\r\n- Undefine LED_BUILTIN for Heltec v2 variant by @ericbarch in https://github.com/meshtastic/firmware/pull/9647\r\n- Fix typo in PIN_GPS_SWITCH by @Jorropo in https://github.com/meshtastic/firmware/pull/9648\r\n- Workaround NCP5623 and LP5562 I2C builds by @Jorropo in https://github.com/meshtastic/firmware/pull/9652\r\n- RadioLib edge-triggered interrupts robustness by @compumike in https://github.com/meshtastic/firmware/pull/9658\r\n- Add USB_MODE=1 for Station G2 - Solving all my serial issues. by @h3lix1 in https://github.com/meshtastic/firmware/pull/9660\r\n- Fix detection of SCD30 by checking if the size of the return from a 2 byte register read is correct by @caveman99 in https://github.com/meshtastic/firmware/pull/9664\r\n- Fix/rak3401 button by @LN4CY in https://github.com/meshtastic/firmware/pull/9668\r\n- Undefine LED_BUILTIN for 9m2ibr_aprs_lora_tracker by @mrekin in https://github.com/meshtastic/firmware/pull/9685\r\n- BLE Pairing fix by @HarukiToreda in https://github.com/meshtastic/firmware/pull/9701\r\n- Implement 'agc' reset for SX126x & LR11x0 chip families by @weebl2000 in https://github.com/meshtastic/firmware/pull/9705\r\n- Add explicit dependency on mklittlefs. by @cpatulea in https://github.com/meshtastic/firmware/pull/9708\r\n- Platform: nrf52: Fix typo in BLEDfuSecure filename by @KokoSoft in https://github.com/meshtastic/firmware/pull/9709\r\n- Meshtasticd: Add Luckfox Lyra Hat pinmaps by @vidplace7 in https://github.com/meshtastic/firmware/pull/9730\r\n- Fix WisMesh Tap V2 env mess by @thebentern in https://github.com/meshtastic/firmware/pull/9734\r\n- Hopefully fix remaining cppcheck issues by @caveman99 in https://github.com/meshtastic/firmware/pull/9745\r\n- Add heltec-v4.3 board by @Quency-D in https://github.com/meshtastic/firmware/pull/9753\r\n- Fix Bluetooth on RAK Ethernet Gateway by removing MESHTASTIC_EXCLUDE_… by @thebentern in https://github.com/meshtastic/firmware/pull/9755\r\n- Increase PSRAM malloc threshold from 256 bytes to 2048 bytes by @thebentern in https://github.com/meshtastic/firmware/pull/9758\r\n- Don't launch canned message when waking screen or silencing notification by @jp-bennett in https://github.com/meshtastic/firmware/pull/9762\r\n- Fix nRF52 AsyncUDP multicast TX/RX race on W5100S by @PhilipLykov in https://github.com/meshtastic/firmware/pull/9765\r\n- Avoid memory leak when possibly malformed packet is received by @m1nl in https://github.com/meshtastic/firmware/pull/9781\r\n- Add ADS1115 ADC to recognition as used on RAK6421 Hat by @caveman99 in https://github.com/meshtastic/firmware/pull/9790\r\n- Improve resource cleanup on connection close (and make server API a unique pointer) by @thebentern in https://github.com/meshtastic/firmware/pull/9799\r\n- Spelling fixes by @ldoolitt in https://github.com/meshtastic/firmware/pull/9801\r\n- Spelling fixes in .md files by @ldoolitt in https://github.com/meshtastic/firmware/pull/9810\r\n- Treat ROUTER_LATE like ROUTER for power management and defaults by @h3lix1 in https://github.com/meshtastic/firmware/pull/9815\r\n- Add ROUTER_LATE use the same rebroadcast rules as ROUTER by @h3lix1 in https://github.com/meshtastic/firmware/pull/9816\r\n- Prevent router-like roles from auto-favoriting DM peers by @h3lix1 in https://github.com/meshtastic/firmware/pull/9821\r\n- Fix(t1000e): reclassify P0.04 as sensor power enable GPIO by @weebl2000 in https://github.com/meshtastic/firmware/pull/9826\r\n- Don't double-blink Thinknode-M1 Power LED while charging by @jp-bennett in https://github.com/meshtastic/firmware/pull/9829\r\n\r\n## ⚙️ Dependencies\r\n\r\n- Update adafruit mpu6050 to v2.2.9 by @app/renovate in https://github.com/meshtastic/firmware/pull/9611\r\n- Update Sensirion Core to v0.7.3 by @app/renovate in https://github.com/meshtastic/firmware/pull/9613\r\n- Update neopixel to v1.15.4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9616\r\n- Update actions/stale action to v10.2.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9669\r\n- Update meshtastic-GxEPD2 digest to c7eb4c3 by @app/renovate in https://github.com/meshtastic/firmware/pull/9694\r\n- Update radiolib to v7.6.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9695\r\n- Update sensorlib to v0.3.4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9727\r\n- Update meshtastic-st7789 digest to 9ee76d6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9729\r\n- Update adafruit mlx90614 to v2.1.6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9756\r\n- Update adafruit_tsl2561 to v1.1.3 by @app/renovate in https://github.com/meshtastic/firmware/pull/9757\r\n- Update platformio/espressif32 to v6.13.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9759\r\n- Update platformio/nordicnrf52 to v10.11.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9760\r\n- Update adafruit dps310 to v1.1.6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9763\r\n- Update platformio/ststm32 to v19.5.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9764\r\n- Update adafruit ahtx0 to v2.0.6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9766\r\n- Update github artifact actions (major) by @app/renovate in https://github.com/meshtastic/firmware/pull/9767\r\n- Update crazy-max/ghaction-import-gpg action to v7 by @app/renovate in https://github.com/meshtastic/firmware/pull/9787\r\n- Update arduinojson to v6.21.6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9788\r\n- Update dorny/test-reporter action to v2.6.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9796\r\n- Update docker/login-action action to v4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9806\r\n- Update docker/setup-qemu-action action to v4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9807\r\n- Update docker/setup-buildx-action action to v4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9824\r\n- Update docker/build-push-action action to v7 by @app/renovate in https://github.com/meshtastic/firmware/pull/9832\r\n- Update docker/metadata-action action to v6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9833\r\n- Update neopixel to v1.15.4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9839\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.20.6658ec2...v2.7.20.6658ec2"
+ },
+ {
+ "id": "v2.7.19.bb3d6d5",
+ "title": "Meshtastic Firmware 2.7.19.bb3d6d5 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.19.bb3d6d5",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.19.bb3d6d5/firmware-2.7.19.bb3d6d5.json",
+ "release_notes": "## 🚀 Enhancements\r\n\r\n- Feat/add sen5x by @oscgonfer in https://github.com/meshtastic/firmware/pull/7245\r\n- Add initial Nix shell by @agustinmista in https://github.com/meshtastic/firmware/pull/8530\r\n- InkHUD Menu improvements by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8975\r\n- Cut NRF52 bluetooth power usage by @phaseloop in https://github.com/meshtastic/firmware/pull/8992\r\n- Feat(GPS): Support Softsleep with WAKE-UP pin on PA1010D by @ndoo in https://github.com/meshtastic/firmware/pull/9078\r\n- NRF52 - power management improvements by @phaseloop in https://github.com/meshtastic/firmware/pull/9211\r\n- Change canned message recipient's previous page to send page by @scobert969 in https://github.com/meshtastic/firmware/pull/9227\r\n- Make BLE TX power configurable for nRF52 variants by @teizz in https://github.com/meshtastic/firmware/pull/9232\r\n- Add interrupt for external charge detection by @jp-bennett in https://github.com/meshtastic/firmware/pull/9332\r\n- Add a watchdog module to meshsolar. by @Quency-D in https://github.com/meshtastic/firmware/pull/9337\r\n- Add StatusMessage module and config overrides by @jp-bennett in https://github.com/meshtastic/firmware/pull/9351\r\n- Implement graduated scaling for NodeInfo send timeout based on active mesh size by @thebentern in https://github.com/meshtastic/firmware/pull/9364\r\n- BaseUI: Bubbles for messages by @HarukiToreda in https://github.com/meshtastic/firmware/pull/9365\r\n- Enable long interleaving mode for LR11x0 and SX128x by @Jorropo in https://github.com/meshtastic/firmware/pull/9399\r\n- Add portduino_status, assign hardware device IDs... by @jp-bennett in https://github.com/meshtastic/firmware/pull/9441\r\n- Add support for Hackaday Communicator function keys by @jp-bennett in https://github.com/meshtastic/firmware/pull/9444\r\n- Add on-screen keyboard to InkHUD by @scobert969 in https://github.com/meshtastic/firmware/pull/9445\r\n- Move more code out of main-nrf52 into variant.cpp by @jp-bennett in https://github.com/meshtastic/firmware/pull/9450\r\n- BaseUI Message Bubble Improvements by @Xaositek in https://github.com/meshtastic/firmware/pull/9452\r\n- Support fully direct request/responses by @esev in https://github.com/meshtastic/firmware/pull/9455\r\n- Add reply bot module with DM-only responses and rate limiting by @mattatat25 in https://github.com/meshtastic/firmware/pull/9456\r\n- Add model workflows by @thebentern in https://github.com/meshtastic/firmware/pull/9462\r\n- Add custom ringtone definition for RAK4631 and enable buzzer pin by @thebentern in https://github.com/meshtastic/firmware/pull/9481\r\n- Remove unused hmx variable by @EricSesterhennX41 in https://github.com/meshtastic/firmware/pull/9529\r\n- Make LED_POWER blip even in critical battery by @jp-bennett in https://github.com/meshtastic/firmware/pull/9545\r\n- Added toggable config and default for larger screens to enable / hide bubbles on chat messages by @thebentern in https://github.com/meshtastic/firmware/pull/9560\r\n- Add Slash Key to VirtualKeyboard by @Xaositek in https://github.com/meshtastic/firmware/pull/9563\r\n- Add support for CW2015 LiPo battery fuel gauge by @jp-bennett in https://github.com/meshtastic/firmware/pull/9564\r\n\r\n## 🐛 Bug fixes and maintenance\r\n\r\n- Add agc reset attempt by @jp-bennett in https://github.com/meshtastic/firmware/pull/8163\r\n- Just set LED_BUILTIN universally to -1, as we don't use it. by @jp-bennett in https://github.com/meshtastic/firmware/pull/8830\r\n- Device-install: Consistently use write-flash by @tyll in https://github.com/meshtastic/firmware/pull/8868\r\n- Added Minimesh variant by @uguraltinsoy in https://github.com/meshtastic/firmware/pull/9289\r\n- Fix uMesh RF POWER configuration error by @linser233 in https://github.com/meshtastic/firmware/pull/9326\r\n- Delete unused code by @EricSesterhennX41 in https://github.com/meshtastic/firmware/pull/9350\r\n- Feat(stm32): Add Milesight GS301 Bathroom Odor Detector by @ndoo in https://github.com/meshtastic/firmware/pull/9359\r\n- To fix the gps power rail issue on RAK 19007 when RAK12023+RAK12035 is installed by @Justin-Mann in https://github.com/meshtastic/firmware/pull/9409\r\n- Consolidate LoRa params / preset logic and fix display of preset values by @thebentern in https://github.com/meshtastic/firmware/pull/9413\r\n- Fix logic for rak12035 sensor default config and improve messaging by @Justin-Mann in https://github.com/meshtastic/firmware/pull/9414\r\n- Add pin sense to wake M6 on Solar Charge by @jp-bennett in https://github.com/meshtastic/firmware/pull/9416\r\n- Move Lora Init code into LoraInit.cpp/h by @jp-bennett in https://github.com/meshtastic/firmware/pull/9435\r\n- Replace strcpy with strncpy and null termination in `MQTT::publish` for JSON payloads by @k3an3 in https://github.com/meshtastic/firmware/pull/9436\r\n- Move device code from main.cpp to earlyInitVariant by @jp-bennett in https://github.com/meshtastic/firmware/pull/9438\r\n- Trackball revamp by @jp-bennett in https://github.com/meshtastic/firmware/pull/9440\r\n- Remove the unused OCV_ARRAYs and move one to a variant.h by @jp-bennett in https://github.com/meshtastic/firmware/pull/9442\r\n- Fix StoreForwardModule retry_delay multiplier always evaluating to 2x by @rcd in https://github.com/meshtastic/firmware/pull/9443\r\n- Add error handling for SPI command failures in LR11x0, RF95, and SX128x interfaces by @thebentern in https://github.com/meshtastic/firmware/pull/9447\r\n- Add Thinknode M4 variant_shutdown() by @jp-bennett in https://github.com/meshtastic/firmware/pull/9449\r\n- External Notification - handleReceived Rewrite by @Xaositek in https://github.com/meshtastic/firmware/pull/9454\r\n- Move input init to an init function in InputBroker by @jp-bennett in https://github.com/meshtastic/firmware/pull/9463\r\n- Initial serialModule cleanup by @jp-bennett in https://github.com/meshtastic/firmware/pull/9465\r\n- Avoid short-circuit evaluation issues in Telemetry by @oscgonfer in https://github.com/meshtastic/firmware/pull/9467\r\n- Add support for the hardware buttons on Retia.io's Bluetooth Nugget device by @treysis in https://github.com/meshtastic/firmware/pull/9468\r\n- Remove stale variant.h defines by @jp-bennett in https://github.com/meshtastic/firmware/pull/9470\r\n- More variant.h cleanup. LED_NOTIFICATION, remove dead code, etc by @jp-bennett in https://github.com/meshtastic/firmware/pull/9477\r\n- Refuse to send legacy DMs simply because the remote public key is unknown by @jp-bennett in https://github.com/meshtastic/firmware/pull/9485\r\n- Fix esp32 ota bin name in scripts by @thebentern in https://github.com/meshtastic/firmware/pull/9488\r\n- You get an RTC, and you get an RTC! (delete HAS_RTC as it wasn't actually doing much) by @jp-bennett in https://github.com/meshtastic/firmware/pull/9493\r\n- Don't ever define PIN_LED or BLE_LED_INVERTED by @jp-bennett in https://github.com/meshtastic/firmware/pull/9494\r\n- Missed in reviews - fixing send bubble by @Xaositek in https://github.com/meshtastic/firmware/pull/9505\r\n- Power off control pin on Thinknode m5 during deepsleep and add RTC by @jp-bennett in https://github.com/meshtastic/firmware/pull/9510\r\n- Prefer EXT_PWR_DETECT pin over chargingVolt to detect power unplugged by @jp-bennett in https://github.com/meshtastic/firmware/pull/9511\r\n- Rename LED_PIN to LED_POWER, move handling out of main to dedicated module by @jp-bennett in https://github.com/meshtastic/firmware/pull/9512\r\n- Inkhud battery icon improvements. by @Vortetty in https://github.com/meshtastic/firmware/pull/9513\r\n- Make sure we always return a value in NodeDB::restorePreferences() by @EricSesterhennX41 in https://github.com/meshtastic/firmware/pull/9516\r\n- Fix config.display.use_long_node_name not saving by @Xaositek in https://github.com/meshtastic/firmware/pull/9522\r\n- Implement UDP multicast handler start/stop to ensure proper lifecycle by @thebentern in https://github.com/meshtastic/firmware/pull/9524\r\n- Undefine LED_BUILTIN for `tlora-v2-1-1_6-tcxo` by @mrekin in https://github.com/meshtastic/firmware/pull/9531\r\n- HotFix for ReplyBot (PR #9456) by @Xaositek in https://github.com/meshtastic/firmware/pull/9532\r\n- Fix hop_limit upgrade detection by @rcd in https://github.com/meshtastic/firmware/pull/9550\r\n- Meshtasticd: Fix install on Fedora 43 by @vidplace7 in https://github.com/meshtastic/firmware/pull/9556\r\n- RPM: Include meshtasticd-start.sh by @vidplace7 in https://github.com/meshtastic/firmware/pull/9561\r\n- Fix embedded null byte truncation in ATAK strings by @niccellular in https://github.com/meshtastic/firmware/pull/9570\r\n\r\n## ⚙️ Dependencies\r\n\r\n- Update XPowersLib to v0.3.3 by @app/renovate in https://github.com/meshtastic/firmware/pull/9354\r\n- Update meshtastic/device-ui digest to 613c095 by @app/renovate in https://github.com/meshtastic/firmware/pull/9383\r\n- Update meshtastic-esp32_https_server digest to b0f3960 by @app/renovate in https://github.com/meshtastic/firmware/pull/9393\r\n- Update lewisxhe-SensorLib to v0.3.4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9395\r\n- Update SensorLib to v0.3.4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9396\r\n- Update pschatzmann_arduino-audio-driver to v0.2.1 by @app/renovate in https://github.com/meshtastic/firmware/pull/9398\r\n- Update meshtastic/device-ui digest to 37ad715 by @app/renovate in https://github.com/meshtastic/firmware/pull/9403\r\n- Update LovyanGFX to v1.2.19 by @app/renovate in https://github.com/meshtastic/firmware/pull/9405\r\n- Update GxEPD2 to v1.6.6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9412\r\n- Update meshtastic/device-ui digest to 69739b8 by @app/renovate in https://github.com/meshtastic/firmware/pull/9448\r\n- Update libch341-spi-userspace digest to af9bc27 by @app/renovate in https://github.com/meshtastic/firmware/pull/9472\r\n- Update meshtastic/device-ui digest to 63967a4 by @app/renovate in https://github.com/meshtastic/firmware/pull/9475\r\n- Update Adafruit MPU6050 to v2.2.7 by @app/renovate in https://github.com/meshtastic/firmware/pull/9525\r\n- Update NeoPixel to v1.15.3 by @app/renovate in https://github.com/meshtastic/firmware/pull/9530\r\n- Update meshtastic-esp8266-oled-ssd1306 digest to 21e484f by @app/renovate in https://github.com/meshtastic/firmware/pull/9533\r\n- Update Adafruit MPU6050 to v2.2.8 by @app/renovate in https://github.com/meshtastic/firmware/pull/9534\r\n- Update meshtastic/device-ui digest to 6c75195 by @app/renovate in https://github.com/meshtastic/firmware/pull/9553\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.18.fb3bf78...v2.7.19.bb3d6d5"
+ },
+ {
+ "id": "v2.7.18.fb3bf78",
+ "title": "Meshtastic Firmware 2.7.18.fb3bf78 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.18.fb3bf78",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.18.fb3bf78/firmware-2.7.18.fb3bf78.json",
+ "release_notes": "## 🚀 Enhancements\r\n\r\n- Move PMSA003I to separate class and update AQ telemetry by @oscgonfer in https://github.com/meshtastic/firmware/pull/7190\r\n- Multi message storage by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8182\r\n- Add support for setting API port from the config file by @tedwardd in https://github.com/meshtastic/firmware/pull/8435\r\n- PIN_PWR_DELAY_MS --> PERIPHERAL_WARMUP_MS by @fifieldt in https://github.com/meshtastic/firmware/pull/8467\r\n- CLIENT_BASE: Act like ROUTER_LATE for fav'd nodes, instead of like ROUTER by @korbinianbauer in https://github.com/meshtastic/firmware/pull/8567\r\n- Rak3112 support by @ford-jones in https://github.com/meshtastic/firmware/pull/8591\r\n- Add systemd wrapper by @tedwardd in https://github.com/meshtastic/firmware/pull/8676\r\n- Adding support for InkHUD joystick navigation for the Seeed Wio Tracker L1 E-ink by @zeropt in https://github.com/meshtastic/firmware/pull/8678\r\n- Gr language specific font by @apo-mak in https://github.com/meshtastic/firmware/pull/8808\r\n- Detect if NTP is active on native by @jp-bennett in https://github.com/meshtastic/firmware/pull/8962\r\n- Add Rebooting to DFU mode notification as a simple pop-up by @Xaositek in https://github.com/meshtastic/firmware/pull/8970\r\n- PIO: Fix ESP32 sub-variant inheritance by @vidplace7 in https://github.com/meshtastic/firmware/pull/8983\r\n- Prep work for better Store and Forward by @jp-bennett in https://github.com/meshtastic/firmware/pull/8999\r\n- Additional Emoji by @Ixitxachitl in https://github.com/meshtastic/firmware/pull/9020\r\n- Add Russell, an STM32WL balloon-optimized node by @ndoo in https://github.com/meshtastic/firmware/pull/9079\r\n- Add menus for Smart Position, Broadcast Interval and Position Interval by @Xaositek in https://github.com/meshtastic/firmware/pull/9080\r\n- Improve sanitizeString function for Node Names by @Xaositek in https://github.com/meshtastic/firmware/pull/9086\r\n- Add Temporary Mute to Home frame and unbury Notification Options by @Xaositek in https://github.com/meshtastic/firmware/pull/9097\r\n- Add a welcome message for new contributors by @fifieldt in https://github.com/meshtastic/firmware/pull/9119\r\n- Calculate hops correctly even when hop_start==0 by @esev in https://github.com/meshtastic/firmware/pull/9120\r\n- Add STORE_FORWARD_PLUSPLUS_APP to core portnum checks by @jp-bennett in https://github.com/meshtastic/firmware/pull/9127\r\n- Faster rotary encoder events by @brad112358 in https://github.com/meshtastic/firmware/pull/9146\r\n- Add support for LilyGo T-Echo Plus by @thebentern in https://github.com/meshtastic/firmware/pull/9149\r\n- Refactored some of the system menus to the new DRY method (Redux) by @Xaositek in https://github.com/meshtastic/firmware/pull/9152\r\n- Add a .clang-format file by @Jorropo in https://github.com/meshtastic/firmware/pull/9154\r\n- Add custom coding rate configuration for LoRa by @jp-bennett in https://github.com/meshtastic/firmware/pull/9155\r\n- Add list of text message packet IDs, and check for dupes by @jp-bennett in https://github.com/meshtastic/firmware/pull/9180\r\n- Add option to Mute/Unmute Channel to BaseUI by @Xaositek in https://github.com/meshtastic/firmware/pull/9194\r\n- Mute: Nodes by @ford-jones in https://github.com/meshtastic/firmware/pull/9209\r\n- Screenless Devices want to mute too! by @Xaositek in https://github.com/meshtastic/firmware/pull/9210\r\n- Migrate all of the Meshtastic API attributes into the ini as a source of truth by @thebentern in https://github.com/meshtastic/firmware/pull/9214\r\n- Pioarduino preparation by @MartinEmrich in https://github.com/meshtastic/firmware/pull/9223\r\n- Meshtastic unified OTA by @thebentern in https://github.com/meshtastic/firmware/pull/9231\r\n- Fix TFT_MESH settings across setting and recalling by @Xaositek in https://github.com/meshtastic/firmware/pull/9234\r\n- Add release notes generation and publishing workflow by @thebentern in https://github.com/meshtastic/firmware/pull/9255\r\n- Unified ESP32 OTA firmware by @vidplace7 in https://github.com/meshtastic/firmware/pull/9258\r\n- Add support for uMesh Modules by @linser233 in https://github.com/meshtastic/firmware/pull/9259\r\n- Extra pins by @jp-bennett in https://github.com/meshtastic/firmware/pull/9260\r\n- BaseUI: Autosave Messages by @HarukiToreda in https://github.com/meshtastic/firmware/pull/9269\r\n- Node Actions Menu Overhaul by @Xaositek in https://github.com/meshtastic/firmware/pull/9287\r\n- Added I2C scanner a check for the QMC6310N. by @lewisxhe in https://github.com/meshtastic/firmware/pull/9305\r\n- Allow ICM20948 IMU to sleep by @HarukiToreda in https://github.com/meshtastic/firmware/pull/9324\r\n- Meshtastic OTA (moar) by @thebentern in https://github.com/meshtastic/firmware/pull/9327\r\n- Add sqlite depdendency (Cherry-picks from sfpp) by @fifieldt in https://github.com/meshtastic/firmware/pull/9328\r\n- Add interrupt for external charge detection by @jp-bennett in https://github.com/meshtastic/firmware/pull/9332\r\n- Improve BaseUI Preset Change Flow by @Xaositek in https://github.com/meshtastic/firmware/pull/9343\r\n- Implement graduated scaling for NodeInfo send timeout based on active mesh size by @thebentern in https://github.com/meshtastic/firmware/pull/9364\r\n\r\n## 🐛 Bug fixes and maintenance\r\n\r\n- RTC: PCF85063 support, port to SensorLib 0.3.1 by @WillyJL in https://github.com/meshtastic/firmware/pull/8061\r\n- Added tcxo definition to mesh-tab by @valzzu in https://github.com/meshtastic/firmware/pull/8604\r\n- Preliminary Thinknode M4 Support by @caveman99 in https://github.com/meshtastic/firmware/pull/8754\r\n- Actions: Compact manifest job output summary by @vidplace7 in https://github.com/meshtastic/firmware/pull/8957\r\n- PlatformIO: Restructure networking_base for re-use by @vidplace7 in https://github.com/meshtastic/firmware/pull/8964\r\n- Add LilyGO T-Beam 1W support by @santosvivos in https://github.com/meshtastic/firmware/pull/8967\r\n- PIO: Remove useless inheritence (references extends env) by @vidplace7 in https://github.com/meshtastic/firmware/pull/8987\r\n- Macro guard heap_caps_malloc_extmem_enable from SENSECAP_INDICATOR by @Xaositek in https://github.com/meshtastic/firmware/pull/9007\r\n- Add Rak 6421 autoconf by @jp-bennett in https://github.com/meshtastic/firmware/pull/9010\r\n- Implement basic github action comment reporting target diffs by @Jorropo in https://github.com/meshtastic/firmware/pull/9022\r\n- In protobuf update, allow develop branch to auto-update by @jp-bennett in https://github.com/meshtastic/firmware/pull/9027\r\n- 🔧 Fix LNA/PA power control for Heltec v4, wireless tracker v2 by @weebl2000 in https://github.com/meshtastic/firmware/pull/9029\r\n- Shame do not complain about missing targets by @Jorropo in https://github.com/meshtastic/firmware/pull/9032\r\n- Action: skip trying to comment binary size change results if it is not a PR by @Jorropo in https://github.com/meshtastic/firmware/pull/9033\r\n- Fix gps pin defs for various NRF variants. by @NomDeTom in https://github.com/meshtastic/firmware/pull/9034\r\n- Fix Rotary enc long press by @brad112358 in https://github.com/meshtastic/firmware/pull/9039\r\n- Add needed support bits for the Meshstick by @jp-bennett in https://github.com/meshtastic/firmware/pull/9042\r\n- In statusLEDModule, also detect isCharging by @jp-bennett in https://github.com/meshtastic/firmware/pull/9050\r\n- PlatformIO: Re-Org ESP32 family shared props by @vidplace7 in https://github.com/meshtastic/firmware/pull/9060\r\n- Cleanup: Remove icarus custom framework-arduinoespressif32 by @vidplace7 in https://github.com/meshtastic/firmware/pull/9064\r\n- M6 shutdown and LEDs work by @jp-bennett in https://github.com/meshtastic/firmware/pull/9065\r\n- Implement HAS_PHYSICAL_KEYBOARD for devices with physical keyboards by @Xaositek in https://github.com/meshtastic/firmware/pull/9071\r\n- KZ_863 is not wide lora by @fifieldt in https://github.com/meshtastic/firmware/pull/9075\r\n- In autoconf, don't probe Wire unless i2c device is set by @jp-bennett in https://github.com/meshtastic/firmware/pull/9081\r\n- Correctly set type for event_mode max() position threshold by @vidplace7 in https://github.com/meshtastic/firmware/pull/9083\r\n- Fix PR#8061 SensorLib nRF ThinkNode M-series by @vidplace7 in https://github.com/meshtastic/firmware/pull/9084\r\n- Pioarduino .gitignore by @vidplace7 in https://github.com/meshtastic/firmware/pull/9085\r\n- Pass GH_TOKEN to shame's gh run download step by @Jorropo in https://github.com/meshtastic/firmware/pull/9087\r\n- GPS Menu Validation Fix - Missed in Reviews by @Xaositek in https://github.com/meshtastic/firmware/pull/9093\r\n- Noop \"download\" portion of #shame by @vidplace7 in https://github.com/meshtastic/firmware/pull/9114\r\n- Syntax fix for first timer welcome bot. by @fifieldt in https://github.com/meshtastic/firmware/pull/9144\r\n- Fix link formatting in welcome message by @fifieldt in https://github.com/meshtastic/firmware/pull/9163\r\n- Fixed shouldFilterReceived function to check prev relay according to the function definition by @strngr in https://github.com/meshtastic/firmware/pull/9168\r\n- Add EByte EoRa-Hub by @vidplace7 in https://github.com/meshtastic/firmware/pull/9169\r\n- Fix zero in sp02 and Heart Rate on screen by @sergeygalkin in https://github.com/meshtastic/firmware/pull/9174\r\n- RadioInterface::getRetransmissionMsec now handles encrypted packets c… by @rbreesems in https://github.com/meshtastic/firmware/pull/9184\r\n- Added support for the new SSD1306 control panel. by @lewisxhe in https://github.com/meshtastic/firmware/pull/9192\r\n- Fix Function + M in code by @Xaositek in https://github.com/meshtastic/firmware/pull/9200\r\n- Fix TSL2591 detection by adding command bit to register read by @heathdutton in https://github.com/meshtastic/firmware/pull/9215\r\n- Fix screen not sleeping due to power status updates by @heathdutton in https://github.com/meshtastic/firmware/pull/9216\r\n- Fix rotary regression and tighten up playBeep by @thebentern in https://github.com/meshtastic/firmware/pull/9221\r\n- Use correct name for ALT_BUTTON_PIN by @jp-bennett in https://github.com/meshtastic/firmware/pull/9225\r\n- CH341 MAC address derivation from serial and product string by @jp-bennett in https://github.com/meshtastic/firmware/pull/9226\r\n- T-Watch S3 Plus GPS support by @mverch67 in https://github.com/meshtastic/firmware/pull/9235\r\n- Update diy_promicro platformio.ini by @mrekin in https://github.com/meshtastic/firmware/pull/9245\r\n- Recover `long_name`, `short_name` from our own NodeDB entry if device.proto is unreadable by @compumike in https://github.com/meshtastic/firmware/pull/9248\r\n- Remove a strlcpy reference by @jp-bennett in https://github.com/meshtastic/firmware/pull/9249\r\n- Add unified OTA to manifest by @thebentern in https://github.com/meshtastic/firmware/pull/9261\r\n- Tiny - include mt-ota in firmware zips by @vidplace7 in https://github.com/meshtastic/firmware/pull/9275\r\n- EXCLUDE_AUDIO on (original) ESP32 by @vidplace7 in https://github.com/meshtastic/firmware/pull/9276\r\n- Partition name in manifest script by @thebentern in https://github.com/meshtastic/firmware/pull/9294\r\n- SafeFile: use atomic rename-with-overwrite, rather than non-atomic delete-then-rename by @compumike in https://github.com/meshtastic/firmware/pull/9296\r\n- Fix OTA partition name matching by @thebentern in https://github.com/meshtastic/firmware/pull/9302\r\n- T-Deck Pro: speed up eink force refresh by @vicliu624 in https://github.com/meshtastic/firmware/pull/9303\r\n- Small fix in register size for SHT4X by @oscgonfer in https://github.com/meshtastic/firmware/pull/9309\r\n- Fix GPS for T-Watch S3 plus by @mverch67 in https://github.com/meshtastic/firmware/pull/9312\r\n- Adds Custom battery curve for thinknode m6 by @jp-bennett in https://github.com/meshtastic/firmware/pull/9313\r\n- /api/v1/fromradio OPTIONS handler: fix sending proper HTTP response. by @cpatulea in https://github.com/meshtastic/firmware/pull/9322\r\n- Heltec V4 TFT metadata by @thebentern in https://github.com/meshtastic/firmware/pull/9325\r\n- Filter BLE updates that don't change pairing status by @jp-bennett in https://github.com/meshtastic/firmware/pull/9333\r\n- Don't Mute DMs just because we mute a channel by @Xaositek in https://github.com/meshtastic/firmware/pull/9348\r\n\r\n## ⚙️ Dependencies\r\n\r\n- Rp2xx0: Update to arduino-pico 5.4.4 by @vidplace7 in https://github.com/meshtastic/firmware/pull/8979\r\n- Replace PIO fuzzy version matches (reproducible builds) by @vidplace7 in https://github.com/meshtastic/firmware/pull/8984\r\n- PIO: Renovate all the things by @vidplace7 in https://github.com/meshtastic/firmware/pull/8994\r\n- Update lewisxhe/SensorLib to 0.3.3 by @vidplace7 in https://github.com/meshtastic/firmware/pull/9061\r\n- Update meshtastic-esp8266-oled-ssd1306 digest to b34c681 by @app/renovate in https://github.com/meshtastic/firmware/pull/9062\r\n- Update meshtastic/device-ui digest to 272defc by @app/renovate in https://github.com/meshtastic/firmware/pull/9166\r\n- Update dorny/test-reporter action to v2.5.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9167\r\n- Update INA226 to v0.6.6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9247\r\n- Update meshtastic/device-ui digest to 12f8cdd by @app/renovate in https://github.com/meshtastic/firmware/pull/9263\r\n- Update meshtastic-gxepd2 digest to a05c11c by @app/renovate in https://github.com/meshtastic/firmware/pull/9264\r\n- Update ArduinoJson to v6.21.5 by @app/renovate in https://github.com/meshtastic/firmware/pull/9265\r\n- Update GxEPD2 to v1.6.5 by @app/renovate in https://github.com/meshtastic/firmware/pull/9266\r\n- Update ESP8266SAM to v1.1.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9271\r\n- Update pschatzmann_arduino-audio-driver to v0.2.0 by @app/renovate in https://github.com/meshtastic/firmware/pull/9272\r\n- Renovate: Ignore lovyangfx for elecrow-panel by @vidplace7 in https://github.com/meshtastic/firmware/pull/9279\r\n- Update RadioLib to v7.5.0 by @vidplace7 in https://github.com/meshtastic/firmware/pull/9281\r\n- Update meshtastic/device-ui digest to 5a870c6 by @app/renovate in https://github.com/meshtastic/firmware/pull/9301\r\n- Update Adafruit BMP280 to v3 by @app/renovate in https://github.com/meshtastic/firmware/pull/9307\r\n- Update meshtastic/device-ui digest to 3480b73 by @app/renovate in https://github.com/meshtastic/firmware/pull/9353\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.17.9058cce...v2.7.18.fb3bf78"
+ },
+ {
+ "id": "v2.7.17.9058cce",
+ "title": "Meshtastic Firmware 2.7.17.9058cce Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.17.9058cce",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.17.9058cce/firmware-2.7.17.9058cce.json",
+ "release_notes": "> [!WARNING]\r\n> If you experience immediate boot-loops after updating, this likely indicates that you need perform a full erase and flash. If you installed the previously revoked 2.7.17 release with the NimBLE 2 upgrade and paired the device with bluetooth, this will occur.\r\n\r\n## 🚀 What's Changed\r\n* Support overriding GPS serial pins on all architectures by @Stary2001 in https://github.com/meshtastic/firmware/pull/8486\r\n* Swap GPS pins for GPS TX/RX only for T114/T-Echo by @Xaositek in https://github.com/meshtastic/firmware/pull/8751\r\n* Remove native from the build, and remove the required permissions by @NomDeTom in https://github.com/meshtastic/firmware/pull/8685\r\n* Swap the GPS serial port pins. by @Quency-D in https://github.com/meshtastic/firmware/pull/8756\r\n* More GPS pin flips for devices by @Xaositek in https://github.com/meshtastic/firmware/pull/8760\r\n* Remove screen activation in powerExit function by @jp-bennett in https://github.com/meshtastic/firmware/pull/8779\r\n* Add LOG_POWERFSM and LOG_INPUT debug macros by @jp-bennett in https://github.com/meshtastic/firmware/pull/8791\r\n* Fix ifdef statement after ST7796 merge to resolve screen color issues by @Xaositek in https://github.com/meshtastic/firmware/pull/8796\r\n* Update dorny/test-reporter action to v2.3.0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8809\r\n* InkHUD: Replace assert in UTF8 decoder to prevent unexpected reboot by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8807\r\n* Update meshtastic/device-ui digest to 3bf3322 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8814\r\n* tryfix screen.cpp ifdefs by @jp-bennett in https://github.com/meshtastic/firmware/pull/8816\r\n* Add WiFi Toggle to System frame to re-enable by @Xaositek in https://github.com/meshtastic/firmware/pull/8802\r\n* #if defined conditions for WiFi by @jp-bennett in https://github.com/meshtastic/firmware/pull/8815\r\n* Add initial support for Hackaday Communicator by @jp-bennett in https://github.com/meshtastic/firmware/pull/8771\r\n* M5Stack UnitC6L - Enabled MQTT and WEBSERVER by default by @RikerZhu in https://github.com/meshtastic/firmware/pull/8679\r\n* Initial Chatter 2.0 fix for baseUI by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8615\r\n* Make GPS_TX_PIN the serial TX and GPS_RX_PIN the serial RX for all NRF variants by @Stary2001 in https://github.com/meshtastic/firmware/pull/8772\r\n* Update XPowersLib to v0.3.2 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8823\r\n* RPM: Fix broken builds (bad backmerge) by @vidplace7 in https://github.com/meshtastic/firmware/pull/8787\r\n* Flags and scripts for size reduction on NRF52 -> Currently targeting … by @thebentern in https://github.com/meshtastic/firmware/pull/8825\r\n* Plain RAK4631 should not compile EInk and TFT display code by @thebentern in https://github.com/meshtastic/firmware/pull/8811\r\n* Fix for high power drain after shutdown on Heltec T114. by @rbomze in https://github.com/meshtastic/firmware/pull/8800\r\n* Bump release version by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8786\r\n* Move everything from /arch to /variant by @jp-bennett in https://github.com/meshtastic/firmware/pull/8831\r\n* Move device specific OCV curves to their respective device.h by @jp-bennett in https://github.com/meshtastic/firmware/pull/8834\r\n* Add 'cleanup' to required PR labels by @jp-bennett in https://github.com/meshtastic/firmware/pull/8835\r\n* Don't scale up the frequency of telemetry sending by @RCGV1 in https://github.com/meshtastic/firmware/pull/8664\r\n* Update actions/stale action to v10.1.1 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8848\r\n* Update alpine Docker tag to v3.23 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8853\r\n* Promicro documentation update by @NomDeTom in https://github.com/meshtastic/firmware/pull/8864\r\n* Optimization flags for all NRF52 targets to reduce code size by @Donix212 in https://github.com/meshtastic/firmware/pull/8854\r\n* Update meshtastic/device-ui digest to 4fb5f24 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8862\r\n* Update protobufs and classes by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8871\r\n* promicro doesn't need limiting by @NomDeTom in https://github.com/meshtastic/firmware/pull/8873\r\n* Enable USB_MODE to acknowledge RTS/DTR reset signal from esptool for heltec-v4 by @h3lix1 in https://github.com/meshtastic/firmware/pull/8881\r\n* Fix #8883 (lora-Pager fter playing the notification, voltage does not disappear from the speaker) by @polarikus in https://github.com/meshtastic/firmware/pull/8884\r\n* Resolve #8887 (T-LoRaPager Vibration on New Message Delivery) by @polarikus in https://github.com/meshtastic/firmware/pull/8888\r\n* OnScreenKeyboard Improvement with Joystick and UpDown Encoder by @whywilson in https://github.com/meshtastic/firmware/pull/8379\r\n* [T-LoraPager]Disable vibration if needed by @polarikus in https://github.com/meshtastic/firmware/pull/8895\r\n* Tryfix: T3S3 ePaper eInk updates by @mverch67 in https://github.com/meshtastic/firmware/pull/8898\r\n* Improved R1 Neo & muzi-base buzzer beeps for GPS on/off by @simon-muzi in https://github.com/meshtastic/firmware/pull/8870\r\n* Meshtastic build manifest by @vidplace7 in https://github.com/meshtastic/firmware/pull/8248\r\n* Fix backwards buttons on Thinknode-M1 by @jp-bennett in https://github.com/meshtastic/firmware/pull/8901\r\n* Update protobuf name of FRIED_CHICKEN by @jp-bennett in https://github.com/meshtastic/firmware/pull/8903\r\n* Guard 2M PHY mode for NimBLE by @thebentern in https://github.com/meshtastic/firmware/pull/8890\r\n* Renovate: fix BH1750_WE by @vidplace7 in https://github.com/meshtastic/firmware/pull/8767\r\n* Fixed the issue where T-Echo did not completely shut down peripherals… by @lewisxhe in https://github.com/meshtastic/firmware/pull/8524\r\n* Fix apply device-install permissions by @vidplace7 in https://github.com/meshtastic/firmware/pull/8911\r\n* Update platformio/espressif32 to v6.12.0 by @vidplace7 in https://github.com/meshtastic/firmware/pull/7697\r\n* Fix #8915 [Bug]: Exception Decoder does not recognize the backtrace by @polarikus in https://github.com/meshtastic/firmware/pull/8917\r\n* Actions: Fix release manifest formating by @vidplace7 in https://github.com/meshtastic/firmware/pull/8918\r\n* ARCtastic runners by @vidplace7 in https://github.com/meshtastic/firmware/pull/8904\r\n* Update peter-evans/create-pull-request action to v8 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8919\r\n* PIO: Fix closedcube lib reference by @vidplace7 in https://github.com/meshtastic/firmware/pull/8920\r\n* Use PSRAM to reduce heap usage percentage on ESP32 with PSRAM by @samm-git in https://github.com/meshtastic/firmware/pull/8891\r\n* Create new screen colors for BaseUI by @Xaositek in https://github.com/meshtastic/firmware/pull/8921\r\n* Enable Muzi-base LED notification by @jp-bennett in https://github.com/meshtastic/firmware/pull/8925\r\n* Update System Frame for improved rendering on devices by @Xaositek in https://github.com/meshtastic/firmware/pull/8923\r\n* Add I2C device check for seesaw device on native by @jp-bennett in https://github.com/meshtastic/firmware/pull/8927\r\n* Use truncated position for smart position by @RCGV1 in https://github.com/meshtastic/firmware/pull/8906\r\n* Properly turn off power pins at shutdown for m3 by @jp-bennett in https://github.com/meshtastic/firmware/pull/8935\r\n* Update meshtastic/device-ui digest to 2746a1c by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8936\r\n* Use 'gh-action-runner' action for \"Check\" jobs. by @vidplace7 in https://github.com/meshtastic/firmware/pull/8938\r\n* Optimize builds to reduce duplicate dependency checks by @vidplace7 in https://github.com/meshtastic/firmware/pull/8943\r\n* Update actions/cache action to v5 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8944\r\n* Fix #8899 [Bug]: [TloraPager] RotaryEncoder crash by @polarikus in https://github.com/meshtastic/firmware/pull/8933\r\n* Mark implicit ACK for MQTT as MQTT transport by @GUVWAF in https://github.com/meshtastic/firmware/pull/8939\r\n* Fix GPS Buffer full issue on NRF52480 (Seeed T1000E) by @fifieldt in https://github.com/meshtastic/firmware/pull/8956\r\n* Actions: Compact manifest job output summary by @vidplace7 in https://github.com/meshtastic/firmware/pull/8957\r\n* Add JSON packet recording option to native by @jp-bennett in https://github.com/meshtastic/firmware/pull/8930\r\n* Implement Long Turbo preset by @thebentern in https://github.com/meshtastic/firmware/pull/8985\r\n* Be more judicious about responding to want_response in existing meshes by @thebentern in https://github.com/meshtastic/firmware/pull/9014\r\n* First position send validation by @thebentern in https://github.com/meshtastic/firmware/pull/9023\r\n* Calculate hops correctly even when hop_start==0 by @esev in https://github.com/meshtastic/firmware/pull/9120\r\n* Revert NimBLE 2.X upgrade by @thebentern in https://github.com/meshtastic/firmware/pull/9125\r\n\r\n## New Contributors\r\n* @RikerZhu made their first contribution in https://github.com/meshtastic/firmware/pull/8679\r\n* @rbomze made their first contribution in https://github.com/meshtastic/firmware/pull/8800\r\n* @Donix212 made their first contribution in https://github.com/meshtastic/firmware/pull/8854\r\n* @polarikus made their first contribution in https://github.com/meshtastic/firmware/pull/8884\r\n* @phaseloop made their first contribution in https://github.com/meshtastic/firmware/pull/8858\r\n* @samm-git made their first contribution in https://github.com/meshtastic/firmware/pull/8891\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.16.a597230...v2.7.17.9058cce"
+ },
+ {
+ "id": "v2.7.16.a597230",
+ "title": "Meshtastic Firmware 2.7.16.a597230 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.16.a597230",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.16.a597230/firmware-esp32-2.7.16.a597230.zip",
+ "release_notes": "## 🚀 What's Changed\r\n* Bugfix: Don't toggle BLE when choosing active state by @jp-bennett in https://github.com/meshtastic/firmware/pull/8579\r\n* chore(deps): update meshtastic/device-ui digest to 28167c6 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8583\r\n* Only call stopNow if we're nagging by @thebentern in https://github.com/meshtastic/firmware/pull/8601\r\n* Clean up GPS toggle logging by @jp-bennett in https://github.com/meshtastic/firmware/pull/8629\r\n* Reset the calibration data back to 0 when doing a compass calibration by @jp-bennett in https://github.com/meshtastic/firmware/pull/8648\r\n* chore(deps): update dorny/test-reporter action to v2.2.0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8637\r\n* Fix RPM builds by @vidplace7 in https://github.com/meshtastic/firmware/pull/8659\r\n* Linux: Fix silly EPEL9 mistake by @vidplace7 in https://github.com/meshtastic/firmware/pull/8660\r\n* Fix ble rssi crash by @thebentern in https://github.com/meshtastic/firmware/pull/8661\r\n* Unify uptime formatting by @jasonbcox in https://github.com/meshtastic/firmware/pull/8677\r\n* chore(deps): update meshtastic-esp8266-oled-ssd1306 digest to 2887bf4 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8688\r\n* Actually respect wake_on_motion setting by @jp-bennett in https://github.com/meshtastic/firmware/pull/8690\r\n* Add a reset pulse signal to the OLED. by @Quency-D in https://github.com/meshtastic/firmware/pull/8691\r\n* Missed one by @thebentern in https://github.com/meshtastic/firmware/pull/8694\r\n* nrf52 watchdog (attempt #2) by @SebKuzminsky in https://github.com/meshtastic/firmware/pull/8670\r\n* Fix build when MESHTASTIC_EXCLUDE_PKI is defined by @jasonbcox in https://github.com/meshtastic/firmware/pull/8698\r\n* Fix MenuHandler when MESHTASTIC_EXCLUDE_PKI is defined by @jasonbcox in https://github.com/meshtastic/firmware/pull/8701\r\n* Update protobufs and classes by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8707\r\n* Add Thinknode M6 by @caveman99 in https://github.com/meshtastic/firmware/pull/8705\r\n* Update Kongduino-Adafruit_nRFCrypto digest to 8cde718 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8708\r\n* Update actions/checkout action to v6 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8695\r\n* Add WisMesh Tag OCV array by @Avi0n in https://github.com/meshtastic/firmware/pull/8646\r\n* R1 Neo - Added OCV_ARRAY from measured discharge curve testing + update ADC multiplier by @simon-muzi in https://github.com/meshtastic/firmware/pull/8716\r\n* Log error if startReceive fails in LR11x0Interface by @jp-bennett in https://github.com/meshtastic/firmware/pull/8718\r\n* Tweak OCV_ARRAY 100% voltage to take into account charger hysteresis and voltage sag after charge by @simon-muzi in https://github.com/meshtastic/firmware/pull/8720\r\n* Thinknode M3 support against master by @jp-bennett in https://github.com/meshtastic/firmware/pull/8630\r\n* M6 leds by @jp-bennett in https://github.com/meshtastic/firmware/pull/8742\r\n* Further fix compass calibration by @jp-bennett in https://github.com/meshtastic/firmware/pull/8740\r\n* More quickly hide \"Shutting Down\" to prevent it showing on Eink sleep screen by @Xaositek in https://github.com/meshtastic/firmware/pull/8749\r\n* Prevent double-registering of Rotary Encoder on TLora Pager by @thebentern in https://github.com/meshtastic/firmware/pull/8746\r\n* 3401 fix by @caveman99 in https://github.com/meshtastic/firmware/pull/8755\r\n* Add support for muzi-base by @jp-bennett in https://github.com/meshtastic/firmware/pull/8753\r\n* Add requestFocus() in CannedMessages by @jp-bennett in https://github.com/meshtastic/firmware/pull/8770\r\n* Update Sensirion Core to v0.7.2 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8551\r\n* Update INA226 to v0.6.5 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8645\r\n* Update NonBlockingRTTTL to v1.4.0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8541\r\n* Update platformio/ststm32 to v19.4.0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8433\r\n* adding support for the ST7796 + creating a new variant of the T-beam by @Nasimovy in https://github.com/meshtastic/firmware/pull/6575\r\n* Correct vertical alignment for Muzi_Base on On Screen Keyboard by @Xaositek in https://github.com/meshtastic/firmware/pull/8774\r\n\r\n## New Contributors\r\n* @Avi0n made their first contribution in https://github.com/meshtastic/firmware/pull/8646\r\n* @simon-muzi made their first contribution in https://github.com/meshtastic/firmware/pull/8716\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.15.567b8ea...v2.7.16.a597230"
+ },
+ {
+ "id": "v2.7.14.e959000",
+ "title": "Meshtastic Firmware 2.7.14.e959000 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.14.e959000",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.14.e959000/firmware-esp32-2.7.14.e959000.zip",
+ "release_notes": "## 🚀 What's Changed\r\n* Add the identification code for the DA217 triaxial accelerometer. by @Quency-D in https://github.com/meshtastic/firmware/pull/8526\r\n* fix strlcpy compile error in Ubuntu 22.04 by @mverch67 in https://github.com/meshtastic/firmware/pull/8520\r\n* Packaging: Add libbsd where needed by @vidplace7 in https://github.com/meshtastic/firmware/pull/8533\r\n* Add support for RAK_WISMESH_TAP_V2 and RAK3401 hardware models by @DanielCao0 in https://github.com/meshtastic/firmware/pull/8537\r\n* Fix: missing T-Deck Pro key '0' by @mverch67 in https://github.com/meshtastic/firmware/pull/8564\r\n* Store hop/mqtt/transport mechanism info in S&F by @weebl2000 in https://github.com/meshtastic/firmware/pull/8560\r\n* Reject legacy text message DMs by @jp-bennett in https://github.com/meshtastic/firmware/pull/8562\r\n* AddFromContact: Don't auto-favorite when `CLIENT_BASE`; don't update `last_heard` unless `CLIENT_BASE` by @compumike in https://github.com/meshtastic/firmware/pull/8495\r\n* Persist favourites on NodeDB reset by @ford-jones in https://github.com/meshtastic/firmware/pull/8292\r\n* Don't ack messages when mqtt client proxy is on but only uplink by @RCGV1 in https://github.com/meshtastic/firmware/pull/8578\r\n* Add API types, state, and log message in Debug screen. Added persistent \"Connected\" icon by @jp-bennett in https://github.com/meshtastic/firmware/pull/8576\r\n* Drop PKI acks if there is no downlink on MQTTClientProxy by @RCGV1 in https://github.com/meshtastic/firmware/pull/8580\r\n* Add the Heltec v4 expansion box. by @Quency-D in https://github.com/meshtastic/firmware/pull/8539\r\n* Update platform-native for WIFi lib fix by @jp-bennett in https://github.com/meshtastic/firmware/pull/8544\r\n* Reject legacy text message DMs by @jp-bennett in https://github.com/meshtastic/firmware/pull/8562\r\n* Bugfix: Don't toggle BLE when choosing active state by @jp-bennett in https://github.com/meshtastic/firmware/pull/8579\r\n* Try-fix traceroute panic by @thebentern in https://github.com/meshtastic/firmware/pull/8568\r\n* chore(deps): update meshtastic/device-ui digest to 28167c6 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8583\r\n* Only call stopNow if we're nagging by @thebentern in https://github.com/meshtastic/firmware/pull/8601\r\n\r\n## New Contributors\r\n* @l0g-lab made their first contribution in https://github.com/meshtastic/firmware/pull/7926\r\n* @dirkmueller made their first contribution in https://github.com/meshtastic/firmware/pull/8320\r\n* @steven52880 made their first contribution in https://github.com/meshtastic/firmware/pull/8330\r\n* @miketweaver made their first contribution in https://github.com/meshtastic/firmware/pull/8355\r\n* @Paplewski made their first contribution in https://github.com/meshtastic/firmware/pull/8362\r\n* @igorka48 made their first contribution in https://github.com/meshtastic/firmware/pull/8187\r\n* @korbinianbauer made their first contribution in https://github.com/meshtastic/firmware/pull/8432\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.12.45f15b8...v2.7.14.e959000"
+ },
+ {
+ "id": "v2.7.13.597fa0b",
+ "title": "Meshtastic Firmware 2.7.13.597fa0b Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.13.597fa0b",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.13.597fa0b/firmware-esp32-2.7.13.597fa0b.zip",
+ "release_notes": "> [!IMPORTANT]\r\n> This release disables device telemetry broadcasts over the mesh by default. If you want to opt back in, you will need to re-enable this in the apps.\r\n\r\n> [!WARNING]\r\n> If you experience immediate bluetooth pairing failures or failure to boot after updating, this likely indicates that you need to do a full erase and flash. Consider backing up your settings before updating.\r\n\r\n## 🚀 What's Changed\r\n* Update python Docker tag to v3.14 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8255\r\n* fix: Move `#include \"variant.h\"` to top of file (fixes #8276) by @ndoo in https://github.com/meshtastic/firmware/pull/8278\r\n* Update meshtastic/device-ui digest to 6d8cc22 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8275\r\n* NimBLE speedup by @thebentern in https://github.com/meshtastic/firmware/pull/8281\r\n* Fix Station G2 Lora Power Settings by @fifieldt in https://github.com/meshtastic/firmware/pull/8273\r\n* chore(deps): update github/codeql-action action to v4 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8250\r\n* Fix BLE stateful issues by @thebentern in https://github.com/meshtastic/firmware/pull/8287\r\n* Attach an interrupt to EXT_PWR_DETECT if present, and force a screen … by @jp-bennett in https://github.com/meshtastic/firmware/pull/8284\r\n* Update XPowersLib to v0.3.1 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8303\r\n* Bump release version by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8304\r\n* Double the number of bluetooth bonds NimBLE will store (from 3 to 6) by @thebentern in https://github.com/meshtastic/firmware/pull/8296\r\n* mDNS: Advertise pio_env (for OTA scripts) by @vidplace7 in https://github.com/meshtastic/firmware/pull/8298\r\n* Master to develop by @jp-bennett in https://github.com/meshtastic/firmware/pull/8306\r\n* Actions: CI docker with a fancy matrix by @vidplace7 in https://github.com/meshtastic/firmware/pull/8253\r\n* GPS_POWER_TOGGLE no longer has a function, so purge by @jp-bennett in https://github.com/meshtastic/firmware/pull/8312\r\n* Update protobufs and classes by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8305\r\n* Remove T1000E GPS startup delay sequence by @fifieldt in https://github.com/meshtastic/firmware/pull/8236\r\n* Increase bluetooth 5.0 PHY speed and MTU on esp32_s3 by @h3lix1 in https://github.com/meshtastic/firmware/pull/8261\r\n* More BaseUI Frame Visibility Toggles by @Xaositek in https://github.com/meshtastic/firmware/pull/8252\r\n* Device Telemetry opt in by @thebentern in https://github.com/meshtastic/firmware/pull/8059\r\n* Fix muted protobuf compile errors by @thebentern in https://github.com/meshtastic/firmware/pull/8316\r\n* Master backmerge by @thebentern in https://github.com/meshtastic/firmware/pull/8317\r\n* chore(deps): update meshtastic/device-ui digest to 3fb7c0e by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8291\r\n* Nodelist: choice of long or short name by @l0g-lab in https://github.com/meshtastic/firmware/pull/7926\r\n* Ble reconnect prefetch bug fix, plus some speed enhancements by @h3lix1 in https://github.com/meshtastic/firmware/pull/8324\r\n* Avoid exceeding allocated buffers when doing MQTT proxying by @dirkmueller in https://github.com/meshtastic/firmware/pull/8320\r\n* Fix erroneous limiting of power in Ham Mode by @fifieldt in https://github.com/meshtastic/firmware/pull/8322\r\n* Fix bug: can not detect battery status while using INA226 by @steven52880 in https://github.com/meshtastic/firmware/pull/8330\r\n* rework sensor instantiation to saves memory by removing the static allocation by @Links2004 in https://github.com/meshtastic/firmware/pull/8054\r\n* Fix multitude of warnings during builds on MeshTiny by @Xaositek in https://github.com/meshtastic/firmware/pull/8331\r\n* Fix multitude of warnings during builds on MeshTiny by @Xaositek in https://github.com/meshtastic/firmware/pull/8331\r\n* Revert \"Fix Station G2 Lora Power Settings\" by @thebentern in https://github.com/meshtastic/firmware/pull/8332\r\n* Develop to master merge by @thebentern in https://github.com/meshtastic/firmware/pull/8337\r\n* Update stale_bot.yml by @NomDeTom in https://github.com/meshtastic/firmware/pull/8333\r\n* Update meshtastic/device-ui digest to 19b7855 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8346\r\n* Add a general-purpose packet cache by @erayd in https://github.com/meshtastic/firmware/pull/8341\r\n* Guarding PhoneAPI node-info staging with mutex to prevent BLE future foot-gun by @h3lix1 in https://github.com/meshtastic/firmware/pull/8354\r\n* Fix portduino native builds by @miketweaver in https://github.com/meshtastic/firmware/pull/8355\r\n* Log the lora frequency error when receiving a packet. by @jp-bennett in https://github.com/meshtastic/firmware/pull/8343\r\n* Bind python version to 3.13 by @Paplewski in https://github.com/meshtastic/firmware/pull/8362\r\n* Update actions/setup-node action to v6 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8339\r\n* Upgrade trunk by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8340\r\n* Ignore MQTT Client Proxy messages while not in sendpackets state by @thebentern in https://github.com/meshtastic/firmware/pull/8358\r\n* Force CannedMessages to another node to be a PKI DM by @jp-bennett in https://github.com/meshtastic/firmware/pull/8373\r\n* Update meshtastic/web to v2.6.7 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8381\r\n* Update DFRobot_RTU to v1.0.6 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8387\r\n* Update mcr.microsoft.com/devcontainers/cpp Docker tag to v2 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8375\r\n* Board support: RAK3401+RAK13302 1-watt by @DanielCao0 in https://github.com/meshtastic/firmware/pull/8140\r\n* Fixed battery voltage to show missing decimals by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8386\r\n* Gating off BaseUI code for Screenless nodes and InkHUD by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8384\r\n* Added support for SugarCube device by @igorka48 in https://github.com/meshtastic/firmware/pull/8187\r\n* Fix NimbleBluetooth reliability and performance by @compumike in https://github.com/meshtastic/firmware/pull/8385\r\n* Add a banner on startup when DEBUG_MUTE is enabled by @Stary2001 in https://github.com/meshtastic/firmware/pull/8402\r\n* Remove \"Phone GPS\" in order to correct GPS reporting by @Xaositek in https://github.com/meshtastic/firmware/pull/8407\r\n* Fix NimbleBluetooth: process fromPhoneQueue (phone->radio) before toPhoneQueue (radio->phone) by @compumike in https://github.com/meshtastic/firmware/pull/8404\r\n* Make packet pool dynamic again on STM32 as a workaround by @Stary2001 in https://github.com/meshtastic/firmware/pull/8400\r\n* InkHUD Map improvements by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8397\r\n* Include RSSI in rangetest csv by @ford-jones in https://github.com/meshtastic/firmware/pull/8395\r\n* Move airtime calculation to when Tx is complete by @GUVWAF in https://github.com/meshtastic/firmware/pull/8427\r\n* Upgrade trunk by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8369\r\n* Allow vibra or buzzer only notifications to obey cutoff by @Xaositek in https://github.com/meshtastic/firmware/pull/8342\r\n* Don't use unsigned integer type for negative SNR value by @korbinianbauer in https://github.com/meshtastic/firmware/pull/8432\r\n* InkHUD crash fix when nodes get deleted from NodeDB by @HarukiToreda in https://github.com/meshtastic/firmware/pull/8428\r\n* Address longName wrapping by @Xaositek in https://github.com/meshtastic/firmware/pull/8441\r\n* Update node to v24 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8476\r\n* Turn the e-ink backlight on for any brightness value over 0 by @jp-bennett in https://github.com/meshtastic/firmware/pull/8481\r\n* Add missed debug log line in RF95 Interface by @jp-bennett in https://github.com/meshtastic/firmware/pull/8490\r\n* Thinknode M5 ADC_MULTIPLIER to actually hit 100% charge by @jp-bennett in https://github.com/meshtastic/firmware/pull/8489\r\n* Better implementation of ExternalNotificationModule::stopNow by @Xaositek in https://github.com/meshtastic/firmware/pull/8492\r\n* Skip setting up Lora GPIO lines when using a ch341 radio on native by @jp-bennett in https://github.com/meshtastic/firmware/pull/8506\r\n* Fix boot on RP2040 by excluding new FreeRTOS task by @GUVWAF in https://github.com/meshtastic/firmware/pull/8508\r\n* Fix dismiss of ext. notification by @thebentern in https://github.com/meshtastic/firmware/pull/8512\r\n* Update device-install.sh to support heltec-v4 by @Melonbwead in https://github.com/meshtastic/firmware/pull/8509\r\n\r\n## New Contributors\r\n* @l0g-lab made their first contribution in https://github.com/meshtastic/firmware/pull/7926\r\n* @dirkmueller made their first contribution in https://github.com/meshtastic/firmware/pull/8320\r\n* @steven52880 made their first contribution in https://github.com/meshtastic/firmware/pull/8330\r\n* @miketweaver made their first contribution in https://github.com/meshtastic/firmware/pull/8355\r\n* @Paplewski made their first contribution in https://github.com/meshtastic/firmware/pull/8362\r\n* @igorka48 made their first contribution in https://github.com/meshtastic/firmware/pull/8187\r\n* @korbinianbauer made their first contribution in https://github.com/meshtastic/firmware/pull/8432\r\n* @Ixitxachitl made their first contribution in https://github.com/meshtastic/firmware/pull/8493\r\n* @mariusfaber98 made their first contribution in https://github.com/meshtastic/firmware/pull/8349\r\n* @shortwavesurfer2009 made their first contribution in https://github.com/meshtastic/firmware/pull/8137\r\n* @pa0lin082 made their first contribution in https://github.com/meshtastic/firmware/pull/8376\r\n* @Xavierhorwood made their first contribution in https://github.com/meshtastic/firmware/pull/6866\r\n* @Melonbwead made their first contribution in https://github.com/meshtastic/firmware/pull/8509\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.12.45f15b8...v2.7.13.597fa0b"
+ },
+ {
+ "id": "v2.7.11.ee68575",
+ "title": "Meshtastic Firmware 2.7.11.ee68575 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.11.ee68575",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.11.ee68575/firmware-esp32-2.7.11.ee68575.zip",
+ "release_notes": "> [!IMPORTANT]\r\nDue to feedback received from users, UDP has been disabled by default and the default PSK decryption bridging logic has been removed for now until channel level controls can be added to a future release.\r\n\r\n> [!WARNING]\r\nRepeater role has been deprecated in this release and going forward.\r\n\r\n## 🚀 What's Changed\r\n* On screen keyboard by @thebentern in https://github.com/meshtastic/firmware/pull/7705\r\n* Update meshtastic/device-ui digest to 0f32b64 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7723\r\n* Update caveman99-stm32-Crypto digest to 1aa30eb by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7725\r\n* Renovate: Always use `master` as the base. by @vidplace7 in https://github.com/meshtastic/firmware/pull/7726\r\n* Add more text message test cases for meshpacket serializer by @TN666 in https://github.com/meshtastic/firmware/pull/7709\r\n* Reduce power of EU433 to 10dBm by @fifieldt in https://github.com/meshtastic/firmware/pull/7733\r\n* Backmerge to develop by @thebentern in https://github.com/meshtastic/firmware/pull/7744\r\n* Log more information about ignored packet by @notmasteryet in https://github.com/meshtastic/firmware/pull/7718\r\n* Setup ESP32 PM-specific capability flags by @m1nl in https://github.com/meshtastic/firmware/pull/7747\r\n* Add more test case for encrypted packet test by @TN666 in https://github.com/meshtastic/firmware/pull/7745\r\n* Backmerge by @thebentern in https://github.com/meshtastic/firmware/pull/7773\r\n* Bump release version by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/7777\r\n* BaseUI Show/Hide Frame Functionality by @Xaositek in https://github.com/meshtastic/firmware/pull/7382\r\n* We don't gotTime if time is 2019. by @fifieldt in https://github.com/meshtastic/firmware/pull/7772\r\n* Add On-Screen Keyboard for UpDown Encoder and Rotary Encoder. by @whywilson in https://github.com/meshtastic/firmware/pull/7762\r\n* Fix InputEvent variable usage with out initialization (random key events while using rotery encoder) by @Links2004 in https://github.com/meshtastic/firmware/pull/8015\r\n* Allow Left / Right Events for selection and improve encoder responsives by @Links2004 in https://github.com/meshtastic/firmware/pull/8016\r\n* Fix build fail on develop branch by @WillyJL in https://github.com/meshtastic/firmware/pull/8043\r\n* Fix more build failures by @WillyJL in https://github.com/meshtastic/firmware/pull/8044\r\n* Fix build with HAS_TELEMETRY 0 by @Links2004 in https://github.com/meshtastic/firmware/pull/8051\r\n* Move HTTP contentTypes to Flash - saves 768 Bytes of RAM by @Links2004 in https://github.com/meshtastic/firmware/pull/8055\r\n* Fix: use `lora.use_preset` config to get name by @GUVWAF in https://github.com/meshtastic/firmware/pull/8057\r\n* Resolve many warnings for BaseUI during builds by @Xaositek in https://github.com/meshtastic/firmware/pull/8063\r\n* Fix Rotary Encoder Button by @Links2004 in https://github.com/meshtastic/firmware/pull/8001\r\n* Add another seeed_xiao_nrf52840_kit build environment for I2C pinout by @NomDeTom in https://github.com/meshtastic/firmware/pull/8036\r\n* Add heltec_v4 board. by @Quency-D in https://github.com/meshtastic/firmware/pull/7845\r\n* Fix build errors by @Xaositek in https://github.com/meshtastic/firmware/pull/8067\r\n* Introduce Radio Preset elections through BaseUI by @Xaositek in https://github.com/meshtastic/firmware/pull/8071\r\n* Allow label enforcement job to run on self-hosted runners by @fifieldt in https://github.com/meshtastic/firmware/pull/7909\r\n* Bump release version by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8100\r\n* Upgrade trunk by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/8094\r\n* Add three expansion screens for heltec mesh solar. by @Quency-D in https://github.com/meshtastic/firmware/pull/7995\r\n* Update Adafruit BusIO to v1.17.4 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8098\r\n* Fix 2.4GHz reconfiguration on LR11xx by @Stary2001 in https://github.com/meshtastic/firmware/pull/8102\r\n* Feat/0-cost hops for favorite routers by @h3lix1 in https://github.com/meshtastic/firmware/pull/7992\r\n* If a packet is heard multiple times, rebroadcast using the highest hop limit by @erayd in https://github.com/meshtastic/firmware/pull/5534\r\n* Make sure next-hop is only set when they received us directly by @GUVWAF in https://github.com/meshtastic/firmware/pull/8053\r\n* Reduce cpu load by optimizing OSThread runOnce calls by @Links2004 in https://github.com/meshtastic/firmware/pull/8101\r\n* Correct inverted mute icon by @Xaositek in https://github.com/meshtastic/firmware/pull/8111\r\n* BaseUI - Saving GPS Format changes are required by @Xaositek in https://github.com/meshtastic/firmware/pull/8122\r\n* Properly output the TCXO Voltage in yaml by @jp-bennett in https://github.com/meshtastic/firmware/pull/8128\r\n* I2S: Fix silent RTTTL regression by @WillyJL in https://github.com/meshtastic/firmware/pull/8129\r\n* Revert cross-preset default-key bridging with UDP and disable UDP by default by @thebentern in https://github.com/meshtastic/firmware/pull/8130\r\n* Develop --> Master by @fifieldt in https://github.com/meshtastic/firmware/pull/8110\r\n* Range-test: Clean on reboot by @ford-jones in https://github.com/meshtastic/firmware/pull/7703\r\n* UIRenderer: display \"No GPS present\" only on the first line to avoid duplication by @plashchynski in https://github.com/meshtastic/firmware/pull/8136\r\n* Remove memcpy by @dfsx1 in https://github.com/meshtastic/firmware/pull/8079\r\n* Correct altitudeLine getting clobbered in the great merge by @Xaositek in https://github.com/meshtastic/firmware/pull/8138\r\n* Bug / Send upgraded (duplicate) packets to phone if the queue removal failed. by @h3lix1 in https://github.com/meshtastic/firmware/pull/8148\r\n* Validate CR and SF lora config by @thebentern in https://github.com/meshtastic/firmware/pull/8146\r\n* Finish deprecating the Repeater role behavior by @thebentern in https://github.com/meshtastic/firmware/pull/8144\r\n* Fix Heltec V3 missed button presses by @thebentern in https://github.com/meshtastic/firmware/pull/8167\r\n\r\n## New Contributors\r\n* @h3lix1 made their first contribution in https://github.com/meshtastic/firmware/pull/7992\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.10.94d4bdf...v2.7.11.ee68575"
+ },
+ {
+ "id": "v2.7.10.94d4bdf",
+ "title": "Meshtastic Firmware 2.7.10.94d4bdf Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.10.94d4bdf",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.10.94d4bdf/firmware-esp32-2.7.10.94d4bdf.zip",
+ "release_notes": "## 🚀 What's Changed\r\n\r\n- BaseUI Show/Hide Frame Functionality by @Xaositek in https://github.com/meshtastic/firmware/pull/7382\r\n- Feature: Seamless Cross-Preset Communication via UDP Multicast Bridging by @ViezeVingertjes in https://github.com/meshtastic/firmware/pull/7753\r\n- Add CLIENT_BASE role: ROUTER for favorites, CLIENT otherwise (for attic/roof nodes!) by @compumike in https://github.com/meshtastic/firmware/pull/7873\r\n- Added Last Coordinate counter to Position screen by @HarukiToreda in https://github.com/meshtastic/firmware/pull/7865\r\n- Phone GPS display on Position Screen for BaseUI by @HarukiToreda in https://github.com/meshtastic/firmware/pull/7875\r\n- Add formatting and menu picking for other GPS format options by @Xaositek in https://github.com/meshtastic/firmware/pull/7974\r\n- Add RAK WisMesh Tap V2 (ESP32S3) Hardware Variant by @DanielCao0 in https://github.com/meshtastic/firmware/pull/7741\r\n- Add support for the Challenger rp2040 lora by @samuel-duffield1 in https://github.com/meshtastic/firmware/pull/7826\r\n- Add support for the RV-3028 on native Linux by @jp-bennett in https://github.com/meshtastic/firmware/pull/7802\r\n- T-Lora Pager: Support LR1121 and SX1280 models by @WillyJL in https://github.com/meshtastic/firmware/pull/7956\r\n- Add another seeed_xiao_nrf52840_kit build environment for I2C pinout by @NomDeTom in https://github.com/meshtastic/firmware/pull/8036\r\n- Add heltec_v4 board. by @Quency-D in https://github.com/meshtastic/firmware/pull/7845\r\n- C6l fixes by @jp-bennett in https://github.com/meshtastic/firmware/pull/8047\r\n- Add TSL2561 sensor by @davide125 in https://github.com/meshtastic/firmware/pull/7675\r\n- Add a new GPS model CM121. by @Quency-D in https://github.com/meshtastic/firmware/pull/7852\r\n- Make ExternalNotification show up in excluded_modules, more STM32 modules by @Stary2001 in https://github.com/meshtastic/firmware/pull/7797\r\n- Enable bmx160 on native by @jp-bennett in https://github.com/meshtastic/firmware/pull/7844\r\n- Fix memory leak in NRF52Bluetooth: allocate BluetoothStatus on stack, not heap by @compumike in https://github.com/meshtastic/firmware/pull/7965\r\n- Fix memory leak in NimbleBluetooth: allocate BluetoothStatus on stack, not heap by @compumike in https://github.com/meshtastic/firmware/pull/7964\r\n- Fix GPS gm_mktime memory leak by @compumike in https://github.com/meshtastic/firmware/pull/7981\r\n- Fix INA3221 higher current wrong readings by @macvenez in https://github.com/meshtastic/firmware/pull/7607\r\n- Fix InputEvent variable usage with out initialization (random key events while using rotery encoder) by @Links2004 in https://github.com/meshtastic/firmware/pull/8015\r\n- Fix Rotary Encoder Button by @Links2004 in https://github.com/meshtastic/firmware/pull/8001\r\n- Fix date display to be upper right bound by @Xaositek in https://github.com/meshtastic/firmware/pull/7876\r\n- Fix excluded modules configuration handling by @capricornusx in https://github.com/meshtastic/firmware/pull/7838\r\n- Fix build error in rak_wismesh_tap_v2 by @fifieldt in https://github.com/meshtastic/firmware/pull/7905\r\n- Fix build fail on develop branch by @WillyJL in https://github.com/meshtastic/firmware/pull/8043\r\n- Fix more build failures by @WillyJL in https://github.com/meshtastic/firmware/pull/8044\r\n- Fix last build issues on develop by @WillyJL in https://github.com/meshtastic/firmware/pull/8046\r\n- Fix build errors by @Xaositek in https://github.com/meshtastic/firmware/pull/8067\r\n- fix build with HAS_TELEMETRY 0 by @Links2004 in https://github.com/meshtastic/firmware/pull/8051\r\n- Fix device-install.bat baud rate by @fifieldt in https://github.com/meshtastic/firmware/pull/7816\r\n- Fix: use lora.use_preset config to get name by @GUVWAF in https://github.com/meshtastic/firmware/pull/8057\r\n- Show GPS Date properly in drawCommonHeader by @Xaositek in https://github.com/meshtastic/firmware/pull/7887\r\n- Make sure to ACK ACKs/replies if next-hop routing is used by @GUVWAF in https://github.com/meshtastic/firmware/pull/8052\r\n- Only stop retransmissions when receiving implicit ACK over LoRa by @GUVWAF in https://github.com/meshtastic/firmware/pull/7872\r\n- Allow Left / Right Events for selection and improve encoder responsives by @Links2004 in https://github.com/meshtastic/firmware/pull/8016\r\n- If usePreset is False, show value as Custom. by @Xaositek in https://github.com/meshtastic/firmware/pull/7812\r\n- (resubmission) Manual GitHub actions to allow building one target or arch by @NomDeTom in https://github.com/meshtastic/firmware/pull/7997\r\n- When DEBUG_HEAP is defined, add free heap bytes to every log line in RedirectablePrint::log_to_serial by @compumike in https://github.com/meshtastic/firmware/pull/8004\r\n- Setup ESP32 PM-specific capability flags by @m1nl in https://github.com/meshtastic/firmware/pull/7747\r\n- move HTTP contentTypes to Flash - saves 768 Bytes of RAM by @Links2004 in https://github.com/meshtastic/firmware/pull/8055\r\n- Portduino config refactor by @jp-bennett in https://github.com/meshtastic/firmware/pull/7796\r\n- Add BUILD_EPOCH to latest setup step. by @fifieldt in https://github.com/meshtastic/firmware/pull/7894\r\n- updated shebang to use a more standard path for bash in flashing scripts. by @vtrenton in https://github.com/meshtastic/firmware/pull/7922\r\n- Update RadioLib to v7.3.0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/8065\r\n- Update Protobuf usage, add MLS, fix clock by @Xaositek in https://github.com/meshtastic/firmware/pull/8041\r\n- Portduino bump to fix gpiod bug by @jp-bennett in https://github.com/meshtastic/firmware/pull/8083\r\n- Ext notification fix (handle ringtone operations even when module is not enabled) by @thebentern in https://github.com/meshtastic/firmware/pull/8089\r\n- tlora-pager wake on button, and kb backlight toggling by @jp-bennett in https://github.com/meshtastic/firmware/pull/8090\r\n- Try-fix: Unstick that PhoneAPI state by @thebentern in https://github.com/meshtastic/firmware/pull/8091\r\n- Also pull a deviceID from esp32c6 devices by @jp-bennett in https://github.com/meshtastic/firmware/pull/8092\r\n- Clear last toradio on BLE disconnect by @thebentern in https://github.com/meshtastic/firmware/pull/8095\r\n\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.9.70724be...v2.7.10.94d4bdf"
+ },
+ {
+ "id": "v2.7.9.70724be",
+ "title": "Meshtastic Firmware 2.7.9.70724be Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.9.70724be",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.9.70724be/firmware-esp32-2.7.9.70724be.zip",
+ "release_notes": "## 🚀 What's Changed\r\n* Add support for new ESP32 DIY variant 9m2ibr_aprs_lora_tracker by @ndoo in https://github.com/meshtastic/firmware/pull/7828\r\n* T-Lora Pager: Fix keyboard and improve rotary wheel haptic by @mverch67 in https://github.com/meshtastic/firmware/pull/7869\r\n* Fix esptool detection and baud rate issues in Windows batch scripts by @jeremiah-k in https://github.com/meshtastic/firmware/pull/7856\r\n* Upon receiving ACK/reply directly, only update next-hop if we’re the *sole* relayer by @GUVWAF in https://github.com/meshtastic/firmware/pull/7859\r\n* Fix merge conflict with test changes by @fifieldt in https://github.com/meshtastic/firmware/pull/7902\r\n* Fix: RotaryEncoder uninitialized kbchar by @mverch67 in https://github.com/meshtastic/firmware/pull/7889\r\n* Chore(deps): update meshtastic/device-ui digest to 233d18e by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7890\r\n* Reorganize 8MB partition for MUI devices by @mverch67 in https://github.com/meshtastic/firmware/pull/7860\r\n* Chore(deps): update meshtastic/device-ui digest to 3677476 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7925\r\n* Disable ATAK Plugin module for non-TAK roles by @thebentern in https://github.com/meshtastic/firmware/pull/7928\r\n* Use char buffer for probeResponse by @thebentern in https://github.com/meshtastic/firmware/pull/7870\r\n* Make phone queues use a static pointer queue by @thebentern in https://github.com/meshtastic/firmware/pull/7919\r\n* Add LOG_HEAP log type, and more heap debug messages by @jp-bennett in https://github.com/meshtastic/firmware/pull/7937\r\n* Unify build epoch to add flag in platformio-custom.py by @thebentern in https://github.com/meshtastic/firmware/pull/7917\r\n* Put guards in place around debug heap operations by @thebentern in https://github.com/meshtastic/firmware/pull/7955\r\n* Static memory pool allocation by @thebentern in https://github.com/meshtastic/firmware/pull/7966\r\n* Update meshtastic-esp8266-oled-ssd1306 digest to 0cbc26b by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7977\r\n* Fix json report crashes on esp32 by @thebentern in https://github.com/meshtastic/firmware/pull/7978\r\n* Scale probe buffer size based on current baud rate by @thebentern in https://github.com/meshtastic/firmware/pull/7975\r\n* Fix overflow of time value by @thebentern in https://github.com/meshtastic/firmware/pull/7984\r\n\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.8.a0c0388...v2.7.9.70724be"
+ },
+ {
+ "id": "v2.7.7.5ae4ff9",
+ "title": "Meshtastic Firmware 2.7.7.5ae4ff9 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.7.5ae4ff9",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.7.5ae4ff9/firmware-esp32-2.7.7.5ae4ff9.zip",
+ "release_notes": "## What's Changed\r\n* Only send Neighbours if we have some to send. by @fifieldt in https://github.com/meshtastic/firmware/pull/7493\r\n* Fix freetext hang by @thebentern in https://github.com/meshtastic/firmware/pull/7781\r\n* Update protobufs and classes by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/7784\r\n* We don't gotTime if time is 2019. by @fifieldt in https://github.com/meshtastic/firmware/pull/7772\r\n* Can't trust RTCs to tell the time. by @fifieldt in https://github.com/meshtastic/firmware/pull/7779\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.6.834c3c5...v2.7.7.5ae4ff9"
+ },
+ {
+ "id": "v2.7.6.834c3c5",
+ "title": "Meshtastic Firmware 2.7.6.834c3c5 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.6.834c3c5",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.6.834c3c5/firmware-esp32-2.7.6.834c3c5.zip",
+ "release_notes": "## 🚀 Enhancements\r\n* Add onboard message for devices with screens by @jp-bennett in https://github.com/meshtastic/firmware/pull/7655\r\n* Only gate PKC behind the simradio CLI flag by @jp-bennett in https://github.com/meshtastic/firmware/pull/7681\r\n* Add SDL option to BaseUI on Native by @jp-bennett in https://github.com/meshtastic/firmware/pull/7568\r\n* Initial stab at rak6421 autoconf by @jp-bennett in https://github.com/meshtastic/firmware/pull/7691\r\n* Update meshtastic/device-ui digest to 3dc7cf3 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7698\r\n* Support for T-Echo Lite, credits to @Szetya for doing all the heavy lifting! by @caveman99 in https://github.com/meshtastic/firmware/pull/7636\r\n* Add more text message test cases for meshpacket serializer by @TN666 in https://github.com/meshtastic/firmware/pull/7709\r\n* Initial attempt to get rfswitch working on Portduino by @jp-bennett in https://github.com/meshtastic/firmware/pull/7663\r\n* Don't update the NodeDB if the nodeinfo has a mismatching public key by @jp-bennett in https://github.com/meshtastic/firmware/pull/7652\r\n* Add BaseUI support for L1 EInk by @thebentern in https://github.com/meshtastic/firmware/pull/7751\r\n* Mesh solar integration by @thebentern in https://github.com/meshtastic/firmware/pull/7764\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Fix 'buildroot' compiles (OpenWRT) by @vidplace7 in https://github.com/meshtastic/firmware/pull/7620\r\n* Fix: apply 180 degree hw rotation for Indicator BaseUI by @mverch67 in https://github.com/meshtastic/firmware/pull/7660\r\n* Update platform-native digest to cd32f4e by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7662\r\n* Move heartbeat response before !available guard. by @jake-b in https://github.com/meshtastic/firmware/pull/7672\r\n* Docker: fix web assets location by @vidplace7 in https://github.com/meshtastic/firmware/pull/7683\r\n* Update meshtastic-esp8266-oled-ssd1306 diges\r\n* Docker: Update Debian images to trixie by @vidplace7 in https://github.com/meshtastic/firmware/pull/7621\r\n* Fix Tracerouter warnings by @thebentern in https://github.com/meshtastic/firmware/pull/7637\r\n* Don't include OLED fonts for international character sets by default by @thebentern in https://github.com/meshtastic/firmware/pull/7639\r\n* Fix marking LoRa transport mechanism by @GUVWAF in https://github.com/meshtastic/firmware/pull/7634\r\n* Thinknode button and backlight fixes by @jp-bennett in https://github.com/meshtastic/firmware/pull/7641\r\n* Update protobufs and classes by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/7647\r\n* Remove JSON serialization from most NRF52 targets by @thebentern in https://github.com/meshtastic/firmware/pull/7640\r\n* Wait for lead up before enable longlong action by @jp-bennett in https://github.com/meshtastic/firmware/pull/7648\r\nt to 9573abb by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7686\r\n* Update meshtastic/device-ui digest to 8f5094b by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7633\r\n* Update caveman99-stm32-Crypto digest to 1aa30eb by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7725\r\n* Renovate: Always use `master` as the base. by @vidplace7 in https://github.com/meshtastic/firmware/pull/7726\r\n* PKC fix by @jp-bennett in https://github.com/meshtastic/firmware/pull/7722\r\n* T-Lora Pager by @mverch67 in https://github.com/meshtastic/firmware/pull/7613\r\n* Fix: enable device telemetry for elecrow advanced series (MUI) by @mverch67 in https://github.com/meshtastic/firmware/pull/7757\r\n* Don't use pin 0 on RAK for input by @jp-bennett in https://github.com/meshtastic/firmware/pull/7755\r\n* Update meshtastic/device-ui digest to a3e0e1b by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7766\r\n\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.5.ddd1499...v2.7.6.834c3c5"
+ },
+ {
+ "id": "v2.7.5.ddd1499",
+ "title": "Meshtastic Firmware 2.7.5.ddd1499 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.5.ddd1499",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.5.ddd1499/firmware-esp32-2.7.5.ddd1499.zip",
+ "release_notes": "\r\n## 🚀 What's Changed\r\n* Reorder for correct recognition by @caveman99 in https://github.com/meshtastic/firmware/pull/7604\r\n* Stop the bleeding with malicious NodeDB overwrites by @jp-bennett in https://github.com/meshtastic/firmware/pull/7596\r\n* Chore(deps): update actions/checkout action to v5 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7605\r\n* Mark meshPackets based on which interface received. by @jp-bennett in https://github.com/meshtastic/firmware/pull/7589\r\n* chore(deps): update actions/download-artifact action to v5 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7559\r\n* Adding medium and large RU fonts. Fixing RU string width calculation by @mrekin in https://github.com/meshtastic/firmware/pull/7498\r\n* nRF52840 promicro deepsleep fix with some additions by @MagnusKos in https://github.com/meshtastic/firmware/pull/7407\r\n* More spoof remediation by @jp-bennett in https://github.com/meshtastic/firmware/pull/7612\r\n\r\n## New Contributors\r\n* @MagnusKos made their first contribution in https://github.com/meshtastic/firmware/pull/7407\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.4.c1f4f79...v2.7.5.ddd1499"
+ },
+ {
+ "id": "v2.7.4.c1f4f79",
+ "title": "Meshtastic Firmware 2.7.4.c1f4f79 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.4.c1f4f79",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.4.c1f4f79/firmware-esp32-2.7.4.c1f4f79.zip",
+ "release_notes": "## 🚀 Enhancements\r\n* Unify the shutdown proceedure by @jp-bennett in https://github.com/meshtastic/firmware/pull/7393\r\n* T-Deck Pro support by @mverch67 in https://github.com/meshtastic/firmware/pull/6936\r\n* Text message rate limiting should return routing error instead by @thebentern in https://github.com/meshtastic/firmware/pull/7365\r\n* WashTastic variant by @valzzu in https://github.com/meshtastic/firmware/pull/7450\r\n* Set canned_message.enabled to true when setting defaults by @jp-bennett in https://github.com/meshtastic/firmware/pull/7414\r\n* Add Trace Route on BaseUI by @whywilson in https://github.com/meshtastic/firmware/pull/7386\r\n* Add BRT3 timezone option to TZPicker menu by @barbabarros in https://github.com/meshtastic/firmware/pull/7438\r\n* Set firmware edition (for events) from userprefs by @thebentern in https://github.com/meshtastic/firmware/pull/7488\r\n* Heartbeat response by @thebentern in https://github.com/meshtastic/firmware/pull/7506\r\n* Airoha GPS - ignore estimated fixes by @fifieldt in https://github.com/meshtastic/firmware/pull/7429\r\n* [7353] Add all telemetry fields to json output by @rradillen in https://github.com/meshtastic/firmware/pull/7363\r\n* Event mode - limit smart position updates to at most every 5m by @powersjcb in https://github.com/meshtastic/firmware/pull/7505\r\n* Move BLE toggle menu option and add confirmation for canned messages in L1 by @thebentern in https://github.com/meshtastic/firmware/pull/7516\r\n* Initial support for the ThinkNode M5 by @jp-bennett in https://github.com/meshtastic/firmware/pull/7502\r\n\r\n## 🐛 Bug fixes and maintenace\r\n* ESP32: Initial sort variants by platform by @vidplace7 in https://github.com/meshtastic/firmware/pull/7340\r\n* ESP32c3: Migrate variants to new structure by @vidplace7 in https://github.com/meshtastic/firmware/pull/7342\r\n* Misc cppcheck fixes by @jp-bennett in https://github.com/meshtastic/firmware/pull/7370\r\n* RP2040/RP2350: Migrate variants to new structure by @vidplace7 in https://github.com/meshtastic/firmware/pull/7345\r\n* STM32: Migrate variants to new structure by @vidplace7 in https://github.com/meshtastic/firmware/pull/7389\r\n* UDP for RAK4631 Eth Gw and the t-eth-elite. Solves #7149 by @caveman99 in https://github.com/meshtastic/firmware/pull/7385\r\n* Restore High Resolution Hour Hand by @Xaositek in https://github.com/meshtastic/firmware/pull/7392\r\n* Fix UDP builds on nRF by @caveman99 in https://github.com/meshtastic/firmware/pull/7394\r\n* ESP32s3: Migrate variants to new structure by @vidplace7 in https://github.com/meshtastic/firmware/pull/7343\r\n* ARCH_STM32*WL* by @vidplace7 in https://github.com/meshtastic/firmware/pull/7397\r\n* Actions: pull_request_target is fun by @vidplace7 in https://github.com/meshtastic/firmware/pull/7398\r\n* Renovate: Use github-tags for XPowersLib updates by @vidplace7 in https://github.com/meshtastic/firmware/pull/7411\r\n* nRF52840: Migrate variants to new structure by @vidplace7 in https://github.com/meshtastic/firmware/pull/7396\r\n* Migrate remaining variants to new dir structure by @vidplace7 in https://github.com/meshtastic/firmware/pull/7412\r\n* Moves the shutdown thread into the Power class, make shutdown and reboot private by @jp-bennett in https://github.com/meshtastic/firmware/pull/7415\r\n* Upgrade trunk by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/7420\r\n* Add a verbose mode flag to meshtasticd by @jp-bennett in https://github.com/meshtastic/firmware/pull/7416\r\n* Update protobufs and classes by @github-actions[bot] in https://github.com/meshtastic/firmware/pull/7422\r\n* AG3335 GPS: Use NAVIC in India/Nepal, L1+L5 elsewhere. by @fifieldt in https://github.com/meshtastic/firmware/pull/7413\r\n* Use platformio-core to build the matrix by @vidplace7 in https://github.com/meshtastic/firmware/pull/7424\r\n* Deprecate disable_triple_click config by @jp-bennett in https://github.com/meshtastic/firmware/pull/7425\r\n* Update meshtastic/device-ui digest to c75d545 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7435\r\n* Add Nepal 865 MHz to 868 MHz by @WOD-MN in https://github.com/meshtastic/firmware/pull/7380\r\n* Add BR_902, Brazil 902MHz-907.5MHz by @fifieldt in https://github.com/meshtastic/firmware/pull/7399\r\n* Add NP_865 and BR_902 to region picker by @barbabarros in https://github.com/meshtastic/firmware/pull/7434\r\n* Actions: Combine embedded builds // split by variant subdir by @vidplace7 in https://github.com/meshtastic/firmware/pull/7417\r\n* Take control of our PRs! by @vidplace7 in https://github.com/meshtastic/firmware/pull/7445\r\n* Fix timezone definition for UTC in TZPicker function by @barbabarros in https://github.com/meshtastic/firmware/pull/7442\r\n* Fix MHz label by @Xaositek in https://github.com/meshtastic/firmware/pull/7455\r\n* Build RP2350 (Pi Pico 2) by @vidplace7 in https://github.com/meshtastic/firmware/pull/7441\r\n* Actions: Enforce PR labels by @vidplace7 in https://github.com/meshtastic/firmware/pull/7379\r\n* Rename Platformio.ini to platformio.ini | WashTastic by @valzzu in https://github.com/meshtastic/firmware/pull/7468\r\n* Fix MQTT config bugs by @thebentern in https://github.com/meshtastic/firmware/pull/7446\r\n* Clear position on GPS deactivation, unless using fixed position by @fifieldt in https://github.com/meshtastic/firmware/pull/7464\r\n* Validate Serial config console override modes by @thebentern in https://github.com/meshtastic/firmware/pull/7470\r\n* Bugfix Add rssi and snr to the store and forward code. by @mikecarper in https://github.com/meshtastic/firmware/pull/7462\r\n* Santa may be checking his list twice, but we only need this in the platformio.ini by @caveman99 in https://github.com/meshtastic/firmware/pull/7490\r\n* NodeDB count on MyNodeInfo for client progress reporting by @thebentern in https://github.com/meshtastic/firmware/pull/7489\r\n* Core portnums rebroadcast mode whitelist instead of blacklist by @thebentern in https://github.com/meshtastic/firmware/pull/7487\r\n* DEBUG_MUTE correctness by @Stary2001 in https://github.com/meshtastic/firmware/pull/7492\r\n* Workaround Webserver needing to stay up while Wifi is being turned off by @fifieldt in https://github.com/meshtastic/firmware/pull/7484\r\n* Update platformio/ststm32 to v19.3.0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7512\r\n* Bugfix Syntax error: \"(\" unexpected in device-update.sh by @mikecarper in https://github.com/meshtastic/firmware/pull/7514\r\n* Remember destination fix by @HarukiToreda in https://github.com/meshtastic/firmware/pull/7427\r\n* Rv3028 rtc fix by @tg-mw in https://github.com/meshtastic/firmware/pull/7524\r\n* Only toggle screen wake, don't break banners by @Xaositek in https://github.com/meshtastic/firmware/pull/7545\r\n* Improve words within logging for onscreen message scroll cache by @Xaositek in https://github.com/meshtastic/firmware/pull/7548\r\n* Fix: ina226 was not calibrated during init by @mrab in https://github.com/meshtastic/firmware/pull/7547\r\n* Rather than mysteriously rebooting, regenerate the keys and inform the user by @jp-bennett in https://github.com/meshtastic/firmware/pull/7558\r\n* Avoid acquiring lock twice by @oscgonfer in https://github.com/meshtastic/firmware/pull/7555\r\n* Chore(deps): update adafruit shtc3 to v1.0.2 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7557\r\n* Fix a crash on Native reboot by @jp-bennett in https://github.com/meshtastic/firmware/pull/7570\r\n* chore(deps): update meshtastic/device-ui digest to d044c01 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7578\r\n\r\n## New Contributors\r\n* @WOD-MN made their first contribution in https://github.com/meshtastic/firmware/pull/7380\r\n* @barbabarros made their first contribution in https://github.com/meshtastic/firmware/pull/7434\r\n* @valzzu made their first contribution in https://github.com/meshtastic/firmware/pull/7450\r\n* @mikecarper made their first contribution in https://github.com/meshtastic/firmware/pull/7462\r\n* @rradillen made their first contribution in https://github.com/meshtastic/firmware/pull/7363\r\n* @powersjcb made their first contribution in https://github.com/meshtastic/firmware/pull/7505\r\n* @tg-mw made their first contribution in https://github.com/meshtastic/firmware/pull/7524\r\n* @mrab made their first contribution in https://github.com/meshtastic/firmware/pull/7547\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.3.cf574c7...v2.7.4.c1f4f79"
+ },
+ {
+ "id": "v2.7.3.cf574c7",
+ "title": "Meshtastic Firmware 2.7.3.cf574c7 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.3.cf574c7",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.3.cf574c7/firmware-esp32-2.7.3.cf574c7.zip",
+ "release_notes": "## 🚀 Enhancements\r\n* Update Screen Wake Default Behavior by @Xaositek in https://github.com/meshtastic/firmware/pull/7282\r\n* Make the shouldWake function always available, and remove the bool by @jp-bennett in https://github.com/meshtastic/firmware/pull/7300\r\n* Shorter audio feedback for InkHUD buttons by @todd-herbert in https://github.com/meshtastic/firmware/pull/7301\r\n* Support native configuration Waveshare Pico LoRa module on Orange Pi Zero3 by @Mictronics in https://github.com/meshtastic/firmware/pull/7295\r\n* Load ringtone from userPrefs by @vidplace7 in https://github.com/meshtastic/firmware/pull/7298\r\n* Seesaw Rotary by @jp-bennett in https://github.com/meshtastic/firmware/pull/7310\r\n* GPS for STM32WL by @Stary2001 in https://github.com/meshtastic/firmware/pull/7297\r\n* Feat: add support for RAK Wismesh Tag hardware platform by @DanielCao0 in https://github.com/meshtastic/firmware/pull/6853\r\n* Message frame New Message Options and Clock / TDeck / Brightness Refinements by @Xaositek in https://github.com/meshtastic/firmware/pull/7344\r\n* BaseUI Updates by @Xaositek in https://github.com/meshtastic/firmware/pull/7358\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Update RadioLib to v7.2.1 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7287\r\n* Update platformio.ini by @Kongduino in https://github.com/meshtastic/firmware/pull/7289\r\n* Update Adafruit BusIO to v1.17.2 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7277\r\n* Update dorny/test-reporter action to v2.1.1 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7284\r\n* Update meshtastic/device-ui digest to 404c6e0 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7302\r\n* Add first config override for Native by @jp-bennett in https://github.com/meshtastic/firmware/pull/7306\r\n* Update meshtastic/device-ui digest to 86a09a7 by @renovate[bot] in https://github.com/meshtastic/firmware/pull/7308\r\n* STM32: Properly ignore OneButton by @vidplace7 in https://github.com/meshtastic/firmware/pull/7311\r\n* Build: Update platformio with `pkg install` by @vidplace7 in https://github.com/meshtastic/firmware/pull/7315\r\n* Bump Framework-native and set version string. by @jp-bennett in https://github.com/meshtastic/firmware/pull/7317\r\n* userPrefs: Set default ringtone nag time by @vidplace7 in https://github.com/meshtastic/firmware/pull/7314\r\n* Remove Ubuntu oracular by @vidplace7 in https://github.com/meshtastic/firmware/pull/7322\r\n* feat: DIY Seeed XIAO nRF52840 + EBYTE E22 variants, pin-compatible with Wio-SX1262 kit by @ndoo in https://github.com/meshtastic/firmware/pull/7105\r\n* feat: New variant esp32c3_super_mini by @ndoo in https://github.com/meshtastic/firmware/pull/7133\r\n* xiao_ble README.md updates by @ndoo in https://github.com/meshtastic/firmware/pull/7283\r\n* fix(device-update.sh): safely filter args without breaking parsing by @NeilHanlon in https://github.com/meshtastic/firmware/pull/7305\r\n* NodeDB.cpp: Fix iOS bluetooth crash by ensuring UINT32_MAX is not used by @Styne13 in https://github.com/meshtastic/firmware/pull/7312\r\n* Improve OLED UI Responsiveness and Force Redraws for Canned message module by @csrutil in https://github.com/meshtastic/firmware/pull/7324\r\n* add pioenv to version string in debug log by @caveman99 in https://github.com/meshtastic/firmware/pull/7328\r\n* PPA: Add Ubuntu Questing (25.10) to daily builds by @vidplace7 in https://github.com/meshtastic/firmware/pull/7329\r\n* get git url part from local repo by @caveman99 in https://github.com/meshtastic/firmware/pull/7331\r\n* Add heap info via standard mallinfo() function for STM32 by @Stary2001 in https://github.com/meshtastic/firmware/pull/7327\r\n* The screen display of the heltec wireless tracker is abnormal. by @Quency-D in https://github.com/meshtastic/firmware/pull/7337\r\n* STM32 PlatformIO cleanup by @vidplace7 in https://github.com/meshtastic/firmware/pull/7339\r\n* Map report should work over devices which do not have network hardware (with client proxy) by @thebentern in https://github.com/meshtastic/firmware/pull/7341\r\n* Fix L1 EInk HWModel by @thebentern in https://github.com/meshtastic/firmware/pull/7346\r\n* Drop NodeInfo packets if the is_licensed bit doesn't match owner by @jp-bennett in https://github.com/meshtastic/firmware/pull/7361\r\n* Clean up double i2c init/scan code by @caveman99 in https://github.com/meshtastic/firmware/pull/7359\r\n* Add additional Epoch check for time set by @fifieldt in https://github.com/meshtastic/firmware/pull/7375\r\n\r\n## New Contributors\r\n* @NeilHanlon made their first contribution in https://github.com/meshtastic/firmware/pull/7305\r\n* @Styne13 made their first contribution in https://github.com/meshtastic/firmware/pull/7312\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.2.f6d3782...v2.7.3.cf574c7"
+ },
+ {
+ "id": "v2.7.2.f6d3782",
+ "title": "Meshtastic Firmware 2.7.2.f6d3782 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.2.f6d3782",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.2.f6d3782/firmware-esp32-2.7.2.f6d3782.zip",
+ "release_notes": "## 🚀 Enhancements\r\n* Fast fix, remove saving tx power inside limitPower() by @mrekin in https://github.com/meshtastic/firmware/pull/7255\r\n* Show user which Clock Face option is currently elected by @Xaositek in https://github.com/meshtastic/firmware/pull/7271\r\n* Heltec Wireless Paper, VM-E213 Hardware Revisions by @todd-herbert in https://github.com/meshtastic/firmware/pull/7258\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Add HWIDs for T1000-E in DFU mode by @thebentern in https://github.com/meshtastic/firmware/pull/7235\r\n* chore(deps): update meshtastic/device-ui digest to 8c7092c by @renovate in https://github.com/meshtastic/firmware/pull/7238\r\n* Automatically bail user out of displaymode_color when not HAS_TFT by @jp-bennett in https://github.com/meshtastic/firmware/pull/7248\r\n* Don't run bluetooth gerFromRadio() unless the phone has requested a packet by @jp-bennett in https://github.com/meshtastic/firmware/pull/7231\r\n* Try-fix: L76K spamming bad times can crash nodes by @thebentern in https://github.com/meshtastic/firmware/pull/7261\r\n* Fix install script by @Pitel in https://github.com/meshtastic/firmware/pull/7259\r\n* Modules and favorite screen fix by @HarukiToreda in https://github.com/meshtastic/firmware/pull/7264\r\n* TFT_MESH Fixes Across Various Devices by @Xaositek in https://github.com/meshtastic/firmware/pull/7247\r\n* Update Bluetooth Toggle to match other variants by @Xaositek in https://github.com/meshtastic/firmware/pull/7269\r\n* Make PacketHistory logging less chatty by @thebentern in https://github.com/meshtastic/firmware/pull/7272\r\n* GitHub Actions faster!! (again) by @vidplace7 in https://github.com/meshtastic/firmware/pull/7268\r\n* Whoops! Re-Add nRF52 OTA zips by @vidplace7 in https://github.com/meshtastic/firmware/pull/7275\r\n* Actions: Re-Add nrf52 hex release (rak4631) by @vidplace7 in https://github.com/meshtastic/firmware/pull/7276\r\n* Update Adafruit INA260 to v1.5.3 by @renovate in https://github.com/meshtastic/firmware/pull/7270\r\n\r\n## New Contributors\r\n* @Pitel made their first contribution in https://github.com/meshtastic/firmware/pull/7259\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.1.f35ca81...v2.7.2.f6d3782"
+ },
+ {
+ "id": "v2.7.1.f35ca81",
+ "title": "Meshtastic Firmware 2.7.1.f35ca81 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.7.1.f35ca81",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.7.1.f35ca81/firmware-esp32-2.7.1.f35ca81.zip",
+ "release_notes": "## 🚀 Enhancements\r\n* Add detection code for SCD4X by @fifieldt in https://github.com/meshtastic/firmware/pull/7185\r\n* Refactor Calibrate battery curve for TRACKER_T1000-E by @Dylanliacc in https://github.com/meshtastic/firmware/pull/7186\r\n* Add detection framework for multiple AirQuality sensors by @fifieldt in https://github.com/meshtastic/firmware/pull/7187\r\n* Log TX power after limits applyng and store it in config by @mrekin in https://github.com/meshtastic/firmware/pull/7065\r\n* Limited emoji support for InkHUD by @todd-herbert in https://github.com/meshtastic/firmware/pull/7176\r\n* Calibrate battery curve for SEEED_WIO_TRACKER_L1 and SEEED_SOLAR_NODE by @Dylanliacc in https://github.com/meshtastic/firmware/pull/7194\r\n* Enable telemetry and I2C sensors on STM32WL (except accelerometers) by @Stary2001 in https://github.com/meshtastic/firmware/pull/7008\r\n* Update protobufs and classes by @github-actions in https://github.com/meshtastic/firmware/pull/7199\r\n* Feat: add support for RAK3312 (New RAKwireless wiscore ESP32-S3 + SX1262) by @DanielCao0 in https://github.com/meshtastic/firmware/pull/7115\r\n* Added option to invert screen on InkHUD by @razurac in https://github.com/meshtastic/firmware/pull/7075\r\n* mDNS: Remove HTTP/HTTPS. Advertise shortname/id. by @vidplace7 in https://github.com/meshtastic/firmware/pull/7162\r\n* Add customizable boot logo based on resolution by @vidplace7 in https://github.com/meshtastic/firmware/pull/7146\r\n* Additional larger font for InkHUD UI by @todd-herbert in https://github.com/meshtastic/firmware/pull/7201\r\n* Add GPIO edge for Native Trackball/Joystick by @jp-bennett in https://github.com/meshtastic/firmware/pull/7212\r\n* Add ROUTER_LATE to EVENT_MODE rules by @vidplace7 in https://github.com/meshtastic/firmware/pull/7220\r\n* Honor custom userPrefs boot-screens in InkHUD by @todd-herbert in https://github.com/meshtastic/firmware/pull/7217\r\n* Battery Layout Updates and Icons Changes by @Xaositek in https://github.com/meshtastic/firmware/pull/7221\r\n* Add Kazakhstan frequencies by @fifieldt in https://github.com/meshtastic/firmware/pull/7209\r\n* Add Kazakhstan to the BaseUI LoRa chooser by @jp-bennett in https://github.com/meshtastic/firmware/pull/7224\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Last second fixes by @jp-bennett in https://github.com/meshtastic/firmware/pull/7156\r\n* Add check for theoretically impossible comparison, and drop nodenum by @jp-bennett in https://github.com/meshtastic/firmware/pull/7165\r\n* fix(xiao_ble): Define xiao_ble I2C pins in parent variant (fixes #7163) by @ndoo in https://github.com/meshtastic/firmware/pull/7164\r\n* Bump release version by @github-actions in https://github.com/meshtastic/firmware/pull/7155\r\n* chore(deps): update meshtastic/device-ui digest to 4b7bf36 by @renovate in https://github.com/meshtastic/firmware/pull/7178\r\n* Fix hydra radio by @jankowski-t in https://github.com/meshtastic/firmware/pull/7192\r\n* Fix seeed_tracker_L1_eink bug of cant't switch between two applets side-by-side by @Dylanliacc in https://github.com/meshtastic/firmware/pull/7195\r\n* Fix build when MESHTASTIC_EXCLUDE_GPS is defined by @Mictronics in https://github.com/meshtastic/firmware/pull/7154\r\n* Renovate comment for sensirion/Sensirion I2C SCD4x by @vidplace7 in https://github.com/meshtastic/firmware/pull/7202\r\n* Chore(deps): update sensirion i2c scd4x to v1.1.0 by @renovate in https://github.com/meshtastic/firmware/pull/7207\r\n* 2.7 fixes w2 by @jp-bennett in https://github.com/meshtastic/firmware/pull/7148\r\n* Fix Seeed L1 board to enable consistent PIO flashing by @thebentern in https://github.com/meshtastic/firmware/pull/7211\r\n* Don't set non-existent pin on e290 by @jp-bennett in https://github.com/meshtastic/firmware/pull/7213\r\n* Disable low brightness, as this soft-bricks at least the L1 by @jp-bennett in https://github.com/meshtastic/firmware/pull/7223\r\n* Fixed --change-mode option in device-update.sh by @mattster98 in https://github.com/meshtastic/firmware/pull/7144\r\n* chore(deps): update meshtastic-esp32_https_server digest to 3223704 by @renovate in https://github.com/meshtastic/firmware/pull/7225\r\n* Chore(deps): update xpowerslib to v0.3.0 by @renovate in https://github.com/meshtastic/firmware/pull/7210\r\n* Add a WiFi menu that can toggle back to Bluetooth by @jp-bennett in https://github.com/meshtastic/firmware/pull/7226\r\n\r\n## New Contributors\r\n* @jankowski-t made their first contribution in https://github.com/meshtastic/firmware/pull/7192\r\n* @razurac made their first contribution in https://github.com/meshtastic/firmware/pull/7075\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.7.0.705515a...v2.7.1.f35ca81"
+ },
+ {
+ "id": "v2.6.13.0561f2c",
+ "title": "Meshtastic Firmware 2.6.13.0561f2c Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.13.0561f2c",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.13.0561f2c/firmware-esp32-2.6.13.0561f2c.zip",
+ "release_notes": "> [!CAUTION] \r\n> This firmware includes built-in security which automatically removes your public key (for direct messages and remote administration) if it is included in any of the 25 known insecure keys in order to keep your communications private. \r\n\r\n## 🚀 Enhancements \r\n* PacketHistory debloat RAM allocations by @Marek-mk in https://github.com/meshtastic/firmware/pull/7034\r\n* Add recognition for SHT40 with serial number starting with 0xc8d by @notmarek in https://github.com/meshtastic/firmware/pull/7061\r\n* Add rak12035 VB Soil Monitor Tested & Working by @Justin-Mann in https://github.com/meshtastic/firmware/pull/6741\r\n* XIAO BLE cleanup (supporting changes to seeed_xiao_nrf52840_kit too) by @ndoo in https://github.com/meshtastic/firmware/pull/7024\r\n* PacketHistory - option to track entries' aging to log by @Marek-mk in https://github.com/meshtastic/firmware/pull/7067\r\n\r\n## 🐛 Bug fixes and enhancements\r\n* Fix Critical Error #3 for LilyGo T-Echo by @Logicbloke in https://github.com/meshtastic/firmware/pull/6791\r\n* Dismiss ExternalNotification nagging on InkHUD button press by @todd-herbert in https://github.com/meshtastic/firmware/pull/7056\r\n* Fix RCWL9620Sensor for rak11310 support by @Nivek-domo in https://github.com/meshtastic/firmware/pull/6617\r\n* Run daily packaging earlier (PPA) by @vidplace7 in https://github.com/meshtastic/firmware/pull/7057\r\n* Ensure incoming hostMetrics userstring is null terminated by @jp-bennett in https://github.com/meshtastic/firmware/pull/7068\r\n* Update HostMetrics.cpp - don't try to print the user string by @jp-bennett in https://github.com/meshtastic/firmware/pull/7081\r\n* Replace blocking delay for wifi reconnect with non-blocking to keep button/display interactivity by @mattster98 in https://github.com/meshtastic/firmware/pull/6983\r\n* Fix position exchange throttling issue by @jeremiah-k in https://github.com/meshtastic/firmware/pull/7079\r\n* Fix nugget s3 lora variant issues by @hafu in https://github.com/meshtastic/firmware/pull/7070\r\n\r\n## New Contributors\r\n* @Logicbloke made their first contribution in https://github.com/meshtastic/firmware/pull/6791\r\n* @Marek-mk made their first contribution in https://github.com/meshtastic/firmware/pull/7034\r\n* @notmarek made their first contribution in https://github.com/meshtastic/firmware/pull/7061\r\n* @mattster98 made their first contribution in https://github.com/meshtastic/firmware/pull/6983\r\n* @hafu made their first contribution in https://github.com/meshtastic/firmware/pull/7070\r\n* @Justin-Mann made their first contribution in https://github.com/meshtastic/firmware/pull/6741\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.12.9861e82...v2.6.13.0561f2c"
+ },
+ {
+ "id": "v2.6.12.9861e82",
+ "title": "Meshtastic Firmware 2.6.12.9861e82 Alpha",
+ "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.12.9861e82",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.12.9861e82/firmware-esp32-2.6.12.9861e82.zip",
+ "release_notes": "> [!CAUTION] \r\n> This firmware includes built-in security which automatically removes your public key (for direct messages and remote administration) if it is included in any of the 25 known insecure keys in order to keep your communications private. \r\n\r\n## 🚀 Enhancements \r\n* Key erase by @jp-bennett in https://github.com/meshtastic/firmware/pull/7018\r\n* Remove GPS Baudrate locking for Seeed Xiao NRF52840 Kit by @fifieldt in https://github.com/meshtastic/firmware/pull/7016\r\n* Validate short and long names so whitespace or empty names cannot be used by @Crank-Git in https://github.com/meshtastic/firmware/pull/6993\r\n* Add InkHUD driver for WeAct Studio 2.13\" display module by @todd-herbert in https://github.com/meshtastic/firmware/pull/7001\r\n* Add InkHUD driver for WeAct Studio 1.54\" display module by @todd-herbert in https://github.com/meshtastic/firmware/pull/7000\r\n* Add support for GAT562 Mesh Trial Tracker by @csrutil in https://github.com/meshtastic/firmware/pull/6984\r\n* Add config for RAK 13300 on RAK6421 by @jp-bennett in https://github.com/meshtastic/firmware/pull/7037\r\n* InkHUD DIY builds for ProMicro & Heltec T114 by @todd-herbert in https://github.com/meshtastic/firmware/pull/7039\r\n* Allow overriding INA3221 channels by @andyshinn in https://github.com/meshtastic/firmware/pull/7035\r\n* Add the ability to share ignored contacts (for blacklisting problematic nodes) by @thebentern in https://github.com/meshtastic/firmware/pull/7044\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* More low-entropy keys, and don't issue a false warning when changing … by @jp-bennett in https://github.com/meshtastic/firmware/pull/7041\r\n* Don't use assert() with side effects in a couple more places by @Stary2001 in https://github.com/meshtastic/firmware/pull/7009\r\n* chore(deps): update platform-native digest to 49634e9 by @renovate in https://github.com/meshtastic/firmware/pull/7020\r\n* chore(deps): update platform-native digest to 681ee02 by @renovate in https://github.com/meshtastic/firmware/pull/7022\r\n* chore(deps): update meshtastic/device-ui digest to 301f11e by @renovate in https://github.com/meshtastic/firmware/pull/7042\r\n* Upgrade trunk by @github-actions in https://github.com/meshtastic/firmware/pull/7030\r\n* Update protobufs and classes by @github-actions in https://github.com/meshtastic/firmware/pull/7043\r\n* Manual bump metainfo version by @vidplace7 in https://github.com/meshtastic/firmware/pull/7049\r\n\r\n## New Contributors\r\n* @csrutil made their first contribution in https://github.com/meshtastic/firmware/pull/6984\r\n* @andyshinn made their first contribution in https://github.com/meshtastic/firmware/pull/7035\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.11.60ec05e...v2.6.12.9861e82"
+ },
{
"id": "v2.6.9.f223b8a",
"title": "Meshtastic Firmware 2.6.9.f223b8a Alpha",
"page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.9.f223b8a",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.9.f223b8a/firmware-stm32-2.6.9.f223b8a.zip",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.9.f223b8a/firmware-esp32-2.6.9.f223b8a.zip",
"release_notes": "\r\n## Enhancements\r\n* Stop the madness! Run as a user (not root) by @vidplace7 in https://github.com/meshtastic/firmware/pull/6718\r\n* Host metrics by @jp-bennett in https://github.com/meshtastic/firmware/pull/6817\r\n* Hostmetrics user string by @jp-bennett in https://github.com/meshtastic/firmware/pull/6850\r\n* Add basic handling for is_manually_validated by @jp-bennett in https://github.com/meshtastic/firmware/pull/6856\r\n* If a contact is add from a QR, it's \"verified\" manually by @thebentern in https://github.com/meshtastic/firmware/pull/6858\r\n* InkHUD Extended ASCII by @todd-herbert in https://github.com/meshtastic/firmware/pull/6768\r\n* Added map report precision bounds by @thebentern in https://github.com/meshtastic/firmware/pull/6862\r\n* Update Adafruit PM25 AQI Sensor to v2 by @renovate in https://github.com/meshtastic/firmware/pull/6778\r\n* Add PCT2075 Temperature Sensor by @mich181189 in https://github.com/meshtastic/firmware/pull/6829\r\n* Add heap metrics to Local stats by @thebentern in https://github.com/meshtastic/firmware/pull/6887\r\n* Feat(RadioInterface): Tx power gain calculation rework by @ndoo in https://github.com/meshtastic/firmware/pull/6796\r\n\r\n## Bug fixes and maintenance\r\n* Remove compass boot calibration by @jp-bennett in https://github.com/meshtastic/firmware/pull/6825\r\n* Update dorny/test-reporter action to v2.1.0 by @renovate in https://github.com/meshtastic/firmware/pull/6833\r\n* Fix for ICM-20948 not initializing by @HarukiToreda in https://github.com/meshtastic/firmware/pull/6827\r\n* Graphics: Add GDEY0213B74 E-Ink display driver by @chihosin in https://github.com/meshtastic/firmware/pull/6879\r\n* chore(deps): update meshtastic/device-ui digest to e63b219 by @renovate in https://github.com/meshtastic/firmware/pull/6883\r\n* Fix is_unmessagable plumbing by @thebentern in https://github.com/meshtastic/firmware/pull/6886\r\n* InkHUD: add missing parsing of UTF-8 chars by @todd-herbert in https://github.com/meshtastic/firmware/pull/6889\r\n* Update seeed solar node led pin by @Dylanliacc in https://github.com/meshtastic/firmware/pull/6871\r\n* Bosch bsec2: Switch back to official releases by @vidplace7 in https://github.com/meshtastic/firmware/pull/6870\r\n\r\n## New Contributors\r\n* @chihosin made their first contribution in https://github.com/meshtastic/firmware/pull/6879\r\n* @mich181189 made their first contribution in https://github.com/meshtastic/firmware/pull/6829\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.8.ef9d0d7...v2.6.9.f223b8a"
},
{
"id": "v2.6.8.ef9d0d7",
"title": "Meshtastic Firmware 2.6.8.ef9d0d7 Alpha",
"page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.8.ef9d0d7",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.8.ef9d0d7/firmware-stm32-2.6.8.ef9d0d7.zip",
+ "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.8.ef9d0d7/firmware-esp32-2.6.8.ef9d0d7.zip",
"release_notes": "## 🚀 Enhancements\r\n* 20948 compass support by @jp-bennett in https://github.com/meshtastic/firmware/pull/6707\r\n* Update XIAO_NRF_KIT RXEN Pin definition by @NomDeTom in https://github.com/meshtastic/firmware/pull/6717\r\n* Add client notification before role based power saving (sleep) by @thebentern in https://github.com/meshtastic/firmware/pull/6759\r\n* Actions: Fix end to end tests by @vidplace7 in https://github.com/meshtastic/firmware/pull/6776\r\n* Add clarifying note about AHT20 also being included with AHT10 library by @NomDeTom in https://github.com/meshtastic/firmware/pull/6787\r\n* Only send nodes on want_config of 69421 by @thebentern in https://github.com/meshtastic/firmware/pull/6792\r\n* Add contact admin message (for QR code) by @thebentern in https://github.com/meshtastic/firmware/pull/6806\r\n* Crowpanel 4.3, 5.0, 7.0 support by @caveman99 in https://github.com/meshtastic/firmware/pull/6611\r\n* MQTT userprefs by @vidplace7 in https://github.com/meshtastic/firmware/pull/6802\r\n* Unmessagable implementation and defaults by @thebentern in https://github.com/meshtastic/firmware/pull/6811\r\n* Added new map report opt-in for compliance and limit map report (and default) to one hour by @thebentern in https://github.com/meshtastic/firmware/pull/6813\r\n* chore(deps): update meshtastic/device-ui digest to 35576e1 by @renovate in https://github.com/meshtastic/firmware/pull/6747\r\n\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Renovate: fix device-ui match (tiny fix) by @vidplace7 in https://github.com/meshtastic/firmware/pull/6748\r\n* Add some no-nonsense coercion for self-reporting node values by @thebentern in https://github.com/meshtastic/firmware/pull/6793\r\n* Device-install.sh: detect t-eth-elite as s3 device by @chri2 in https://github.com/meshtastic/firmware/pull/6767\r\n* Fixes BUG #6243 by @Richard3366 in https://github.com/meshtastic/firmware/pull/6781\r\n* Update Seeed Solar Node by @rcarteraz in https://github.com/meshtastic/firmware/pull/6763\r\n* Protect T-Echo's touch button against phantom presses in OLED UI by @todd-herbert in https://github.com/meshtastic/firmware/pull/6735\r\n* Don't run `test-native` for event firmwares by @vidplace7 in https://github.com/meshtastic/firmware/pull/6749\r\n* Fix EVENT_MODE on mqttless targets by @vidplace7 in https://github.com/meshtastic/firmware/pull/6750\r\n* Fix event templates (names, PSKs) by @vidplace7 in https://github.com/meshtastic/firmware/pull/6753\r\n* Add suppport for Quectel L80 by @fifieldt in https://github.com/meshtastic/firmware/pull/6803\r\n\r\n## New Contributors\r\n* @chri2 made their first contribution in https://github.com/meshtastic/firmware/pull/6767\r\n* @Richard3366 made their first contribution in https://github.com/meshtastic/firmware/pull/6781\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.7.2d6181f...v2.6.8.ef9d0d7"
- },
- {
- "id": "v2.6.7.2d6181f",
- "title": "Meshtastic Firmware 2.6.7.2d6181f Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.7.2d6181f",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.7.2d6181f/firmware-stm32-2.6.7.2d6181f.zip",
- "release_notes": "## 🚀 Enhancements\r\n* Step one of Linux Sensor support by @jp-bennett in https://github.com/meshtastic/firmware/pull/6673\r\n* PMSA003I: add support for driving SET pin low while not actively taking a telemetry reading by @vogon in https://github.com/meshtastic/firmware/pull/6569\r\n* UDP-multicast: bump platform-native to fix UDP read of unitialized memory bug by @Jorropo in https://github.com/meshtastic/firmware/pull/6686\r\n* UDP-multicast: remove the thread from the multicast thread API by @Jorropo in https://github.com/meshtastic/firmware/pull/6685\r\n* Rate limit waypoints and alerts and increase to allow every 10 seconds instead of 5 by @thebentern in https://github.com/meshtastic/firmware/pull/6699\r\n* Restore InkHUD to defaults on factory reset by @todd-herbert in https://github.com/meshtastic/firmware/pull/6637\r\n* MUI: native frame buffer support by @mverch67 in https://github.com/meshtastic/firmware/pull/6703\r\n* Add PA1010D GPS support by @fmckeogh in https://github.com/meshtastic/firmware/pull/6691\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Fix: native runs 100% CPU in tft_task_handler() when deviceScreen is null by @jp-bennett in https://github.com/meshtastic/firmware/pull/6695\r\n* Lock SPI bus while in use by InkHUD by @todd-herbert in https://github.com/meshtastic/firmware/pull/6719\r\n* Update template for event userprefs by @vidplace7 in https://github.com/meshtastic/firmware/pull/6720\r\n* Renovate: Add changelogs for device-ui, cleanup by @vidplace7 in https://github.com/meshtastic/firmware/pull/6733\r\n* Update Bosch BSEC2 to v1.8.2610, BME68x to v1.2.40408 by @vidplace7 in https://github.com/meshtastic/firmware/pull/6727\r\n\r\n## New Contributors\r\n* @vogon made their first contribution in https://github.com/meshtastic/firmware/pull/6569\r\n* @fmckeogh made their first contribution in https://github.com/meshtastic/firmware/pull/6691\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.6.54c1423...v2.6.7.2d6181f"
- },
- {
- "id": "v2.6.6.54c1423",
- "title": "Meshtastic Firmware 2.6.6.54c1423 Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.6.54c1423",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.6.54c1423/firmware-stm32-2.6.6.54c1423.zip",
- "release_notes": "## 🚀 Enhancements\r\n* DIY v1/v1_1 add TCXO_OPTIONAL make it so that the firmware can try both TCXO and XTAL by @Andrik45719 in https://github.com/meshtastic/firmware/pull/6534\r\n* InkHUD support for LilyGo T3S3 E-Paper by @todd-herbert in https://github.com/meshtastic/firmware/pull/6503\r\n* Feat: Add Electronic Cats variant for Catsniffer by @JahazielLem in https://github.com/meshtastic/firmware/pull/6483\r\n* Add generic thread module by @tavdog in https://github.com/meshtastic/firmware/pull/5484\r\n* Add Meshtastic Linux desktop metadata by @vidplace7 in https://github.com/meshtastic/firmware/pull/6568\r\n* Add new hardware: Heltec MeshPocket by @Heltec-Aaron-Lee in https://github.com/meshtastic/firmware/pull/6533\r\n* Switch to actually maintained thingsboard pubsubclient by @thebentern in https://github.com/meshtastic/firmware/pull/5204\r\n* Make startup screen show the short ID by @Heltec-Aaron-Lee in https://github.com/meshtastic/firmware/pull/6591\r\n* Update platformio.ini to exclude unused modules from t1000-e by @benkyd in https://github.com/meshtastic/firmware/pull/6584\r\n* Debian: use native-tft compile target by @vidplace7 in https://github.com/meshtastic/firmware/pull/6580\r\n* Create lora-piggystick-lr1121.yaml by @markbirss in https://github.com/meshtastic/firmware/pull/6600\r\n* Add TFT docker builds (for CI) by @vidplace7 in https://github.com/meshtastic/firmware/pull/6614\r\n* FlatHub: bump metainfo.xml on release by @ThatKalle in https://github.com/meshtastic/firmware/pull/6578\r\n\r\n## 🐛 Bug fixes and enhancements\r\n* Fix Ublox GPS for Heltec T114 by @todd-herbert in https://github.com/meshtastic/firmware/pull/6497\r\n* Portduino: Set C standard to 17 by @vidplace7 in https://github.com/meshtastic/firmware/pull/6561\r\n* Fix: Correct underlying cause of T-Watch not functioning when set to a 16MB filesystem by @Kealper in https://github.com/meshtastic/firmware/pull/6563\r\n* Trunk fixes for heltec mesh pocket. by @fifieldt in https://github.com/meshtastic/firmware/pull/6588\r\n* Fix T-Echo display light blink on LoRa TX by @todd-herbert in https://github.com/meshtastic/firmware/pull/6590\r\n* Fix: set upload_speed for tlora_v1_3 & tlora_v2_1_16 by @MayNiklas in https://github.com/meshtastic/firmware/pull/6595\r\n* Fix tlora v1 uploadspeed by @MayNiklas in https://github.com/meshtastic/firmware/pull/6601\r\n* Fix uninitialised memory read (adminModule) by @benkyd in https://github.com/meshtastic/firmware/pull/6605\r\n* Add support for Seeed solar panel by @Dylanliacc in https://github.com/meshtastic/firmware/pull/6597\r\n* Fix compiler error in PowerFSM when WiFi is excluded by @benkyd in https://github.com/meshtastic/firmware/pull/6603\r\n* Crowpanel support by @caveman99 in https://github.com/meshtastic/firmware/pull/6355\r\n* Lib Update by @caveman99 in https://github.com/meshtastic/firmware/pull/6510\r\n* Fix crash when clearing NRF52 BLE bonds by @todd-herbert in https://github.com/meshtastic/firmware/pull/6609\r\n* Docker: Fix arg passthrough by @vidplace7 in https://github.com/meshtastic/firmware/pull/6623\r\n* RPM: Build native-tft target by @vidplace7 in https://github.com/meshtastic/firmware/pull/6613\r\n* Docker alpine: Add config templates by @vidplace7 in https://github.com/meshtastic/firmware/pull/6631\r\n* Appdata.xml: Add date to all releases by @vidplace7 in https://github.com/meshtastic/firmware/pull/6632\r\n* Rak13800 Ethernet works on rak11310 too by @Nivek-domo in https://github.com/meshtastic/firmware/pull/6622\r\n* Build and deploy event firmwares by @vidplace7 in https://github.com/meshtastic/firmware/pull/6628\r\n* Publish firmware all together by @vidplace7 in https://github.com/meshtastic/firmware/pull/6642\r\n* Fix: SenseCAP Indicator: remove buzzer definition by @mverch67 in https://github.com/meshtastic/firmware/pull/6652\r\n* Correct a typing error in InkHUD display driver by @todd-herbert in https://github.com/meshtastic/firmware/pull/6651\r\n* Fix preamble detected IRQ flag by @GUVWAF in https://github.com/meshtastic/firmware/pull/6653\r\n* Update meshtastic-device-ui digest to 189ed6c by @renovate in https://github.com/meshtastic/firmware/pull/6657\r\n* Fix building WiPhone variant by @todd-herbert in https://github.com/meshtastic/firmware/pull/6664\r\n* Downgrade web to 2.5.4 by @vidplace7 in https://github.com/meshtastic/firmware/pull/6669\r\n\r\n## New Contributors\r\n* @renovate made their first contribution in https://github.com/meshtastic/firmware/pull/6545\r\n* @JahazielLem made their first contribution in https://github.com/meshtastic/firmware/pull/6483\r\n* @MayNiklas made their first contribution in https://github.com/meshtastic/firmware/pull/6595\r\n* @benkyd made their first contribution in https://github.com/meshtastic/firmware/pull/6584\r\n* @Nivek-domo made their first contribution in https://github.com/meshtastic/firmware/pull/6622\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.5.fc3d9f2...v2.6.6.54c1423"
- },
- {
- "id": "v2.6.5.fc3d9f2",
- "title": "Meshtastic Firmware 2.6.5.fc3d9f2 Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.5.fc3d9f2",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.5.fc3d9f2/firmware-stm32-2.6.5.fc3d9f2.zip",
- "release_notes": "> [!CAUTION] \r\n> Updating from a previous version of firmware to 2.6, **will wipe** your device. Please remember to [backup your keys](https://meshtastic.org/docs/configuration/radio/security/#security-keys---backup-and-restore) and important [configurations](https://meshtastic.org/docs/software/python/cli/usage/#export-device-config-with---export-config) before proceeding!\r\n\r\n## 🚀 Enhancements\r\n* Update library deps and nrf Toolchain by @caveman99 in https://github.com/meshtastic/firmware/pull/6450\r\n* Update to handle ws80 serial data as well by @tavdog in https://github.com/meshtastic/firmware/pull/6440\r\n* Add a static_assert to verify assumption about NodeInfoLite size by @jasonbcox in https://github.com/meshtastic/firmware/pull/6428\r\n* meshtasticd: CH341 / HAT+ Auto Configuration by @vidplace7 in https://github.com/meshtastic/firmware/pull/6446\r\n* More toggles for InkHUD menu by @todd-herbert in https://github.com/meshtastic/firmware/pull/6469\r\n* Add InkHUD driver for WeAct Studio 4.2\" display module by @todd-herbert in https://github.com/meshtastic/firmware/pull/6384\r\n* Added initial support for Texas Instruments LP5562 by @CypressXt in https://github.com/meshtastic/firmware/pull/6381\r\n* meshtasticd: Set available.d dir in yaml by @vidplace7 in https://github.com/meshtastic/firmware/pull/6481\r\n* Disable bluetooth config on rp2040, portduino (for now), and stm32 by @thebentern in https://github.com/meshtastic/firmware/pull/6465\r\n* meshtasticd: Add FrequencyLabs MeshAdv-Mini Hat by @vidplace7 in https://github.com/meshtastic/firmware/pull/6458\r\n* Initial InkHUD support for Elecrow ThinkNode M1 by @todd-herbert in https://github.com/meshtastic/firmware/pull/6473\r\n* Add support for Quectel-L96, a MT3333 module by @ke6zfi in https://github.com/meshtastic/firmware/pull/6498\r\n* Update OLED library, fix nRF build of SH1107 by @caveman99 in https://github.com/meshtastic/firmware/pull/6489\r\n* Disable network config for non-eth_gateway nrf52 and non-W RP2040 targets by @thebentern in https://github.com/meshtastic/firmware/pull/6462\r\n* Honor user button remapping within InkHUD by @todd-herbert in https://github.com/meshtastic/firmware/pull/6400\r\n* Improve PKC unit test coverage by @jasonbcox in https://github.com/meshtastic/firmware/pull/6485\r\n* TCA8418 initial config + basic 3x4 keypad config by @Nasimovy in https://github.com/meshtastic/firmware/pull/6422\r\n* MUI: update device-ui commit reference by @mverch67 in https://github.com/meshtastic/firmware/pull/6526\r\n\r\n## 🐛 Bug fixes & maintenance\r\n* Fix: Update xiao_ble E22-900M30S regulatory gain to 7 dB by @ndoo in https://github.com/meshtastic/firmware/pull/6466\r\n* Update ScreenFonts.h fix CrowPanel 5.79 Font by @markbirss in https://github.com/meshtastic/firmware/pull/6412\r\n* Added 'bluetooth' as a connectivity option for the LilyGo T-Watch-S3.… by @PlantDaddy in https://github.com/meshtastic/firmware/pull/6470* Try-fix some import of configuration inconsistencies by @thebentern in https://github.com/meshtastic/firmware/pull/6364\r\n* Fix: T-Echo frontlight on at boot when using OLED UI by @todd-herbert in https://github.com/meshtastic/firmware/pull/6474\r\n* MUI unPhone-tft: fix defaults (BT, power save, and MUI cache size) by @mverch67 in https://github.com/meshtastic/firmware/pull/6477\r\n* Fixes #6315 by @RCGV1 in https://github.com/meshtastic/firmware/pull/6475\r\n* Reinstate M1 Backlight by @caveman99 in https://github.com/meshtastic/firmware/pull/6484\r\n* Remove Very_Long_Slow by @rcarteraz in https://github.com/meshtastic/firmware/pull/6486\r\n* Revert \"Try-fix ESP32 wifi disconnects\" by @thebentern in https://github.com/meshtastic/firmware/pull/6493\r\n* InkHUD: ad-hoc ping using the menu by @todd-herbert in https://github.com/meshtastic/firmware/pull/6492\r\n* Remove duplicate HAS_LP5562 introduced in #6422 by @Nasimovy in https://github.com/meshtastic/firmware/pull/6494\r\n* Fix for PSRAM detection on ESP32-S3R8 and t-beam by @Nasimovy in https://github.com/meshtastic/firmware/pull/6504\r\n* Fix several features of M1 and M2 (i know what the 7 is now ...) by @caveman99 in https://github.com/meshtastic/firmware/pull/6507\r\n* Update platformio.ini fix build-flags ${esp32s3_base.build_flags} by @markbirss in https://github.com/meshtastic/firmware/pull/6512\r\n* inkhud doesn't have a button thread by @caveman99 in https://github.com/meshtastic/firmware/pull/6513\r\n* Fix device-specific logic in install script by @epall in https://github.com/meshtastic/firmware/pull/6508\r\n* Update web, use centrally defined version by @vidplace7 in https://github.com/meshtastic/firmware/pull/6500\r\n* Minor adjustment of blink codes and 'unstick' the M2 button. by @caveman99 in https://github.com/meshtastic/firmware/pull/6521\r\n* chore: update ubx.h by @eltociear in https://github.com/meshtastic/firmware/pull/6522\r\n* meshtasticd docker: Support webui by @vidplace7 in https://github.com/meshtastic/firmware/pull/6482\r\n* remove checkov from trunk config by @fifieldt in https://github.com/meshtastic/firmware/pull/6532\r\n* Send UDP packet even if it's encrypted by @GUVWAF in https://github.com/meshtastic/firmware/pull/6524\r\n\r\n## New Contributors\r\n* @jasonbcox made their first contribution in https://github.com/meshtastic/firmware/pull/6428\r\n* @PlantDaddy made their first contribution in https://github.com/meshtastic/firmware/pull/6470\r\n* @CypressXt made their first contribution in https://github.com/meshtastic/firmware/pull/6381\r\n* @ke6zfi made their first contribution in https://github.com/meshtastic/firmware/pull/6498\r\n* @epall made their first contribution in https://github.com/meshtastic/firmware/pull/6508\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.4.b89355f...v2.6.5.fc3d9f2"
- },
- {
- "id": "v2.6.2.31c0e8f",
- "title": "Meshtastic Firmware 2.6.2.31c0e8f Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.2.31c0e8f",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.2.31c0e8f/firmware-stm32-2.6.2.31c0e8f.zip",
- "release_notes": "> [!CAUTION] \r\n> Updating from a previous version of firmware to 2.6, **will wipe** your device. Please remember to [backup your keys](https://meshtastic.org/docs/configuration/radio/security/#security-keys---backup-and-restore) and important [configurations](https://meshtastic.org/docs/software/python/cli/usage/#export-device-config-with---export-config) before proceeding!\r\n\r\n> [!WARNING] \r\nAdditionally, this release allocates more storage space on a number of ESP32 targets. Updating one of these devices flashed with previous versions of meshtastic may result in unexpected behavior and we recommend doing a full erase / flash to be safe.\r\n\r\n**Affected 8MB and 16MB devices:**\r\n\r\n- **Heltec:** LoRa v3, Tracker, Wireless Stick Lite v3, Wireless Paper, Vision Master\r\n- **Lilygo:** T-Beam S3 Supreme, T-Watch S3\r\n- **Seeed:** Xiao-S3\r\n- **B&Q:** Station G2\r\n\r\n## ⚠️ Known issues\r\nThis release may will cause issues with T-Watch S3 devices which have 8MB flash #6406\r\n\r\n## 🚀 Enhancements\r\n* Don't allow is_managed without any valid admin_keys by @cdanis in https://github.com/meshtastic/firmware/pull/6310\r\n* E-ink partial refresh limitation removed for free text screen by @HarukiToreda in https://github.com/meshtastic/firmware/pull/6201\r\n* Send UDP packets to multicast address rather than broadcast address by @Jorropo in https://github.com/meshtastic/firmware/pull/6331\r\n* Simplify MAX_NUM_NODES, increase limit on large-flash targets. by @vidplace7 in https://github.com/meshtastic/firmware/pull/6311\r\n* Add packages to devcontainer for build native-tft by @ThatKalle in https://github.com/meshtastic/firmware/pull/6299\r\n* Mainline tlora v3 by @caveman99 in https://github.com/meshtastic/firmware/pull/6322\r\n* Update Seeed-xiao-nrf52840-kit board defination by @Dylanliacc in https://github.com/meshtastic/firmware/pull/6318\r\n* Support WiFi OTA by @mskvortsov in https://github.com/meshtastic/firmware/pull/6352\r\n* Add UDP multicast support on linux. by @Jorropo in https://github.com/meshtastic/firmware/pull/6342\r\n* RP2xx0: Add UDP Multicast support by @vidplace7 in https://github.com/meshtastic/firmware/pull/6327\r\n* Pass pointer to UDP multicast packet to protobuf decoder by @Jorropo in https://github.com/meshtastic/firmware/pull/6333\r\n* Meshtasticd: Add MeshToad - USB 1W 'MeshStick' by @vidplace7 in https://github.com/meshtastic/firmware/pull/6339\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Windows script lineendings by @ThatKalle in https://github.com/meshtastic/firmware/pull/6289\r\n* MUI: fix packet queue full by @mverch67 in https://github.com/meshtastic/firmware/pull/6292\r\n* Fix KR920's Tx power limitation by @qkdxorjs1002 in https://github.com/meshtastic/firmware/pull/6307\r\n* New device: Lilygo T-Eth-Elite by @caveman99 in https://github.com/meshtastic/firmware/pull/6321\r\n* Pass pointer to UDP multicast packet to protobuf decoder by @Jorropo in https://github.com/meshtastic/firmware/pull/6333\r\n* Device-install/update: fix esptool --port by @ThatKalle in https://github.com/meshtastic/firmware/pull/6341\r\n* Fixed UF2 generation problem when sys.executable path has spaces in it ( platformio-custom.py ) by @rbreesems in https://github.com/meshtastic/firmware/pull/6346\r\n* Added bounds checking to memcpy and use memory-safe strlcpy by @raulperdomo in https://github.com/meshtastic/firmware/pull/6351\r\n\r\n## New Contributors\r\n* @qkdxorjs1002 made their first contribution in https://github.com/meshtastic/firmware/pull/6307\r\n* @rbreesems made their first contribution in https://github.com/meshtastic/firmware/pull/6346\r\n* @raulperdomo made their first contribution in https://github.com/meshtastic/firmware/pull/6351\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.6.0.f7afa9a...v2.6.2.31c0e8f"
- },
- {
- "id": "v2.6.1.7c3edde",
- "title": "Meshtastic Firmware 2.6.1.7c3edde Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.1.7c3edde",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.1.7c3edde/firmware-stm32-2.6.1.7c3edde.zip",
- "release_notes": "> [!CAUTION] \r\n> Updating from a previous version of firmware to 2.6, **will wipe** your device. Please remember to [backup your keys](https://meshtastic.org/docs/configuration/radio/security/#security-keys---backup-and-restore) and important [configurations](https://meshtastic.org/docs/software/python/cli/usage/#export-device-config-with---export-config) before proceeding!\r\n\r\n\r\n\r\n## 🚀 Enhancements\r\n\r\n### [Big 2.6 changes!](https://meshtastic.org/blog/meshtastic-2-6-preview/)\r\n- Meshtastic UI\r\n- Next-hop Routing Protocol for DMs\r\n- Optimized LoRa Slot-Time Calculation\r\n- InkHUD\r\n- Meshtastic over LAN (ESP32 Wifi UDP experimental support)\r\n- Improved Device State File Management\r\n- Add rain data from ws85 by @tavdog in https://github.com/meshtastic/firmware/pull/6242\r\n- Add some minor additional options to userPrefs.jsonc by @karchf in https://github.com/meshtastic/firmware/pull/6137\r\n- Switch pio_deps to `native-tft` for flatpak by @vidplace7 in https://github.com/meshtastic/firmware/pull/6187\r\n- Only request NodeInfo/Position from everyone on fresh install by @GUVWAF in https://github.com/meshtastic/firmware/pull/6184\r\n- Create lora-starter-edition-sx1262-i2c.yaml and lora-ws-raspberry-pi-pico-to-rpi-adapter.yaml by @markbirss in https://github.com/meshtastic/firmware/pull/6162\r\n- Create lora-raxda-rock2f-starter-edition-hat.yaml by @markbirss in https://github.com/meshtastic/firmware/pull/6192\r\n- Enable external (UART) GPS support on Seeed WM1110 tracker dev board by @thebentern in https://github.com/meshtastic/firmware/pull/6189\r\n- Changes for 2.6 device_install by @gjelsoe in https://github.com/meshtastic/firmware/pull/6206\r\n- Consume device-ui as a pio library by @vidplace7 in https://github.com/meshtastic/firmware/pull/6193\r\n- Add support for seeed_xiao_nrf52840_kit by @Dylanliacc in https://github.com/meshtastic/firmware/pull/6231\r\n- Environment: add DPS310 high-accuracy barometer by @cdanis in https://github.com/meshtastic/firmware/pull/6237\r\n- Update platformio.ini for 4.2 and 2.9 CrowPanel ESP32-S3 epaper and point GxEPD2 to meshtastic branch by @markbirss in https://github.com/meshtastic/firmware/pull/6245\r\n- Ebyte E77 (STM32) DevKit support by @vidplace7 in https://github.com/meshtastic/firmware/pull/6255\r\n- Add detection support for LTR390UV Sensor by @fifieldt in https://github.com/meshtastic/firmware/pull/6009\r\n- NodeInfo request: don't bother if too far away by @cdanis in https://github.com/meshtastic/firmware/pull/6260\r\n- MUI: exFat support for SD by @mverch67 in https://github.com/meshtastic/firmware/pull/6279\r\n\r\n## 🐛 Bug fixes and maintenance\r\n- Fix trunk debt by @vidplace7 in https://github.com/meshtastic/firmware/pull/6149\r\n- Cast user pref strings. by @Mictronics in https://github.com/meshtastic/firmware/pull/6123\r\n- More trunk junk / remove old workflows by @vidplace7 in https://github.com/meshtastic/firmware/pull/6153\r\n- DevContainers: Include meshtasticd dependencies by @rickmark in https://github.com/meshtastic/firmware/pull/5699\r\n- RAK11310: Update to last building platform package and possibly fix for #5361 by @Mictronics in https://github.com/meshtastic/firmware/pull/6202\r\n- RAK11310 support for RAK12002 RTC added. by @Mictronics in https://github.com/meshtastic/firmware/pull/6210\r\n- Only call GPS Probe commands once per family by @fifieldt in https://github.com/meshtastic/firmware/pull/6114\r\n- Enable GPS functionality for RAK4631_eth_gw variant by @mandreko in https://github.com/meshtastic/firmware/pull/6229\r\n- RAK11310 Fix build with latest Arduino framework by @Mictronics in https://github.com/meshtastic/firmware/pull/6227\r\n- EBYTE E22-400Mxx SX126X_DIO3_TCXO_VOLTAGE fix by @Andrik45719 in https://github.com/meshtastic/firmware/pull/6232\r\n- InkHUD refactoring by @todd-herbert in https://github.com/meshtastic/firmware/pull/6216\r\n- Add initial support for CrowPanel ESP32 5.79” E-paper HMI by @markbirss in https://github.com/meshtastic/firmware/pull/6233\r\n- [Task]: 2.6 device-install scripts by @ThatKalle in https://github.com/meshtastic/firmware/pull/6248\r\n- I2C: 0x45 can also be an SHT35, not just an OPT3001 by @cdanis in https://github.com/meshtastic/firmware/pull/6249\r\n- Flag semgrep to not run on self-hosted by @fifieldt in https://github.com/meshtastic/firmware/pull/6256\r\n- PlatformIO: Bump ArduinoThread / device-ui versions by @vidplace7 in https://github.com/meshtastic/firmware/pull/6271-\r\n- Fix excluded_modules metadata with InkHUD by @todd-herbert in https://github.com/meshtastic/firmware/pull/6272\r\n- Update device-install scripts by @ThatKalle in https://github.com/meshtastic/firmware/pull/6267\r\n\r\n## New Contributors\r\n- @karchf made their first contribution in https://github.com/meshtastic/firmware/pull/6137\r\n- @rickmark made their first contribution in https://github.com/meshtastic/firmware/pull/5699\r\n- @mandreko made their first contribution in https://github.com/meshtastic/firmware/pull/6229\r\n- @cdanis made their first contribution in https://github.com/meshtastic/firmware/pull/6237\r\n- @Andrik45719 made their first contribution in https://github.com/meshtastic/firmware/pull/6232\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.23.bf958ed...v2.6.1.7c3edde"
- },
- {
- "id": "v2.6.0.f7afa9a",
- "title": "Meshtastic Firmware 2.6.0.f7afa9a Technical Preview",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.6.0.f7afa9a",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.6.0.f7afa9a/firmware-stm32-2.6.0.f7afa9a.zip",
- "release_notes": "## [Meshtastic 2.6 Preview: MUI and Next-Hop Routing are here!](https://meshtastic.org/blog/meshtastic-2-6-preview/)\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.23.bf958ed...v2.6.0.f7afa9a"
- },
- {
- "id": "v2.5.23.bf958ed",
- "title": "Meshtastic Firmware 2.5.23.bf958ed Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.23.bf958ed",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.23.bf958ed/firmware-stm32-2.5.23.bf958ed.zip",
- "release_notes": "## 🚀 Enhancements\r\n* Add XIAO nRF52840 + Wio SX1262 DIY Variant by @porkcube in https://github.com/meshtastic/firmware/pull/5976\r\n* Allow NeighborInfo on non-default frequency slot by @GUVWAF in https://github.com/meshtastic/firmware/pull/6061\r\n* Assigning SDA/SCL so it actually works 8| by @porkcube in https://github.com/meshtastic/firmware/pull/6065\r\n* Reject invalid configuration for the default MQTT server by @esev in https://github.com/meshtastic/firmware/pull/6066\r\n* Add support for new NRF52 board, MeshLink by @ponzano in https://github.com/meshtastic/firmware/pull/5736\r\n* Validate MQTT config by testing a connection by @esev in https://github.com/meshtastic/firmware/pull/6076\r\n* Add missing traceroute fields to serialized JSON output by @noahhaon in https://github.com/meshtastic/firmware/pull/6087\r\n* Trunk: Annotate PRs and Auto-Upgrade by @vidplace7 in https://github.com/meshtastic/firmware/pull/6091\r\n* Dependencies: minor version updates by @fifieldt in https://github.com/meshtastic/firmware/pull/6045\r\n* Add Pico2W variant including Wifi support. by @Mictronics in https://github.com/meshtastic/firmware/pull/6062\r\n* Feat: added BMP-390 support to the BMP-3xx sensors by @rostekus in https://github.com/meshtastic/firmware/pull/6103\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Consider the MQTT TLS remote IP when checking for a private IP by @esev in https://github.com/meshtastic/firmware/pull/6058\r\n* Fix MQTT over TLS crash loop by @esev in https://github.com/meshtastic/firmware/pull/6057\r\n* Expose INA219 measurement as battery voltage for Seeed Xiao ESP32S3 by @syssi in https://github.com/meshtastic/firmware/pull/6070\r\n* Chore: update unishox2.h by @eltociear in https://github.com/meshtastic/firmware/pull/6092\r\n* Fix STM32WL TCXO setting; enable logs and modules by @GUVWAF in https://github.com/meshtastic/firmware/pull/6063\r\n* Update Readme by @rcarteraz in https://github.com/meshtastic/firmware/pull/6088\r\n* PIO: Cleanup dependency naming by @vidplace7 in https://github.com/meshtastic/firmware/pull/6090\r\n* Move variant-specific lines back to variant by @fifieldt in https://github.com/meshtastic/firmware/pull/6044\r\n* Ignore and disallow multi-hop traceroutes destined to broadcast address by @GUVWAF in https://github.com/meshtastic/firmware/pull/6109\r\n* Fix PowerTelemetry initialization by @GUVWAF in https://github.com/meshtastic/firmware/pull/6106\r\n* Perhaps fix TXCO reports on pro-micro by @thebentern in https://github.com/meshtastic/firmware/pull/6110\r\n* meshtasticd deb: Build armv6-compatible binary by @vidplace7 in https://github.com/meshtastic/firmware/pull/6104\r\n* GPS Factory Reset no longer needed. by @fifieldt in https://github.com/meshtastic/firmware/pull/6116\r\n* Reduce some log levels. by @fifieldt in https://github.com/meshtastic/firmware/pull/6127\r\n* Debian: Ensure deps exist for changelog bump by @vidplace7 in https://github.com/meshtastic/firmware/pull/6145\r\n* Trunk: userPrefs trailing commas begone! by @vidplace7 in https://github.com/meshtastic/firmware/pull/6038\r\n* Typo in Bandit button LEDs by @gjelsoe in https://github.com/meshtastic/firmware/pull/6053\r\n\r\n\r\n## New Contributors\r\n* @porkcube made their first contribution in https://github.com/meshtastic/firmware/pull/5976\r\n* @ponzano made their first contribution in https://github.com/meshtastic/firmware/pull/5736\r\n* @noahhaon made their first contribution in https://github.com/meshtastic/firmware/pull/6087\r\n* @eltociear made their first contribution in https://github.com/meshtastic/firmware/pull/6092\r\n* @syssi made their first contribution in https://github.com/meshtastic/firmware/pull/6070\r\n* @rostekus made their first contribution in https://github.com/meshtastic/firmware/pull/6103\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.22.d1fa27d...v2.5.23.bf958ed"
- },
- {
- "id": "v2.5.22.d1fa27d",
- "title": "Meshtastic Firmware 2.5.22.d1fa27d Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.22.d1fa27d",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.22.d1fa27d/firmware-stm32-2.5.22.d1fa27d.zip",
- "release_notes": " ## ⚠️ Known issues \r\n* PowerTelemetry reporting is broken in this release. This issue will be resolved in the next release.\r\n\r\n## 🚀 Enhancements\r\n* Change nonce logging to DEBUG instead of Info by @lizTheDeveloper in https://github.com/meshtastic/firmware/pull/6001\r\n* T1000-E hardware updates and GPS positioning accuracy optimization by @Dylanliacc in https://github.com/meshtastic/firmware/pull/6003\r\n* Improve UTF-8 string handling in JSONValue by @ChangYanChu in https://github.com/meshtastic/firmware/pull/6011\r\n* meshtasticd flatpak: Include pio deps with release by @vidplace7 in https://github.com/meshtastic/firmware/pull/6025\r\n* Add support for 12- and 24-hour clock, Minor Settings Frame Adjustment by @Xaositek in https://github.com/meshtastic/firmware/pull/5988\r\n* Added custom OCV array values for T1000-E to improve percentage estimates by @nwilde1590 in https://github.com/meshtastic/firmware/pull/6031\r\n\r\n## 🐛 Bug fixes\r\n* Update protobufs and classes by @github-actions in https://github.com/meshtastic/firmware/pull/6027\r\n* meshtasticd: include `.hidden` (.git) dirs in pio-deps by @vidplace7 in https://github.com/meshtastic/firmware/pull/6028\r\n* Small fix: don't junk the zip for pio-deps by @vidplace7 in https://github.com/meshtastic/firmware/pull/6029\r\n* Fix T-Deck/T-Watch no BT by @mverch67 in https://github.com/meshtastic/firmware/pull/5998\r\n* Corrected some misinformation by @NomDeTom in https://github.com/meshtastic/firmware/pull/5995\r\n* meshtasticd: Fix web download location by @vidplace7 in https://github.com/meshtastic/firmware/pull/5993\r\n\r\n\r\n## New Contributors\r\n* @lizTheDeveloper made their first contribution in https://github.com/meshtastic/firmware/pull/6001\r\n* @ChangYanChu made their first contribution in https://github.com/meshtastic/firmware/pull/6011\r\n* @nwilde1590 made their first contribution in https://github.com/meshtastic/firmware/pull/6031\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.21.447533a...v2.5.22.d1fa27d"
- },
- {
- "id": "v2.5.21.447533a",
- "title": "Meshtastic Firmware 2.5.21.447533a Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.21.447533a",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.21.447533a/firmware-esp32c3-2.5.21.447533a.zip",
- "release_notes": "> [!IMPORTANT] \r\n> Linux packages have been migrated from GitHub Releases to distro-specific build services.\r\n> For additional information see: [Installing meshtasticd](https://meshtastic.org/docs/hardware/devices/linux-native-hardware/#installing-meshtasticd)\r\n\r\n\r\n ## ⚠️ Known issues \r\n * For NRF52 devices which have been upgraded through the 2.5.X versions, a [full flash erase](https://meshtastic.org/docs/getting-started/flashing-firmware/nrf52/nrf52-erase/) is recommended to fully remediate any lingering LFS assert issues.\r\n* Bluetooth was inadvertently disabled for T-Deck and T-Watch devices, preventing pairing with client apps. This issue will be resolved in the next alpha release after 2.5.21.\r\n* PowerTelemetry reporting is broken in this release. This issue will be resolved in the next release after 2.5.22.\r\n\r\n## 🚀 Enhancements\r\n* Rate limit position replies to three minutes by @GUVWAF in https://github.com/meshtastic/firmware/pull/5932\r\n* Space out periodic broadcasts of modules automatically by @GUVWAF in https://github.com/meshtastic/firmware/pull/5931\r\n* Oem logo by @caveman99 in https://github.com/meshtastic/firmware/pull/5939\r\n* Portduino: Allow limiting TX Power from yaml by @vidplace7 in https://github.com/meshtastic/firmware/pull/5954\r\n* Portduino: Set Web SSL Cert / Key paths from yaml by @vidplace7 in https://github.com/meshtastic/firmware/pull/5961\r\n* Add bearing to other node on device screen in text by @Woutvstk in https://github.com/meshtastic/firmware/pull/5968\r\n* Don't rate-limit position requests for Lost and Found role by @GUVWAF in https://github.com/meshtastic/firmware/pull/5981\r\n* E80 promicro update by @NomDeTom in https://github.com/meshtastic/firmware/pull/5967\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Revert \"No focus on new messages if auto-carousel is off\" by @thebentern in https://github.com/meshtastic/firmware/pull/5936\r\n* Clean up some legacy macro definitions by @caveman99 in https://github.com/meshtastic/firmware/pull/5983\r\n* meshtasticd-debian: Remove existing deb builds by @vidplace7 in https://github.com/meshtastic/firmware/pull/5792\r\n* Fix: TCXO_OPTIONAL featuring SenseCAP Indicator (V1/V2) by @mverch67 in https://github.com/meshtastic/firmware/pull/5948\r\n* Add missing build_unflags by @krant in https://github.com/meshtastic/firmware/pull/5941\r\n* Fix INA226 Sensor Voltage Readings by @fifieldt in https://github.com/meshtastic/firmware/pull/5972\r\n* Fix off-by-one error with log writes by @fifieldt in https://github.com/meshtastic/firmware/pull/5959\r\n* Fixes #5766 Updated MQTT privateCidrRanges to add Tailscale by @Xaositek in https://github.com/meshtastic/firmware/pull/5957\r\n* Remove unused usages of #include to save Flash by @Stary2001 in https://github.com/meshtastic/firmware/pull/5978\r\n* Fix negative decimal value detection in userPrefs by @thebentern in https://github.com/meshtastic/firmware/pull/5963\r\n\r\n## New Contributors\r\n* @krant made their first contribution in https://github.com/meshtastic/firmware/pull/5941\r\n* @Xaositek made their first contribution in https://github.com/meshtastic/firmware/pull/5957\r\n* @Stary2001 made their first contribution in https://github.com/meshtastic/firmware/pull/5978\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.20.4c97351...v2.5.21.447533a"
- },
- {
- "id": "v2.5.17.b4b2fd6",
- "title": "Meshtastic Firmware 2.5.17.b4b2fd6 Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.17.b4b2fd6",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.17.b4b2fd6/firmware-stm32-2.5.17.b4b2fd6.zip",
- "release_notes": "## 🚀 Enhancements\r\n* Update OpenWRT_One_mikroBUS_sx1262.yaml by @markbirss in https://github.com/meshtastic/firmware/pull/5544\r\n* Add portduino-buildroot variant by @vidplace7 in https://github.com/meshtastic/firmware/pull/5540\r\n* Portduino-buildroot: Define C++ standard by @vidplace7 in https://github.com/meshtastic/firmware/pull/5547\r\n* DIO3_TCXO_VOLTAGE in config.yaml can now take an exact voltage by @jp-bennett in https://github.com/meshtastic/firmware/pull/5558\r\n* Support TLORA_V3.0 by @caveman99 in https://github.com/meshtastic/firmware/pull/5563\r\n* Create OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml by @markbirss in https://github.com/meshtastic/firmware/pull/5564\r\n* Add new endpoint to retrieve node info by @andrepcg in https://github.com/meshtastic/firmware/pull/5557\r\n* Add screen detection function by @Heltec-Aaron-Lee in https://github.com/meshtastic/firmware/pull/5533\r\n* Based default Node Names on NodeNum, rather than MAC address by @fifieldt in https://github.com/meshtastic/firmware/pull/5576\r\n* Define BUTTON_PIN as -1 for RP2040-lora by @fifieldt in https://github.com/meshtastic/firmware/pull/5574\r\n* StoreForward: (tapback) reply support by @GUVWAF in https://github.com/meshtastic/firmware/pull/5585\r\n* Added support for the LR1121 radio to the NRF52 Pro-Micro by @Nestpebble in https://github.com/meshtastic/firmware/pull/5515\r\n* Added product url by @WatskeBart in https://github.com/meshtastic/firmware/pull/5594\r\n* [T-Deck] Fixed the issue that some devices may experience low voltage… by @lewisxhe in https://github.com/meshtastic/firmware/pull/5607\r\n* Remove unnecessary memcpy for PKI crypto by @esev in https://github.com/meshtastic/firmware/pull/5608\r\n* Use IPAddress.fromString in MQTT.cpp for parsing private IPs by @esev in https://github.com/meshtastic/firmware/pull/5621\r\n* Use encoded ServiceEnvelope in mqttQueue by @esev in https://github.com/meshtastic/firmware/pull/5619\r\n* Ch341 by @jp-bennett in https://github.com/meshtastic/firmware/pull/5474\r\n* Add detection code for INA226 by @fifieldt in https://github.com/meshtastic/firmware/pull/5605\r\n* Check if MQTT remote IP is private by @esev in https://github.com/meshtastic/firmware/pull/5627\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Portduino-buildroot: Remove `pkg-config` optional libs by @vidplace7 in https://github.com/meshtastic/firmware/pull/5573\r\n* Portduino: Move meshtasticd/web out of /usr/share/doc/ by @vidplace7 in https://github.com/meshtastic/firmware/pull/5548\r\n* Portduino: fix transitional symlinks for /usr/share/doc/ by @vidplace7 in https://github.com/meshtastic/firmware/pull/5550\r\n* Cherry-pick: Windows Support - Trunk and Platformio (#5397) by @fifieldt in https://github.com/meshtastic/firmware/pull/5518\r\n* Synch minor changes from TFT branch by @fifieldt in https://github.com/meshtastic/firmware/pull/5520\r\n* Refactor MQTT::onReceive to reduce if/else nesting by @esev in https://github.com/meshtastic/firmware/pull/5592\r\n* Let RangeTest Module (RX) use Phone position if there's no GPS by @fifieldt in https://github.com/meshtastic/firmware/pull/5623\r\n* Separate host:port before checking for private IP by @esev in https://github.com/meshtastic/firmware/pull/5630\r\n* Clean up some straggler NRF52 json by @thebentern in https://github.com/meshtastic/firmware/pull/5628\r\n* Fix omission of AQ metrics by @thebentern in https://github.com/meshtastic/firmware/pull/5584\r\n* tlora_v2_1_16: Unset BUTTON_PIN and BUTTON_NEED_PULLUP by @ndoo in https://github.com/meshtastic/firmware/pull/5535\r\n* Fix detection for some RadSens hardware versions by @jake-b in https://github.com/meshtastic/firmware/pull/5542\r\n* Initialize dmac array to nulls by @jp-bennett in https://github.com/meshtastic/firmware/pull/5538\r\n* Portduino: fix setting `hwId` via argument by @GUVWAF in https://github.com/meshtastic/firmware/pull/5565\r\n* Add nugget and nibble boards for 38c3 by @caveman99 in https://github.com/meshtastic/firmware/pull/5609\r\n* Fix: Add libusb to dockerfile for ch341 by @thebentern in https://github.com/meshtastic/firmware/pull/5641\r\n* Portduino: specify C++ standard and link pthread by @GUVWAF in https://github.com/meshtastic/firmware/pull/5642\r\n* Separate host:port before checking for private IP (x2) by @esev in https://github.com/meshtastic/firmware/pull/5643\r\n* Update Femtofox configs by @noon92 in https://github.com/meshtastic/firmware/pull/5646\r\n* Detect charging status by measuring current flow with configured INA219 battery sensor by @nebman in https://github.com/meshtastic/firmware/pull/5271\r\n* Add NXP_SE050 detection by @jp-bennett in https://github.com/meshtastic/firmware/pull/5651\r\n* Check if MQTT remote IP is private by @esev in https://github.com/meshtastic/firmware/pull/5647\r\n* LIS3DH (WisMesh Pocket) - Honor Wake On Tap Or Motion by @fifieldt in https://github.com/meshtastic/firmware/pull/5625\r\n\r\n## New Contributors\r\n* @andrepcg made their first contribution in https://github.com/meshtastic/firmware/pull/5557\r\n* @WatskeBart made their first contribution in https://github.com/meshtastic/firmware/pull/5594\r\n* @esev made their first contribution in https://github.com/meshtastic/firmware/pull/5592\r\n* @nebman made their first contribution in https://github.com/meshtastic/firmware/pull/5271\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.16.f81d3b0...v2.5.17.b4b2fd6"
- },
- {
- "id": "v2.5.16.f81d3b0",
- "title": "Meshtastic Firmware 2.5.16.f81d3b0 Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.16.f81d3b0",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.16.f81d3b0/firmware-rp2040-2.5.16.f81d3b0.zip",
- "release_notes": "## 🚀 Enhancements\r\n* Adds libusb dev package to Raspbian build steps by @jp-bennett in https://github.com/meshtastic/firmware/pull/5480\r\n* Update arduino-pico core and remove mDNS restriction by @GUVWAF in https://github.com/meshtastic/firmware/pull/5483\r\n* Update xiao_esp32 fully support L76K by @Dylanliacc in https://github.com/meshtastic/firmware/pull/5488\r\n* Convert userprefs to a json file instead of header file which has to be included everywhere by @thebentern in https://github.com/meshtastic/firmware/pull/5471\r\n* SimRadio: clean-up and emulate collisions by @GUVWAF in https://github.com/meshtastic/firmware/pull/5487\r\n* add nodeId to nodeinfo update log lines and removed redundant nodeinfo update log line by @rbrtio in https://github.com/meshtastic/firmware/pull/5493\r\n* Refactor the macro definition of GPS initialization of GPSDEFAULTD_NOT_PRESENT and added seeeed Indicator to this sequence by @Dylanliacc in https://github.com/meshtastic/firmware/pull/5494\r\n* Extend Length of Source and Destination Node IDs Logged by @rbrtio in https://github.com/meshtastic/firmware/pull/5492\r\n* Added femtofox configs by @noon92 in https://github.com/meshtastic/firmware/pull/5477\r\n* [Add] LR1110, LR1120 and LR1121 to linux native Portduino by @markbirss in https://github.com/meshtastic/firmware/pull/5496\r\n* Add popular nrf52 pro micro to the builds by @thebentern in https://github.com/meshtastic/firmware/pull/5523\r\n* Add MACAddress to config.yaml by @jp-bennett in https://github.com/meshtastic/firmware/pull/5506\r\n* Configure Seeed Xiao S3 RX enable pin by @mgranberry in https://github.com/meshtastic/firmware/pull/5517\r\n* Add OpenWRT One config.d files by @markbirss in https://github.com/meshtastic/firmware/pull/5529\r\n\r\n## 🐛 Bug fixes and maintenance\r\n* Fix minor typos in package workflows by @jp-bennett in https://github.com/meshtastic/firmware/pull/5505\r\n* Don't use channel index for encrypted packet by @GUVWAF in https://github.com/meshtastic/firmware/pull/5509\r\n* Always Announce MDNS meshtastic service by @broglep in https://github.com/meshtastic/firmware/pull/5503\r\n* Cherry-pick: fix nodeDB erase loop when free mem returns invalid value (0, -1). by @fifieldt in https://github.com/meshtastic/firmware/pull/5519\r\n* Portduino fixes by @jp-bennett in https://github.com/meshtastic/firmware/pull/5479\r\n\r\n## New Contributors\r\n* @noon92 made their first contribution in https://github.com/meshtastic/firmware/pull/5477\r\n* @broglep made their first contribution in https://github.com/meshtastic/firmware/pull/5503\r\n* @mgranberry made their first contribution in https://github.com/meshtastic/firmware/pull/5517\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.15.79da236...v2.5.16.f81d3b0"
- },
- {
- "id": "v2.5.12.aa184e6",
- "title": "Meshtastic Firmware 2.5.12.aa184e6 Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.12.aa184e6",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.12.aa184e6/firmware-stm32-2.5.12.aa184e6.zip",
- "release_notes": "## ⚠️ Known issues \r\n* In some cases, connected apps may show duplicate received packets.\r\n\r\n## 🚀 Enhancements\r\n* uClibc compatibility by @vidplace7 in https://github.com/meshtastic/firmware/pull/5270\r\n* Smarter traffic scaling by @thebentern in https://github.com/meshtastic/firmware/pull/5264\r\n* Fix device flashing scripts so they work with esptool when it's installed via pipx by @jeremiah-k in https://github.com/meshtastic/firmware/pull/5269\r\n\r\n## 🐛 Bug fixes & maintenance\r\n* More log reductions. I'll probably stop now ;-) by @thebentern in https://github.com/meshtastic/firmware/pull/5263\r\n* Add exception for RTC to not strip time from position by @thebentern in https://github.com/meshtastic/firmware/pull/5262\r\n* Only PKC encrypt when packet originates from us by @GUVWAF in https://github.com/meshtastic/firmware/pull/5267\r\n* Fix wio-tracker-dev sensor scan by @caveman99 in https://github.com/meshtastic/firmware/pull/5274\r\n* Fixed compile error when using GPS_DEBUG by @macvenez in https://github.com/meshtastic/firmware/pull/5275\r\n* Copy the has_relative_humidity value to full telem packet from AHTX0 packet by @tavdog in https://github.com/meshtastic/firmware/pull/5277\r\n\r\n## New Contributors\r\n* @jeremiah-k made their first contribution in https://github.com/meshtastic/firmware/pull/5269\r\n* @macvenez made their first contribution in https://github.com/meshtastic/firmware/pull/5275\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.11.8e2a3e5...v2.5.12.aa184e6"
- },
- {
- "id": "v2.5.10.0fc5c9b",
- "title": "Meshtastic Firmware 2.5.10.0fc5c9b Alpha",
- "page_url": "https://github.com/meshtastic/firmware/releases/tag/v2.5.10.0fc5c9b",
- "zip_url": "https://github.com/meshtastic/firmware/releases/download/v2.5.10.0fc5c9b/firmware-stm32-2.5.10.0fc5c9b.zip",
- "release_notes": "## ⚠️ Known issues \r\n* Enabling NeighborInfo module can cause device crashes #5235\r\n* GPS reports as not present before first lock #5257 \r\n\r\n## 🚀 Enhancements\r\n* Added ADC control pin automatic logic switch function for Heltec LoRa 32 V3 by @Heltec-Aaron-Lee in https://github.com/meshtastic/firmware/pull/5196\r\n* Create CODE_OF_CONDUCT.md by @thebentern in https://github.com/meshtastic/firmware/pull/5225\r\n* Don't skip GPS serial speeds, and always land on GPS_BAUDRATE by @jp-bennett in https://github.com/meshtastic/firmware/pull/5195\r\n\r\n## 🐛 Bug fixes & maintenance\r\n* Fix: don't broadcast public keys if the user is licensed by @andrekir in https://github.com/meshtastic/firmware/pull/5190\r\n* Fix SerialModule handling received packet by @GUVWAF in https://github.com/meshtastic/firmware/pull/5206\r\n* Refactor getMacAddr function by @alexbegoon in https://github.com/meshtastic/firmware/pull/5208\r\n* Increase NimBLE stack size by @thebentern in https://github.com/meshtastic/firmware/pull/5202\r\n* Don't try to count non-lora transmissions into airtime (or attempt to decode) by @thebentern in https://github.com/meshtastic/firmware/pull/5215\r\n* Drop oldest packet from radio when queue is full by @GUVWAF in https://github.com/meshtastic/firmware/pull/5212\r\n* Fix \"Scan and Select\" input for Canned Messages by @todd-herbert in https://github.com/meshtastic/firmware/pull/5221\r\n* Remove assert in mesh-pb-constants.cpp by @jp-bennett in https://github.com/meshtastic/firmware/pull/5207\r\n* Optimize GPS Baud Rate cycle by @fifieldt in https://github.com/meshtastic/firmware/pull/5102\r\n\r\n## New Contributors\r\n* @alexbegoon made their first contribution in https://github.com/meshtastic/firmware/pull/5208\r\n\r\n**Full Changelog**: https://github.com/meshtastic/firmware/compare/v2.5.9.936260f...v2.5.10.0fc5c9b"
}
]
},
diff --git a/app/src/main/java/com/geeksville/mesh/AppIntroduction.kt b/app/src/main/java/com/geeksville/mesh/AppIntroduction.kt
deleted file mode 100644
index 48a33dcee..000000000
--- a/app/src/main/java/com/geeksville/mesh/AppIntroduction.kt
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import android.os.Bundle
-import androidx.core.content.edit
-import androidx.fragment.app.Fragment
-import com.geeksville.mesh.model.UIViewModel
-import com.github.appintro.AppIntro
-import com.github.appintro.AppIntroFragment
-
-class AppIntroduction : AppIntro() {
-
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- // Make sure you don't call setContentView!
-
- // Call addSlide passing your Fragments.
- // You can use AppIntroFragment to use a pre-built fragment
- addSlide(
- AppIntroFragment.createInstance(
- title = resources.getString(R.string.intro_welcome),
- description = resources.getString(R.string.intro_welcome_text),
- imageDrawable = R.mipmap.ic_launcher2_round,
- backgroundColorRes = R.color.colourGrey,
- descriptionColorRes = R.color.colorOnPrimary
- ))
- addSlide(AppIntroFragment.createInstance(
- title = resources.getString(R.string.intro_started),
- description = resources.getString(R.string.intro_started_text),
- imageDrawable = R.drawable.icon_meanings,
- backgroundColorRes = R.color.colourGrey,
- descriptionColorRes = R.color.colorOnPrimary
- ))
- addSlide(AppIntroFragment.createInstance(
- title = resources.getString(R.string.intro_encryption),
- description = resources.getString(R.string.intro_encryption_text),
- imageDrawable = R.drawable.channel_name_image,
- backgroundColorRes = R.color.colourGrey,
- descriptionColorRes = R.color.colorOnPrimary
- ))
- //addSlide(SlideTwoFragment())
- }
-
- private fun done() {
- val prefs = UIViewModel.getPreferences(this)
- prefs.edit { putBoolean("app_intro_completed", true) }
- finish()
- }
-
- override fun onSkipPressed(currentFragment: Fragment?) {
- super.onSkipPressed(currentFragment)
- // Decide what to do when the user clicks on "Skip"
- done()
- }
-
- override fun onDonePressed(currentFragment: Fragment?) {
- super.onDonePressed(currentFragment)
- // Decide what to do when the user clicks on "Done"
- done()
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/ApplicationModule.kt b/app/src/main/java/com/geeksville/mesh/ApplicationModule.kt
deleted file mode 100644
index 3aa71c8d3..000000000
--- a/app/src/main/java/com/geeksville/mesh/ApplicationModule.kt
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import android.app.Application
-import android.content.Context
-import android.content.SharedPreferences
-import androidx.lifecycle.Lifecycle
-import androidx.lifecycle.LifecycleOwner
-import androidx.lifecycle.ProcessLifecycleOwner
-import dagger.Module
-import dagger.Provides
-import dagger.hilt.InstallIn
-import dagger.hilt.components.SingletonComponent
-
-@InstallIn(SingletonComponent::class)
-@Module
-object ApplicationModule {
- @Provides
- fun provideSharedPreferences(application: Application): SharedPreferences {
- return application.getSharedPreferences("ui-prefs", Context.MODE_PRIVATE)
- }
-
- @Provides
- fun provideProcessLifecycleOwner(): LifecycleOwner {
- return ProcessLifecycleOwner.get()
- }
-
- @Provides
- fun provideProcessLifecycle(processLifecycleOwner: LifecycleOwner): Lifecycle {
- return processLifecycleOwner.lifecycle
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/DataPacket.kt b/app/src/main/java/com/geeksville/mesh/DataPacket.kt
deleted file mode 100644
index b855359bb..000000000
--- a/app/src/main/java/com/geeksville/mesh/DataPacket.kt
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import android.os.Parcel
-import android.os.Parcelable
-import kotlinx.parcelize.Parcelize
-import kotlinx.serialization.Serializable
-
-/**
- * Generic [Parcel.readParcelable] Android 13 compatibility extension.
- */
-private inline fun Parcel.readParcelableCompat(loader: ClassLoader?): T? {
- return if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.TIRAMISU) {
- @Suppress("DEPRECATION")
- readParcelable(loader)
- } else {
- readParcelable(loader, T::class.java)
- }
-}
-
-@Parcelize
-enum class MessageStatus : Parcelable {
- UNKNOWN, // Not set for this message
- RECEIVED, // Came in from the mesh
- QUEUED, // Waiting to send to the mesh as soon as we connect to the device
- ENROUTE, // Delivered to the radio, but no ACK or NAK received
- DELIVERED, // We received an ack
- ERROR // We received back a nak, message not delivered
-}
-
-/**
- * A parcelable version of the protobuf MeshPacket + Data subpacket.
- */
-@Serializable
-data class DataPacket(
- var to: String? = ID_BROADCAST, // a nodeID string, or ID_BROADCAST for broadcast
- val bytes: ByteArray?,
- val dataType: Int, // A port number for this packet (formerly called DataType, see portnums.proto for new usage instructions)
- var from: String? = ID_LOCAL, // a nodeID string, or ID_LOCAL for localhost
- var time: Long = System.currentTimeMillis(), // msecs since 1970
- var id: Int = 0, // 0 means unassigned
- var status: MessageStatus? = MessageStatus.UNKNOWN,
- var hopLimit: Int = 0,
- var channel: Int = 0, // channel index
- var wantAck: Boolean = true, // If true, the receiver should send an ack back
-) : Parcelable {
-
- /**
- * If there was an error with this message, this string describes what was wrong.
- */
- var errorMessage: String? = null
-
- /**
- * Syntactic sugar to make it easy to create text messages
- */
- constructor(to: String?, channel: Int, text: String) : this(
- to = to,
- bytes = text.encodeToByteArray(),
- dataType = Portnums.PortNum.TEXT_MESSAGE_APP_VALUE,
- channel = channel
- )
-
- /**
- * If this is a text message, return the string, otherwise null
- */
- val text: String?
- get() = if (dataType == Portnums.PortNum.TEXT_MESSAGE_APP_VALUE) {
- bytes?.decodeToString()
- } else {
- null
- }
-
- val alert: String?
- get() = if (dataType == Portnums.PortNum.ALERT_APP_VALUE) {
- bytes?.decodeToString()
- } else {
- null
- }
-
- constructor(to: String?, channel: Int, waypoint: MeshProtos.Waypoint) : this(
- to = to,
- bytes = waypoint.toByteArray(),
- dataType = Portnums.PortNum.WAYPOINT_APP_VALUE,
- channel = channel
- )
-
- val waypoint: MeshProtos.Waypoint?
- get() = if (dataType == Portnums.PortNum.WAYPOINT_APP_VALUE) {
- MeshProtos.Waypoint.parseFrom(bytes)
- } else {
- null
- }
-
- // Autogenerated comparision, because we have a byte array
-
- constructor(parcel: Parcel) : this(
- parcel.readString(),
- parcel.createByteArray(),
- parcel.readInt(),
- parcel.readString(),
- parcel.readLong(),
- parcel.readInt(),
- parcel.readParcelableCompat(MessageStatus::class.java.classLoader),
- parcel.readInt(),
- parcel.readInt(),
- parcel.readInt() == 1,
- )
-
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (javaClass != other?.javaClass) return false
-
- other as DataPacket
-
- if (from != other.from) return false
- if (to != other.to) return false
- if (channel != other.channel) return false
- if (time != other.time) return false
- if (id != other.id) return false
- if (dataType != other.dataType) return false
- if (!bytes!!.contentEquals(other.bytes!!)) return false
- if (status != other.status) return false
- if (hopLimit != other.hopLimit) return false
- if (wantAck != other.wantAck) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- var result = from.hashCode()
- result = 31 * result + to.hashCode()
- result = 31 * result + time.hashCode()
- result = 31 * result + id
- result = 31 * result + dataType
- result = 31 * result + bytes!!.contentHashCode()
- result = 31 * result + status.hashCode()
- result = 31 * result + hopLimit
- result = 31 * result + channel
- result = 31 * result + wantAck.hashCode()
- return result
- }
-
- override fun writeToParcel(parcel: Parcel, flags: Int) {
- parcel.writeString(to)
- parcel.writeByteArray(bytes)
- parcel.writeInt(dataType)
- parcel.writeString(from)
- parcel.writeLong(time)
- parcel.writeInt(id)
- parcel.writeParcelable(status, flags)
- parcel.writeInt(hopLimit)
- parcel.writeInt(channel)
- parcel.writeInt(if (wantAck) 1 else 0)
- }
-
- override fun describeContents(): Int {
- return 0
- }
-
- // Update our object from our parcel (used for inout parameters
- fun readFromParcel(parcel: Parcel) {
- to = parcel.readString()
- parcel.createByteArray()
- parcel.readInt()
- from = parcel.readString()
- time = parcel.readLong()
- id = parcel.readInt()
- status = parcel.readParcelableCompat(MessageStatus::class.java.classLoader)
- hopLimit = parcel.readInt()
- channel = parcel.readInt()
- wantAck = parcel.readInt() == 1
- }
-
- companion object CREATOR : Parcelable.Creator {
- // Special node IDs that can be used for sending messages
-
- /** the Node ID for broadcast destinations */
- const val ID_BROADCAST = "^all"
-
- /** The Node ID for the local node - used for from when sender doesn't know our local node ID */
- const val ID_LOCAL = "^local"
-
- // special broadcast address
- const val NODENUM_BROADCAST = (0xffffffff).toInt()
-
- // Public-key cryptography (PKC) channel index
- const val PKC_CHANNEL_INDEX = 8
-
- fun nodeNumToDefaultId(n: Int): String = "!%08x".format(n)
- fun idToDefaultNodeNum(id: String?): Int? = runCatching { id?.toLong(16)?.toInt() }.getOrNull()
-
- override fun createFromParcel(parcel: Parcel): DataPacket {
- return DataPacket(parcel)
- }
-
- override fun newArray(size: Int): Array {
- return arrayOfNulls(size)
- }
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/MainActivity.kt b/app/src/main/java/com/geeksville/mesh/MainActivity.kt
deleted file mode 100644
index 5c5f8680e..000000000
--- a/app/src/main/java/com/geeksville/mesh/MainActivity.kt
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import android.app.PendingIntent
-import android.app.TaskStackBuilder
-import android.bluetooth.BluetoothAdapter
-import android.content.Intent
-import android.content.pm.PackageInfo
-import android.content.pm.PackageManager
-import android.hardware.usb.UsbManager
-import android.net.Uri
-import android.os.Build
-import android.os.Bundle
-import android.os.RemoteException
-import android.provider.Settings
-import android.view.MotionEvent
-import android.widget.Toast
-import androidx.activity.compose.setContent
-import androidx.activity.enableEdgeToEdge
-import androidx.activity.result.contract.ActivityResultContracts
-import androidx.activity.viewModels
-import androidx.appcompat.app.AppCompatActivity
-import androidx.appcompat.app.AppCompatDelegate
-import androidx.compose.foundation.isSystemInDarkTheme
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.safeDrawingPadding
-import androidx.compose.runtime.collectAsState
-import androidx.compose.runtime.getValue
-import androidx.compose.ui.Modifier
-import androidx.core.content.edit
-import androidx.core.net.toUri
-import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
-import com.geeksville.mesh.android.BindFailedException
-import com.geeksville.mesh.android.GeeksvilleApplication
-import com.geeksville.mesh.android.Logging
-import com.geeksville.mesh.android.ServiceClient
-import com.geeksville.mesh.android.getBluetoothPermissions
-import com.geeksville.mesh.android.getNotificationPermissions
-import com.geeksville.mesh.android.hasBluetoothPermission
-import com.geeksville.mesh.android.hasNotificationPermission
-import com.geeksville.mesh.android.permissionMissing
-import com.geeksville.mesh.android.shouldShowRequestPermissionRationale
-import com.geeksville.mesh.concurrent.handledLaunch
-import com.geeksville.mesh.model.BluetoothViewModel
-import com.geeksville.mesh.model.DeviceVersion
-import com.geeksville.mesh.model.UIViewModel
-import com.geeksville.mesh.navigation.DEEP_LINK_BASE_URI
-import com.geeksville.mesh.service.MeshService
-import com.geeksville.mesh.service.ServiceRepository
-import com.geeksville.mesh.service.startService
-import com.geeksville.mesh.ui.MainMenuAction
-import com.geeksville.mesh.ui.MainScreen
-import com.geeksville.mesh.ui.theme.AppTheme
-import com.geeksville.mesh.ui.theme.MODE_DYNAMIC
-import com.geeksville.mesh.util.Exceptions
-import com.geeksville.mesh.util.LanguageUtils
-import com.geeksville.mesh.util.getPackageInfoCompat
-import dagger.hilt.android.AndroidEntryPoint
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.Job
-import kotlinx.coroutines.cancel
-import javax.inject.Inject
-
-@AndroidEntryPoint
-class MainActivity : AppCompatActivity(), Logging {
-
- // Used to schedule a coroutine in the GUI thread
- private val mainScope = CoroutineScope(Dispatchers.Main + Job())
-
- private val bluetoothViewModel: BluetoothViewModel by viewModels()
- private val model: UIViewModel by viewModels()
-
- @Inject
- internal lateinit var serviceRepository: ServiceRepository
-
- private val bluetoothPermissionsLauncher =
- registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { result ->
- if (result.entries.all { it.value }) {
- info("Bluetooth permissions granted")
- } else {
- warn("Bluetooth permissions denied")
- model.showSnackbar(permissionMissing)
- }
- requestedEnable = false
- bluetoothViewModel.permissionsUpdated()
- }
-
- private val notificationPermissionsLauncher =
- registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { result ->
- if (result.entries.all { it.value }) {
- info("Notification permissions granted")
- checkAlertDnD()
- } else {
- warn("Notification permissions denied")
- model.showSnackbar(getString(R.string.notification_denied))
- }
- }
-
- override fun onCreate(savedInstanceState: Bundle?) {
- enableEdgeToEdge()
- installSplashScreen()
- super.onCreate(savedInstanceState)
-
- if (savedInstanceState == null) {
- val prefs = UIViewModel.getPreferences(this)
- // First run: migrate in-app language prefs to appcompat
- val lang = prefs.getString("lang", LanguageUtils.SYSTEM_DEFAULT)
- if (lang != LanguageUtils.SYSTEM_MANAGED) LanguageUtils.migrateLanguagePrefs(prefs)
- info("in-app language is ${LanguageUtils.getLocale()}")
- // First run: show AppIntroduction
- if (!prefs.getBoolean("app_intro_completed", false)) {
- startActivity(Intent(this, AppIntroduction::class.java))
- }
- // Ask user to rate in play store
- (application as GeeksvilleApplication).askToRate(this)
- }
-
- setContent {
- Box(Modifier.safeDrawingPadding()) {
- val theme by model.theme.collectAsState()
- val dynamic = theme == MODE_DYNAMIC
- val dark = when (theme) {
- AppCompatDelegate.MODE_NIGHT_YES -> true
- AppCompatDelegate.MODE_NIGHT_NO -> false
- AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM -> isSystemInDarkTheme()
- else -> isSystemInDarkTheme()
- }
- AppTheme(
- dynamicColor = dynamic,
- darkTheme = dark,
- ) {
- MainScreen(viewModel = model, onAction = ::onMainMenuAction)
- }
- }
- }
-
- // Handle any intent
- handleIntent(intent)
- }
-
- override fun onNewIntent(intent: Intent) {
- super.onNewIntent(intent)
- handleIntent(intent)
- }
-
- // Handle any intents that were passed into us
- private fun handleIntent(intent: Intent) {
- val appLinkAction = intent.action
- val appLinkData: Uri? = intent.data
-
- when (appLinkAction) {
- Intent.ACTION_VIEW -> {
- appLinkData?.let {
- debug("App link data: $it")
- if (it.path?.startsWith("/e/") == true ||
- it.path?.startsWith("/E/") == true
- ) {
- debug("App link data is a channel set")
- model.requestChannelUrl(it)
- } else {
- debug("App link data is not a channel set")
- }
- }
- }
-
- UsbManager.ACTION_USB_DEVICE_ATTACHED -> {
- debug("USB device attached")
- showSettingsPage()
- }
-
- Intent.ACTION_MAIN -> {
- }
-
- Intent.ACTION_SEND -> {
- val text = intent.getStringExtra(Intent.EXTRA_TEXT)
- if (text != null) {
- createShareIntent(text).send()
- }
- }
-
- else -> {
- warn("Unexpected action $appLinkAction")
- }
- }
- }
-
- private fun createShareIntent(message: String): PendingIntent {
- val deepLink = "$DEEP_LINK_BASE_URI/share?message=$message"
- val startActivityIntent = Intent(
- Intent.ACTION_VIEW, deepLink.toUri(),
- this, MainActivity::class.java
- )
-
- val resultPendingIntent: PendingIntent? = TaskStackBuilder.create(this).run {
- addNextIntentWithParentStack(startActivityIntent)
- getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE)
- }
- return resultPendingIntent!!
- }
-
- private fun createSettingsIntent(): PendingIntent {
- val deepLink = "$DEEP_LINK_BASE_URI/settings"
- val startActivityIntent = Intent(
- Intent.ACTION_VIEW, deepLink.toUri(),
- this, MainActivity::class.java
- )
-
- val resultPendingIntent: PendingIntent? = TaskStackBuilder.create(this).run {
- addNextIntentWithParentStack(startActivityIntent)
- getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE)
- }
- return resultPendingIntent!!
- }
-
- private var requestedEnable = false
- private val bleRequestEnable = registerForActivityResult(
- ActivityResultContracts.StartActivityForResult()
- ) {
- requestedEnable = false
- }
-
- private val createDocumentLauncher = registerForActivityResult(
- ActivityResultContracts.StartActivityForResult()
- ) {
- if (it.resultCode == RESULT_OK) {
- it.data?.data?.let { file_uri -> model.saveMessagesCSV(file_uri) }
- }
- }
-
- override fun onDestroy() {
- mainScope.cancel("Activity going away")
- super.onDestroy()
- }
-
- // Called when we gain/lose a connection to our mesh radio
- private fun onMeshConnectionChanged(newConnection: MeshService.ConnectionState) {
- if (newConnection == MeshService.ConnectionState.CONNECTED) {
- serviceRepository.meshService?.let { service ->
- try {
- val info: MyNodeInfo? = service.myNodeInfo // this can be null
-
- if (info != null) {
- val isOld = info.minAppVersion > BuildConfig.VERSION_CODE
- if (isOld) {
- model.showAlert(
- getString(R.string.app_too_old),
- getString(R.string.must_update),
- dismissable = false,
- )
- } else {
- // If we are already doing an update don't put up a dialog or try to get device info
- val isUpdating = service.updateStatus >= 0
- if (!isUpdating) {
- val curVer = DeviceVersion(info.firmwareVersion ?: "0.0.0")
- if (curVer < MeshService.minDeviceVersion) {
- val title = getString(R.string.firmware_too_old)
- val message = getString(R.string.firmware_old)
- model.showAlert(title, message, dismissable = false)
- }
- }
- }
- }
- } catch (ex: RemoteException) {
- warn("Abandoning connect $ex, because we probably just lost device connection")
- }
- // if provideLocation enabled: Start providing location (from phone GPS) to mesh
- if (model.provideLocation.value == true) {
- service.startProvideLocation()
- } else {
- service.stopProvideLocation()
- }
- }
- checkNotificationPermissions()
- }
- }
-
- private fun checkNotificationPermissions() {
- if (!hasNotificationPermission()) {
- val notificationPermissions = getNotificationPermissions()
- if (shouldShowRequestPermissionRationale(notificationPermissions)) {
- val title = getString(R.string.notification_required)
- val message = getString(R.string.why_notification_required)
- model.showAlert(
- title = title,
- message = message,
- onConfirm = {
- notificationPermissionsLauncher.launch(notificationPermissions)
- },
- )
- } else {
- notificationPermissionsLauncher.launch(notificationPermissions)
- }
- }
- }
-
- @Suppress("MagicNumber")
- private fun checkAlertDnD() {
- if (
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
- ) {
- val prefs = UIViewModel.getPreferences(this)
- val rationaleShown = prefs.getBoolean("dnd_rationale_shown", false)
- if (!rationaleShown && hasNotificationPermission()) {
- fun showAlertAppNotificationSettings() {
- val intent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
- intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
- intent.putExtra(Settings.EXTRA_CHANNEL_ID, "my_alerts")
- startActivity(intent)
- }
- model.showAlert(
- title = getString(R.string.alerts_dnd_request_title),
- html = getString(R.string.alerts_dnd_request_text),
- onConfirm = {
- showAlertAppNotificationSettings()
- },
- dismissable = true
- ).also {
- prefs.edit { putBoolean("dnd_rationale_shown", true) }
- }
- }
- }
- }
-
- override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
- return try {
- super.dispatchTouchEvent(ev)
- } catch (ex: Throwable) {
- Exceptions.report(
- ex,
- "dispatchTouchEvent"
- ) // hide this Compose error from the user but report to the mothership
- false
- }
- }
-
- private var connectionJob: Job? = null
-
- private val mesh = object : ServiceClient(IMeshService.Stub::asInterface) {
- override fun onConnected(service: IMeshService) {
- connectionJob = mainScope.handledLaunch {
- serviceRepository.setMeshService(service)
-
- try {
- val connectionState =
- MeshService.ConnectionState.valueOf(service.connectionState())
-
- // We won't receive a notify for the initial state of connection, so we force an update here
- onMeshConnectionChanged(connectionState)
- } catch (ex: RemoteException) {
- errormsg("Device error during init ${ex.message}")
- } finally {
- connectionJob = null
- }
-
- debug("connected to mesh service, connectionState=${model.connectionState.value}")
- }
- }
-
- override fun onDisconnected() {
- serviceRepository.setMeshService(null)
- }
- }
-
- private fun bindMeshService() {
- debug("Binding to mesh service!")
- // we bind using the well known name, to make sure 3rd party apps could also
- if (serviceRepository.meshService != null) {
- /* This problem can occur if we unbind, but there is already an onConnected job waiting to run. That job runs and then makes meshService != null again
- I think I've fixed this by cancelling connectionJob. We'll see!
- */
- Exceptions.reportError("meshService was supposed to be null, ignoring (but reporting a bug)")
- }
-
- try {
- MeshService.startService(this) // Start the service so it stays running even after we unbind
- } catch (ex: Exception) {
- // Old samsung phones have a race condition andthis might rarely fail. Which is probably find because the bind will be sufficient most of the time
- errormsg("Failed to start service from activity - but ignoring because bind will work ${ex.message}")
- }
-
- // ALSO bind so we can use the api
- mesh.connect(
- this,
- MeshService.createIntent(),
- BIND_AUTO_CREATE + BIND_ABOVE_CLIENT
- )
- }
-
- private fun unbindMeshService() {
- // If we have received the service, and hence registered with
- // it, then now is the time to unregister.
- // if we never connected, do nothing
- debug("Unbinding from mesh service!")
- connectionJob?.let { job ->
- connectionJob = null
- warn("We had a pending onConnection job, so we are cancelling it")
- job.cancel("unbinding")
- }
- mesh.close()
- serviceRepository.setMeshService(null)
- }
-
- override fun onStop() {
- unbindMeshService()
- super.onStop()
- }
-
- override fun onStart() {
- super.onStart()
-
- bluetoothViewModel.enabled.observe(this) { enabled ->
- if (!enabled && !requestedEnable && model.selectedBluetooth) {
- requestedEnable = true
- if (hasBluetoothPermission()) {
- val enableBtIntent = Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)
- bleRequestEnable.launch(enableBtIntent)
- } else {
- val bluetoothPermissions = getBluetoothPermissions()
- val title = getString(R.string.required_permissions)
- val message = permissionMissing
- model.showAlert(
- title = title,
- message = message,
- onConfirm = {
- bluetoothPermissionsLauncher.launch(bluetoothPermissions)
- },
- )
- }
- }
- }
-
- try {
- bindMeshService()
- } catch (ex: BindFailedException) {
- // App is probably shutting down, ignore
- errormsg("Bind of MeshService failed${ex.message}")
- }
- }
-
- private fun showSettingsPage() {
- createSettingsIntent().send()
- }
-
- private fun onMainMenuAction(action: MainMenuAction) {
- when (action) {
- MainMenuAction.ABOUT -> {
- getVersionInfo()
- }
-
- MainMenuAction.EXPORT_MESSAGES -> {
- val intent = Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
- addCategory(Intent.CATEGORY_OPENABLE)
- type = "application/csv"
- putExtra(Intent.EXTRA_TITLE, "rangetest.csv")
- }
- createDocumentLauncher.launch(intent)
- }
-
- MainMenuAction.THEME -> {
- chooseThemeDialog()
- }
-
- MainMenuAction.LANGUAGE -> {
- chooseLangDialog()
- }
-
- MainMenuAction.SHOW_INTRO -> {
- startActivity(Intent(this, AppIntroduction::class.java))
- }
-
- else -> {}
- }
- }
-
- private fun getVersionInfo() {
- try {
- val packageInfo: PackageInfo = packageManager.getPackageInfoCompat(packageName, 0)
- val versionName = packageInfo.versionName
- Toast.makeText(this, versionName, Toast.LENGTH_LONG).show()
- } catch (e: PackageManager.NameNotFoundException) {
- errormsg("Can not find the version: ${e.message}")
- }
- }
-
- // Theme functions
-
- private fun chooseThemeDialog() {
- val styles = mapOf(
- getString(R.string.dynamic) to MODE_DYNAMIC,
- getString(R.string.theme_light) to AppCompatDelegate.MODE_NIGHT_NO,
- getString(R.string.theme_dark) to AppCompatDelegate.MODE_NIGHT_YES,
- getString(R.string.theme_system) to AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
- )
-
- // Load preferences and its value
- val prefs = UIViewModel.getPreferences(this)
- val theme = prefs.getInt("theme", AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
- debug("Theme from prefs: $theme")
- // map theme keys to function to set theme
- model.showAlert(
- title = getString(R.string.choose_theme),
- message = "",
- choices = styles.mapValues { (_, value) ->
- {
- model.setTheme(value)
- }
- },
- )
- }
-
- private fun chooseLangDialog() {
- val languageTags = LanguageUtils.getLanguageTags(this)
- // Load preferences and its value
- val lang = LanguageUtils.getLocale()
- debug("Lang from prefs: $lang")
- // map lang keys to function to set locale
- val langMap = languageTags.mapValues { (_, value) ->
- {
- LanguageUtils.setLocale(value)
- }
- }
-
- model.showAlert(
- title = getString(R.string.preferences_language),
- message = "",
- choices = langMap,
- )
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/NodeInfo.kt b/app/src/main/java/com/geeksville/mesh/NodeInfo.kt
deleted file mode 100644
index 38aa4bde0..000000000
--- a/app/src/main/java/com/geeksville/mesh/NodeInfo.kt
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh
-
-import android.graphics.Color
-import android.os.Parcelable
-import com.geeksville.mesh.util.GPSFormat
-import com.geeksville.mesh.util.bearing
-import com.geeksville.mesh.util.latLongToMeter
-import com.geeksville.mesh.util.anonymize
-import kotlinx.parcelize.Parcelize
-
-//
-// model objects that directly map to the corresponding protobufs
-//
-
-@Parcelize
-data class MeshUser(
- val id: String,
- val longName: String,
- val shortName: String,
- val hwModel: MeshProtos.HardwareModel,
- val isLicensed: Boolean = false,
- val role: Int = 0,
-) : Parcelable {
-
- override fun toString(): String {
- return "MeshUser(id=${id.anonymize}, " +
- "longName=${longName.anonymize}, " +
- "shortName=${shortName.anonymize}, " +
- "hwModel=$hwModelString, " +
- "isLicensed=$isLicensed, " +
- "role=$role)"
- }
-
- /** Create our model object from a protobuf.
- */
- constructor(p: MeshProtos.User) : this(
- p.id,
- p.longName,
- p.shortName,
- p.hwModel,
- p.isLicensed,
- p.roleValue
- )
-
- /** a string version of the hardware model, converted into pretty lowercase and changing _ to -, and p to dot
- * or null if unset
- * */
- val hwModelString: String?
- get() =
- if (hwModel == MeshProtos.HardwareModel.UNSET) null
- else hwModel.name.replace('_', '-').replace('p', '.').lowercase()
-}
-
-@Parcelize
-data class Position(
- val latitude: Double,
- val longitude: Double,
- val altitude: Int,
- val time: Int = currentTime(), // default to current time in secs (NOT MILLISECONDS!)
- val satellitesInView: Int = 0,
- val groundSpeed: Int = 0,
- val groundTrack: Int = 0, // "heading"
- val precisionBits: Int = 0,
-) : Parcelable {
-
- companion object {
- /// Convert to a double representation of degrees
- fun degD(i: Int) = i * 1e-7
- fun degI(d: Double) = (d * 1e7).toInt()
-
- fun currentTime() = (System.currentTimeMillis() / 1000).toInt()
- }
-
- /** Create our model object from a protobuf. If time is unspecified in the protobuf, the provided default time will be used.
- */
- constructor(position: MeshProtos.Position, defaultTime: Int = currentTime()) : this(
- // We prefer the int version of lat/lon but if not available use the depreciated legacy version
- degD(position.latitudeI),
- degD(position.longitudeI),
- position.altitude,
- if (position.time != 0) position.time else defaultTime,
- position.satsInView,
- position.groundSpeed,
- position.groundTrack,
- position.precisionBits
- )
-
- /// @return distance in meters to some other node (or null if unknown)
- fun distance(o: Position) = latLongToMeter(latitude, longitude, o.latitude, o.longitude)
-
- /// @return bearing to the other position in degrees
- fun bearing(o: Position) = bearing(latitude, longitude, o.latitude, o.longitude)
-
- // If GPS gives a crap position don't crash our app
- fun isValid(): Boolean {
- return latitude != 0.0 && longitude != 0.0 &&
- (latitude >= -90 && latitude <= 90.0) &&
- (longitude >= -180 && longitude <= 180)
- }
-
- fun gpsString(gpsFormat: Int): String = when (gpsFormat) {
- ConfigProtos.Config.DisplayConfig.GpsCoordinateFormat.DEC_VALUE -> GPSFormat.DEC(this)
- ConfigProtos.Config.DisplayConfig.GpsCoordinateFormat.DMS_VALUE -> GPSFormat.DMS(this)
- ConfigProtos.Config.DisplayConfig.GpsCoordinateFormat.UTM_VALUE -> GPSFormat.UTM(this)
- ConfigProtos.Config.DisplayConfig.GpsCoordinateFormat.MGRS_VALUE -> GPSFormat.MGRS(this)
- else -> GPSFormat.DEC(this)
- }
-
- override fun toString(): String {
- return "Position(lat=${latitude.anonymize}, lon=${longitude.anonymize}, alt=${altitude.anonymize}, time=${time})"
- }
-}
-
-
-@Parcelize
-data class DeviceMetrics(
- val time: Int = currentTime(), // default to current time in secs (NOT MILLISECONDS!)
- val batteryLevel: Int = 0,
- val voltage: Float,
- val channelUtilization: Float,
- val airUtilTx: Float,
- val uptimeSeconds: Int,
-) : Parcelable {
- companion object {
- fun currentTime() = (System.currentTimeMillis() / 1000).toInt()
- }
-
- /** Create our model object from a protobuf.
- */
- constructor(p: TelemetryProtos.DeviceMetrics, telemetryTime: Int = currentTime()) : this(
- telemetryTime,
- p.batteryLevel,
- p.voltage,
- p.channelUtilization,
- p.airUtilTx,
- p.uptimeSeconds,
- )
-}
-
-@Parcelize
-data class EnvironmentMetrics(
- val time: Int = currentTime(), // default to current time in secs (NOT MILLISECONDS!)
- val temperature: Float,
- val relativeHumidity: Float,
- val barometricPressure: Float,
- val gasResistance: Float,
- val voltage: Float,
- val current: Float,
- val iaq: Int,
-) : Parcelable {
- companion object {
- fun currentTime() = (System.currentTimeMillis() / 1000).toInt()
- }
-}
-
-@Parcelize
-data class NodeInfo(
- val num: Int, // This is immutable, and used as a key
- var user: MeshUser? = null,
- var position: Position? = null,
- var snr: Float = Float.MAX_VALUE,
- var rssi: Int = Int.MAX_VALUE,
- var lastHeard: Int = 0, // the last time we've seen this node in secs since 1970
- var deviceMetrics: DeviceMetrics? = null,
- var channel: Int = 0,
- var environmentMetrics: EnvironmentMetrics? = null,
- var hopsAway: Int = 0
-) : Parcelable {
-
- val colors: Pair
- get() { // returns foreground and background @ColorInt for each 'num'
- val r = (num and 0xFF0000) shr 16
- val g = (num and 0x00FF00) shr 8
- val b = num and 0x0000FF
- val brightness = ((r * 0.299) + (g * 0.587) + (b * 0.114)) / 255
- return (if (brightness > 0.5) Color.BLACK else Color.WHITE) to Color.rgb(r, g, b)
- }
-
- val batteryLevel get() = deviceMetrics?.batteryLevel
- val voltage get() = deviceMetrics?.voltage
- val batteryStr get() = if (batteryLevel in 1..100) String.format("%d%%", batteryLevel) else ""
-
- /**
- * true if the device was heard from recently
- */
- val isOnline: Boolean
- get() {
- val now = System.currentTimeMillis() / 1000
- val timeout = 15 * 60
- return (now - lastHeard <= timeout)
- }
-
- /// return the position if it is valid, else null
- val validPosition: Position?
- get() {
- return position?.takeIf { it.isValid() }
- }
-
- /// @return distance in meters to some other node (or null if unknown)
- fun distance(o: NodeInfo?): Int? {
- val p = validPosition
- val op = o?.validPosition
- return if (p != null && op != null) p.distance(op).toInt() else null
- }
-
- /// @return bearing to the other position in degrees
- fun bearing(o: NodeInfo?): Int? {
- val p = validPosition
- val op = o?.validPosition
- return if (p != null && op != null) p.bearing(op).toInt() else null
- }
-
- /// @return a nice human readable string for the distance, or null for unknown
- fun distanceStr(o: NodeInfo?, prefUnits: Int = 0) = distance(o)?.let { dist ->
- when {
- dist == 0 -> null // same point
- prefUnits == ConfigProtos.Config.DisplayConfig.DisplayUnits.METRIC_VALUE && dist < 1000 -> "%.0f m".format(dist.toDouble())
- prefUnits == ConfigProtos.Config.DisplayConfig.DisplayUnits.METRIC_VALUE && dist >= 1000 -> "%.1f km".format(dist / 1000.0)
- prefUnits == ConfigProtos.Config.DisplayConfig.DisplayUnits.IMPERIAL_VALUE && dist < 1609 -> "%.0f ft".format(dist.toDouble()*3.281)
- prefUnits == ConfigProtos.Config.DisplayConfig.DisplayUnits.IMPERIAL_VALUE && dist >= 1609 -> "%.1f mi".format(dist / 1609.34)
- else -> null
- }
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/analytics/AnalyticsClient.kt b/app/src/main/java/com/geeksville/mesh/analytics/AnalyticsClient.kt
deleted file mode 100644
index e57054f5c..000000000
--- a/app/src/main/java/com/geeksville/mesh/analytics/AnalyticsClient.kt
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.analytics
-
-/**
- * Created by kevinh on 12/24/14.
- */
-interface AnalyticsProvider {
-
- // Turn analytics logging on/off
- fun setEnabled(on: Boolean)
-
- /**
- * Store an event
- */
- fun track(event: String, vararg properties: DataPair)
-
- /**
- * Only track this event if using a cheap provider (like google)
- */
- fun trackLowValue(event: String, vararg properties: DataPair)
-
- fun endSession()
- fun startSession()
-
- /**
- * Set persistent ID info about this user, as a key value pair
- */
- fun setUserInfo(vararg p: DataPair)
-
- /**
- * Increment some sort of analytics counter
- */
- fun increment(name: String, amount: Double = 1.0)
-
- fun sendScreenView(name: String)
- fun endScreenView()
-}
diff --git a/app/src/main/java/com/geeksville/mesh/android/AppPrefs.kt b/app/src/main/java/com/geeksville/mesh/android/AppPrefs.kt
deleted file mode 100644
index 3824f29cc..000000000
--- a/app/src/main/java/com/geeksville/mesh/android/AppPrefs.kt
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.content.Context
-import android.content.SharedPreferences
-import java.util.UUID
-import kotlin.reflect.KProperty
-
-/**
- * Created by kevinh on 1/4/15.
- */
-
-
-/**
- * A delegate for "foo by FloatPref"
- */
-class FloatPref {
- fun get(thisRef: AppPrefs, prop: KProperty): Float = thisRef.getPrefs().getFloat(thisRef.makeName(prop.name), java.lang.Float.MIN_VALUE)
-
- fun set(thisRef: AppPrefs, prop: KProperty, value: Float) {
- thisRef.setPrefs { e -> e.putFloat(thisRef.makeName(prop.name), value)}
- }
-}
-
-/**
- * A delegate for "foo by StringPref"
- */
-class StringPref(val default: String) {
- fun get(thisRef: AppPrefs, prop: KProperty): String = thisRef.getPrefs().getString(thisRef.makeName(prop.name), default)!!
-
- fun set(thisRef: AppPrefs, prop: KProperty, value: String) {
- thisRef.setPrefs { e ->
- e.putString(thisRef.makeName(prop.name), value)
- }
- }
-}
-
-/**
- * A mixin for accessing android prefs for the app
- */
-public open class AppPrefs(val context: Context) {
-
- companion object {
- private val baseName = "appPrefs_"
- }
-
- fun makeName(s: String) = baseName + s
-
- fun getPrefs() = context.getSharedPreferences("prefs", Context.MODE_PRIVATE)
-
- fun setPrefs(body: (SharedPreferences.Editor) -> Unit) {
- val e = getPrefs().edit()
- body(e)
- e.commit()
- }
-
- fun incPref(name: String) {
- setPrefs { e ->
- e.putInt(name, 1 + getPrefs().getInt(name, 0))
- }
- }
-
- fun removePref(name: String) {
- setPrefs { e ->
- e.remove(name)
- }
- }
-
- fun putPref(name: String, b: Boolean) {
- setPrefs { e ->
- e.putBoolean(name, b)
- }
- }
-
- fun putPref(name: String, b: Float) {
- setPrefs { e ->
- e.putFloat(name, b)
- }
- }
-
- fun putPref(name: String, b: Int) {
- setPrefs { e ->
- e.putInt(name, b)
- }
- }
-
- fun putPref(name: String, b: Set) {
- setPrefs { e ->
- e.putStringSet(name, b)
- }
- }
-
- fun putPref(name: String, b: String) {
- setPrefs { e ->
- e.putString(name, b)
- }
- }
-
- /**
- * Return a persistent installation ID
- */
- fun getInstallId(): String {
- var r = getPrefs().getString(makeName("installId"), "")!!
- if(r == "") {
- r = UUID.randomUUID().toString()
- putPref(makeName("installId"), r)
- }
-
- return r
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/android/ContextExtensions.kt b/app/src/main/java/com/geeksville/mesh/android/ContextExtensions.kt
deleted file mode 100644
index 83ea9b944..000000000
--- a/app/src/main/java/com/geeksville/mesh/android/ContextExtensions.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.app.Activity
-import android.content.Context
-import android.util.TypedValue
-import android.view.inputmethod.InputMethodManager
-import android.widget.Toast
-
-/// show a toast
-fun Context.toast(message: CharSequence) =
- Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
-
-/// Utility function to hide the soft keyboard per stack overflow
-fun Activity.hideKeyboard() {
- // Check if no view has focus:
- currentFocus?.let { v ->
- val imm =
- getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager
- imm?.hideSoftInputFromWindow(v.windowToken, 0)
- }
-}
-
-// Converts SP to pixels.
-fun Context.spToPx(sp: Float): Int =
- TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, resources.displayMetrics).toInt()
-
-// Converts DP to pixels.
-fun Context.dpToPx(dp: Float): Int =
- TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, resources.displayMetrics).toInt()
diff --git a/app/src/main/java/com/geeksville/mesh/android/ContextServices.kt b/app/src/main/java/com/geeksville/mesh/android/ContextServices.kt
deleted file mode 100644
index e09594770..000000000
--- a/app/src/main/java/com/geeksville/mesh/android/ContextServices.kt
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.Manifest
-import android.app.Activity
-import android.app.NotificationManager
-import android.bluetooth.BluetoothManager
-import android.content.Context
-import android.content.pm.PackageManager
-import android.location.LocationManager
-import androidx.core.app.ActivityCompat
-import androidx.core.content.ContextCompat
-import androidx.fragment.app.Fragment
-import com.geeksville.mesh.R
-import com.google.android.material.dialog.MaterialAlertDialogBuilder
-
-/**
- * @return null on platforms without a BlueTooth driver (i.e. the emulator)
- */
-val Context.bluetoothManager: BluetoothManager?
- get() = getSystemService(Context.BLUETOOTH_SERVICE).takeIf { hasBluetoothPermission() } as? BluetoothManager?
-
-val Context.notificationManager: NotificationManager get() = requireNotNull(getSystemService(Context.NOTIFICATION_SERVICE) as? NotificationManager?)
-
-val Context.locationManager: LocationManager get() = requireNotNull(getSystemService(Context.LOCATION_SERVICE) as? LocationManager?)
-
-/**
- * @return true if the device has a GPS receiver
- */
-fun Context.hasGps(): Boolean = locationManager.allProviders.contains(LocationManager.GPS_PROVIDER)
-
-/**
- * @return true if the device has a GPS receiver and it is disabled (location turned off)
- */
-fun Context.gpsDisabled(): Boolean =
- if (hasGps()) !locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) else false
-
-/**
- * @return the text string of the permissions missing
- */
-val Context.permissionMissing: String
- get() = if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.S) {
- getString(R.string.permission_missing)
- } else {
- getString(R.string.permission_missing_31)
- }
-
-/**
- * Checks if any given permissions need to show rationale.
- *
- * @return true if should show UI with rationale before requesting a permission.
- */
-fun Activity.shouldShowRequestPermissionRationale(permissions: Array): Boolean {
- for (permission in permissions) {
- if (ActivityCompat.shouldShowRequestPermissionRationale(this, permission)) {
- return true
- }
- }
- return false
-}
-
-/**
- * Checks if any given permissions need to show rationale.
- *
- * @return true if should show UI with rationale before requesting a permission.
- */
-fun Fragment.shouldShowRequestPermissionRationale(permissions: Array): Boolean {
- for (permission in permissions) {
- if (shouldShowRequestPermissionRationale(permission)) {
- return true
- }
- }
- return false
-}
-
-/**
- * Handles whether a rationale dialog should be shown before performing an action.
- */
-fun Context.rationaleDialog(
- shouldShowRequestPermissionRationale: Boolean = true,
- title: Int = R.string.required_permissions,
- rationale: CharSequence = permissionMissing,
- invokeFun: () -> Unit,
-) {
- if (!shouldShowRequestPermissionRationale) invokeFun()
- else MaterialAlertDialogBuilder(this)
- .setTitle(title)
- .setMessage(rationale)
- .setNeutralButton(R.string.cancel) { _, _ ->
- }
- .setPositiveButton(R.string.accept) { _, _ ->
- invokeFun()
- }
- .show()
-}
-
-/**
- * return a list of the permissions we don't have
- */
-fun Context.getMissingPermissions(perms: List): Array = perms.filter {
- ContextCompat.checkSelfPermission(
- this,
- it
- ) != PackageManager.PERMISSION_GRANTED
-}.toTypedArray()
-
-/**
- * Bluetooth permissions (or empty if we already have what we need)
- */
-fun Context.getBluetoothPermissions(): Array {
- val perms = mutableListOf()
-
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
- perms.add(Manifest.permission.BLUETOOTH_SCAN)
- perms.add(Manifest.permission.BLUETOOTH_CONNECT)
- } else {
- perms.add(Manifest.permission.ACCESS_FINE_LOCATION)
- }
- return getMissingPermissions(perms)
-}
-
-/** @return true if the user already has Bluetooth connect permission */
-fun Context.hasBluetoothPermission() = getBluetoothPermissions().isEmpty()
-
-/**
- * Camera permission (or empty if we already have what we need)
- */
-fun Context.getCameraPermissions(): Array {
- val perms = mutableListOf(Manifest.permission.CAMERA)
-
- return getMissingPermissions(perms)
-}
-
-/** @return true if the user already has camera permission */
-fun Context.hasCameraPermission() = getCameraPermissions().isEmpty()
-
-/**
- * Location permission (or empty if we already have what we need)
- */
-fun Context.getLocationPermissions(): Array {
- val perms = mutableListOf(Manifest.permission.ACCESS_FINE_LOCATION)
-
- return getMissingPermissions(perms)
-}
-
-/** @return true if the user already has location permission */
-fun Context.hasLocationPermission() = getLocationPermissions().isEmpty()
-
-/**
- * Notification permission (or empty if we already have what we need)
- */
-fun Context.getNotificationPermissions(): Array {
- val perms = mutableListOf()
- if (android.os.Build.VERSION.SDK_INT >= 33) {
- perms.add(Manifest.permission.POST_NOTIFICATIONS)
- }
-
- return getMissingPermissions(perms)
-}
-
-/** @return true if the user already has notification permission */
-fun Context.hasNotificationPermission() = getNotificationPermissions().isEmpty()
diff --git a/app/src/main/java/com/geeksville/mesh/android/ExpireChecker.kt b/app/src/main/java/com/geeksville/mesh/android/ExpireChecker.kt
deleted file mode 100644
index cce68043b..000000000
--- a/app/src/main/java/com/geeksville/mesh/android/ExpireChecker.kt
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.app.Activity
-import android.content.Intent
-import android.net.Uri
-import android.widget.Toast
-import com.geeksville.mesh.R
-import java.util.*
-
-/**
- * Created by kevinh on 1/13/16.
- */
-class ExpireChecker(val context: Activity) : Logging {
-
- fun check(year: Int, month: Int, day: Int) {
- val expireDate = DateUtils.dateUTC(year, month, day)
- val now = Date()
-
- debug("Expire check $now vs $expireDate")
- if (now.after(expireDate))
- doExpire()
- }
-
- private fun doExpire() {
- val packageName = context.packageName
- errormsg("$packageName is too old and must be updated at the Play store")
-
- Toast.makeText(
- context,
- R.string.app_too_old,
- Toast.LENGTH_LONG
- ).show()
- val i = Intent(Intent.ACTION_VIEW)
- i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
- i.setData(Uri.parse("market://details?id=$packageName&referrer=utm_source%3Dexpired"))
- context.startActivity(i)
- context.finish()
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/android/Logging.kt b/app/src/main/java/com/geeksville/mesh/android/Logging.kt
deleted file mode 100644
index 9411c89b0..000000000
--- a/app/src/main/java/com/geeksville/mesh/android/Logging.kt
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.os.Build
-import android.util.Log
-import com.geeksville.mesh.BuildConfig
-import com.geeksville.mesh.util.Exceptions
-
-/**
- * Created by kevinh on 12/24/14.
- */
-
-typealias LogPrinter = (Int, String, String) -> Unit
-
-interface Logging {
-
- companion object {
- /** Some vendors strip log messages unless the severity is super high.
- *
- * alps == Soyes
- * HMD Global == mfg of the Nokia 7.2
- */
- private val badVendors = setOf("OnePlus", "alps", "HMD Global", "Sony")
-
- /// if false NO logs will be shown, set this in the application based on BuildConfig.DEBUG
- var showLogs = true
-
- /** if true, all logs will be printed at error level. Sometimes necessary for buggy ROMs
- * that filter logcat output below this level.
- *
- * Since there are so many bad vendors, we just always lie if we are a release build
- */
- var forceErrorLevel = !BuildConfig.DEBUG || badVendors.contains(Build.MANUFACTURER)
-
- /// If false debug logs will not be shown (but others might)
- var showDebug = true
-
- /**
- * By default all logs are printed using the standard android Log class. But clients
- * can change printlog to a different implementation (for logging to files or via
- * google crashlytics)
- */
- var printlog: LogPrinter = { level, tag, message ->
- if (showLogs) {
- if (showDebug || level > Log.DEBUG) {
- Log.println(if (forceErrorLevel) Log.ERROR else level, tag, message)
- }
- }
- }
- }
-
- private fun tag(): String = this.javaClass.getName()
-
- fun info(msg: String) = printlog(Log.INFO, tag(), msg)
- fun verbose(msg: String) = printlog(Log.VERBOSE, tag(), msg)
- fun debug(msg: String) = printlog(Log.DEBUG, tag(), msg)
- fun warn(msg: String) = printlog(Log.WARN, tag(), msg)
-
- /**
- * Log an error message, note - we call this errormsg rather than error because error() is
- * a stdlib function in kotlin in the global namespace and we don't want users to accidentally call that.
- */
- fun errormsg(msg: String, ex: Throwable? = null) {
- if (ex?.message != null)
- printlog(Log.ERROR, tag(), "$msg (exception ${ex.message})")
- else
- printlog(Log.ERROR, tag(), "$msg")
- }
-
- /// Kotlin assertions are disabled on android, so instead we use this assert helper
- fun logAssert(f: Boolean) {
- if (!f) {
- val ex = AssertionError("Assertion failed")
-
- // if(!Debug.isDebuggerConnected())
- throw ex
- }
- }
-
- /// Report an error (including messaging our crash reporter service if allowed
- fun reportError(s: String) {
- Exceptions.report(Exception("logging reportError: $s"), s)
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/android/ServiceClient.kt b/app/src/main/java/com/geeksville/mesh/android/ServiceClient.kt
deleted file mode 100644
index 0c5e1f5d9..000000000
--- a/app/src/main/java/com/geeksville/mesh/android/ServiceClient.kt
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.android
-
-import android.content.ComponentName
-import android.content.Context
-import android.content.Intent
-import android.content.ServiceConnection
-import android.os.IBinder
-import android.os.IInterface
-import com.geeksville.mesh.util.exceptionReporter
-import java.io.Closeable
-import java.lang.IllegalArgumentException
-import java.util.concurrent.locks.ReentrantLock
-import kotlin.concurrent.withLock
-
-class BindFailedException : Exception("bindService failed")
-
-/**
- * A wrapper that cleans up the service binding process
- */
-open class ServiceClient(private val stubFactory: (IBinder) -> T) : Closeable,
- Logging {
-
- var serviceP: T? = null
-
- // A getter that returns the bound service or throws if not bound
- val service: T
- get() {
- waitConnect() // Wait for at least the initial connection to happen
- return serviceP ?: throw Exception("Service not bound")
- }
-
- private var context: Context? = null
-
- private var isClosed = true
-
- private val lock = ReentrantLock()
- private val condition = lock.newCondition()
-
- /** Call this if you want to stall until the connection is completed */
- fun waitConnect() {
- // Wait until this service is connected
- lock.withLock {
- if (context == null) {
- throw Exception("Haven't called connect")
- }
-
- if (serviceP == null) {
- condition.await()
- }
- }
- }
-
- fun connect(c: Context, intent: Intent, flags: Int) {
- context = c
- if (isClosed) {
- isClosed = false
- if (!c.bindService(intent, connection, flags)) {
-
- // Some phones seem to ahve a race where if you unbind and quickly rebind bindService returns false. Try
- // a short sleep to see if that helps
- errormsg("Needed to use the second bind attempt hack")
- Thread.sleep(500) // was 200ms, but received an autobug from a Galaxy Note4, android 6.0.1
- if (!c.bindService(intent, connection, flags)) {
- throw BindFailedException()
- }
- }
- } else {
- warn("Ignoring rebind attempt for service")
- }
- }
-
- override fun close() {
- isClosed = true
- try {
- context?.unbindService(connection)
- } catch (ex: IllegalArgumentException) {
- // Autobugs show this can generate an illegal arg exception for "service not registered" during reinstall?
- warn("Ignoring error in ServiceClient.close, probably harmless")
- }
- serviceP = null
- context = null
- }
-
- // Called when we become connected
- open fun onConnected(service: T) {
- }
-
- // called on loss of connection
- open fun onDisconnected() {
- }
-
- private val connection = object : ServiceConnection {
- override fun onServiceConnected(name: ComponentName, binder: IBinder) = exceptionReporter {
- if (!isClosed) {
- val s = stubFactory(binder)
- serviceP = s
- onConnected(s)
-
- // after calling our handler, tell anyone who was waiting for this connection to complete
- lock.withLock {
- condition.signalAll()
- }
- } else {
- // If we start to close a service, it seems that there is a possibility a onServiceConnected event is the queue
- // for us. Be careful not to process that stale event
- warn("A service connected while we were closing it, ignoring")
- }
- }
-
- override fun onServiceDisconnected(name: ComponentName?) = exceptionReporter {
- serviceP = null
- onDisconnected()
- }
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/concurrent/SyncContinuation.kt b/app/src/main/java/com/geeksville/mesh/concurrent/SyncContinuation.kt
deleted file mode 100644
index 1fd6462d9..000000000
--- a/app/src/main/java/com/geeksville/mesh/concurrent/SyncContinuation.kt
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.concurrent
-
-import com.geeksville.mesh.android.Logging
-
-/**
- * A deferred execution object (with various possible implementations)
- */
-interface Continuation : Logging {
- abstract fun resume(res: Result)
-
- // syntactic sugar
-
- fun resumeSuccess(res: T) = resume(Result.success(res))
- fun resumeWithException(ex: Throwable) = try {
- resume(Result.failure(ex))
- } catch (ex: Throwable) {
- // errormsg("Ignoring $ex while resuming, because we are the ones who threw it")
- throw ex
- }
-}
-
-/**
- * An async continuation that just calls a callback when the result is available
- */
-class CallbackContinuation(private val cb: (Result) -> Unit) : Continuation {
- override fun resume(res: Result) = cb(res)
-}
-
-/**
- * This is a blocking/threaded version of coroutine Continuation
- *
- * A little bit ugly, but the coroutine version has a nasty internal bug that showed up
- * in my SyncBluetoothDevice so I needed a quick workaround.
- */
-class SyncContinuation : Continuation {
-
- private val mbox = java.lang.Object()
- private var result: Result? = null
-
- override fun resume(res: Result) {
- synchronized(mbox) {
- result = res
- mbox.notify()
- }
- }
-
- // Wait for the result (or throw an exception)
- fun await(timeoutMsecs: Long = 0): T {
- synchronized(mbox) {
- val startT = System.currentTimeMillis()
- while (result == null) {
- mbox.wait(timeoutMsecs)
-
- if (timeoutMsecs > 0 && ((System.currentTimeMillis() - startT) >= timeoutMsecs)) {
- throw Exception("SyncContinuation timeout")
- }
- }
-
- val r = result
- if (r != null) {
- return r.getOrThrow()
- } else {
- throw Exception("This shouldn't happen")
- }
- }
- }
-}
-
-/**
- * Calls an init function which is responsible for saving our continuation so that some
- * other thread can call resume or resume with exception.
- *
- * Essentially this is a blocking version of the (buggy) coroutine suspendCoroutine
- */
-fun suspend(timeoutMsecs: Long = -1, initfn: (SyncContinuation) -> Unit): T {
- val cont = SyncContinuation()
-
- // First call the init funct
- initfn(cont)
-
- // Now wait for the continuation to finish
- return cont.await(timeoutMsecs)
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/Converters.kt b/app/src/main/java/com/geeksville/mesh/database/Converters.kt
deleted file mode 100644
index 97ddf5d21..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/Converters.kt
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database
-
-import androidx.room.TypeConverter
-import com.geeksville.mesh.DataPacket
-import com.geeksville.mesh.MeshProtos
-import com.geeksville.mesh.PaxcountProtos
-import com.geeksville.mesh.TelemetryProtos
-import com.geeksville.mesh.android.Logging
-import com.google.protobuf.InvalidProtocolBufferException
-import kotlinx.serialization.json.Json
-
-@Suppress("TooManyFunctions")
-class Converters : Logging {
- @TypeConverter
- fun dataFromString(value: String): DataPacket {
- val json = Json { isLenient = true }
- return json.decodeFromString(DataPacket.serializer(), value)
- }
-
- @TypeConverter
- fun dataToString(value: DataPacket): String {
- val json = Json { isLenient = true }
- return json.encodeToString(DataPacket.serializer(), value)
- }
-
- @TypeConverter
- fun bytesToFromRadio(bytes: ByteArray): MeshProtos.FromRadio {
- return try {
- MeshProtos.FromRadio.parseFrom(bytes)
- } catch (ex: InvalidProtocolBufferException) {
- errormsg("bytesToFromRadio TypeConverter error:", ex)
- MeshProtos.FromRadio.getDefaultInstance()
- }
- }
-
- @TypeConverter
- fun fromRadioToBytes(value: MeshProtos.FromRadio): ByteArray? {
- return value.toByteArray()
- }
-
- @TypeConverter
- fun bytesToUser(bytes: ByteArray): MeshProtos.User {
- return try {
- MeshProtos.User.parseFrom(bytes)
- } catch (ex: InvalidProtocolBufferException) {
- errormsg("bytesToUser TypeConverter error:", ex)
- MeshProtos.User.getDefaultInstance()
- }
- }
-
- @TypeConverter
- fun userToBytes(value: MeshProtos.User): ByteArray? {
- return value.toByteArray()
- }
-
- @TypeConverter
- fun bytesToPosition(bytes: ByteArray): MeshProtos.Position {
- return try {
- MeshProtos.Position.parseFrom(bytes)
- } catch (ex: InvalidProtocolBufferException) {
- errormsg("bytesToPosition TypeConverter error:", ex)
- MeshProtos.Position.getDefaultInstance()
- }
- }
-
- @TypeConverter
- fun positionToBytes(value: MeshProtos.Position): ByteArray? {
- return value.toByteArray()
- }
-
- @TypeConverter
- fun bytesToTelemetry(bytes: ByteArray): TelemetryProtos.Telemetry {
- return try {
- TelemetryProtos.Telemetry.parseFrom(bytes)
- } catch (ex: InvalidProtocolBufferException) {
- errormsg("bytesToTelemetry TypeConverter error:", ex)
- TelemetryProtos.Telemetry.getDefaultInstance()
- }
- }
-
- @TypeConverter
- fun telemetryToBytes(value: TelemetryProtos.Telemetry): ByteArray? {
- return value.toByteArray()
- }
-
- @TypeConverter
- fun bytesToPaxcounter(bytes: ByteArray): PaxcountProtos.Paxcount {
- return try {
- PaxcountProtos.Paxcount.parseFrom(bytes)
- } catch (ex: InvalidProtocolBufferException) {
- errormsg("bytesToPaxcounter TypeConverter error:", ex)
- PaxcountProtos.Paxcount.getDefaultInstance()
- }
- }
-
- @TypeConverter
- fun paxCounterToBytes(value: PaxcountProtos.Paxcount): ByteArray? {
- return value.toByteArray()
- }
-
- @TypeConverter
- fun bytesToMetadata(bytes: ByteArray): MeshProtos.DeviceMetadata {
- return try {
- MeshProtos.DeviceMetadata.parseFrom(bytes)
- } catch (ex: InvalidProtocolBufferException) {
- errormsg("bytesToMetadata TypeConverter error:", ex)
- MeshProtos.DeviceMetadata.getDefaultInstance()
- }
- }
-
- @TypeConverter
- fun metadataToBytes(value: MeshProtos.DeviceMetadata): ByteArray? {
- return value.toByteArray()
- }
-
- @TypeConverter
- fun fromStringList(value: String?): List? {
- if (value == null) {
- return null
- }
- return Json.decodeFromString>(value)
- }
-
- @TypeConverter
- fun toStringList(list: List?): String? {
- if (list == null) {
- return null
- }
- return Json.encodeToString(list)
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/DatabaseModule.kt b/app/src/main/java/com/geeksville/mesh/database/DatabaseModule.kt
deleted file mode 100644
index db0ba1251..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/DatabaseModule.kt
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database
-
-import android.app.Application
-import com.geeksville.mesh.database.dao.DeviceHardwareDao
-import com.geeksville.mesh.database.dao.FirmwareReleaseDao
-import com.geeksville.mesh.database.dao.MeshLogDao
-import com.geeksville.mesh.database.dao.NodeInfoDao
-import com.geeksville.mesh.database.dao.PacketDao
-import com.geeksville.mesh.database.dao.QuickChatActionDao
-import dagger.Module
-import dagger.Provides
-import dagger.hilt.InstallIn
-import dagger.hilt.components.SingletonComponent
-import javax.inject.Singleton
-
-@InstallIn(SingletonComponent::class)
-@Module
-class DatabaseModule {
- @Provides
- @Singleton
- fun provideDatabase(app: Application): MeshtasticDatabase =
- MeshtasticDatabase.getDatabase(app)
-
- @Provides
- fun provideNodeInfoDao(database: MeshtasticDatabase): NodeInfoDao {
- return database.nodeInfoDao()
- }
-
- @Provides
- fun providePacketDao(database: MeshtasticDatabase): PacketDao {
- return database.packetDao()
- }
-
- @Provides
- fun provideMeshLogDao(database: MeshtasticDatabase): MeshLogDao {
- return database.meshLogDao()
- }
-
- @Provides
- fun provideQuickChatActionDao(database: MeshtasticDatabase): QuickChatActionDao {
- return database.quickChatActionDao()
- }
-
- @Provides
- fun provideDeviceHardwareDao(database: MeshtasticDatabase): DeviceHardwareDao {
- return database.deviceHardwareDao()
- }
-
- @Provides
- fun provideFirmwareReleaseDao(database: MeshtasticDatabase): FirmwareReleaseDao {
- return database.firmwareReleaseDao()
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/MeshLogRepository.kt b/app/src/main/java/com/geeksville/mesh/database/MeshLogRepository.kt
deleted file mode 100644
index 71d32892d..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/MeshLogRepository.kt
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database
-
-import com.geeksville.mesh.CoroutineDispatchers
-import com.geeksville.mesh.MeshProtos.MeshPacket
-import com.geeksville.mesh.Portnums
-import com.geeksville.mesh.TelemetryProtos.Telemetry
-import com.geeksville.mesh.database.dao.MeshLogDao
-import com.geeksville.mesh.database.entity.MeshLog
-import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.conflate
-import kotlinx.coroutines.flow.distinctUntilChanged
-import kotlinx.coroutines.flow.flowOn
-import kotlinx.coroutines.flow.mapLatest
-import kotlinx.coroutines.withContext
-import javax.inject.Inject
-
-class MeshLogRepository @Inject constructor(
- private val meshLogDaoLazy: dagger.Lazy,
- private val dispatchers: CoroutineDispatchers,
-) {
- private val meshLogDao by lazy {
- meshLogDaoLazy.get()
- }
-
- fun getAllLogs(maxItems: Int = MAX_ITEMS): Flow> = meshLogDao.getAllLogs(maxItems)
- .flowOn(dispatchers.io)
- .conflate()
-
- fun getAllLogsInReceiveOrder(maxItems: Int = MAX_ITEMS): Flow> =
- meshLogDao.getAllLogsInReceiveOrder(maxItems)
- .flowOn(dispatchers.io)
- .conflate()
-
- private fun parseTelemetryLog(log: MeshLog): Telemetry? = runCatching {
- Telemetry.parseFrom(log.fromRadio.packet.decoded.payload)
- .toBuilder().setTime((log.received_date / MILLIS_TO_SECONDS).toInt()).build()
- }.getOrNull()
-
- fun getTelemetryFrom(nodeNum: Int): Flow> =
- meshLogDao.getLogsFrom(nodeNum, Portnums.PortNum.TELEMETRY_APP_VALUE, MAX_MESH_PACKETS)
- .distinctUntilChanged()
- .mapLatest { list -> list.mapNotNull(::parseTelemetryLog) }
- .flowOn(dispatchers.io)
-
- fun getLogsFrom(
- nodeNum: Int,
- portNum: Int = Portnums.PortNum.UNKNOWN_APP_VALUE,
- maxItem: Int = MAX_MESH_PACKETS,
- ): Flow> = meshLogDao.getLogsFrom(nodeNum, portNum, maxItem)
- .distinctUntilChanged()
- .flowOn(dispatchers.io)
-
- /*
- * Retrieves MeshPackets matching 'nodeNum' and 'portNum'.
- * If 'portNum' is not specified, returns all MeshPackets. Otherwise, filters by 'portNum'.
- */
- fun getMeshPacketsFrom(
- nodeNum: Int,
- portNum: Int = Portnums.PortNum.UNKNOWN_APP_VALUE,
- ): Flow> = getLogsFrom(nodeNum, portNum)
- .mapLatest { list -> list.map { it.fromRadio.packet } }
- .flowOn(dispatchers.io)
-
- suspend fun insert(log: MeshLog) = withContext(dispatchers.io) {
- meshLogDao.insert(log)
- }
-
- suspend fun deleteAll() = withContext(dispatchers.io) {
- meshLogDao.deleteAll()
- }
-
- suspend fun deleteLog(uuid: String) = withContext(dispatchers.io) {
- meshLogDao.deleteLog(uuid)
- }
-
- suspend fun deleteLogs(nodeNum: Int, portNum: Int) = withContext(dispatchers.io) {
- meshLogDao.deleteLogs(nodeNum, portNum)
- }
-
- companion object {
- private const val MAX_ITEMS = 500
- private const val MAX_MESH_PACKETS = 10000
- private const val MILLIS_TO_SECONDS = 1000
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/MeshtasticDatabase.kt b/app/src/main/java/com/geeksville/mesh/database/MeshtasticDatabase.kt
deleted file mode 100644
index 740f0711d..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/MeshtasticDatabase.kt
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database
-
-import android.content.Context
-import androidx.room.AutoMigration
-import androidx.room.Database
-import androidx.room.DeleteTable
-import androidx.room.Room
-import androidx.room.RoomDatabase
-import androidx.room.TypeConverters
-import androidx.room.migration.AutoMigrationSpec
-import com.geeksville.mesh.database.dao.DeviceHardwareDao
-import com.geeksville.mesh.database.dao.FirmwareReleaseDao
-import com.geeksville.mesh.database.dao.MeshLogDao
-import com.geeksville.mesh.database.dao.NodeInfoDao
-import com.geeksville.mesh.database.dao.PacketDao
-import com.geeksville.mesh.database.dao.QuickChatActionDao
-import com.geeksville.mesh.database.entity.ContactSettings
-import com.geeksville.mesh.database.entity.DeviceHardwareEntity
-import com.geeksville.mesh.database.entity.FirmwareReleaseEntity
-import com.geeksville.mesh.database.entity.MeshLog
-import com.geeksville.mesh.database.entity.MetadataEntity
-import com.geeksville.mesh.database.entity.MyNodeEntity
-import com.geeksville.mesh.database.entity.NodeEntity
-import com.geeksville.mesh.database.entity.Packet
-import com.geeksville.mesh.database.entity.QuickChatAction
-import com.geeksville.mesh.database.entity.ReactionEntity
-
-@Database(
- entities = [
- MyNodeEntity::class,
- NodeEntity::class,
- Packet::class,
- ContactSettings::class,
- MeshLog::class,
- QuickChatAction::class,
- ReactionEntity::class,
- MetadataEntity::class,
- DeviceHardwareEntity::class,
- FirmwareReleaseEntity::class,
- ],
- autoMigrations = [
- AutoMigration(from = 3, to = 4),
- AutoMigration(from = 4, to = 5),
- AutoMigration(from = 5, to = 6),
- AutoMigration(from = 6, to = 7),
- AutoMigration(from = 7, to = 8),
- AutoMigration(from = 8, to = 9),
- AutoMigration(from = 9, to = 10),
- AutoMigration(from = 10, to = 11),
- AutoMigration(from = 11, to = 12),
- AutoMigration(from = 12, to = 13, spec = AutoMigration12to13::class),
- AutoMigration(from = 13, to = 14),
- AutoMigration(from = 14, to = 15),
- AutoMigration(from = 15, to = 16),
- AutoMigration(from = 16, to = 17),
- ],
- version = 17,
- exportSchema = true,
-)
-@TypeConverters(Converters::class)
-abstract class MeshtasticDatabase : RoomDatabase() {
- abstract fun nodeInfoDao(): NodeInfoDao
- abstract fun packetDao(): PacketDao
- abstract fun meshLogDao(): MeshLogDao
- abstract fun quickChatActionDao(): QuickChatActionDao
- abstract fun deviceHardwareDao(): DeviceHardwareDao
- abstract fun firmwareReleaseDao(): FirmwareReleaseDao
-
- companion object {
- fun getDatabase(context: Context): MeshtasticDatabase {
-
- return Room.databaseBuilder(
- context.applicationContext,
- MeshtasticDatabase::class.java,
- "meshtastic_database"
- )
- .fallbackToDestructiveMigration(false)
- .build()
- }
- }
-}
-
-@DeleteTable.Entries(
- DeleteTable(tableName = "NodeInfo"),
- DeleteTable(tableName = "MyNodeInfo")
-)
-class AutoMigration12to13 : AutoMigrationSpec
diff --git a/app/src/main/java/com/geeksville/mesh/database/NodeRepository.kt b/app/src/main/java/com/geeksville/mesh/database/NodeRepository.kt
deleted file mode 100644
index d975117ec..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/NodeRepository.kt
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database
-
-import androidx.lifecycle.Lifecycle
-import androidx.lifecycle.coroutineScope
-import com.geeksville.mesh.CoroutineDispatchers
-import com.geeksville.mesh.DataPacket
-import com.geeksville.mesh.MeshProtos
-import com.geeksville.mesh.database.dao.NodeInfoDao
-import com.geeksville.mesh.database.entity.MetadataEntity
-import com.geeksville.mesh.database.entity.MyNodeEntity
-import com.geeksville.mesh.database.entity.NodeEntity
-import com.geeksville.mesh.model.Node
-import com.geeksville.mesh.model.NodeSortOption
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.SharingStarted
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.conflate
-import kotlinx.coroutines.flow.flowOn
-import kotlinx.coroutines.flow.map
-import kotlinx.coroutines.flow.mapLatest
-import kotlinx.coroutines.flow.onEach
-import kotlinx.coroutines.flow.stateIn
-import kotlinx.coroutines.withContext
-import javax.inject.Inject
-import javax.inject.Singleton
-
-@Singleton
-class NodeRepository @Inject constructor(
- processLifecycle: Lifecycle,
- private val nodeInfoDao: NodeInfoDao,
- private val dispatchers: CoroutineDispatchers,
-) {
- // hardware info about our local device (can be null)
- val myNodeInfo: StateFlow = nodeInfoDao.getMyNodeInfo()
- .flowOn(dispatchers.io)
- .stateIn(processLifecycle.coroutineScope, SharingStarted.Eagerly, null)
-
- // our node info
- private val _ourNodeInfo = MutableStateFlow(null)
- val ourNodeInfo: StateFlow get() = _ourNodeInfo
-
- // The unique userId of our node
- private val _myId = MutableStateFlow(null)
- val myId: StateFlow get() = _myId
-
- fun getNodeDBbyNum() = nodeInfoDao.nodeDBbyNum()
- .map { map -> map.mapValues { (_, it) -> it.toEntity() } }
-
- // A map from nodeNum to Node
- val nodeDBbyNum: StateFlow> = nodeInfoDao.nodeDBbyNum()
- .mapLatest { map -> map.mapValues { (_, it) -> it.toModel() } }
- .onEach {
- val ourNodeInfo = it.values.firstOrNull()
- _ourNodeInfo.value = ourNodeInfo
- _myId.value = ourNodeInfo?.user?.id
- }
- .flowOn(dispatchers.io)
- .conflate()
- .stateIn(processLifecycle.coroutineScope, SharingStarted.Eagerly, emptyMap())
-
- fun getNode(userId: String): Node = nodeDBbyNum.value.values.find { it.user.id == userId }
- ?: Node(
- num = DataPacket.idToDefaultNodeNum(userId) ?: 0,
- user = getUser(userId),
- )
-
- fun getUser(nodeNum: Int): MeshProtos.User = getUser(DataPacket.nodeNumToDefaultId(nodeNum))
-
- fun getUser(userId: String): MeshProtos.User =
- nodeDBbyNum.value.values.find { it.user.id == userId }?.user
- ?: MeshProtos.User.newBuilder()
- .setId(userId)
- .setLongName("Meshtastic ${userId.takeLast(n = 4)}")
- .setShortName(userId.takeLast(n = 4))
- .setHwModel(MeshProtos.HardwareModel.UNSET)
- .build()
-
- fun getNodes(
- sort: NodeSortOption = NodeSortOption.LAST_HEARD,
- filter: String = "",
- includeUnknown: Boolean = true,
- ) = nodeInfoDao.getNodes(
- sort = sort.sqlValue,
- filter = filter,
- includeUnknown = includeUnknown,
- ).mapLatest { list ->
- list.map {
- it.toModel()
- }
- }.flowOn(dispatchers.io).conflate()
-
- suspend fun upsert(node: NodeEntity) = withContext(dispatchers.io) {
- nodeInfoDao.upsert(node)
- }
-
- suspend fun installNodeDB(mi: MyNodeEntity, nodes: List) = withContext(dispatchers.io) {
- val isDifferentNode = myNodeInfo.value?.myNodeNum != mi.myNodeNum
- nodeInfoDao.clearMyNodeInfo()
- nodeInfoDao.setMyNodeInfo(mi) // set MyNodeEntity first
- if (isDifferentNode) {
- nodeInfoDao.clearNodeInfo()
- }
- nodeInfoDao.putAll(nodes)
- }
-
- suspend fun clearNodeDB() = withContext(dispatchers.io) {
- nodeInfoDao.clearNodeInfo()
- }
-
- suspend fun deleteNode(num: Int) = withContext(dispatchers.io) {
- nodeInfoDao.deleteNode(num)
- nodeInfoDao.deleteMetadata(num)
- }
-
- suspend fun insertMetadata(metadata: MetadataEntity) = withContext(dispatchers.io) {
- nodeInfoDao.upsert(metadata)
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/PacketRepository.kt b/app/src/main/java/com/geeksville/mesh/database/PacketRepository.kt
deleted file mode 100644
index 78a2f9a2c..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/PacketRepository.kt
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database
-
-import com.geeksville.mesh.DataPacket
-import com.geeksville.mesh.MessageStatus
-import com.geeksville.mesh.Portnums.PortNum
-import com.geeksville.mesh.database.dao.PacketDao
-import com.geeksville.mesh.database.entity.ContactSettings
-import com.geeksville.mesh.database.entity.Packet
-import com.geeksville.mesh.database.entity.ReactionEntity
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.withContext
-import javax.inject.Inject
-
-class PacketRepository @Inject constructor(private val packetDaoLazy: dagger.Lazy) {
- private val packetDao by lazy {
- packetDaoLazy.get()
- }
-
- fun getWaypoints(): Flow> = packetDao.getAllPackets(PortNum.WAYPOINT_APP_VALUE)
-
- fun getContacts(): Flow> = packetDao.getContactKeys()
-
- suspend fun getMessageCount(contact: String): Int = withContext(Dispatchers.IO) {
- packetDao.getMessageCount(contact)
- }
-
- suspend fun getUnreadCount(contact: String): Int = withContext(Dispatchers.IO) {
- packetDao.getUnreadCount(contact)
- }
-
- suspend fun clearUnreadCount(contact: String, timestamp: Long) = withContext(Dispatchers.IO) {
- packetDao.clearUnreadCount(contact, timestamp)
- }
-
- suspend fun getQueuedPackets(): List? = withContext(Dispatchers.IO) {
- packetDao.getQueuedPackets()
- }
-
- suspend fun insert(packet: Packet) = withContext(Dispatchers.IO) {
- packetDao.insert(packet)
- }
-
- fun getMessagesFrom(contact: String) = packetDao.getMessagesFrom(contact)
-
- suspend fun updateMessageStatus(d: DataPacket, m: MessageStatus) = withContext(Dispatchers.IO) {
- packetDao.updateMessageStatus(d, m)
- }
-
- suspend fun updateMessageId(d: DataPacket, id: Int) = withContext(Dispatchers.IO) {
- packetDao.updateMessageId(d, id)
- }
-
- suspend fun getPacketById(requestId: Int) = withContext(Dispatchers.IO) {
- packetDao.getPacketById(requestId)
- }
-
- suspend fun deleteMessages(uuidList: List) = withContext(Dispatchers.IO) {
- for (chunk in uuidList.chunked(500)) { // limit number of UUIDs per query
- packetDao.deleteMessages(chunk)
- }
- }
-
- suspend fun deleteContacts(contactList: List) = withContext(Dispatchers.IO) {
- packetDao.deleteContacts(contactList)
- }
-
- suspend fun deleteWaypoint(id: Int) = withContext(Dispatchers.IO) {
- packetDao.deleteWaypoint(id)
- }
-
- suspend fun delete(packet: Packet) = withContext(Dispatchers.IO) {
- packetDao.delete(packet)
- }
-
- suspend fun update(packet: Packet) = withContext(Dispatchers.IO) {
- packetDao.update(packet)
- }
-
- fun getContactSettings(): Flow> = packetDao.getContactSettings()
-
- suspend fun getContactSettings(contact: String) = withContext(Dispatchers.IO) {
- packetDao.getContactSettings(contact) ?: ContactSettings(contact)
- }
-
- suspend fun setMuteUntil(contacts: List, until: Long) = withContext(Dispatchers.IO) {
- packetDao.setMuteUntil(contacts, until)
- }
-
- suspend fun insertReaction(reaction: ReactionEntity) = withContext(Dispatchers.IO) {
- packetDao.insert(reaction)
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/QuickChatActionRepository.kt b/app/src/main/java/com/geeksville/mesh/database/QuickChatActionRepository.kt
deleted file mode 100644
index 2f60898af..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/QuickChatActionRepository.kt
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database
-
-import com.geeksville.mesh.CoroutineDispatchers
-import com.geeksville.mesh.database.dao.QuickChatActionDao
-import com.geeksville.mesh.database.entity.QuickChatAction
-import kotlinx.coroutines.flow.flowOn
-import kotlinx.coroutines.withContext
-import javax.inject.Inject
-
-class QuickChatActionRepository @Inject constructor(
- private val quickChatDaoLazy: dagger.Lazy,
- private val dispatchers: CoroutineDispatchers,
-) {
- private val quickChatActionDao by lazy {
- quickChatDaoLazy.get()
- }
-
- fun getAllActions() = quickChatActionDao.getAll().flowOn(dispatchers.io)
-
- suspend fun upsert(action: QuickChatAction) = withContext(dispatchers.io) {
- quickChatActionDao.upsert(action)
- }
-
- suspend fun deleteAll() = withContext(dispatchers.io) {
- quickChatActionDao.deleteAll()
- }
-
- suspend fun delete(action: QuickChatAction) = withContext(dispatchers.io) {
- quickChatActionDao.delete(action)
- }
-
- suspend fun setItemPosition(uuid: Long, newPos: Int) = withContext(dispatchers.io) {
- quickChatActionDao.updateActionPosition(uuid, newPos)
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/database/dao/NodeInfoDao.kt b/app/src/main/java/com/geeksville/mesh/database/dao/NodeInfoDao.kt
deleted file mode 100644
index 3dd438a94..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/dao/NodeInfoDao.kt
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database.dao
-
-import androidx.room.Dao
-import androidx.room.Insert
-import androidx.room.MapColumn
-import androidx.room.OnConflictStrategy
-import androidx.room.Query
-import androidx.room.Transaction
-import androidx.room.Upsert
-import com.geeksville.mesh.android.BuildUtils.warn
-import com.geeksville.mesh.copy
-import com.geeksville.mesh.database.entity.MetadataEntity
-import com.geeksville.mesh.database.entity.MyNodeEntity
-import com.geeksville.mesh.database.entity.NodeEntity
-import com.geeksville.mesh.database.entity.NodeWithRelations
-import kotlinx.coroutines.flow.Flow
-
-@Suppress("TooManyFunctions")
-@Dao
-interface NodeInfoDao {
-
- @Query("SELECT * FROM my_node")
- fun getMyNodeInfo(): Flow
-
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- fun setMyNodeInfo(myInfo: MyNodeEntity)
-
- @Query("DELETE FROM my_node")
- fun clearMyNodeInfo()
-
- @Query(
- """
- SELECT * FROM nodes
- ORDER BY CASE
- WHEN num = (SELECT myNodeNum FROM my_node LIMIT 1) THEN 0
- ELSE 1
- END,
- last_heard DESC
- """
- )
- @Transaction
- fun nodeDBbyNum(): Flow>
-
- @Query(
- """
- WITH OurNode AS (
- SELECT latitude, longitude
- FROM nodes
- WHERE num = (SELECT myNodeNum FROM my_node LIMIT 1)
- )
- SELECT * FROM nodes
- WHERE (:includeUnknown = 1 OR short_name IS NOT NULL)
- AND (:filter = ''
- OR (long_name LIKE '%' || :filter || '%'
- OR short_name LIKE '%' || :filter || '%'))
- ORDER BY CASE
- WHEN num = (SELECT myNodeNum FROM my_node LIMIT 1) THEN 0
- ELSE 1
- END,
- CASE
- WHEN :sort = 'last_heard' THEN last_heard * -1
- WHEN :sort = 'alpha' THEN UPPER(long_name)
- WHEN :sort = 'distance' THEN
- CASE
- WHEN latitude IS NULL OR longitude IS NULL OR
- (latitude = 0.0 AND longitude = 0.0) THEN 999999999
- ELSE
- (latitude - (SELECT latitude FROM OurNode)) *
- (latitude - (SELECT latitude FROM OurNode)) +
- (longitude - (SELECT longitude FROM OurNode)) *
- (longitude - (SELECT longitude FROM OurNode))
- END
- WHEN :sort = 'hops_away' THEN
- CASE
- WHEN hops_away = -1 THEN 999999999
- ELSE hops_away
- END
- WHEN :sort = 'channel' THEN channel
- WHEN :sort = 'via_mqtt' THEN via_mqtt
- WHEN :sort = 'via_favorite' THEN is_favorite * -1
- ELSE 0
- END ASC,
- last_heard DESC
- """
- )
- @Transaction
- fun getNodes(
- sort: String,
- filter: String,
- includeUnknown: Boolean,
- ): Flow>
-
- @Upsert
- fun upsert(node: NodeEntity) {
- val found = getNodeByNum(node.num)?.node
- found?.let {
- val keyMatch = !it.hasPKC || it.user.publicKey == node.user.publicKey
- it.user = if (keyMatch) {
- node.user
- } else {
- node.user.copy {
- warn("Public key mismatch from $longName ($shortName)")
- publicKey = NodeEntity.ERROR_BYTE_STRING
- }
- }
- }
- doUpsert(node)
- }
-
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- fun putAll(nodes: List) {
- nodes.forEach { node ->
- val found = getNodeByNum(node.num)?.node
- found?.let {
- val keyMatch = !it.hasPKC || it.user.publicKey == node.user.publicKey
- it.user = if (keyMatch) {
- node.user
- } else {
- node.user.copy {
- warn("Public key mismatch from $longName ($shortName)")
- publicKey = NodeEntity.ERROR_BYTE_STRING
- }
- }
- }
- }
- doPutAll(nodes)
- }
-
- @Query("DELETE FROM nodes")
- fun clearNodeInfo()
-
- @Query("DELETE FROM nodes WHERE num=:num")
- fun deleteNode(num: Int)
-
- @Upsert
- fun upsert(meta: MetadataEntity)
-
- @Query("DELETE FROM metadata WHERE num=:num")
- fun deleteMetadata(num: Int)
-
- @Query("SELECT * FROM nodes WHERE num=:num")
- @Transaction
- fun getNodeByNum(num: Int): NodeWithRelations?
-
- @Upsert
- fun doUpsert(node: NodeEntity)
-
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- fun doPutAll(nodes: List)
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/dao/PacketDao.kt b/app/src/main/java/com/geeksville/mesh/database/dao/PacketDao.kt
deleted file mode 100644
index 717d53b22..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/dao/PacketDao.kt
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database.dao
-
-import androidx.room.Dao
-import androidx.room.MapColumn
-import androidx.room.Update
-import androidx.room.Query
-import androidx.room.Transaction
-import androidx.room.Upsert
-import com.geeksville.mesh.DataPacket
-import com.geeksville.mesh.MessageStatus
-import com.geeksville.mesh.database.entity.ContactSettings
-import com.geeksville.mesh.database.entity.PacketEntity
-import com.geeksville.mesh.database.entity.Packet
-import com.geeksville.mesh.database.entity.ReactionEntity
-import kotlinx.coroutines.flow.Flow
-
-@Dao
-interface PacketDao {
-
- @Query(
- """
- SELECT * FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND port_num = :portNum
- ORDER BY received_time ASC
- """
- )
- fun getAllPackets(portNum: Int): Flow>
-
- @Query(
- """
- SELECT * FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND port_num = 1
- ORDER BY received_time DESC
- """
- )
- fun getContactKeys(): Flow>
-
- @Query(
- """
- SELECT COUNT(*) FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND port_num = 1 AND contact_key = :contact
- """
- )
- suspend fun getMessageCount(contact: String): Int
-
- @Query(
- """
- SELECT COUNT(*) FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND port_num = 1 AND contact_key = :contact AND read = 0
- """
- )
- suspend fun getUnreadCount(contact: String): Int
-
- @Query(
- """
- UPDATE packet
- SET read = 1
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND port_num = 1 AND contact_key = :contact AND read = 0 AND received_time <= :timestamp
- """
- )
- suspend fun clearUnreadCount(contact: String, timestamp: Long)
-
- @Upsert
- suspend fun insert(packet: Packet)
-
- @Query(
- """
- SELECT * FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND port_num = 1 AND contact_key = :contact
- ORDER BY received_time DESC
- """
- )
- @Transaction
- fun getMessagesFrom(contact: String): Flow>
-
- @Query(
- """
- SELECT * FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND data = :data
- """
- )
- suspend fun findDataPacket(data: DataPacket): Packet?
-
- @Query("DELETE FROM packet WHERE uuid in (:uuidList)")
- suspend fun deletePackets(uuidList: List)
-
- @Query(
- """
- DELETE FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND contact_key IN (:contactList)
- """
- )
- suspend fun deleteContacts(contactList: List)
-
- @Query("DELETE FROM packet WHERE uuid=:uuid")
- suspend fun _delete(uuid: Long)
-
- @Transaction
- suspend fun delete(packet: Packet) {
- _delete(packet.uuid)
- }
-
- @Query("SELECT packet_id FROM packet WHERE uuid IN (:uuidList)")
- suspend fun getPacketIdsFrom(uuidList: List): List
-
- @Query("DELETE FROM reactions WHERE reply_id IN (:packetIds)")
- suspend fun deleteReactions(packetIds: List)
-
- @Transaction
- suspend fun deleteMessages(uuidList: List) {
- val packetIds = getPacketIdsFrom(uuidList)
- if (packetIds.isNotEmpty()) {
- deleteReactions(packetIds)
- }
- deletePackets(uuidList)
- }
-
- @Update
- suspend fun update(packet: Packet)
-
- @Transaction
- suspend fun updateMessageStatus(data: DataPacket, m: MessageStatus) {
- val new = data.copy(status = m)
- findDataPacket(data)?.let { update(it.copy(data = new)) }
- }
-
- @Transaction
- suspend fun updateMessageId(data: DataPacket, id: Int) {
- val new = data.copy(id = id)
- findDataPacket(data)?.let { update(it.copy(data = new)) }
- }
-
- @Query(
- """
- SELECT data FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- ORDER BY received_time ASC
- """
- )
- suspend fun getDataPackets(): List
-
- @Query(
- """
- SELECT * FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND packet_id = :requestId
- ORDER BY received_time DESC
- """
- )
- suspend fun getPacketById(requestId: Int): Packet?
-
- @Transaction
- suspend fun getQueuedPackets(): List? =
- getDataPackets().filter { it.status == MessageStatus.QUEUED }
-
- @Query(
- """
- SELECT * FROM packet
- WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
- AND port_num = 8
- ORDER BY received_time ASC
- """
- )
- suspend fun getAllWaypoints(): List
-
- @Transaction
- suspend fun deleteWaypoint(id: Int) {
- val uuidList = getAllWaypoints().filter { it.data.waypoint?.id == id }.map { it.uuid }
- deleteMessages(uuidList)
- }
-
- @Query("SELECT * FROM contact_settings")
- fun getContactSettings(): Flow>
-
- @Query("SELECT * FROM contact_settings WHERE contact_key = :contact")
- suspend fun getContactSettings(contact: String): ContactSettings?
-
- @Upsert
- suspend fun upsertContactSettings(contacts: List)
-
- @Transaction
- suspend fun setMuteUntil(contacts: List, until: Long) {
- val contactList = contacts.map { contact ->
- getContactSettings(contact)?.copy(muteUntil = until)
- ?: ContactSettings(contact_key = contact, muteUntil = until)
- }
- upsertContactSettings(contactList)
- }
-
- @Upsert
- suspend fun insert(reaction: ReactionEntity)
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/entity/MeshLog.kt b/app/src/main/java/com/geeksville/mesh/database/entity/MeshLog.kt
deleted file mode 100644
index 870e3b642..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/entity/MeshLog.kt
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database.entity
-
-import androidx.room.ColumnInfo
-import androidx.room.Entity
-import androidx.room.Index
-import androidx.room.PrimaryKey
-import com.geeksville.mesh.MeshProtos
-import com.geeksville.mesh.MeshProtos.FromRadio
-import com.geeksville.mesh.Portnums
-import com.google.protobuf.TextFormat
-import java.io.IOException
-
-@Entity(
- tableName = "log",
- indices = [
- Index(value = ["from_num"]),
- Index(value = ["port_num"]),
- ],
-)
-data class MeshLog(
- @PrimaryKey val uuid: String,
- @ColumnInfo(name = "type") val message_type: String,
- @ColumnInfo(name = "received_date") val received_date: Long,
- @ColumnInfo(name = "message") val raw_message: String,
- @ColumnInfo(name = "from_num", defaultValue = "0") val fromNum: Int = 0,
- @ColumnInfo(name = "port_num", defaultValue = "0") val portNum: Int = 0,
- @ColumnInfo(name = "from_radio", typeAffinity = ColumnInfo.BLOB, defaultValue = "x''")
- val fromRadio: FromRadio = FromRadio.getDefaultInstance(),
-) {
-
- val meshPacket: MeshProtos.MeshPacket?
- get() {
- if (message_type == "Packet") {
- val builder = MeshProtos.MeshPacket.newBuilder()
- try {
- TextFormat.getParser().merge(raw_message, builder)
- return builder.build()
- } catch (e: IOException) {
- }
- }
- return null
- }
-
- val nodeInfo: MeshProtos.NodeInfo?
- get() {
- if (message_type == "NodeInfo") {
- val builder = MeshProtos.NodeInfo.newBuilder()
- try {
- TextFormat.getParser().merge(raw_message, builder)
- return builder.build()
- } catch (e: IOException) {
- }
- }
- return null
- }
-
- val myNodeInfo: MeshProtos.MyNodeInfo?
- get() {
- if (message_type == "MyNodeInfo") {
- val builder = MeshProtos.MyNodeInfo.newBuilder()
- try {
- TextFormat.getParser().merge(raw_message, builder)
- return builder.build()
- } catch (e: IOException) {
- }
- }
- return null
- }
-
- val position: MeshProtos.Position?
- get() {
- return meshPacket?.run {
- if (hasDecoded() && decoded.portnumValue == Portnums.PortNum.POSITION_APP_VALUE) {
- return MeshProtos.Position.parseFrom(decoded.payload)
- }
- return null
- } ?: nodeInfo?.position
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/entity/NodeEntity.kt b/app/src/main/java/com/geeksville/mesh/database/entity/NodeEntity.kt
deleted file mode 100644
index 5a04f5076..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/entity/NodeEntity.kt
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database.entity
-
-import androidx.room.ColumnInfo
-import androidx.room.Embedded
-import androidx.room.Entity
-import androidx.room.Index
-import androidx.room.PrimaryKey
-import androidx.room.Relation
-import com.geeksville.mesh.DeviceMetrics
-import com.geeksville.mesh.EnvironmentMetrics
-import com.geeksville.mesh.MeshProtos
-import com.geeksville.mesh.MeshUser
-import com.geeksville.mesh.NodeInfo
-import com.geeksville.mesh.PaxcountProtos
-import com.geeksville.mesh.Position
-import com.geeksville.mesh.TelemetryProtos
-import com.geeksville.mesh.copy
-import com.geeksville.mesh.model.Node
-import com.google.protobuf.ByteString
-
-data class NodeWithRelations(
- @Embedded val node: NodeEntity,
- @Relation(entity = MetadataEntity::class, parentColumn = "num", entityColumn = "num")
- val metadata: MetadataEntity? = null,
-) {
- fun toModel() = with(node) {
- Node(
- num = num,
- metadata = metadata?.proto,
- user = user,
- position = position,
- snr = snr,
- rssi = rssi,
- lastHeard = lastHeard,
- deviceMetrics = deviceTelemetry.deviceMetrics,
- channel = channel,
- viaMqtt = viaMqtt,
- hopsAway = hopsAway,
- isFavorite = isFavorite,
- isIgnored = isIgnored,
- environmentMetrics = environmentTelemetry.environmentMetrics,
- powerMetrics = powerTelemetry.powerMetrics,
- paxcounter = paxcounter,
- )
- }
-
- fun toEntity() = with(node) {
- NodeEntity(
- num = num,
- user = user,
- position = position,
- snr = snr,
- rssi = rssi,
- lastHeard = lastHeard,
- deviceTelemetry = deviceTelemetry,
- channel = channel,
- viaMqtt = viaMqtt,
- hopsAway = hopsAway,
- isFavorite = isFavorite,
- isIgnored = isIgnored,
- environmentTelemetry = environmentTelemetry,
- powerTelemetry = powerTelemetry,
- paxcounter = paxcounter,
- )
- }
-}
-
-@Entity(
- tableName = "metadata",
- indices = [
- Index(value = ["num"]),
- ],
-)
-data class MetadataEntity(
- @PrimaryKey val num: Int,
- @ColumnInfo(name = "proto", typeAffinity = ColumnInfo.BLOB)
- val proto: MeshProtos.DeviceMetadata,
- val timestamp: Long = System.currentTimeMillis(),
-)
-
-@Suppress("MagicNumber")
-@Entity(tableName = "nodes")
-data class NodeEntity(
- @PrimaryKey(autoGenerate = false)
- val num: Int, // This is immutable, and used as a key
-
- @ColumnInfo(typeAffinity = ColumnInfo.BLOB)
- var user: MeshProtos.User = MeshProtos.User.getDefaultInstance(),
- @ColumnInfo(name = "long_name") var longName: String? = null,
- @ColumnInfo(name = "short_name") var shortName: String? = null, // used in includeUnknown filter
-
- @ColumnInfo(typeAffinity = ColumnInfo.BLOB)
- var position: MeshProtos.Position = MeshProtos.Position.getDefaultInstance(),
- var latitude: Double = 0.0,
- var longitude: Double = 0.0,
-
- var snr: Float = Float.MAX_VALUE,
- var rssi: Int = Int.MAX_VALUE,
-
- @ColumnInfo(name = "last_heard")
- var lastHeard: Int = 0, // the last time we've seen this node in secs since 1970
-
- @ColumnInfo(name = "device_metrics", typeAffinity = ColumnInfo.BLOB)
- var deviceTelemetry: TelemetryProtos.Telemetry = TelemetryProtos.Telemetry.getDefaultInstance(),
-
- var channel: Int = 0,
-
- @ColumnInfo(name = "via_mqtt")
- var viaMqtt: Boolean = false,
-
- @ColumnInfo(name = "hops_away")
- var hopsAway: Int = -1,
-
- @ColumnInfo(name = "is_favorite")
- var isFavorite: Boolean = false,
-
- @ColumnInfo(name = "is_ignored", defaultValue = "0")
- var isIgnored: Boolean = false,
-
- @ColumnInfo(name = "environment_metrics", typeAffinity = ColumnInfo.BLOB)
- var environmentTelemetry: TelemetryProtos.Telemetry = TelemetryProtos.Telemetry.getDefaultInstance(),
-
- @ColumnInfo(name = "power_metrics", typeAffinity = ColumnInfo.BLOB)
- var powerTelemetry: TelemetryProtos.Telemetry = TelemetryProtos.Telemetry.getDefaultInstance(),
-
- @ColumnInfo(typeAffinity = ColumnInfo.BLOB)
- var paxcounter: PaxcountProtos.Paxcount = PaxcountProtos.Paxcount.getDefaultInstance(),
-) {
- val deviceMetrics: TelemetryProtos.DeviceMetrics
- get() = deviceTelemetry.deviceMetrics
-
- val environmentMetrics: TelemetryProtos.EnvironmentMetrics
- get() = environmentTelemetry.environmentMetrics
-
- val isUnknownUser get() = user.hwModel == MeshProtos.HardwareModel.UNSET
- val hasPKC get() = !user.publicKey.isEmpty
- val errorByteString: ByteString get() = ERROR_BYTE_STRING
-
- fun setPosition(p: MeshProtos.Position, defaultTime: Int = currentTime()) {
- position = p.copy { time = if (p.time != 0) p.time else defaultTime }
- latitude = degD(p.latitudeI)
- longitude = degD(p.longitudeI)
- }
-
- /**
- * true if the device was heard from recently
- */
- val isOnline: Boolean
- get() {
- val now = System.currentTimeMillis() / 1000
- val timeout = 2 * 60 * 60
- return (now - lastHeard <= timeout)
- }
-
- companion object {
- // Convert to a double representation of degrees
- fun degD(i: Int) = i * 1e-7
- fun degI(d: Double) = (d * 1e7).toInt()
-
- val ERROR_BYTE_STRING: ByteString = ByteString.copyFrom(ByteArray(32) { 0 })
- fun currentTime() = (System.currentTimeMillis() / 1000).toInt()
- }
-
- fun toNodeInfo() = NodeInfo(
- num = num,
- user = MeshUser(
- id = user.id,
- longName = user.longName,
- shortName = user.shortName,
- hwModel = user.hwModel,
- role = user.roleValue,
- ).takeIf { user.id.isNotEmpty() },
- position = Position(
- latitude = latitude,
- longitude = longitude,
- altitude = position.altitude,
- time = position.time,
- satellitesInView = position.satsInView,
- groundSpeed = position.groundSpeed,
- groundTrack = position.groundTrack,
- precisionBits = position.precisionBits,
- ).takeIf { it.isValid() },
- snr = snr,
- rssi = rssi,
- lastHeard = lastHeard,
- deviceMetrics = DeviceMetrics(
- time = deviceTelemetry.time,
- batteryLevel = deviceMetrics.batteryLevel,
- voltage = deviceMetrics.voltage,
- channelUtilization = deviceMetrics.channelUtilization,
- airUtilTx = deviceMetrics.airUtilTx,
- uptimeSeconds = deviceMetrics.uptimeSeconds,
- ),
- channel = channel,
- environmentMetrics = EnvironmentMetrics(
- time = environmentTelemetry.time,
- temperature = environmentMetrics.temperature,
- relativeHumidity = environmentMetrics.relativeHumidity,
- barometricPressure = environmentMetrics.barometricPressure,
- gasResistance = environmentMetrics.gasResistance,
- voltage = environmentMetrics.voltage,
- current = environmentMetrics.current,
- iaq = environmentMetrics.iaq,
- ),
- hopsAway = hopsAway,
- )
-}
diff --git a/app/src/main/java/com/geeksville/mesh/database/entity/Packet.kt b/app/src/main/java/com/geeksville/mesh/database/entity/Packet.kt
deleted file mode 100644
index cdcbdddaa..000000000
--- a/app/src/main/java/com/geeksville/mesh/database/entity/Packet.kt
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.database.entity
-
-import androidx.room.ColumnInfo
-import androidx.room.Embedded
-import androidx.room.Entity
-import androidx.room.Index
-import androidx.room.PrimaryKey
-import androidx.room.Relation
-import com.geeksville.mesh.DataPacket
-import com.geeksville.mesh.MeshProtos.User
-import com.geeksville.mesh.model.Message
-import com.geeksville.mesh.model.Node
-import com.geeksville.mesh.util.getShortDateTime
-
-data class PacketEntity(
- @Embedded val packet: Packet,
- @Relation(entity = ReactionEntity::class, parentColumn = "packet_id", entityColumn = "reply_id")
- val reactions: List = emptyList(),
-) {
- suspend fun toMessage(getNode: suspend (userId: String?) -> Node) = with(packet) {
- Message(
- uuid = uuid,
- receivedTime = received_time,
- node = getNode(data.from),
- text = data.text.orEmpty(),
- time = getShortDateTime(data.time),
- read = read,
- status = data.status,
- routingError = routingError,
- packetId = packetId,
- emojis = reactions.toReaction(getNode),
- )
- }
-}
-
-@Entity(
- tableName = "packet",
- indices = [
- Index(value = ["myNodeNum"]),
- Index(value = ["port_num"]),
- Index(value = ["contact_key"]),
- ]
-)
-
-data class Packet(
- @PrimaryKey(autoGenerate = true) val uuid: Long,
- @ColumnInfo(name = "myNodeNum", defaultValue = "0") val myNodeNum: Int,
- @ColumnInfo(name = "port_num") val port_num: Int,
- @ColumnInfo(name = "contact_key") val contact_key: String,
- @ColumnInfo(name = "received_time") val received_time: Long,
- @ColumnInfo(name = "read", defaultValue = "1") val read: Boolean,
- @ColumnInfo(name = "data") val data: DataPacket,
- @ColumnInfo(name = "packet_id", defaultValue = "0") val packetId: Int = 0,
- @ColumnInfo(name = "routing_error", defaultValue = "-1") var routingError: Int = -1,
- @ColumnInfo(name = "reply_id", defaultValue = "0") val replyId: Int = 0,
-)
-
-@Entity(tableName = "contact_settings")
-data class ContactSettings(
- @PrimaryKey val contact_key: String,
- val muteUntil: Long = 0L,
-) {
- val isMuted get() = System.currentTimeMillis() <= muteUntil
-}
-
-data class Reaction(
- val replyId: Int,
- val user: User,
- val emoji: String,
- val timestamp: Long,
-)
-
-@Entity(
- tableName = "reactions",
- primaryKeys = ["reply_id", "user_id", "emoji"],
- indices = [
- Index(value = ["reply_id"]),
- ],
-)
-data class ReactionEntity(
- @ColumnInfo(name = "reply_id") val replyId: Int,
- @ColumnInfo(name = "user_id") val userId: String,
- val emoji: String,
- val timestamp: Long,
-)
-
-private suspend fun ReactionEntity.toReaction(
- getNode: suspend (userId: String?) -> Node
-) = Reaction(
- replyId = replyId,
- user = getNode(userId).user,
- emoji = emoji,
- timestamp = timestamp,
-)
-
-private suspend fun List.toReaction(
- getNode: suspend (userId: String?) -> Node
-) = this.map { it.toReaction(getNode) }
diff --git a/app/src/main/java/com/geeksville/mesh/model/BTScanModel.kt b/app/src/main/java/com/geeksville/mesh/model/BTScanModel.kt
deleted file mode 100644
index 0864045ed..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/BTScanModel.kt
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import android.annotation.SuppressLint
-import android.app.Application
-import android.bluetooth.BluetoothDevice
-import android.content.Context
-import android.hardware.usb.UsbManager
-import android.os.RemoteException
-import androidx.lifecycle.LiveData
-import androidx.lifecycle.MutableLiveData
-import androidx.lifecycle.ViewModel
-import androidx.lifecycle.viewModelScope
-import com.geeksville.mesh.R
-import com.geeksville.mesh.android.Logging
-import com.geeksville.mesh.repository.bluetooth.BluetoothRepository
-import com.geeksville.mesh.repository.network.NetworkRepository
-import com.geeksville.mesh.repository.network.NetworkRepository.Companion.toAddressString
-import com.geeksville.mesh.repository.radio.InterfaceId
-import com.geeksville.mesh.repository.radio.RadioInterfaceService
-import com.geeksville.mesh.repository.usb.UsbRepository
-import com.geeksville.mesh.service.MeshService
-import com.geeksville.mesh.service.ServiceRepository
-import com.geeksville.mesh.util.anonymize
-import com.hoho.android.usbserial.driver.UsbSerialDriver
-import dagger.hilt.android.lifecycle.HiltViewModel
-import kotlinx.coroutines.Job
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.asStateFlow
-import kotlinx.coroutines.flow.catch
-import kotlinx.coroutines.flow.combine
-import kotlinx.coroutines.flow.launchIn
-import kotlinx.coroutines.flow.onEach
-import javax.inject.Inject
-
-@HiltViewModel
-class BTScanModel @Inject constructor(
- private val application: Application,
- private val serviceRepository: ServiceRepository,
- private val bluetoothRepository: BluetoothRepository,
- private val usbRepository: UsbRepository,
- private val usbManagerLazy: dagger.Lazy,
- private val networkRepository: NetworkRepository,
- private val radioInterfaceService: RadioInterfaceService,
-) : ViewModel(), Logging {
-
- private val context: Context get() = application.applicationContext
- val devices = MutableLiveData>(mutableMapOf())
- val errorText = MutableLiveData(null)
-
- private val showMockInterface: StateFlow get() =
- MutableStateFlow(radioInterfaceService.isMockInterface()).asStateFlow()
-
- init {
- combine(
- bluetoothRepository.state,
- networkRepository.resolvedList,
- usbRepository.serialDevicesWithDrivers,
- showMockInterface,
- ) { ble, tcp, usb, showMockInterface ->
- devices.value = mutableMapOf().apply {
- fun addDevice(entry: DeviceListEntry) {
- this[entry.fullAddress] = entry
- }
-
- // Include a placeholder for "None"
- addDevice(DeviceListEntry(context.getString(R.string.none), "n", true))
-
- if (showMockInterface) {
- addDevice(DeviceListEntry("Demo Mode", "m", true))
- }
-
- // Include paired Bluetooth devices
- ble.bondedDevices.map(::BLEDeviceListEntry).sortedBy { it.name }
- .forEach(::addDevice)
-
- // Include Network Service Discovery
- tcp.forEach { service ->
- val address = service.toAddressString()
- addDevice(DeviceListEntry(address, "t$address", true))
- }
-
- usb.forEach { (_, d) ->
- addDevice(USBDeviceListEntry(radioInterfaceService, usbManagerLazy.get(), d))
- }
- }
- }.launchIn(viewModelScope)
-
- serviceRepository.statusMessage
- .onEach { errorText.value = it }
- .launchIn(viewModelScope)
-
- debug("BTScanModel created")
- }
-
- /**
- * @param fullAddress Interface [prefix] + [address] (example: "x7C:9E:BD:F0:BE:BE")
- */
- open class DeviceListEntry(val name: String, val fullAddress: String, val bonded: Boolean) {
- val prefix get() = fullAddress[0]
- val address get() = fullAddress.substring(1)
-
- override fun toString(): String {
- return "DeviceListEntry(name=${name.anonymize}, addr=${address.anonymize}, bonded=$bonded)"
- }
-
- val isBLE: Boolean get() = prefix == 'x'
- val isUSB: Boolean get() = prefix == 's'
- val isTCP: Boolean get() = prefix == 't'
- }
-
- @SuppressLint("MissingPermission")
- class BLEDeviceListEntry(device: BluetoothDevice) : DeviceListEntry(
- device.name ?: "unnamed-${device.address}", // some devices might not have a name
- "x${device.address}",
- device.bondState == BluetoothDevice.BOND_BONDED
- )
-
- class USBDeviceListEntry(
- radioInterfaceService: RadioInterfaceService,
- usbManager: UsbManager,
- val usb: UsbSerialDriver,
- ) : DeviceListEntry(
- usb.device.deviceName,
- radioInterfaceService.toInterfaceAddress(InterfaceId.SERIAL, usb.device.deviceName),
- usbManager.hasPermission(usb.device),
- )
-
- override fun onCleared() {
- super.onCleared()
- debug("BTScanModel cleared")
- }
-
- fun setErrorText(text: String) {
- errorText.value = text
- }
-
- private var scanJob: Job? = null
-
- val selectedAddress get() = radioInterfaceService.getDeviceAddress()
- val selectedBluetooth: Boolean get() = selectedAddress?.getOrNull(0) == 'x'
-
- // / Use the string for the NopInterface
- val selectedNotNull: String get() = selectedAddress ?: "n"
-
- val scanResult = MutableLiveData>(mutableMapOf())
-
- fun clearScanResults() {
- stopScan()
- scanResult.value = mutableMapOf()
- }
-
- fun stopScan() {
- if (scanJob != null) {
- debug("stopping scan")
- try {
- scanJob?.cancel()
- } catch (ex: Throwable) {
- warn("Ignoring error stopping scan, probably BT adapter was disabled suddenly: ${ex.message}")
- } finally {
- scanJob = null
- }
- }
- _spinner.value = false
- }
-
- @SuppressLint("MissingPermission")
- fun startScan() {
- debug("starting classic scan")
-
- _spinner.value = true
- scanJob = bluetoothRepository.scan()
- .onEach { result ->
- val fullAddress = radioInterfaceService.toInterfaceAddress(
- InterfaceId.BLUETOOTH,
- result.device.address
- )
- // prevent log spam because we'll get lots of redundant scan results
- val isBonded = result.device.bondState == BluetoothDevice.BOND_BONDED
- val oldDevs = scanResult.value!!
- val oldEntry = oldDevs[fullAddress]
- // Don't spam the GUI with endless updates for non changing nodes
- if (oldEntry == null || oldEntry.bonded != isBonded) {
- val entry = DeviceListEntry(result.device.name, fullAddress, isBonded)
- oldDevs[entry.fullAddress] = entry
- scanResult.value = oldDevs
- }
- }.catch { ex ->
- serviceRepository.setErrorMessage("Unexpected Bluetooth scan failure: ${ex.message}")
- }.launchIn(viewModelScope)
- }
-
- private fun changeDeviceAddress(address: String) {
- try {
- serviceRepository.meshService?.let { service ->
- MeshService.changeDeviceAddress(context, service, address)
- }
- devices.value = devices.value // Force a GUI update
- } catch (ex: RemoteException) {
- errormsg("changeDeviceSelection failed, probably it is shutting down", ex)
- // ignore the failure and the GUI won't be updating anyways
- }
- }
-
- @SuppressLint("MissingPermission")
- private fun requestBonding(it: DeviceListEntry) {
- val device = bluetoothRepository.getRemoteDevice(it.address) ?: return
- info("Starting bonding for ${device.anonymize}")
-
- bluetoothRepository.createBond(device)
- .onEach { state ->
- debug("Received bond state changed $state")
- if (state != BluetoothDevice.BOND_BONDING) {
- debug("Bonding completed, state=$state")
- if (state == BluetoothDevice.BOND_BONDED) {
- setErrorText(context.getString(R.string.pairing_completed))
- changeDeviceAddress(it.fullAddress)
- } else {
- setErrorText(context.getString(R.string.pairing_failed_try_again))
- }
- }
- }.catch { ex ->
- // We ignore missing BT adapters, because it lets us run on the emulator
- warn("Failed creating Bluetooth bond: ${ex.message}")
- }.launchIn(viewModelScope)
- }
-
- private fun requestPermission(it: USBDeviceListEntry) {
- usbRepository.requestPermission(it.usb.device)
- .onEach { granted ->
- if (granted) {
- info("User approved USB access")
- changeDeviceAddress(it.fullAddress)
- } else {
- errormsg("USB permission denied for device ${it.address}")
- }
- }.launchIn(viewModelScope)
- }
-
- // Called by the GUI when a new device has been selected by the user
- // @returns true if we were able to change to that item
- fun onSelected(it: DeviceListEntry): Boolean {
- // If the device is paired, let user select it, otherwise start the pairing flow
- if (it.bonded) {
- changeDeviceAddress(it.fullAddress)
- return true
- } else {
- // Handle requesting USB or bluetooth permissions for the device
- debug("Requesting permissions for the device")
-
- if (it.isBLE) {
- requestBonding(it)
- }
-
- if (it.isUSB) {
- requestPermission(it as USBDeviceListEntry)
- }
-
- return false
- }
- }
-
- private val _spinner = MutableLiveData(false)
- val spinner: LiveData get() = _spinner
-}
diff --git a/app/src/main/java/com/geeksville/mesh/model/BluetoothViewModel.kt b/app/src/main/java/com/geeksville/mesh/model/BluetoothViewModel.kt
deleted file mode 100644
index ba60e9727..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/BluetoothViewModel.kt
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import androidx.lifecycle.ViewModel
-import androidx.lifecycle.asLiveData
-import com.geeksville.mesh.repository.bluetooth.BluetoothRepository
-import dagger.hilt.android.lifecycle.HiltViewModel
-import kotlinx.coroutines.flow.map
-import javax.inject.Inject
-
-/**
- * Thin view model which adapts the view layer to the `BluetoothRepository`.
- */
-@HiltViewModel
-class BluetoothViewModel @Inject constructor(
- private val bluetoothRepository: BluetoothRepository,
-) : ViewModel() {
- /**
- * Called when permissions have been updated. This causes an explicit refresh of the
- * bluetooth state.
- */
- fun permissionsUpdated() = bluetoothRepository.refreshState()
-
- val enabled = bluetoothRepository.state.map { it.enabled }.asLiveData()
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/geeksville/mesh/model/Channel.kt b/app/src/main/java/com/geeksville/mesh/model/Channel.kt
deleted file mode 100644
index ae4235ec0..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/Channel.kt
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import com.geeksville.mesh.ChannelProtos
-import com.geeksville.mesh.ConfigProtos.Config.LoRaConfig.ModemPreset
-import com.geeksville.mesh.ConfigKt.loRaConfig
-import com.geeksville.mesh.ConfigProtos
-import com.geeksville.mesh.channelSettings
-import com.google.protobuf.ByteString
-import java.security.SecureRandom
-
-/** Utility function to make it easy to declare byte arrays - FIXME move someplace better */
-fun byteArrayOfInts(vararg ints: Int) = ByteArray(ints.size) { pos -> ints[pos].toByte() }
-fun xorHash(b: ByteArray) = b.fold(0) { acc, x -> acc xor (x.toInt() and 0xff) }
-
-data class Channel(
- val settings: ChannelProtos.ChannelSettings = default.settings,
- val loraConfig: ConfigProtos.Config.LoRaConfig = default.loraConfig,
-) {
- companion object {
- // These bytes must match the well known and not secret bytes used the default channel AES128 key device code
- private val channelDefaultKey = byteArrayOfInts(
- 0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59,
- 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0x01
- )
-
- private val cleartextPSK = ByteString.EMPTY
- private val defaultPSK =
- byteArrayOfInts(1) // a shortstring code to indicate we need our default PSK
-
- // The default channel that devices ship with
- val default = Channel(
- channelSettings { psk = ByteString.copyFrom(defaultPSK) },
- // references: NodeDB::installDefaultConfig / Channels::initDefaultChannel
- loRaConfig {
- usePreset = true
- modemPreset = ModemPreset.LONG_FAST
- hopLimit = 3
- txEnabled = true
- }
- )
-
- fun getRandomKey(size: Int = 32): ByteString {
- val bytes = ByteArray(size)
- val random = SecureRandom()
- random.nextBytes(bytes)
- return ByteString.copyFrom(bytes)
- }
- }
-
- // Return the name of our channel as a human readable string. If empty string, assume "Default" per mesh.proto spec
- val name: String
- get() = settings.name.ifEmpty {
- // We have a new style 'empty' channel name. Use the same logic from the device to convert that to a human readable name
- if (loraConfig.usePreset) when (loraConfig.modemPreset) {
- ModemPreset.SHORT_TURBO -> "ShortTurbo"
- ModemPreset.SHORT_FAST -> "ShortFast"
- ModemPreset.SHORT_SLOW -> "ShortSlow"
- ModemPreset.MEDIUM_FAST -> "MediumFast"
- ModemPreset.MEDIUM_SLOW -> "MediumSlow"
- ModemPreset.LONG_FAST -> "LongFast"
- ModemPreset.LONG_SLOW -> "LongSlow"
- ModemPreset.LONG_MODERATE -> "LongMod"
- ModemPreset.VERY_LONG_SLOW -> "VLongSlow"
- else -> "Invalid"
- } else "Custom"
- }
-
- val psk: ByteString
- get() = if (settings.psk.size() != 1) {
- settings.psk // A standard PSK
- } else {
- // One of our special 1 byte PSKs, see mesh.proto for docs.
- val pskIndex = settings.psk.byteAt(0).toInt()
-
- if (pskIndex == 0) {
- cleartextPSK
- } else {
- // Treat an index of 1 as the old channelDefaultKey and work up from there
- val bytes = channelDefaultKey.clone()
- bytes[bytes.size - 1] = (0xff and (bytes[bytes.size - 1] + pskIndex - 1)).toByte()
- ByteString.copyFrom(bytes)
- }
- }
-
- /**
- * Given a channel name and psk, return the (0 to 255) hash for that channel
- */
- val hash: Int get() = xorHash(name.toByteArray()) xor xorHash(psk.toByteArray())
-
- val channelNum: Int get() = loraConfig.channelNum(name)
-
- val radioFreq: Float get() = loraConfig.radioFreq(channelNum)
-
- override fun equals(other: Any?): Boolean = (other is Channel)
- && psk.toByteArray() contentEquals other.psk.toByteArray()
- && name == other.name
-
- override fun hashCode(): Int {
- var result = settings.hashCode()
- result = 31 * result + loraConfig.hashCode()
- return result
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/model/ChannelOption.kt b/app/src/main/java/com/geeksville/mesh/model/ChannelOption.kt
deleted file mode 100644
index ef0acf7d1..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/ChannelOption.kt
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import com.geeksville.mesh.ConfigProtos.Config.LoRaConfig
-import com.geeksville.mesh.ConfigProtos.Config.LoRaConfig.ModemPreset
-import com.geeksville.mesh.ConfigProtos.Config.LoRaConfig.RegionCode
-import com.geeksville.mesh.R
-
-/**
- * hash a string into an integer using the djb2 algorithm by Dan Bernstein
- * http://www.cse.yorku.ca/~oz/hash.html
- */
-private fun hash(name: String): UInt { // using UInt instead of Long to match RadioInterface.cpp results
- var hash: UInt = 5381u
- for (c in name) {
- hash += (hash shl 5) + c.code.toUInt()
- }
- return hash
-}
-
-private val ModemPreset.bandwidth: Float
- get() {
- for (option in ChannelOption.entries) {
- if (option.modemPreset == this) return option.bandwidth
- }
- return 0f
- }
-
-private fun LoRaConfig.bandwidth() = if (usePreset) {
- val wideLora = region == RegionCode.LORA_24
- modemPreset.bandwidth * if (wideLora) 3.25f else 1f
-} else when (bandwidth) {
- 31 -> .03125f
- 62 -> .0625f
- 200 -> .203125f
- 400 -> .40625f
- 800 -> .8125f
- 1600 -> 1.6250f
- else -> bandwidth / 1000f
-}
-
-val LoRaConfig.numChannels: Int get() {
- for (option in RegionInfo.entries) {
- if (option.regionCode == region) {
- return ((option.freqEnd - option.freqStart) / bandwidth()).toInt()
- }
- }
- return 0
-}
-
-internal fun LoRaConfig.channelNum(primaryName: String): Int = when {
- channelNum != 0 -> channelNum
- numChannels == 0 -> 0
- else -> (hash(primaryName) % numChannels.toUInt()).toInt() + 1
-}
-
-internal fun LoRaConfig.radioFreq(channelNum: Int): Float {
- if (overrideFrequency != 0f) return overrideFrequency + frequencyOffset
- for (option in RegionInfo.entries) {
- if (option.regionCode == region) {
- return (option.freqStart + bandwidth() / 2) + (channelNum - 1) * bandwidth()
- }
- }
- return 0f
-}
-
-@Suppress("MagicNumber")
-enum class RegionInfo(
- val regionCode: RegionCode,
- val description: String,
- val freqStart: Float,
- val freqEnd: Float,
-) {
- UNSET(RegionCode.UNSET, "Please set a region", 902.0f, 928.0f),
- US(RegionCode.US, "United States", 902.0f, 928.0f),
- EU_433(RegionCode.EU_433, "European Union 433MHz", 433.0f, 434.0f),
- EU_868(RegionCode.EU_868, "European Union 868MHz", 869.4f, 869.65f),
- CN(RegionCode.CN, "China", 470.0f, 510.0f),
- JP(RegionCode.JP, "Japan", 920.5f, 923.5f),
- ANZ(RegionCode.ANZ, "Australia / New Zealand", 915.0f, 928.0f),
- KR(RegionCode.KR, "Korea", 920.0f, 923.0f),
- TW(RegionCode.TW, "Taiwan", 920.0f, 925.0f),
- RU(RegionCode.RU, "Russia", 868.7f, 869.2f),
- IN(RegionCode.IN, "India", 865.0f, 867.0f),
- NZ_865(RegionCode.NZ_865, "New Zealand 865MHz", 864.0f, 868.0f),
- TH(RegionCode.TH, "Thailand", 920.0f, 925.0f),
- UA_433(RegionCode.UA_433, "Ukraine 433MHz", 433.0f, 434.7f),
- UA_868(RegionCode.UA_868, "Ukraine 868MHz", 868.0f, 868.6f),
- MY_433(RegionCode.MY_433, "Malaysia 433MHz", 433.0f, 435.0f),
- MY_919(RegionCode.MY_919, "Malaysia 919MHz", 919.0f, 924.0f),
- SG_923(RegionCode.SG_923, "Singapore 923MHz", 917.0f, 925.0f),
- PH_433(RegionCode.PH_433, "Philippines 433MHz", 433.0f, 434.7f),
- PH_868(RegionCode.PH_868, "Philippines 868MHz", 868.0f, 869.4f),
- PH_915(RegionCode.PH_915, "Philippines 915MHz", 915.0f, 918.0f),
- LORA_24(RegionCode.LORA_24, "2.4 GHz", 2400.0f, 2483.5f),
-}
-
-enum class ChannelOption(
- val modemPreset: ModemPreset,
- val configRes: Int,
- val bandwidth: Float,
-) {
- SHORT_TURBO(ModemPreset.SHORT_TURBO, R.string.modem_config_turbo, bandwidth = .500f),
- SHORT_FAST(ModemPreset.SHORT_FAST, R.string.modem_config_short, .250f),
- SHORT_SLOW(ModemPreset.SHORT_SLOW, R.string.modem_config_slow_short, .250f),
- MEDIUM_FAST(ModemPreset.MEDIUM_FAST, R.string.modem_config_medium, .250f),
- MEDIUM_SLOW(ModemPreset.MEDIUM_SLOW, R.string.modem_config_slow_medium, .250f),
- LONG_FAST(ModemPreset.LONG_FAST, R.string.modem_config_long, .250f),
- LONG_MODERATE(ModemPreset.LONG_MODERATE, R.string.modem_config_mod_long, .125f),
- LONG_SLOW(ModemPreset.LONG_SLOW, R.string.modem_config_slow_long, .125f),
- VERY_LONG_SLOW(ModemPreset.VERY_LONG_SLOW, R.string.modem_config_very_long, .0625f),
-}
diff --git a/app/src/main/java/com/geeksville/mesh/model/ChannelSet.kt b/app/src/main/java/com/geeksville/mesh/model/ChannelSet.kt
deleted file mode 100644
index a3dbe67d1..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/ChannelSet.kt
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import android.graphics.Bitmap
-import android.net.Uri
-import android.util.Base64
-import com.geeksville.mesh.AppOnlyProtos.ChannelSet
-import com.geeksville.mesh.android.BuildUtils.errormsg
-import com.google.zxing.BarcodeFormat
-import com.google.zxing.MultiFormatWriter
-import com.journeyapps.barcodescanner.BarcodeEncoder
-import java.net.MalformedURLException
-import kotlin.jvm.Throws
-
-private const val MESHTASTIC_HOST = "meshtastic.org"
-private const val CHANNEL_PATH = "/e/"
-internal const val URL_PREFIX = "https://$MESHTASTIC_HOST$CHANNEL_PATH#"
-private const val BASE64FLAGS = Base64.URL_SAFE + Base64.NO_WRAP + Base64.NO_PADDING
-
-/**
- * Return a [ChannelSet] that represents the ChannelSet encoded by the URL.
- * @throws MalformedURLException when not recognized as a valid Meshtastic URL
- */
-@Throws(MalformedURLException::class)
-fun Uri.toChannelSet(): ChannelSet {
- if (fragment.isNullOrBlank() ||
- !host.equals(MESHTASTIC_HOST, true) ||
- !path.equals(CHANNEL_PATH, true)
- ) {
- throw MalformedURLException("Not a valid Meshtastic URL: ${toString().take(40)}")
- }
-
- // Older versions of Meshtastic clients (Apple/web) included `?add=true` within the URL fragment.
- // This gracefully handles those cases until the newer version are generally available/used.
- val url = ChannelSet.parseFrom(Base64.decode(fragment!!.substringBefore('?'), BASE64FLAGS))
- val shouldAdd = fragment?.substringAfter('?', "")
- ?.takeUnless { it.isBlank() }
- ?.equals("add=true")
- ?: getBooleanQueryParameter("add", false)
-
- return url.toBuilder().apply { if (shouldAdd) clearLoraConfig() }.build()
-}
-
-/**
- * @return A list of globally unique channel IDs usable with MQTT subscribe()
- */
-val ChannelSet.subscribeList: List
- get() = settingsList.filter { it.downlinkEnabled }.map { Channel(it, loraConfig).name }
-
-fun ChannelSet.getChannel(index: Int): Channel? =
- if (settingsCount > index) Channel(getSettings(index), loraConfig) else null
-
-/**
- * Return the primary channel info
- */
-val ChannelSet.primaryChannel: Channel? get() = getChannel(0)
-
-/**
- * Return a URL that represents the [ChannelSet]
- * @param upperCasePrefix portions of the URL can be upper case to make for more efficient QR codes
- */
-fun ChannelSet.getChannelUrl(upperCasePrefix: Boolean = false): Uri {
- val channelBytes = this.toByteArray() ?: ByteArray(0) // if unset just use empty
- val enc = Base64.encodeToString(channelBytes, BASE64FLAGS)
- val p = if (upperCasePrefix) URL_PREFIX.uppercase() else URL_PREFIX
- return Uri.parse("$p$enc")
-}
-
-val ChannelSet.qrCode: Bitmap?
- get() = try {
- val multiFormatWriter = MultiFormatWriter()
-
- val bitMatrix =
- multiFormatWriter.encode(
- getChannelUrl(false).toString(),
- BarcodeFormat.QR_CODE,
- 960,
- 960
- )
- val barcodeEncoder = BarcodeEncoder()
- barcodeEncoder.createBitmap(bitMatrix)
- } catch (ex: Throwable) {
- errormsg("URL was too complex to render as barcode")
- null
- }
diff --git a/app/src/main/java/com/geeksville/mesh/model/DebugViewModel.kt b/app/src/main/java/com/geeksville/mesh/model/DebugViewModel.kt
deleted file mode 100644
index 801a1df6e..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/DebugViewModel.kt
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import androidx.compose.runtime.Immutable
-import androidx.lifecycle.ViewModel
-import androidx.lifecycle.viewModelScope
-import com.geeksville.mesh.android.Logging
-import com.geeksville.mesh.database.MeshLogRepository
-import com.geeksville.mesh.database.entity.MeshLog
-import dagger.hilt.android.lifecycle.HiltViewModel
-import kotlinx.collections.immutable.ImmutableList
-import kotlinx.collections.immutable.persistentListOf
-import kotlinx.collections.immutable.toImmutableList
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.flow.SharingStarted
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.map
-import kotlinx.coroutines.flow.stateIn
-import kotlinx.coroutines.launch
-import java.text.DateFormat
-import java.util.Locale
-import javax.inject.Inject
-
-@HiltViewModel
-class DebugViewModel @Inject constructor(
- private val meshLogRepository: MeshLogRepository,
-) : ViewModel(), Logging {
-
- val meshLog: StateFlow> = meshLogRepository.getAllLogs()
- .map(::toUiState)
- .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), persistentListOf())
-
- init {
- debug("DebugViewModel created")
- }
-
- override fun onCleared() {
- super.onCleared()
- debug("DebugViewModel cleared")
- }
-
- private fun toUiState(databaseLogs: List) = databaseLogs.map { log ->
- UiMeshLog(
- uuid = log.uuid,
- messageType = log.message_type,
- formattedReceivedDate = TIME_FORMAT.format(log.received_date),
- logMessage = annotateMeshLogMessage(log),
- )
- }.toImmutableList()
-
- /**
- * Transform the input [MeshLog] by enhancing the raw message with annotations.
- */
- private fun annotateMeshLogMessage(meshLog: MeshLog): String {
- val annotated = when (meshLog.message_type) {
- "Packet" -> meshLog.meshPacket?.let { packet ->
- annotateRawMessage(meshLog.raw_message, packet.from, packet.to)
- }
-
- "NodeInfo" -> meshLog.nodeInfo?.let { nodeInfo ->
- annotateRawMessage(meshLog.raw_message, nodeInfo.num)
- }
-
- "MyNodeInfo" -> meshLog.myNodeInfo?.let { nodeInfo ->
- annotateRawMessage(meshLog.raw_message, nodeInfo.myNodeNum)
- }
-
- else -> null
- }
- return annotated ?: meshLog.raw_message
- }
-
- /**
- * Annotate the raw message string with the node IDs provided, in hex, if they are present.
- */
- private fun annotateRawMessage(rawMessage: String, vararg nodeIds: Int): String {
- val msg = StringBuilder(rawMessage)
- var mutated = false
- nodeIds.forEach { nodeId ->
- mutated = mutated or msg.annotateNodeId(nodeId)
- }
- return if (mutated) {
- return msg.toString()
- } else {
- rawMessage
- }
- }
-
- /**
- * Look for a single node ID integer in the string and annotate it with the hex equivalent
- * if found.
- */
- private fun StringBuilder.annotateNodeId(nodeId: Int): Boolean {
- val nodeIdStr = nodeId.toUInt().toString()
- indexOf(nodeIdStr).takeIf { it >= 0 }?.let { idx ->
- insert(idx + nodeIdStr.length, " (${nodeId.asNodeId()})")
- return true
- }
- return false
- }
-
- private fun Int.asNodeId(): String {
- return "!%08x".format(Locale.getDefault(), this)
- }
-
- fun deleteAllLogs() = viewModelScope.launch(Dispatchers.IO) {
- meshLogRepository.deleteAll()
- }
-
- @Immutable
- data class UiMeshLog(
- val uuid: String,
- val messageType: String,
- val formattedReceivedDate: String,
- val logMessage: String,
- )
-
- companion object {
- private val TIME_FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM)
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/model/EnvironmentMetricsState.kt b/app/src/main/java/com/geeksville/mesh/model/EnvironmentMetricsState.kt
deleted file mode 100644
index 6c0ef9ac7..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/EnvironmentMetricsState.kt
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import androidx.compose.ui.graphics.Color
-import com.geeksville.mesh.TelemetryProtos.Telemetry
-import com.geeksville.mesh.ui.theme.InfantryBlue
-import com.geeksville.mesh.ui.theme.Orange
-
-enum class Environment(val color: Color) {
- TEMPERATURE(Color.Red) {
- override fun getValue(telemetry: Telemetry): Float {
- return telemetry.environmentMetrics.temperature
- }
- },
- HUMIDITY(InfantryBlue) {
- override fun getValue(telemetry: Telemetry): Float {
- return telemetry.environmentMetrics.relativeHumidity
- }
- },
- IAQ(Color.Green) {
- override fun getValue(telemetry: Telemetry): Float {
- return telemetry.environmentMetrics.iaq.toFloat()
- }
- },
- BAROMETRIC_PRESSURE(Orange) {
- override fun getValue(telemetry: Telemetry): Float {
- return telemetry.environmentMetrics.barometricPressure
- }
- };
-
- abstract fun getValue(telemetry: Telemetry): Float
-}
-
-/**
- * @param metrics the filtered [List]
- * @param shouldPlot a [List] the size of [Environment] used to determine if a metric
- * should be plotted
- * @param leftMinMax [Pair] with the min and max of the barometric pressure
- * @param rightMinMax [Pair] with the combined min and max of: the temperature, humidity, and IAQ
- * @param times [Pair] with the oldest and newest times in that order
- */
-data class EnvironmentGraphingData(
- val metrics: List,
- val shouldPlot: List,
- val leftMinMax: Pair = Pair(0f, 0f),
- val rightMinMax: Pair = Pair(0f, 0f),
- val times: Pair = Pair(0, 0)
-)
-
-data class EnvironmentMetricsState(
- val environmentMetrics: List = emptyList(),
-) {
- fun hasEnvironmentMetrics() = environmentMetrics.isNotEmpty()
-
- /**
- * Filters [environmentMetrics] based on a [TimeFrame].
- *
- * @param timeFrame used to filter
- * @return [EnvironmentGraphingData]
- */
- @Suppress("LongMethod")
- fun environmentMetricsFiltered(timeFrame: TimeFrame): EnvironmentGraphingData {
- val oldestTime = timeFrame.calculateOldestTime()
- val telemetries = environmentMetrics.filter { it.time >= oldestTime }
- val shouldPlot = BooleanArray(Environment.entries.size) { false }
- if (telemetries.isEmpty()) {
- return EnvironmentGraphingData(metrics = telemetries, shouldPlot = shouldPlot.toList())
- }
-
- /* Grab the combined min and max for temp, humidity, and iaq. */
- val minValues = mutableListOf()
- val maxValues = mutableListOf()
- val (minTemp, maxTemp) = Pair(
- telemetries.minBy { it.environmentMetrics.temperature },
- telemetries.maxBy { it.environmentMetrics.temperature }
- )
- if (minTemp.environmentMetrics.temperature != 0f || maxTemp.environmentMetrics.temperature != 0f) {
- minValues.add(minTemp.environmentMetrics.temperature)
- maxValues.add(maxTemp.environmentMetrics.temperature)
- shouldPlot[Environment.TEMPERATURE.ordinal] = true
- }
-
- val (minHumidity, maxHumidity) = Pair(
- telemetries.minBy { it.environmentMetrics.relativeHumidity },
- telemetries.maxBy { it.environmentMetrics.relativeHumidity }
- )
- if (minHumidity.environmentMetrics.relativeHumidity != 0f ||
- maxHumidity.environmentMetrics.relativeHumidity != 0f) {
- minValues.add(minHumidity.environmentMetrics.relativeHumidity)
- maxValues.add(maxHumidity.environmentMetrics.relativeHumidity)
- shouldPlot[Environment.HUMIDITY.ordinal] = true
- }
-
- val (minIAQ, maxIAQ) = Pair(
- telemetries.minBy { it.environmentMetrics.iaq },
- telemetries.maxBy { it.environmentMetrics.iaq }
- )
- if (minIAQ.environmentMetrics.iaq != 0 || maxIAQ.environmentMetrics.iaq != 0) {
- minValues.add(minIAQ.environmentMetrics.iaq.toFloat())
- maxValues.add(maxIAQ.environmentMetrics.iaq.toFloat())
- shouldPlot[Environment.IAQ.ordinal] = true
- }
-
- val min = minValues.minOf { it }
- val max = maxValues.maxOf { it }
-
- val (minPressure, maxPressure) = Pair(
- telemetries.minBy { it.environmentMetrics.barometricPressure },
- telemetries.maxBy { it.environmentMetrics.barometricPressure }
- )
- if (minPressure.environmentMetrics.barometricPressure != 0.0F &&
- maxPressure.environmentMetrics.barometricPressure != 0.0F) {
- shouldPlot[Environment.BAROMETRIC_PRESSURE.ordinal] = true
- }
- val (oldest, newest) = Pair(
- telemetries.minBy { it.time },
- telemetries.maxBy { it.time }
- )
-
- return EnvironmentGraphingData(
- metrics = telemetries,
- shouldPlot = shouldPlot.toList(),
- leftMinMax = Pair(
- minPressure.environmentMetrics.barometricPressure,
- maxPressure.environmentMetrics.barometricPressure
- ),
- rightMinMax = Pair(min, max),
- times = Pair(oldest.time, newest.time)
- )
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/model/Message.kt b/app/src/main/java/com/geeksville/mesh/model/Message.kt
deleted file mode 100644
index f8d52981c..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/Message.kt
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import androidx.annotation.StringRes
-import com.geeksville.mesh.MeshProtos.Routing
-import com.geeksville.mesh.MessageStatus
-import com.geeksville.mesh.R
-import com.geeksville.mesh.database.entity.Reaction
-
-@Suppress("CyclomaticComplexMethod")
-@StringRes
-fun getStringResFrom(routingError: Int): Int = when (routingError) {
- Routing.Error.NONE_VALUE -> R.string.routing_error_none
- Routing.Error.NO_ROUTE_VALUE -> R.string.routing_error_no_route
- Routing.Error.GOT_NAK_VALUE -> R.string.routing_error_got_nak
- Routing.Error.TIMEOUT_VALUE -> R.string.routing_error_timeout
- Routing.Error.NO_INTERFACE_VALUE -> R.string.routing_error_no_interface
- Routing.Error.MAX_RETRANSMIT_VALUE -> R.string.routing_error_max_retransmit
- Routing.Error.NO_CHANNEL_VALUE -> R.string.routing_error_no_channel
- Routing.Error.TOO_LARGE_VALUE -> R.string.routing_error_too_large
- Routing.Error.NO_RESPONSE_VALUE -> R.string.routing_error_no_response
- Routing.Error.DUTY_CYCLE_LIMIT_VALUE -> R.string.routing_error_duty_cycle_limit
- Routing.Error.BAD_REQUEST_VALUE -> R.string.routing_error_bad_request
- Routing.Error.NOT_AUTHORIZED_VALUE -> R.string.routing_error_not_authorized
- Routing.Error.PKI_FAILED_VALUE -> R.string.routing_error_pki_failed
- Routing.Error.PKI_UNKNOWN_PUBKEY_VALUE -> R.string.routing_error_pki_unknown_pubkey
- Routing.Error.ADMIN_BAD_SESSION_KEY_VALUE -> R.string.routing_error_admin_bad_session_key
- Routing.Error.ADMIN_PUBLIC_KEY_UNAUTHORIZED_VALUE -> R.string.routing_error_admin_public_key_unauthorized
- else -> R.string.unrecognized
-}
-
-data class Message(
- val uuid: Long,
- val receivedTime: Long,
- val node: Node,
- val text: String,
- val time: String,
- val read: Boolean,
- val status: MessageStatus?,
- val routingError: Int,
- val packetId: Int,
- val emojis: List,
-) {
- fun getStatusStringRes(): Pair {
- val title = if (routingError > 0) R.string.error else R.string.message_delivery_status
- val text = when (status) {
- MessageStatus.RECEIVED -> R.string.delivery_confirmed
- MessageStatus.QUEUED -> R.string.message_status_queued
- MessageStatus.ENROUTE -> R.string.message_status_enroute
- else -> getStringResFrom(routingError)
- }
- return title to text
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/model/MetricsViewModel.kt b/app/src/main/java/com/geeksville/mesh/model/MetricsViewModel.kt
deleted file mode 100644
index 58c7444b6..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/MetricsViewModel.kt
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.geeksville.mesh.model
-
-import android.app.Application
-import android.content.SharedPreferences
-import android.net.Uri
-import androidx.annotation.StringRes
-import androidx.compose.ui.unit.Dp
-import androidx.compose.ui.unit.dp
-import androidx.lifecycle.SavedStateHandle
-import androidx.lifecycle.ViewModel
-import androidx.lifecycle.viewModelScope
-import androidx.navigation.toRoute
-import com.geeksville.mesh.ConfigProtos.Config.DisplayConfig.DisplayUnits
-import com.geeksville.mesh.CoroutineDispatchers
-import com.geeksville.mesh.MeshProtos.MeshPacket
-import com.geeksville.mesh.MeshProtos.Position
-import com.geeksville.mesh.Portnums.PortNum
-import com.geeksville.mesh.R
-import com.geeksville.mesh.TelemetryProtos.Telemetry
-import com.geeksville.mesh.android.Logging
-import com.geeksville.mesh.database.MeshLogRepository
-import com.geeksville.mesh.database.entity.FirmwareRelease
-import com.geeksville.mesh.database.entity.MeshLog
-import com.geeksville.mesh.model.map.CustomTileSource
-import com.geeksville.mesh.navigation.Route
-import com.geeksville.mesh.repository.api.DeviceHardwareRepository
-import com.geeksville.mesh.repository.api.FirmwareReleaseRepository
-import com.geeksville.mesh.repository.datastore.RadioConfigRepository
-import com.geeksville.mesh.service.ServiceAction
-import com.geeksville.mesh.ui.map.MAP_STYLE_ID
-import dagger.hilt.android.lifecycle.HiltViewModel
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.asFlow
-import kotlinx.coroutines.flow.combine
-import kotlinx.coroutines.flow.distinctUntilChanged
-import kotlinx.coroutines.flow.launchIn
-import kotlinx.coroutines.flow.mapLatest
-import kotlinx.coroutines.flow.onEach
-import kotlinx.coroutines.flow.toList
-import kotlinx.coroutines.flow.update
-import kotlinx.coroutines.launch
-import kotlinx.coroutines.withContext
-import java.io.BufferedWriter
-import java.io.FileNotFoundException
-import java.io.FileWriter
-import java.text.SimpleDateFormat
-import java.util.Locale
-import java.util.concurrent.TimeUnit
-import javax.inject.Inject
-
-data class MetricsState(
- val isLocal: Boolean = false,
- val isManaged: Boolean = true,
- val isFahrenheit: Boolean = false,
- val displayUnits: DisplayUnits = DisplayUnits.METRIC,
- val node: Node? = null,
- val deviceMetrics: List = emptyList(),
- val signalMetrics: List = emptyList(),
- val powerMetrics: List = emptyList(),
- val tracerouteRequests: List = emptyList(),
- val tracerouteResults: List = emptyList(),
- val positionLogs: List = emptyList(),
- val deviceHardware: DeviceHardware? = null,
- val isLocalDevice: Boolean = false,
- val latestStableFirmware: FirmwareRelease? = null,
- val latestAlphaFirmware: FirmwareRelease? = null,
-) {
- fun hasDeviceMetrics() = deviceMetrics.isNotEmpty()
- fun hasSignalMetrics() = signalMetrics.isNotEmpty()
- fun hasPowerMetrics() = powerMetrics.isNotEmpty()
- fun hasTracerouteLogs() = tracerouteRequests.isNotEmpty()
- fun hasPositionLogs() = positionLogs.isNotEmpty()
-
- fun deviceMetricsFiltered(timeFrame: TimeFrame): List {
- val oldestTime = timeFrame.calculateOldestTime()
- return deviceMetrics.filter { it.time >= oldestTime }
- }
-
- fun signalMetricsFiltered(timeFrame: TimeFrame): List {
- val oldestTime = timeFrame.calculateOldestTime()
- return signalMetrics.filter { it.rxTime >= oldestTime }
- }
-
- fun powerMetricsFiltered(timeFrame: TimeFrame): List {
- val oldestTime = timeFrame.calculateOldestTime()
- return powerMetrics.filter { it.time >= oldestTime }
- }
-
- companion object {
- val Empty = MetricsState()
- }
-}
-
-/**
- * Supported time frames used to display data.
- */
-@Suppress("MagicNumber")
-enum class TimeFrame(
- val seconds: Long,
- @StringRes val strRes: Int
-) {
- TWENTY_FOUR_HOURS(TimeUnit.DAYS.toSeconds(1), R.string.twenty_four_hours),
- FORTY_EIGHT_HOURS(TimeUnit.DAYS.toSeconds(2), R.string.forty_eight_hours),
- ONE_WEEK(TimeUnit.DAYS.toSeconds(7), R.string.one_week),
- TWO_WEEKS(TimeUnit.DAYS.toSeconds(14), R.string.two_weeks),
- FOUR_WEEKS(TimeUnit.DAYS.toSeconds(28), R.string.four_weeks),
- MAX(0L, R.string.max);
-
- fun calculateOldestTime(): Long = if (this == MAX) {
- MAX.seconds
- } else {
- System.currentTimeMillis() / 1000 - this.seconds
- }
-
- /**
- * The time interval to draw the vertical lines representing
- * time on the x-axis.
- *
- * @return seconds epoch seconds
- */
- fun lineInterval(): Long {
- return when (this.ordinal) {
- TWENTY_FOUR_HOURS.ordinal ->
- TimeUnit.HOURS.toSeconds(6)
-
- FORTY_EIGHT_HOURS.ordinal ->
- TimeUnit.HOURS.toSeconds(12)
-
- ONE_WEEK.ordinal,
- TWO_WEEKS.ordinal ->
- TimeUnit.DAYS.toSeconds(1)
-
- else ->
- TimeUnit.DAYS.toSeconds(7)
- }
- }
-
- /**
- * Used to detect a significant time separation between [Telemetry]s.
- */
- fun timeThreshold(): Long {
- return when (this.ordinal) {
- TWENTY_FOUR_HOURS.ordinal ->
- TimeUnit.HOURS.toSeconds(6)
-
- FORTY_EIGHT_HOURS.ordinal ->
- TimeUnit.HOURS.toSeconds(12)
-
- else ->
- TimeUnit.DAYS.toSeconds(1)
- }
- }
-
- /**
- * Calculates the needed [Dp] depending on the amount of time being plotted.
- *
- * @param time in seconds
- */
- fun dp(screenWidth: Int, time: Long): Dp {
- val timePerScreen = this.lineInterval()
- val multiplier = time / timePerScreen
- val dp = (screenWidth * multiplier).toInt().dp
- return dp.takeIf { it != 0.dp } ?: screenWidth.dp
- }
-}
-
-private fun MeshPacket.hasValidSignal(): Boolean =
- rxTime > 0 && (rxSnr != 0f && rxRssi != 0) && (hopStart > 0 && hopStart - hopLimit == 0)
-
-private fun MeshPacket.toPosition(): Position? = if (!decoded.wantResponse) {
- runCatching { Position.parseFrom(decoded.payload) }.getOrNull()
-} else {
- null
-}
-
-@Suppress("LongParameterList")
-@HiltViewModel
-class MetricsViewModel @Inject constructor(
- savedStateHandle: SavedStateHandle,
- private val app: Application,
- private val dispatchers: CoroutineDispatchers,
- private val meshLogRepository: MeshLogRepository,
- private val radioConfigRepository: RadioConfigRepository,
- private val deviceHardwareRepository: DeviceHardwareRepository,
- private val firmwareReleaseRepository: FirmwareReleaseRepository,
- private val preferences: SharedPreferences,
-) : ViewModel(), Logging {
- private val destNum = savedStateHandle.toRoute().destNum
-
- private fun MeshLog.hasValidTraceroute(): Boolean = with(fromRadio.packet) {
- hasDecoded() && decoded.wantResponse && from == 0 && to == destNum
- }
-
- fun getUser(nodeNum: Int) = radioConfigRepository.getUser(nodeNum)
- val tileSource get() = CustomTileSource.getTileSource(preferences.getInt(MAP_STYLE_ID, 0))
-
- fun deleteLog(uuid: String) = viewModelScope.launch(dispatchers.io) {
- meshLogRepository.deleteLog(uuid)
- }
-
- fun clearPosition() = viewModelScope.launch(dispatchers.io) {
- destNum?.let {
- meshLogRepository.deleteLogs(it, PortNum.POSITION_APP_VALUE)
- }
- }
-
- fun onServiceAction(action: ServiceAction) = viewModelScope.launch {
- radioConfigRepository.onServiceAction(action)
- }
-
- private val _state = MutableStateFlow(MetricsState.Empty)
- val state: StateFlow = _state
-
- private val _envState = MutableStateFlow(EnvironmentMetricsState())
- val environmentState: StateFlow = _envState
-
- private val _timeFrame = MutableStateFlow(TimeFrame.TWENTY_FOUR_HOURS)
- val timeFrame: StateFlow = _timeFrame
-
- init {
- destNum?.let {
- radioConfigRepository.nodeDBbyNum
- .mapLatest { nodes -> nodes[destNum] to nodes.keys.firstOrNull() }
- .distinctUntilChanged()
- .onEach { (node, ourNode) ->
- val deviceHardware = node?.user?.hwModel?.number?.let {
- deviceHardwareRepository.getDeviceHardwareByModel(it)
- }
- _state.update { state ->
- state.copy(
- node = node,
- isLocal = destNum == ourNode,
- deviceHardware = deviceHardware
- )
- }
- }.launchIn(viewModelScope)
-
- radioConfigRepository.deviceProfileFlow.onEach { profile ->
- val moduleConfig = profile.moduleConfig
- _state.update { state ->
- state.copy(
- isManaged = profile.config.security.isManaged,
- isFahrenheit = moduleConfig.telemetry.environmentDisplayFahrenheit,
- )
- }
- }.launchIn(viewModelScope)
-
- meshLogRepository.getTelemetryFrom(destNum).onEach { telemetry ->
- _state.update { state ->
- state.copy(
- deviceMetrics = telemetry.filter { it.hasDeviceMetrics() },
- powerMetrics = telemetry.filter { it.hasPowerMetrics() }
- )
- }
- _envState.update { state ->
- state.copy(
- environmentMetrics = telemetry.filter {
- it.hasEnvironmentMetrics() &&
- it.environmentMetrics.relativeHumidity >= 0f &&
- !it.environmentMetrics.temperature.isNaN()
- },
- )
- }
- }.launchIn(viewModelScope)
-
- meshLogRepository.getMeshPacketsFrom(destNum).onEach { meshPackets ->
- _state.update { state ->
- state.copy(signalMetrics = meshPackets.filter { it.hasValidSignal() })
- }
- }.launchIn(viewModelScope)
-
- combine(
- meshLogRepository.getLogsFrom(nodeNum = 0, PortNum.TRACEROUTE_APP_VALUE),
- meshLogRepository.getMeshPacketsFrom(destNum, PortNum.TRACEROUTE_APP_VALUE),
- ) { request, response ->
- _state.update { state ->
- state.copy(
- tracerouteRequests = request.filter { it.hasValidTraceroute() },
- tracerouteResults = response,
- )
- }
- }.launchIn(viewModelScope)
-
- meshLogRepository.getMeshPacketsFrom(destNum, PortNum.POSITION_APP_VALUE)
- .onEach { packets ->
- val distinctPositions =
- packets.mapNotNull { it.toPosition() }.asFlow()
- .distinctUntilChanged { old, new ->
- old.time == new.time ||
- (old.latitudeI == new.latitudeI && old.longitudeI == new.longitudeI)
- }.toList()
- _state.update { state ->
- state.copy(positionLogs = distinctPositions)
- }
- }.launchIn(viewModelScope)
-
- firmwareReleaseRepository.stableRelease.onEach { latestStable ->
- _state.update { state ->
- state.copy(latestStableFirmware = latestStable)
- }
- }.launchIn(viewModelScope)
-
- firmwareReleaseRepository.alphaRelease.onEach { latestAlpha ->
- _state.update { state ->
- state.copy(latestAlphaFirmware = latestAlpha)
- }
- }.launchIn(viewModelScope)
-
- debug("MetricsViewModel created")
- }
- }
-
- override fun onCleared() {
- super.onCleared()
- debug("MetricsViewModel cleared")
- }
-
- fun setTimeFrame(timeFrame: TimeFrame) {
- _timeFrame.value = timeFrame
- }
-
- /**
- * Write the persisted Position data out to a CSV file in the specified location.
- */
- fun savePositionCSV(uri: Uri) = viewModelScope.launch(dispatchers.main) {
- val positions = state.value.positionLogs
- writeToUri(uri) { writer ->
- writer.appendLine("\"date\",\"time\",\"latitude\",\"longitude\",\"altitude\",\"satsInView\",\"speed\",\"heading\"")
-
- val dateFormat =
- SimpleDateFormat("\"yyyy-MM-dd\",\"HH:mm:ss\"", Locale.getDefault())
-
- positions.forEach { position ->
- val rxDateTime = dateFormat.format(position.time * 1000L)
- val latitude = position.latitudeI * 1e-7
- val longitude = position.longitudeI * 1e-7
- val altitude = position.altitude
- val satsInView = position.satsInView
- val speed = position.groundSpeed
- val heading = "%.2f".format(position.groundTrack * 1e-5)
-
- // date,time,latitude,longitude,altitude,satsInView,speed,heading
- writer.appendLine("$rxDateTime,\"$latitude\",\"$longitude\",\"$altitude\",\"$satsInView\",\"$speed\",\"$heading\"")
- }
- }
- }
-
- private suspend inline fun writeToUri(
- uri: Uri,
- crossinline block: suspend (BufferedWriter) -> Unit
- ) = withContext(dispatchers.io) {
- try {
- app.contentResolver.openFileDescriptor(uri, "wt")?.use { parcelFileDescriptor ->
- FileWriter(parcelFileDescriptor.fileDescriptor).use { fileWriter ->
- BufferedWriter(fileWriter).use { writer -> block.invoke(writer) }
- }
- }
- } catch (ex: FileNotFoundException) {
- errormsg("Can't write file error: ${ex.message}")
- }
- }
-}
diff --git a/app/src/main/java/com/geeksville/mesh/model/Node.kt b/app/src/main/java/com/geeksville/mesh/model/Node.kt
deleted file mode 100644
index 7c979785c..000000000
--- a/app/src/main/java/com/geeksville/mesh/model/Node.kt
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2025 Meshtastic LLC
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see