diff --git a/.github/scripts/notary-wait.py b/.github/scripts/notary-wait.py new file mode 100644 index 00000000..b1805a1c --- /dev/null +++ b/.github/scripts/notary-wait.py @@ -0,0 +1,69 @@ +"""Polls Apple's notary service for one submission until it settles or a deadline passes. + +Usage: notary-wait.py +Env: P8 (path to the App Store Connect .p8), NOTARY_KEY_ID, NOTARY_ISSUER_ID + +Exit 0 only on Accepted. Invalid/Rejected print Apple's log and exit 1. Still +In Progress at the deadline exits 1 with how to resume: the submission keeps +going at Apple, and "Re-run failed jobs" polls the same id again (#1109). +""" +import json +import os +import sys +import time +import urllib.error +import urllib.request + +import jwt + +API = "https://appstoreconnect.apple.com/notary/v2/submissions/" +POLL_SECONDS = 60 + +submission_id = sys.argv[1] +deadline = time.time() + int(sys.argv[2]) * 60 +with open(os.environ["P8"], encoding="utf-8") as fh: + private_key = fh.read() + + +def get(url, auth=True): + headers = {} + if auth: + now = int(time.time()) + token = jwt.encode( + {"iss": os.environ["NOTARY_ISSUER_ID"], "iat": now, "exp": now + 600, "aud": "appstoreconnect-v1"}, + private_key, algorithm="ES256", headers={"kid": os.environ["NOTARY_KEY_ID"], "typ": "JWT"}, + ) + headers["Authorization"] = f"Bearer {token}" + with urllib.request.urlopen(urllib.request.Request(url, headers=headers), timeout=30) as response: + return json.load(response) + + +while True: + try: + body = get(API + submission_id) + status = body["data"]["attributes"]["status"] + except (KeyError, TypeError): + print(f"::error::Unexpected notary API response for {submission_id}: {json.dumps(body)[:500]}") + sys.exit(1) + except urllib.error.HTTPError as error: + if error.code < 500: + print(f"::error::Notary API returned HTTP {error.code} for {submission_id}.") + sys.exit(1) + status = f"HTTP {error.code}, retrying" + except urllib.error.URLError as error: + status = f"network error ({error.reason}), retrying" + print(time.strftime("%H:%M:%S"), status, flush=True) + + if status == "Accepted": + sys.exit(0) + if status in ("Invalid", "Rejected"): + print(f"::error::Apple returned {status} for notary submission {submission_id}.") + log_url = get(API + submission_id + "/logs")["data"]["attributes"]["developerLogUrl"] + print(json.dumps(get(log_url, auth=False), indent=2)) + sys.exit(1) + if time.time() > deadline: + print(f"::error::Notary submission {submission_id} is still In Progress at Apple. " + "Nothing is lost: the signed app is kept as an artifact of this run. " + "Use 'Re-run failed jobs' later to check the same submission again.") + sys.exit(1) + time.sleep(POLL_SECONDS) diff --git a/.github/workflows/docs-notify.yml b/.github/workflows/docs-notify.yml new file mode 100644 index 00000000..a39fce7b --- /dev/null +++ b/.github/workflows/docs-notify.yml @@ -0,0 +1,35 @@ +name: Notify the docs site + +# A change to the app manual on dev tells offband-site to rebuild and publish +# docs.offband.org/app/ (#1148, offband-site#77). GitHub cannot trigger a +# workflow in another repository, so this side sends a repository dispatch. The +# site validates the payload and builds the current dev head itself; the SHA is +# a notification, not a checkout. +on: + push: + branches: [dev] + paths: ['docs/user/**'] +# No workflow_dispatch: it would run a branch's own copy of this file with the +# PAT. To republish by hand, run offband-site's Documentation workflow instead. + +permissions: + contents: read + +jobs: + notify: + if: github.ref == 'refs/heads/dev' + runs-on: ubuntu-latest + steps: + # The payload is offband-site's version-1 contract (its scripts/build_docs.py + # validate_event): exactly these four fields, or the site refuses the run. + - name: Send the app-docs dispatch to offband-site + env: + GH_TOKEN: ${{ secrets.PROJECT_PAT }} + SOURCE_SHA: ${{ github.sha }} + run: >- + gh api repos/OffbandMesh/offband-site/dispatches --method POST + -f event_type=app-docs + -F 'client_payload[schema_version]=1' + -f 'client_payload[source_repository]=OffbandMesh/meshcore-client' + -f 'client_payload[source_ref]=refs/heads/dev' + -f "client_payload[source_sha]=$SOURCE_SHA" diff --git a/.github/workflows/macos-signed.yml b/.github/workflows/macos-signed.yml new file mode 100644 index 00000000..05450d8e --- /dev/null +++ b/.github/workflows/macos-signed.yml @@ -0,0 +1,232 @@ +name: macOS signed build + +# Builds the macOS app, signs it with the Developer ID Application identity, +# notarizes it with Apple and staples the ticket, so it opens on any Mac with +# no Gatekeeper warning (#1109, epic #1107). Called by release-signed.yml. +# +# Three jobs, so no Mac runner ever sits waiting on Apple's queue: +# 1. build-sign-submit (Mac): build, sign, submit, keep the signed app. +# 2. notary-wait (Linux): poll Apple for that submission, up to 340 min. +# 3. staple (Mac): staple the ticket, verify, publish the zip. +# If Apple holds a submission past the poll deadline, job 2 fails, the signed +# app stays an artifact of the run, and "Re-run failed jobs" checks the SAME +# submission again later. Nothing is rebuilt or resubmitted. +# +# SEPARATION: this lane uses its own `apple-macos` Environment and its own +# App Store Connect key. It shares no Environment, secret or key with the +# iOS lane (`apple-signing`), so a hold, revocation or failure in one Apple +# lane cannot break the other. +# +# SECURITY: this repo is PUBLIC, and jobs 1 and 2 hold the Developer ID key +# and the notary API key. +# +# - NEVER call this from a `pull_request` workflow. A PR (incl. from a fork) +# must never run a job that can read these secrets. +# - Only jobs 1 and 2 reference the `apple-macos` Environment, so only they +# receive secrets, and only after the required reviewer approves. Job 3 +# needs none: stapling fetches the public ticket by the app's hash. +# - Secret files live in RUNNER_TEMP and are removed with `if: always()`. +# - Values are passed via env:, never echoed. The identity name holds the +# owner's legal name and is masked. +# +# There is deliberately no skip-notarization input: an unsigned or +# unnotarized app must fail this lane, never pass it (#904). + +on: + workflow_call: + +permissions: + contents: read + +jobs: + build-sign-submit: + runs-on: macos-latest + environment: apple-macos # required-reviewer gate; do not remove + timeout-minutes: 60 + outputs: + submission-id: ${{ steps.submit.outputs.id }} + steps: + - uses: actions/checkout@v4 + + - name: Check the signing secrets are present + env: + MACOS_DEVID_P12_BASE64: ${{ secrets.MACOS_DEVID_P12_BASE64 }} + MACOS_DEVID_P12_PASSWORD: ${{ secrets.MACOS_DEVID_P12_PASSWORD }} + MACOS_NOTARY_KEY_P8_BASE64: ${{ secrets.MACOS_NOTARY_KEY_P8_BASE64 }} + MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }} + MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }} + run: | + set -eu + missing=0 + for name in MACOS_DEVID_P12_BASE64 MACOS_DEVID_P12_PASSWORD \ + MACOS_NOTARY_KEY_P8_BASE64 MACOS_NOTARY_KEY_ID MACOS_NOTARY_ISSUER_ID; do + if [ -z "${!name:-}" ]; then + echo "::error::Secret ${name} is empty or absent in this run." + missing=1 + fi + done + exit "${missing}" + + - name: Temporary keychain with the Developer ID identity + env: + MACOS_DEVID_P12_BASE64: ${{ secrets.MACOS_DEVID_P12_BASE64 }} + MACOS_DEVID_P12_PASSWORD: ${{ secrets.MACOS_DEVID_P12_PASSWORD }} + run: | + set -eu + umask 077 + KC="${RUNNER_TEMP}/signing.keychain-db" + KP="$(openssl rand -hex 16)" + echo "::add-mask::${KP}" + echo "KC=${KC}" >> "$GITHUB_ENV" + security create-keychain -p "${KP}" "${KC}" + security set-keychain-settings -lut 21600 "${KC}" + security unlock-keychain -p "${KP}" "${KC}" + P12="${RUNNER_TEMP}/devid.p12" + printf '%s' "${MACOS_DEVID_P12_BASE64}" | base64 --decode > "${P12}" + security import "${P12}" -k "${KC}" -P "${MACOS_DEVID_P12_PASSWORD}" \ + -T /usr/bin/codesign -T /usr/bin/security + rm -f "${P12}" + security set-key-partition-list -S apple-tool:,apple: -s -k "${KP}" "${KC}" > /dev/null + security list-keychains -d user -s "${KC}" $(security list-keychains -d user | tr -d '"') + IDENTITIES="$(security find-identity -v -p codesigning "${KC}")" + COUNT="$(printf '%s\n' "${IDENTITIES}" | grep -c '"Developer ID Application: ' || true)" + if [ "${COUNT}" != "1" ]; then + echo "::error::Expected one Developer ID Application identity in the keychain, found ${COUNT}." + exit 1 + fi + IDENTITY="$(printf '%s\n' "${IDENTITIES}" | sed -n 's/.*"\(Developer ID Application: .*\)".*/\1/p')" + echo "::add-mask::${IDENTITY}" + echo "IDENTITY=${IDENTITY}" >> "$GITHUB_ENV" + echo "Keychain ready with one Developer ID Application identity." + + - uses: subosito/flutter-action@v2 + with: + flutter-version: "3.44.1" + cache: true + - run: flutter pub get + - run: dart run build_runner build --delete-conflicting-outputs + - name: Write dart_defines.json + env: + GIPHY_API_KEY: ${{ secrets.GIPHY_API_KEY }} + run: jq -n --arg k "$GIPHY_API_KEY" '{GIPHY_API_KEY:$k}' > dart_defines.json + - name: Enable native assets (bundles sqlite3 + llamadart libs, #445) + run: flutter config --enable-native-assets + - run: flutter build macos --release --no-pub --dart-define-from-file=dart_defines.json + + # Inside-out: every nested Mach-O first, then each framework bundle, then + # the app with its entitlements. Hardened Runtime and a secure timestamp + # are what notarization requires. + - name: Sign with Developer ID + run: | + set -eu + APP=build/macos/Build/Products/Release/offband_meshcore.app + echo "APP=${APP}" >> "$GITHUB_ENV" + SIGN=(codesign --force --options runtime --timestamp --sign "${IDENTITY}" --keychain "${KC}") + while IFS= read -r -d '' f; do + if file -b "${f}" | grep -q 'Mach-O'; then + "${SIGN[@]}" "${f}" + fi + done < <(find "${APP}/Contents/Frameworks" -type f -print0) + while IFS= read -r -d '' fw; do + "${SIGN[@]}" "${fw}" + done < <(find "${APP}/Contents/Frameworks" -depth -name '*.framework' -type d -print0) + "${SIGN[@]}" --entitlements macos/Runner/Release.entitlements "${APP}" + codesign --verify --deep --strict --verbose=2 "${APP}" + lipo -archs "${APP}/Contents/MacOS/offband_meshcore" + + # ditto, not zip: it preserves the .app bundle's symlinks (#1108). The + # same zip is what Apple notarizes and what job 3 staples. + - name: Zip the signed app + run: ditto -c -k --keepParent "${APP}" offband-macos-signed.zip + + # Upload only, no --wait: the verdict is job 2's business. + - name: Submit for notarization + id: submit + env: + MACOS_NOTARY_KEY_P8_BASE64: ${{ secrets.MACOS_NOTARY_KEY_P8_BASE64 }} + MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }} + MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }} + run: | + set -eu + umask 077 + P8="${RUNNER_TEMP}/AuthKey.p8" + printf '%s' "${MACOS_NOTARY_KEY_P8_BASE64}" | base64 --decode > "${P8}" + OUT="${RUNNER_TEMP}/notarize.json" + xcrun notarytool submit offband-macos-signed.zip --key "${P8}" \ + --key-id "${MACOS_NOTARY_KEY_ID}" --issuer "${MACOS_NOTARY_ISSUER_ID}" \ + --output-format json > "${OUT}" + cat "${OUT}" + ID="$(jq -r '.id // empty' "${OUT}")" + if [ -z "${ID}" ]; then + echo "::error::notarytool returned no submission id." + exit 1 + fi + echo "id=${ID}" >> "$GITHUB_OUTPUT" + echo "Submitted for notarization: ${ID}" + + # Kept 30 days so a held submission can be finished by a re-run. + - uses: actions/upload-artifact@v4 + with: + name: macos-signed-unstapled + path: offband-macos-signed.zip + if-no-files-found: error + retention-days: 30 + + - name: Remove the signing material + if: always() + run: | + set +e + if [ -n "${KC:-}" ]; then security delete-keychain "${KC}"; fi + rm -f dart_defines.json "${RUNNER_TEMP}/devid.p12" "${RUNNER_TEMP}/AuthKey.p8" + + notary-wait: + needs: build-sign-submit + runs-on: ubuntu-latest + environment: apple-macos # holds the notary key; do not remove + # GitHub's job limit is 360 minutes. A Linux runner on a public repo costs + # nothing to keep polling, and a hold of a few hours then finishes with no + # manual re-run. The poll deadline leaves room for setup inside the limit. + timeout-minutes: 355 + steps: + - uses: actions/checkout@v4 + - run: pip install --quiet "PyJWT[crypto]==2.10.1" + - name: Wait for Apple's verdict (340 min max) + env: + SUBMISSION_ID: ${{ needs.build-sign-submit.outputs.submission-id }} + MACOS_NOTARY_KEY_P8_BASE64: ${{ secrets.MACOS_NOTARY_KEY_P8_BASE64 }} + NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }} + NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }} + run: | + set -eu + umask 077 + export P8="${RUNNER_TEMP}/AuthKey.p8" + printf '%s' "${MACOS_NOTARY_KEY_P8_BASE64}" | base64 --decode > "${P8}" + python3 .github/scripts/notary-wait.py "${SUBMISSION_ID}" 340 + - name: Remove the notary key + if: always() + run: rm -f "${RUNNER_TEMP}/AuthKey.p8" + + staple: + needs: notary-wait + runs-on: macos-latest + timeout-minutes: 20 + steps: + - uses: actions/download-artifact@v4 + with: + name: macos-signed-unstapled + - name: Staple and verify + run: | + set -eu + ditto -x -k offband-macos-signed.zip . + APP=offband_meshcore.app + xcrun stapler staple "${APP}" + xcrun stapler validate "${APP}" + codesign --verify --deep --strict --verbose=2 "${APP}" + spctl --assess --type execute --verbose=4 "${APP}" + ditto -c -k --keepParent "${APP}" offband-macos.zip + - uses: actions/upload-artifact@v4 + with: + name: release-macos + path: offband-macos.zip + if-no-files-found: error + retention-days: 7 diff --git a/.github/workflows/release-signed.yml b/.github/workflows/release-signed.yml index 2171883e..689237f0 100644 --- a/.github/workflows/release-signed.yml +++ b/.github/workflows/release-signed.yml @@ -1,8 +1,9 @@ name: Release (signed, all platforms) # Produces a COMPLETE, published release from a `v*` tag: signed Android APK + -# AAB, Windows, Linux, and macOS (unsigned until #1109), attached to a GitHub -# release whose body is the human-authored release notes. This is what makes a partial release (the +# AAB, Windows and Linux, attached to a GitHub release whose body is the +# human-authored release notes. The notarized macOS zip (#1109) is added after +# Apple accepts it, by `macos-attach`. This is what makes a partial release (the # rc.2/rc.3 failure) impossible. # # SECURITY: this repo is PUBLIC and the `android` job has the signing keystore, @@ -14,7 +15,8 @@ name: Release (signed, all platforms) # - Only the `android` job references the `release-signing` Environment, so # ONLY it receives the keystore secrets, and only after the required # reviewer approves. The windows/linux/release jobs never see them. The -# `ios` job has its own Environment, `apple-signing`, in ios-signed.yml. +# `ios` job uses the `apple-signing` Environment (ios-signed.yml); the +# `macos` jobs use the separate `apple-macos` one (macos-signed.yml). # - Keystore written to disk only for the build, deleted with `if: always()`. # - Signing values passed via env:, never on a command line, never echoed. # @@ -250,41 +252,15 @@ jobs: if-no-files-found: error retention-days: 7 - # Unsigned (ad-hoc) macOS build, distributed as a release asset (#1108). - # No Apple service is involved, so unlike `ios` it blocks the release like - # the other desktop jobs. Developer ID signing + notarization is #1109. + # Developer ID signed and notarized macOS build (#1109). Deliberately not in + # `release`'s needs: Apple's notary queue is outside our control, so it must + # not hold up Android, Windows and Linux. `macos-attach` adds the asset to + # the published release once Apple accepts it. An unnotarized macOS app is + # never published: if notarization fails, the release ships without it. macos: needs: gate - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - flutter-version: "3.44.1" - cache: true - - run: flutter pub get - - run: dart run build_runner build --delete-conflicting-outputs - - name: Write dart_defines.json - env: - GIPHY_API_KEY: ${{ secrets.GIPHY_API_KEY }} - run: jq -n --arg k "$GIPHY_API_KEY" '{GIPHY_API_KEY:$k}' > dart_defines.json - - name: Enable native assets (bundles sqlite3 + llamadart libs, #445) - run: flutter config --enable-native-assets - - run: flutter build macos --release --no-pub --dart-define-from-file=dart_defines.json - # ditto, not zip: it preserves the .app bundle's symlinks, which plain - # zip flattens into copies that break code-signing validation (#1108). - - name: Zip macOS app - run: | - set -eu - APP=build/macos/Build/Products/Release/offband_meshcore.app - lipo -archs "${APP}/Contents/MacOS/offband_meshcore" || true - ditto -c -k --keepParent "${APP}" offband-macos.zip - - uses: actions/upload-artifact@v4 - with: - name: release-macos - path: offband-macos.zip - if-no-files-found: error - retention-days: 7 + uses: ./.github/workflows/macos-signed.yml + secrets: inherit # Uploads to App Store Connect (#1039). Deliberately not in `release`'s needs: # an Apple-side failure must not block the Android and desktop release. @@ -297,7 +273,7 @@ jobs: # check) have passed, so a signing failure yields no release rather than an # empty one. Published directly: the notes were reviewed in the cut PR. release: - needs: [android, windows, linux, macos] + needs: [android, windows, linux] runs-on: ubuntu-latest permissions: contents: write # create the release + upload assets @@ -321,7 +297,6 @@ jobs: cp incoming/release-android/* out/ cp incoming/release-windows/* out/ cp incoming/release-linux/* out/ - cp incoming/release-macos/* out/ echo "Assets for the release:" ls -la out/ # Draft-first so publication is ATOMIC: the release is not visible to @@ -383,3 +358,20 @@ jobs: gh release edit "${TAG}" "${PRERELEASE_FLAG}" --draft=false fi echo "Release ${TAG} published with $(ls out | wc -l) assets." + + # Adds the notarized macOS zip to the release after both are done (#1109). + # If macOS was held at Apple, "Re-run failed jobs" finishes the macOS lane + # and then this job, with no rebuild. + macos-attach: + needs: [release, macos] + runs-on: ubuntu-latest + permissions: + contents: write # upload one asset to the existing release + steps: + - uses: actions/download-artifact@v4 + with: + name: release-macos + - name: Attach macOS asset + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload "${GITHUB_REF_NAME}" offband-macos.zip --clobber --repo "${GITHUB_REPOSITORY}" diff --git a/CHANGELOG.md b/CHANGELOG.md index d0a08899..d90c8768 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,139 @@ All notable changes to Offband Meshcore. Pre-releases are tagged `-beta.N` / `-rc.N`. +## [1.8.0] - 2026-11-09 + +Production successor to 1.7.0. A channels release: message state keyed by channel identity +instead of slot, no hidden history, every channel write confirmed by the radio, the firmware +1.7.0 slot rules, plus radio-side settings over the `0xC5 0x1C` capability advert. Radio +sound, Display and LED, and rotation need Offband firmware 1.7.0 or newer. Database schema +unchanged (2). + +### Upgrade notes + +- First full sync purges history under channel keys the radio does not hold, plus pre-#194 + slot-index keys for empty slots. Runs only when the sync saw every slot device info + reported, every slot confirmed, none erased, no write in flight, and at least one channel; + every sync logs the result or the skip reason (#1128). +- Slot 0 reserved for Public on every firmware; on stock or older firmware one slot of 40 goes + unused without Public. An existing non-Public occupant of slot 0 is left alone (#1117). +- 65 new UI strings, English-only in all 17 other locales; `untranslated.json` regenerated. + One string retired (`channels_noFreeSlot`). + +### Channels and message history + +- Key change (hashtag rename or new private key) asks keep or delete. Applied once the radio + confirms the clear. Keep runs `moveChannelHistory` (copy, verify, delete only copied rows, + up to 3 passes; a blob-only old key moved onto rows first) plus `moveChannelNotifyMode`. + Delete runs `deleteChannelHistory`. Failed move returns `historyNotMoved`, persistent. A key + whose change could not land is spared from the purge until the connection ends. A different + channel written over an occupied slot is settled by the next full sync, since firmware 1.7.0 + may move the occupant (#1128). +- Fail-closed channel sync: an unanswered slot is UNKNOWN, surfaced by a persistent Retry + banner, never backfilled from the previous list; lookups and notify evaluation for it fail + closed (suppress). Ingress barrier holds live channel traffic until the list is confirmed, + keyed per radio, and re-holds frames for still-unconfirmed slots; pull-based frames are + never dropped; raw-RX no longer matches the offline cache. Unread survives a sync only for + the same PSK; identity changes listed in a dismissible notice. A sync with unconfirmed slots + does not overwrite the last fully confirmed cache; a failed sync on a live link retries + (#1062, #1064). +- In-memory conversation dropped and reloaded on a slot identity change; reassignment clears + only legacy slot-index keys; `sendChannelMessage` refuses an unconfirmed slot with a + persistent error; `_loadChannelMessages` merges messages that arrived during the read + (#1063). +- Channel writes (`setChannel`, `deleteChannel`, `editChannel`) await OK/ERR via the generic + ack queue with a 5 s timeout and return `ok`, `occupied`, `rejected`, `noReply` or + `clearedNotAdded`; history cleared only after OK; key change is clear-then-add; success + toasts only after OK, refusals persistent (#1026, #1025). +- Slot chosen at the write by `decideChannelSlot` / `allocateChannelSlotOrExplain`; refuses + while syncing and when full (no more `return 0`); covers channels screen, QR share, community + join (green toast only when written) and config import (`planChannelImport` requires + `isSyncing`, skips with `channelsSyncing`). Syncs defer while a write is in flight; batches + hold the guard; the last write runs one re-read (#1021, #1022, #1023, #1024, #1025). +- Firmware 1.7.0 slot rules: Public to slot 0, nothing else ever to slot 0; second Public + refused on every path; Delete Public refused at the attempt; Public's key locked in Edit and + refused on another channel; hashtag "public" (namesPublic rule) writes the real Public + (#1117, #1029). +- Restore to radio: `planChannelRestore` places by identity (live keys skipped, Public to slot + 0, others to their remembered slot if free or erased and not 0, else lowest free, live slots + never a destination, erased slots cleared first); every write awaits OK/ERR; reports the + confirmed count and names what did not land; busy table refuses (#1060, #1117). +- Erased (`0xFF`) records and undecodable names refused from the wire and dropped at + `loadCachedChannels`; a sync seeing an erased slot keeps the cache (#1060). +- Edit Channel: hashtag PSK read-only, copyable, re-derived on rename; non-hashtag or `##` + names refused; community hashtag name and key read-only; Save refused when the slot's live + occupant changed since the dialog opened (#1103). + +### Radio settings + +- `0xC5 0x1C` capability advert (TLV, `TAG_CONTINUE` bounded at 8 rounds, unknown tags kept + and skipped) replaces device-info offset 87, which nothing reads now (#1094, #1095, #1096, + #1097). +- Capability gates on caps bits, not `FIRMWARE_VER_CODE`: block list, caplog, packet hash and + observer config (`OFFBAND_CONFIG_MIN_VER` deleted). Companion radio stats `>= 8` and region + scope `>= 13` stay version-gated by owner ruling; removal tracked in #1066 (#1065). +- Radio per-channel notify over `0xC5 0x18/0x19` (unset, all, mentions, off), gated on caps2 + `0x80` and `TAG_CHAN_NOTIFY`, read on every completed sync, keyed by PSK, slot resolved at + send time; independent of the phone setting, which is relabeled Phone notifications (#1068, + #1060). +- Display mode and status LED (device-info bytes 86, 85) and rotation over `0xC5 0x1A/0x1B` + gated on `TAG_DISPLAY_ROTATION` (#523, #1098). Display and LED gated independently on advert + tags `0x04` TAG_DISPLAY_CONTROL and `0x05` TAG_LED_CONTROL, falling back to caps2 `0x04` + when neither tag is advertised, the advert is refused, or it is not answered yet; each SET + refused locally without its own capability; rotation SET gate unchanged. Client half of + firmware #2069; the tags are on firmware-base, not in `offband-v1.7.0` (#1132). +- BLE pairing PIN: `CMD_SET_DEVICE_PIN` (37), read from device-info bytes 4..7, shown in plain + text, 100000-999999 or 0 for the firmware default (#1100). +- Factory reset: `CMD_FACTORY_RESET` (51), no version floor. "Also delete this radio's data + stored in the app" (default on) deletes every perRadio surface from `scoping_inventory.dart` + when the reset is sent; no confirmation from the radio is possible. Failed delete shows a + persistent banner (#1057, #1118). + +### App + +- Sponsor window: 3rd launch and 7 days, Not now 30 days, Sponsor 90 days, Never Show Again; + hidden on iOS; test builds keyed by `GIT_SHA` show once per commit; five global + `sponsor_prompt_*` prefs keys (#1129). +- App-only settings from the connect screen: App Settings, Debug (Share logs, logging switch, + log viewers) and About without a radio; export failures persistent (#693, #1030). +- Bluetooth scan start failure shown persistently, with a Location-off message (#1033). +- Tile User-Agent `OffbandMeshCore (app.offband.meshcore; +https://offband.org)` (not on web); + OSM credit on all six maps (#1111). +- Notify-mode saves, notify decisions and the slot lookup's source logged (#1122). +- Long menus scroll; links beside @mentions tappable (#1074, #1075, #1079). +- "Offband MeshCore" spelling in launcher, titles, strings, notifications, web; Windows + `ProductName` unchanged so the data folder does not move (#1050). +- iOS: Google Play link, Donate and Experimental hidden; back arrow, edge swipe, keyboard + dismiss; `ITSAppUsesNonExemptEncryption` false (#1043, #1048, #1051, #1052). + +### Build and release + +- First App Store release (iOS 1.7.0) went live 2026-11-09. The release `ios` job uploads + 1.8.0 to App Store Connect; submitting it for review is a manual step there (#200, #961). +- macOS build as a release asset (#1108), now Developer ID signed and notarized (#1109): + `macos-signed.yml` (env `apple-macos`) builds, signs and submits on a Mac without waiting, + `notary-wait` polls Apple on Linux for up to 340 minutes, `staple` runs on a Mac, and + `macos-attach` adds `offband-macos.zip` to the published release. Not in `release`'s needs; + an unnotarized app is never published. +- iOS signing toolchain, signed IPA, TestFlight upload, App Store review package (#958, #1012, + #1013, #1014, #1016, #1017, #1019, #1037, #1038, #1039, #1040, #1041, #1044, #1045, #1046, + #1047). +- Plan of record for Play publishing automation (#1077, #1091). +- Release texts gain `announcements/.md`, the GitHub Discussions Announcements post + (#1137). + +### Known issues + +- #1121 Phone notifications Off can still notify. +- #1123 Factory reset leaves stale data for that radio on other devices. +- #1132 On firmware 1.7.0, boards with a display and no controllable LED still show the LED + switch (needs the firmware tags). +- #1124 `_sendIndicatorSet` never clears its pending-write flag, so a stale read can overwrite + a newer change. +- #1028 A refused contact add shows as added; DMs fail silently after 8 s. +- #1134 Position Reporting Interval reports success when the radio refuses it (T1000-E). +- #1066 Two capability reads still use `FIRMWARE_VER_CODE`. + ## [1.7.0] - 2026-10-26 Production successor to 1.6.0. A foundations release: per-message storage with a diff --git a/announcements/1.8.0.md b/announcements/1.8.0.md new file mode 100644 index 00000000..1d783c01 --- /dev/null +++ b/announcements/1.8.0.md @@ -0,0 +1,70 @@ +**Title:** Offband MeshCore 1.8.0, and Offband MeshCore is on the App Store + +--- + +Offband MeshCore 1.8.0 is out. It's a channels release: message history now belongs to the +channel itself rather than the slot it occupies on your radio, every channel write waits for +the radio to confirm it, and the app no longer keeps history out of sight where it could +reappear later. + +Full release notes, downloads and known issues: +https://github.com/OffbandMesh/meshcore-client/releases/tag/v1.8.0 + +### Now on iPhone + +Offband MeshCore is on the App Store, for iOS 16.4 or newer: +https://apps.apple.com/us/app/offband-meshcore/id6829124741 + +The App Store has 1.7.0 today. 1.8.0 goes up once Apple has reviewed it. + +### Before you update + +- **Hidden history is cleared.** On its first full sync with a radio, 1.8.0 deletes the + stored history of any channel that radio no longer holds. Channels on your radio are not + touched. If any slot went unanswered or erased, nothing is deleted. If a reflash erased the + radio's channel storage, the app keeps the history and offers **Restore to radio**. +- **Slot 0 is kept for Public on every radio.** On stock or older firmware without Public, + that slot goes unused. +- **New text is English-only for now** in the other 17 languages. + +### What's new + +- **Channels:** history, unread counts and notification settings follow the channel's key. + Changing a key asks whether to keep or delete the history. Adds can't overwrite another + channel. Public stays in slot 0 and can't be deleted. An incomplete sync keeps your list + and offers Retry sync. Restore to radio puts back channels a radio lost and reports what + it confirmed. +- **Your radio's settings** (Offband firmware 1.7.0 or newer): per-channel Radio sound, + separate from phone notifications, plus display mode, status LED and display rotation. +- **Any radio:** BLE pairing PIN and Factory Reset, with an option to delete that radio's data + from the app. +- **Fixed:** blocks stored on the radio, Serial capture's radio log, CoreScope observer counts + and observer settings could be hidden by a firmware version check. +- **macOS:** a desktop build signed and notarized by Apple is part of each release. It appears + on the release page once Apple accepts it. It's new and hasn't had a full test pass. +- Share logs and About work without a radio. Bluetooth scan errors stay on screen. Every map + shows the OpenStreetMap credit. Long menus scroll, and links beside @mentions can be tapped. + +### Known issues + +- A channel's phone notifications set to Off can still notify (#1121). +- A factory reset deletes the app data only on the phone that sent it (#1123). +- On a T1000-E, QCC badge or Heltec T096 running firmware 1.7.0, the Status LED switch + appears but the radio refuses it (#1132). +- A Display or LED change can be undone by an older reading arriving just after it (#1124). +- A contact add the radio refuses because its table is full shows as added (#1028). +- On a T1000-E, Position Reporting Interval says it saved when the radio refused it (#1134). + +### Get it + +- **Android:** [Google Play](https://play.google.com/store/apps/details?id=app.offband.meshcore), + rolling out in stages, or the APK on the release page +- **iPhone:** [App Store](https://apps.apple.com/us/app/offband-meshcore/id6829124741) +- **Windows, macOS, Linux:** [v1.8.0 release](https://github.com/OffbandMesh/meshcore-client/releases/tag/v1.8.0) +- **Browser:** https://offband.app +- **Offband firmware 1.7.0:** [offband-v1.7.0](https://github.com/OffbandMesh/meshcore-firmware/releases/tag/offband-v1.7.0) + +Questions go in [Q&A](https://github.com/OffbandMesh/meshcore-client/discussions/categories/q-a) +and bugs in [Issues](https://github.com/OffbandMesh/meshcore-client/issues). Thanks to the +[OKIMesh community](https://okimesh.org/). If you'd like to help keep Offband going: +https://offband.org/donate diff --git a/announcements/README.md b/announcements/README.md new file mode 100644 index 00000000..ea943730 --- /dev/null +++ b/announcements/README.md @@ -0,0 +1,17 @@ +# GitHub Discussions announcement + +One file per release: `announcements/.md`, e.g. `announcements/1.8.0.md`. + +## Style + +A post for the **Announcements** category of this repo's GitHub Discussions. It's for people +who follow the project on GitHub: what landed, anything to read before updating, every known +issue that ships, and where to get each platform. Plainer than the Discord text, shorter than +the release notes, and it links to the release page for the full notes. + +The first line gives the discussion title (`**Title:** ...`), followed by a `---` line. The +post body is everything after that. + +**The post goes up after the release is published**, because it links to the release page. +Only the owner posts it, or an agent on the owner's word. CI never posts it, and the release +gate (`.github/scripts/release-gate.sh`) does not check this file. diff --git a/discord/1.8.0.md b/discord/1.8.0.md new file mode 100644 index 00000000..ec711c1f --- /dev/null +++ b/discord/1.8.0.md @@ -0,0 +1,25 @@ +🚀 **Offband MeshCore 1.8.0 is out.** A channels release: your message history now belongs to the channel, not to whichever slot it sits in on your radio. + +📱 **And it's on iPhone.** Offband MeshCore is now on the App Store (iOS 16.4 or newer): https://apps.apple.com/us/app/offband-meshcore/id6829124741. The App Store has 1.7.0 right now; 1.8.0 goes up once Apple has reviewed it. + +⚠️ **Heads up before updating.** Older versions could keep a channel's messages hidden after the channel left your radio, and bring them back later. 1.8.0 doesn't. On its first full sync, it deletes stored history for any channel your radio no longer holds. Channels still on your radio are untouched. If a reflash wiped the radio's channel storage, the app spots it, keeps the history, and offers **Restore to radio** instead. + +📡 **Channels you can trust.** History and unread counts follow the channel's key, so a channel that moves slots keeps them. Changing a channel's key asks whether to **keep** or **delete** its history. Adds can't overwrite another channel. Public always lives in slot 0, can't be deleted, and typing "public" as a hashtag gets you the real Public. An incomplete sync keeps your list and offers **Retry sync**. + +🔔 **Your radio's own settings** (needs Offband firmware 1.7.0): choose per channel whether the radio itself beeps for everything, mentions only, or nothing, separately from your phone. **Display and LED** settings, including rotation for an upside-down screen. (On a T1000-E, QCC badge or Heltec T096, the Status LED switch still shows on firmware 1.7.0 but the radio won't take it; a later firmware release lets the app hide it.) Settings from 1.7.0 like GPS power save and custom tunes show up now too. + +🔐 **Also:** set your radio's **BLE pairing PIN**, and **Factory Reset** from Settings (with a box to also clear that radio's data from the app). + +🍎 **macOS build** now on every release, signed and notarized by Apple, so it opens like any other app. It lands on the release page once Apple's check finishes, which can trail the other downloads. + +🔧 **Fixes and polish.** Radio-side blocks, Serial capture's radio log, CoreScope observer counts and observer settings no longer get hidden by a firmware version check. Share logs and About work without a radio, Bluetooth scan errors stay on screen, the OpenStreetMap credit is on every map, long menus scroll, and links next to @mentions are tappable. New text is English-only for now in other languages. + +🐛 **Known issues** (full list in the release notes): a channel's phone notifications set to Off can still notify, a factory reset only clears the app data on the phone that sent it, and on a T1000-E the Position Reporting Interval says it saved when the radio refused it. + +**📥 Get it on Google Play:** search **Offband MeshCore**, or https://play.google.com/store/apps/details?id=app.offband.meshcore (rolling out in stages, so it may take a few days to reach you) +📱 **iPhone, on the App Store:** https://apps.apple.com/us/app/offband-meshcore/id6829124741 (1.8.0 follows Apple's review) +💻 **Desktop (Windows / macOS / Linux) and Android APK:** https://github.com/OffbandMesh/meshcore-client/releases/tag/v1.8.0 +🌐 **Or run it in your browser:** https://offband.app +📻 **Offband firmware 1.7.0:** https://github.com/OffbandMesh/meshcore-firmware/releases/tag/offband-v1.7.0 + +💚 Thanks as always to the **OKIMesh community** (https://okimesh.org/). Offband is open source and always will be; if you'd like to help keep it going: https://offband.org/donate diff --git a/docs/user/assets/android/about.png b/docs/user/assets/android/about.png new file mode 100644 index 00000000..084f833c Binary files /dev/null and b/docs/user/assets/android/about.png differ diff --git a/docs/user/assets/android/actions.png b/docs/user/assets/android/actions.png new file mode 100644 index 00000000..dd212c6b Binary files /dev/null and b/docs/user/assets/android/actions.png differ diff --git a/docs/user/assets/android/app-debug-log.png b/docs/user/assets/android/app-debug-log.png new file mode 100644 index 00000000..30308647 Binary files /dev/null and b/docs/user/assets/android/app-debug-log.png differ diff --git a/docs/user/assets/android/app-settings-map-storage.png b/docs/user/assets/android/app-settings-map-storage.png new file mode 100644 index 00000000..22d35a75 Binary files /dev/null and b/docs/user/assets/android/app-settings-map-storage.png differ diff --git a/docs/user/assets/android/app-settings-translation-battery.png b/docs/user/assets/android/app-settings-translation-battery.png new file mode 100644 index 00000000..2c368439 Binary files /dev/null and b/docs/user/assets/android/app-settings-translation-battery.png differ diff --git a/docs/user/assets/android/app-settings.jpg b/docs/user/assets/android/app-settings.jpg new file mode 100644 index 00000000..b374ccfb Binary files /dev/null and b/docs/user/assets/android/app-settings.jpg differ diff --git a/docs/user/assets/android/blocked-list.png b/docs/user/assets/android/blocked-list.png new file mode 100644 index 00000000..983a2e70 Binary files /dev/null and b/docs/user/assets/android/blocked-list.png differ diff --git a/docs/user/assets/android/buzzer-and-tones-custom-tunes.jpg b/docs/user/assets/android/buzzer-and-tones-custom-tunes.jpg new file mode 100644 index 00000000..7d0fd0bc Binary files /dev/null and b/docs/user/assets/android/buzzer-and-tones-custom-tunes.jpg differ diff --git a/docs/user/assets/android/buzzer-and-tones.jpg b/docs/user/assets/android/buzzer-and-tones.jpg new file mode 100644 index 00000000..364ab9ad Binary files /dev/null and b/docs/user/assets/android/buzzer-and-tones.jpg differ diff --git a/docs/user/assets/android/channel-actions.jpg b/docs/user/assets/android/channel-actions.jpg new file mode 100644 index 00000000..3f8537ca Binary files /dev/null and b/docs/user/assets/android/channel-actions.jpg differ diff --git a/docs/user/assets/android/channel-chat-menu.png b/docs/user/assets/android/channel-chat-menu.png new file mode 100644 index 00000000..c4e9e1c1 Binary files /dev/null and b/docs/user/assets/android/channel-chat-menu.png differ diff --git a/docs/user/assets/android/channel-chat.png b/docs/user/assets/android/channel-chat.png new file mode 100644 index 00000000..76d9a302 Binary files /dev/null and b/docs/user/assets/android/channel-chat.png differ diff --git a/docs/user/assets/android/channel-drawer.jpg b/docs/user/assets/android/channel-drawer.jpg new file mode 100644 index 00000000..7ad02c47 Binary files /dev/null and b/docs/user/assets/android/channel-drawer.jpg differ diff --git a/docs/user/assets/android/channel-message-path.png b/docs/user/assets/android/channel-message-path.png new file mode 100644 index 00000000..29bbcadb Binary files /dev/null and b/docs/user/assets/android/channel-message-path.png differ diff --git a/docs/user/assets/android/channel-path-map.png b/docs/user/assets/android/channel-path-map.png new file mode 100644 index 00000000..3855308c Binary files /dev/null and b/docs/user/assets/android/channel-path-map.png differ diff --git a/docs/user/assets/android/channel-phone-notifications.jpg b/docs/user/assets/android/channel-phone-notifications.jpg new file mode 100644 index 00000000..0c9cb06e Binary files /dev/null and b/docs/user/assets/android/channel-phone-notifications.jpg differ diff --git a/docs/user/assets/android/channel-radio-sound.jpg b/docs/user/assets/android/channel-radio-sound.jpg new file mode 100644 index 00000000..f2e61836 Binary files /dev/null and b/docs/user/assets/android/channel-radio-sound.jpg differ diff --git a/docs/user/assets/android/channel-radio-tone-your-tunes.jpg b/docs/user/assets/android/channel-radio-tone-your-tunes.jpg new file mode 100644 index 00000000..d6a73a38 Binary files /dev/null and b/docs/user/assets/android/channel-radio-tone-your-tunes.jpg differ diff --git a/docs/user/assets/android/channel-radio-tone.jpg b/docs/user/assets/android/channel-radio-tone.jpg new file mode 100644 index 00000000..bc77bc68 Binary files /dev/null and b/docs/user/assets/android/channel-radio-tone.jpg differ diff --git a/docs/user/assets/android/channels.jpg b/docs/user/assets/android/channels.jpg new file mode 100644 index 00000000..b000ed22 Binary files /dev/null and b/docs/user/assets/android/channels.jpg differ diff --git a/docs/user/assets/android/chat-empty.png b/docs/user/assets/android/chat-empty.png new file mode 100644 index 00000000..156959ca Binary files /dev/null and b/docs/user/assets/android/chat-empty.png differ diff --git a/docs/user/assets/android/chat-menu.png b/docs/user/assets/android/chat-menu.png new file mode 100644 index 00000000..7b715150 Binary files /dev/null and b/docs/user/assets/android/chat-menu.png differ diff --git a/docs/user/assets/android/chat-routing-mode.png b/docs/user/assets/android/chat-routing-mode.png new file mode 100644 index 00000000..2f01c364 Binary files /dev/null and b/docs/user/assets/android/chat-routing-mode.png differ diff --git a/docs/user/assets/android/chat.png b/docs/user/assets/android/chat.png new file mode 100644 index 00000000..f62174d3 Binary files /dev/null and b/docs/user/assets/android/chat.png differ diff --git a/docs/user/assets/android/companion-debug-log.png b/docs/user/assets/android/companion-debug-log.png new file mode 100644 index 00000000..983a4bbb Binary files /dev/null and b/docs/user/assets/android/companion-debug-log.png differ diff --git a/docs/user/assets/android/contact-info.png b/docs/user/assets/android/contact-info.png new file mode 100644 index 00000000..4331d4f2 Binary files /dev/null and b/docs/user/assets/android/contact-info.png differ diff --git a/docs/user/assets/android/contact-settings.png b/docs/user/assets/android/contact-settings.png new file mode 100644 index 00000000..61604baf Binary files /dev/null and b/docs/user/assets/android/contact-settings.png differ diff --git a/docs/user/assets/android/contacts-advert-menu.png b/docs/user/assets/android/contacts-advert-menu.png new file mode 100644 index 00000000..7495469c Binary files /dev/null and b/docs/user/assets/android/contacts-advert-menu.png differ diff --git a/docs/user/assets/android/contacts-menu.png b/docs/user/assets/android/contacts-menu.png new file mode 100644 index 00000000..41fe5a33 Binary files /dev/null and b/docs/user/assets/android/contacts-menu.png differ diff --git a/docs/user/assets/android/contacts-sort-and-filter.png b/docs/user/assets/android/contacts-sort-and-filter.png new file mode 100644 index 00000000..457e77ce Binary files /dev/null and b/docs/user/assets/android/contacts-sort-and-filter.png differ diff --git a/docs/user/assets/android/contacts.png b/docs/user/assets/android/contacts.png new file mode 100644 index 00000000..fd2a6388 Binary files /dev/null and b/docs/user/assets/android/contacts.png differ diff --git a/docs/user/assets/android/debug.png b/docs/user/assets/android/debug.png new file mode 100644 index 00000000..b5695dcf Binary files /dev/null and b/docs/user/assets/android/debug.png differ diff --git a/docs/user/assets/android/device-info.png b/docs/user/assets/android/device-info.png new file mode 100644 index 00000000..3fa9d216 Binary files /dev/null and b/docs/user/assets/android/device-info.png differ diff --git a/docs/user/assets/android/discovered-contacts.png b/docs/user/assets/android/discovered-contacts.png new file mode 100644 index 00000000..5fffd804 Binary files /dev/null and b/docs/user/assets/android/discovered-contacts.png differ diff --git a/docs/user/assets/android/experimental.png b/docs/user/assets/android/experimental.png new file mode 100644 index 00000000..39f5116c Binary files /dev/null and b/docs/user/assets/android/experimental.png differ diff --git a/docs/user/assets/android/line-of-sight.png b/docs/user/assets/android/line-of-sight.png new file mode 100644 index 00000000..6c5ee148 Binary files /dev/null and b/docs/user/assets/android/line-of-sight.png differ diff --git a/docs/user/assets/android/location.jpg b/docs/user/assets/android/location.jpg new file mode 100644 index 00000000..03ae2d6a Binary files /dev/null and b/docs/user/assets/android/location.jpg differ diff --git a/docs/user/assets/android/map-cache.png b/docs/user/assets/android/map-cache.png new file mode 100644 index 00000000..ef6b1bce Binary files /dev/null and b/docs/user/assets/android/map-cache.png differ diff --git a/docs/user/assets/android/map-drawer.png b/docs/user/assets/android/map-drawer.png new file mode 100644 index 00000000..3b84e757 Binary files /dev/null and b/docs/user/assets/android/map-drawer.png differ diff --git a/docs/user/assets/android/map-path-trace.png b/docs/user/assets/android/map-path-trace.png new file mode 100644 index 00000000..7f1008c2 Binary files /dev/null and b/docs/user/assets/android/map-path-trace.png differ diff --git a/docs/user/assets/android/map.png b/docs/user/assets/android/map.png new file mode 100644 index 00000000..115d92f7 Binary files /dev/null and b/docs/user/assets/android/map.png differ diff --git a/docs/user/assets/android/mesh-topology.png b/docs/user/assets/android/mesh-topology.png new file mode 100644 index 00000000..5a963183 Binary files /dev/null and b/docs/user/assets/android/mesh-topology.png differ diff --git a/docs/user/assets/android/message-settings.jpg b/docs/user/assets/android/message-settings.jpg new file mode 100644 index 00000000..61cc5b8e Binary files /dev/null and b/docs/user/assets/android/message-settings.jpg differ diff --git a/docs/user/assets/android/my-contact-qr.png b/docs/user/assets/android/my-contact-qr.png new file mode 100644 index 00000000..ae715247 Binary files /dev/null and b/docs/user/assets/android/my-contact-qr.png differ diff --git a/docs/user/assets/android/node-battery.png b/docs/user/assets/android/node-battery.png new file mode 100644 index 00000000..8dbd789f Binary files /dev/null and b/docs/user/assets/android/node-battery.png differ diff --git a/docs/user/assets/android/node-button-actions.png b/docs/user/assets/android/node-button-actions.png new file mode 100644 index 00000000..af317e0b Binary files /dev/null and b/docs/user/assets/android/node-button-actions.png differ diff --git a/docs/user/assets/android/node-display-and-led.png b/docs/user/assets/android/node-display-and-led.png new file mode 100644 index 00000000..c28ad36d Binary files /dev/null and b/docs/user/assets/android/node-display-and-led.png differ diff --git a/docs/user/assets/android/node-screen.png b/docs/user/assets/android/node-screen.png new file mode 100644 index 00000000..1970635a Binary files /dev/null and b/docs/user/assets/android/node-screen.png differ diff --git a/docs/user/assets/android/node-settings.jpg b/docs/user/assets/android/node-settings.jpg new file mode 100644 index 00000000..e7c22632 Binary files /dev/null and b/docs/user/assets/android/node-settings.jpg differ diff --git a/docs/user/assets/android/privacy-settings.png b/docs/user/assets/android/privacy-settings.png new file mode 100644 index 00000000..d202b136 Binary files /dev/null and b/docs/user/assets/android/privacy-settings.png differ diff --git a/docs/user/assets/android/radio-presets-usa.jpg b/docs/user/assets/android/radio-presets-usa.jpg new file mode 100644 index 00000000..4537b39b Binary files /dev/null and b/docs/user/assets/android/radio-presets-usa.jpg differ diff --git a/docs/user/assets/android/radio-settings-path-hash-mode.jpg b/docs/user/assets/android/radio-settings-path-hash-mode.jpg new file mode 100644 index 00000000..0e2269e2 Binary files /dev/null and b/docs/user/assets/android/radio-settings-path-hash-mode.jpg differ diff --git a/docs/user/assets/android/radio-settings-usa-queencitycon.jpg b/docs/user/assets/android/radio-settings-usa-queencitycon.jpg new file mode 100644 index 00000000..ba94b7e1 Binary files /dev/null and b/docs/user/assets/android/radio-settings-usa-queencitycon.jpg differ diff --git a/docs/user/assets/android/radio-settings-usa.jpg b/docs/user/assets/android/radio-settings-usa.jpg new file mode 100644 index 00000000..f48a4a78 Binary files /dev/null and b/docs/user/assets/android/radio-settings-usa.jpg differ diff --git a/docs/user/assets/android/radio-stats.png b/docs/user/assets/android/radio-stats.png new file mode 100644 index 00000000..c6e0e7ce Binary files /dev/null and b/docs/user/assets/android/radio-stats.png differ diff --git a/docs/user/assets/android/repeater-login.png b/docs/user/assets/android/repeater-login.png new file mode 100644 index 00000000..d920ecfc Binary files /dev/null and b/docs/user/assets/android/repeater-login.png differ diff --git a/docs/user/assets/android/settings-contacts.png b/docs/user/assets/android/settings-contacts.png new file mode 100644 index 00000000..b7fb2dc7 Binary files /dev/null and b/docs/user/assets/android/settings-contacts.png differ diff --git a/docs/user/assets/android/settings-more.png b/docs/user/assets/android/settings-more.png new file mode 100644 index 00000000..29a371f4 Binary files /dev/null and b/docs/user/assets/android/settings-more.png differ diff --git a/docs/user/assets/android/settings.jpg b/docs/user/assets/android/settings.jpg new file mode 100644 index 00000000..ef57cf52 Binary files /dev/null and b/docs/user/assets/android/settings.jpg differ diff --git a/docs/user/guides/channels.md b/docs/user/guides/channels.md new file mode 100644 index 00000000..4a3a652b --- /dev/null +++ b/docs/user/guides/channels.md @@ -0,0 +1,68 @@ +--- +title: Use channels +--- + +# Use channels + +A channel is a group conversation. Everyone whose radio holds the same channel +key can read it. The **Channels** tab lists the channels stored on your radio, +with a red badge for unread messages. + +![Channel list](../assets/android/channels.jpg) + +## Kinds of channel + +| Kind | Who can read it | +|---|---| +| **Public** | Every MeshCore radio. The app won't delete it, and Offband firmware keeps it in the first slot. | +| **Hashtag** (`#name`) | Anyone who joins the same name. The key is made from the name, so nothing secret is shared. | +| **Private** | Only people you give the secret key to, by typing it in or by sharing a QR code. | + +## Add a channel + +Tap **+** at the bottom right, then choose to create a private channel, join a +private channel by its key, join the Public channel, or join a hashtag channel by +name. Your radio has a fixed number of channel slots. + +## Read and send + +Tap a channel to open it. With message tracing on (**Settings > App Settings > +Enable Message Tracing**), each message also shows its time, how many hops it took +and the repeaters it came through. + +![Channel chat](../assets/android/channel-chat.png) + +Type `@` to mention someone; the app suggests recent senders and contacts. Tap a +message's hop count to see its full route, hop by hop, and the same route on a map. + +![Packet path](../assets/android/channel-message-path.png) + +![Path on the map](../assets/android/channel-path-map.png) + +## Channel actions + +Long-press a channel (right-click on desktop) to open its actions. + +![Channel actions](../assets/android/channel-actions.jpg) + +- **Edit channel:** rename it, or change a private channel's key. Renaming a + hashtag channel changes its key, because the key comes from the name. Whenever + the key changes, the app asks whether to **keep** the message history (it moves + to the new key) or **delete** it. +- **Share QR Code:** show a code another person can scan to join. +- **Phone notifications, Radio sound, Radio tone:** see + [Notifications, sounds and radio tones](notifications-and-tones.md). +- **Delete channel:** removes it from the radio and deletes its message history. + +Drag the handle on the right of a channel to change the order of the list. + +## In a channel + +The menu at the top right of an open channel has the notification, sound and tone +settings, **Set Region Scope** and **Clear Chat**. + +![Channel menu](../assets/android/channel-chat-menu.png) + +**Set Region Scope** limits how far your messages in that channel travel: only +repeaters that allow the chosen region pass them on. It needs repeaters in your +area that have regions set up. diff --git a/docs/user/guides/contacts-and-messages.md b/docs/user/guides/contacts-and-messages.md new file mode 100644 index 00000000..b29278ab --- /dev/null +++ b/docs/user/guides/contacts-and-messages.md @@ -0,0 +1,84 @@ +--- +title: Message contacts directly +--- + +# Message contacts directly + +The **Contacts** tab lists the nodes your radio knows: people (chat nodes), +repeaters, room servers and sensors. Each row shows the route to it (Flood or a +hop count), part of its public key and when it was last heard. + +![Contact list](../assets/android/contacts.png) + +Use the filter button at the top right to sort by latest message, last heard or +name, and to show only favorites, one kind of node, or contacts with unread +messages. + +![Sort and filter](../assets/android/contacts-sort-and-filter.png) + +## Add a contact + +Nodes are added when your radio hears their advert, if automatic adding is on +for that kind of node (**Settings > Contacts**). Nodes heard but not added are in +the menu at the top right under **Discovered Contacts**. + +![Contacts menu](../assets/android/contacts-menu.png) + +The same menu can add a contact by public key or by scanning their QR code, and +shows **My contact QR** for others to scan. The QR's link works even if the other +person has never heard your advert. + +![My contact QR](../assets/android/my-contact-qr.png) + +## Let others find you + +The broadcast button next to the menu sends your advert so other radios can add +you: + +- **Zero Hop Advert** reaches only radios that hear you directly. +- **Flood Advert** is repeated across the mesh. + +The same menu can copy your advert to the clipboard, or add a contact from an +advert someone else copied. + +![Advert menu](../assets/android/contacts-advert-menu.png) + +## Send a direct message + +Tap a chat contact to open the conversation. Your sent messages show a check +mark once delivery is confirmed, and the round-trip time. A message that needed +another try shows its retry count. + +![Direct chat](../assets/android/chat.png) + +## Routing + +The route button at the top of a chat chooses how messages reach this contact: + +- **Auto (use saved path):** use the route learned from earlier messages, and + flood when there isn't one. +- **Direct:** send with no repeaters. The message arrives only if the contact's + radio hears yours directly. +- **Force Flood Mode:** always flood. + +![Routing mode](../assets/android/chat-routing-mode.png) + +## Contact menu + +The menu at the top right of a chat has **Contact Info**, **Telemetry**, +**Contact Settings**, **Clear Chat** and **Block**. + +![Contact menu](../assets/android/chat-menu.png) + +**Contact Info** shows the node type, route, last-heard time, location and full +public key. + +![Contact info](../assets/android/contact-info.png) + +**Contact Settings** controls what this contact may receive from your radio: +battery and basic telemetry, location, environment sensors, and whether they may +run CLI commands on your radio (**Remote CLI**). + +![Contact settings](../assets/android/contact-settings.png) + +Blocked contacts are listed under **Settings > Blocked**. diff --git a/docs/user/guides/getting-started.md b/docs/user/guides/getting-started.md new file mode 100644 index 00000000..dace559e --- /dev/null +++ b/docs/user/guides/getting-started.md @@ -0,0 +1,53 @@ +--- +title: Install the app and connect your radio +--- + +# Install the app and connect your radio + +## Get the app + +| Platform | Where | +|---|---| +| Android | [Google Play](https://play.google.com/store/apps/details?id=app.offband.meshcore), or the `.apk` on the [releases page](https://github.com/OffbandMesh/meshcore-client/releases) | +| iPhone | [App Store](https://apps.apple.com/us/app/offband-meshcore/id6829124741), iOS 16.4 or newer | +| Windows, macOS, Linux | The `offband-windows-x64.zip`, `offband-macos.zip` and `offband-linux-x64.tar.gz` downloads on the [releases page](https://github.com/OffbandMesh/meshcore-client/releases) | +| Web | [offband.app](https://offband.app) in Chrome or Edge | + +The web app uses Web Bluetooth, which works only in Chromium-based browsers +(Chrome, Edge) and not in any browser on iPhone or iPad; on an iPhone, use the +App Store app. TCP connections are not available on the web. + +## Connect + +Your radio must run MeshCore **companion** firmware. A repeater or room-server +image can't be connected to directly; manage those from the app with a +[repeater login](repeaters.md). + +- **Bluetooth:** scan from the app's first screen and pick your radio, then enter + its pairing PIN when your device asks for it: + - A radio with a screen shows a new PIN on its screen each time it starts. + - A radio without a screen, such as the SenseCAP T1000-E or a QCC badge + without a display, uses **123456**. + - Once you set your own PIN, the radio uses that instead. See or change it + under **Settings > Actions > BLE pairing PIN**. +- **USB:** plug the radio in and choose its serial port. +- **TCP:** enter the host and port of a radio that is reachable over your + network. Not available on the web. + +## Find your way around + +Once connected, the app opens on three tabs: + +| Tab | What it's for | +|---|---| +| **Contacts** | People, repeaters and other nodes your radio knows, and direct messages with them | +| **Channels** | Group conversations: Public, hashtag channels and private channels | +| **Map** | Nodes with known positions, path traces and line-of-sight checks | + +![Channel list](../assets/android/channels.jpg) + +The top of each tab shows your radio's name, battery level and the signal of the +last packet it heard. The menu button at the top left opens the side panel, +which holds your channel list, **Disconnect** and **Settings**. + +![Side panel](../assets/android/channel-drawer.jpg) diff --git a/docs/user/guides/location-and-privacy.md b/docs/user/guides/location-and-privacy.md new file mode 100644 index 00000000..9fd081d7 --- /dev/null +++ b/docs/user/guides/location-and-privacy.md @@ -0,0 +1,50 @@ +--- +title: Control location and privacy +--- + +# Control location and privacy + +## Your radio's location + +**Settings > Location** controls the radio's GPS, on radios that have one: + +- **Off**, **On**, or **Power save**, which takes a fix and then sleeps. +- **Sleep between fix attempts** sets how long power save waits. +- **Coordinates** shows and sets the position your radio reports. +- **Position reporting interval** sets how often the position is sent. + +If the radio can't get a fix it backs off and shows when it will try again; +**Query** asks it now. + +![Location](../assets/android/location.jpg) + +## What your radio shares + +**Settings > Privacy Settings**: + +- **Advert Location** includes your position in the advert other radios receive. +- **Multi-ACKs** sends extra delivery confirmations. +- **Telemetry Base, Location and Environment Mode** choose who may request each + kind of telemetry from your radio. + +![Privacy settings](../assets/android/privacy-settings.png) + +Each contact can also be allowed or refused individually under that contact's +**Contact Settings**; see [Message contacts directly](contacts-and-messages.md#contact-menu). + +## What contacts are added + +**Settings > Contacts** chooses which kinds of node your radio adds +automatically when it hears them: users, repeaters, room servers and sensors. +**Overwrite Oldest** replaces the oldest contact that isn't a favorite when the +list is full. + +![Contact settings](../assets/android/settings-contacts.png) + +## Blocking + +Block a contact from its chat menu. Blocked contacts are listed under +**Settings > Blocked**. On radios that support it, the block list is also stored +on the radio. + +![Blocked](../assets/android/blocked-list.png) diff --git a/docs/user/guides/map-and-line-of-sight.md b/docs/user/guides/map-and-line-of-sight.md new file mode 100644 index 00000000..95eeb509 --- /dev/null +++ b/docs/user/guides/map-and-line-of-sight.md @@ -0,0 +1,50 @@ +--- +title: Use the map, path traces and line of sight +--- + +# Use the map, path traces and line of sight + +## Node map + +The **Map** tab shows every node with a known position. The panel at the top +right summarizes how many nodes are shown; tap its arrow for the breakdown. + +![Node map](../assets/android/map.png) + +The menu button at the top left chooses which nodes appear: chat nodes, +repeaters and other nodes, discovered contacts, guessed locations, and whether +names are always shown. + +![Map filters](../assets/android/map-drawer.png) + +Map tiles come from OpenStreetMap. To use the map without a connection, save an +area first under **Settings > App Settings > Offline Map Cache**. + +![Offline map cache](../assets/android/map-cache.png) + +## Path trace + +The path trace button at the top right starts a trace: tap nodes on the map, in +order, to build the route you want to trace. Tap the **X** to cancel. + +![Path trace](../assets/android/map-path-trace.png) + +## Line of sight + +The line-of-sight button checks whether terrain blocks the radio path between +two points. Tap nodes, or long-press the map for a custom point, to set point A +and point B, then run the check. + +![Line of sight](../assets/android/line-of-sight.png) + +The profile shows: + +- **Terrain** along the path, from Open-Meteo elevation data. +- **LOS beam**, the straight line between the two antennas. +- **Radio horizon**, the curve the signal follows at your radio's frequency. + +The result reads either "clear" with the minimum clearance, or "blocked" with +how far the terrain rises above the path. Tap a blocked spot to highlight it on +the map; the details give its distance from each end and its coordinates. + +Distances and heights follow **Settings > App Settings > Units**. diff --git a/docs/user/guides/notifications-and-tones.md b/docs/user/guides/notifications-and-tones.md new file mode 100644 index 00000000..ab2b3da3 --- /dev/null +++ b/docs/user/guides/notifications-and-tones.md @@ -0,0 +1,58 @@ +--- +title: Choose notifications, sounds and radio tones +--- + +# Choose notifications, sounds and radio tones + +There are two separate things that can alert you: + +- **Phone notifications** come from the app on your phone or computer. +- **Radio sounds** come from the buzzer on the radio itself, on radios that have + one and run firmware that supports it. + +## App notifications + +**Settings > Message Settings** turns app notifications on or off for direct +messages, channel messages and newly heard nodes. + +![Message settings](../assets/android/message-settings.jpg) + +Each channel also has its own setting. Long-press the channel and choose +**Phone notifications**: **All messages**, **Mentions only**, or **Off**. + +![Phone notifications for a channel](../assets/android/channel-phone-notifications.jpg) + +## The radio's buzzer + +**Settings > Message Settings > Buzzer and tones** sets when the radio beeps: + +- **All:** for any received message. +- **Self:** only for direct messages and @mentions of you. +- **None:** never. + +Below that, **Tones** picks what the radio plays for each event: a direct +message, a channel message, a room message, a new contact, an acknowledgement +and a sent message. + +![Buzzer and tones](../assets/android/buzzer-and-tones.jpg) + +### Custom tunes + +The radio stores eight custom tunes in RTTTL format. Tap an empty slot to add +one, and the play button to hear it on the radio. A saved tune can be picked for +any event or channel. + +![Custom tunes](../assets/android/buzzer-and-tones-custom-tunes.jpg) + +### Per channel + +Long-press a channel to override the radio for that channel: + +- **Radio sound:** **Not set** (follow the radio's setting), **All messages**, + **Mentions only**, or **Off**. +- **Radio tone:** the tone this channel plays, from the built-in tones or your + custom tunes. + +![Radio sound for a channel](../assets/android/channel-radio-sound.jpg) + +![Radio tone for a channel](../assets/android/channel-radio-tone.jpg) diff --git a/docs/user/guides/radio-settings.md b/docs/user/guides/radio-settings.md new file mode 100644 index 00000000..b96e7c85 --- /dev/null +++ b/docs/user/guides/radio-settings.md @@ -0,0 +1,51 @@ +--- +title: Set your radio's frequency and presets +--- + +# Set your radio's frequency and presets + +Radios only hear each other when they use the same frequency, bandwidth, +spreading factor and coding rate. Open **Settings > Radio Settings**. + +## Pick a preset + +The **Presets** list sets all four values at once. Presets are grouped by +country. Each is labeled **MeshCore**, from MeshCore's suggested regional +settings, or **Offband**, for presets Offband adds, such as event and local-mesh +settings. The date under the list shows when the presets were last updated; tap +the refresh button to fetch the latest. + +![Preset list, USA](../assets/android/radio-presets-usa.jpg) + +In the United States, use **USA** unless your local mesh or an event tells you +otherwise. + +![USA preset](../assets/android/radio-settings-usa.jpg) + +![An event preset](../assets/android/radio-settings-usa-queencitycon.jpg) + +## Set values by hand + +You can also enter the frequency, bandwidth, spreading factor, coding rate and +transmit power yourself. The hint under each field shows the range your radio +accepts. Tap **Save** to write the settings to the radio. + +- **Off-Grid Repeat** lets your companion radio repeat other people's packets. +- **Path hash mode** sets how many bytes identify each repeater in a route. More + bytes mean fewer collisions between repeater IDs but fewer hops per route. + Radios on firmware 1.13 or older drop multi-byte routes, so raise it only once + your local network has updated. + +![Off-grid repeat and path hash mode](../assets/android/radio-settings-path-hash-mode.jpg) + +## Check the radio + +**Settings > Radio stats** shows the noise floor, the signal strength and SNR of +the last packet, and total transmit and receive airtime. + +![Radio stats](../assets/android/radio-stats.png) + +**Settings > Device Info** shows the radio's firmware version, model and +capabilities. + +![Device info](../assets/android/device-info.png) diff --git a/docs/user/guides/repeaters.md b/docs/user/guides/repeaters.md new file mode 100644 index 00000000..95e881fc --- /dev/null +++ b/docs/user/guides/repeaters.md @@ -0,0 +1,28 @@ +--- +title: Log in to and manage a repeater +--- + +# Log in to and manage a repeater + +Repeaters appear in your **Contacts** list with an antenna icon. Tap one to log +in. + +![Repeater login](../assets/android/repeater-login.png) + +Enter the repeater's guest or admin password. Tick **Save password** to keep it +on this device. **Manage Paths** chooses the route used to reach the repeater, +the same way as for a [direct message](contacts-and-messages.md#routing). Room +servers use the same login. + +After logging in, the repeater's page opens: + +| Page | Guest | Admin | +|---|---|---| +| **Status** | Yes | Yes | +| **Telemetry** | Yes | Yes | +| **Neighbors**: the repeaters it hears directly | Yes | Yes | +| **CLI**: the repeater's command line | | Yes | +| **Settings**: name, radio and other repeater settings | | Yes | + +Repeater firmware and its commands are covered in the +[Offband firmware manual](https://docs.offband.org/firmware/). diff --git a/docs/user/guides/support-logs.md b/docs/user/guides/support-logs.md new file mode 100644 index 00000000..5268224c --- /dev/null +++ b/docs/user/guides/support-logs.md @@ -0,0 +1,36 @@ +--- +title: Collect logs for a bug report +--- + +# Collect logs for a bug report + +A log from around the time of a problem is often the fastest way to find its +cause. Open **Settings > Debug**. + +![Debug](../assets/android/debug.png) + +1. Turn on **App Debug Logging**, if it isn't already, and reproduce the problem. +2. Tap **Share logs** and attach the file to your + [bug report](https://github.com/OffbandMesh/meshcore-client/issues/new/choose). +3. In the report, say which radio, firmware version and app version you use + (**Settings > Device Info** and **Settings > About**), what you did, what you + expected and what happened. + +## What's in the logs + +- **App Debug Log:** what the app did, such as syncing messages, saving + settings and deciding whether to notify you. +- **Companion Debug Log:** every frame sent to and received from your radio. +- **Serial capture:** records the radio's own serial log and shares it as a file. +- **Mesh topology:** the nodes and links the app has learned from routed packets. + +![App debug log](../assets/android/app-debug-log.png) + +![Companion debug log](../assets/android/companion-debug-log.png) + +## Before you share + +Logs can contain contact names, public keys, message text and your radio's +location, sometimes in encoded form, such as a GPS reply shown as hex in the +companion log. Read through a log before posting it publicly, or send it +privately. diff --git a/docs/user/index.md b/docs/user/index.md new file mode 100644 index 00000000..09e08bf6 --- /dev/null +++ b/docs/user/index.md @@ -0,0 +1,35 @@ +--- +title: Offband MeshCore app manual +--- + +# Offband MeshCore app manual + +Offband MeshCore is an open-source app for MeshCore LoRa radios. It connects to +your radio over Bluetooth, USB or TCP and gives you channels, direct messages, +a node map, radio settings and repeater administration. + +## Start here + +- [Install the app and connect your radio](guides/getting-started.md). +- [Use channels](guides/channels.md). +- [Message contacts directly](guides/contacts-and-messages.md). +- [Use the map, path traces and line of sight](guides/map-and-line-of-sight.md). +- [Set your radio's frequency and presets](guides/radio-settings.md). +- [Choose notifications, sounds and radio tones](guides/notifications-and-tones.md). +- [Log in to and manage a repeater](guides/repeaters.md). +- [Control location and privacy](guides/location-and-privacy.md). +- [Collect logs for a bug report](guides/support-logs.md). +- [See every screen](screens.md). +- [Download the app](https://github.com/OffbandMesh/meshcore-client/releases). +- [Report a problem](https://github.com/OffbandMesh/meshcore-client/issues/new/choose). + +## About this manual + +These pages describe Offband MeshCore 1.8.0. The screenshots are from Android; +the desktop apps use the same screens and settings in a wider layout. Some +features depend on your radio's firmware, and a page says so where that applies. +For the radio itself, see the [Offband firmware manual](https://docs.offband.org/firmware/). + +The manual is maintained with the app's source code and is corrected as the app +changes. If a page doesn't match what you see, please +[report it](https://github.com/OffbandMesh/meshcore-client/issues/new/choose). diff --git a/docs/user/screens.md b/docs/user/screens.md new file mode 100644 index 00000000..5e246f4d --- /dev/null +++ b/docs/user/screens.md @@ -0,0 +1,91 @@ +--- +title: Every screen +--- + +# Every screen + +Screenshots of Offband MeshCore 1.8.0 on Android (Samsung Galaxy S26 Ultra), connected to a radio running Offband firmware with the USA radio presets. Personal details are blurred. + +## Contacts and direct messages + +| Screen | Image | +|---|---| +| Contact list | [contacts.png](assets/android/contacts.png) | +| Sort and filter | [contacts-sort-and-filter.png](assets/android/contacts-sort-and-filter.png) | +| Contacts menu: discovered contacts, add by key, scan QR, my QR | [contacts-menu.png](assets/android/contacts-menu.png) | +| Advert menu | [contacts-advert-menu.png](assets/android/contacts-advert-menu.png) | +| Discovered contacts | [discovered-contacts.png](assets/android/discovered-contacts.png) | +| My contact QR | [my-contact-qr.png](assets/android/my-contact-qr.png) | +| Direct chat | [chat.png](assets/android/chat.png) | +| Direct chat with no messages | [chat-empty.png](assets/android/chat-empty.png) | +| Chat menu | [chat-menu.png](assets/android/chat-menu.png) | +| Routing mode | [chat-routing-mode.png](assets/android/chat-routing-mode.png) | +| Contact info | [contact-info.png](assets/android/contact-info.png) | +| Contact settings | [contact-settings.png](assets/android/contact-settings.png) | +| Repeater login | [repeater-login.png](assets/android/repeater-login.png) | + +## Channels + +| Screen | Image | +|---|---| +| Channel list | [channels.jpg](assets/android/channels.jpg) | +| Side panel | [channel-drawer.jpg](assets/android/channel-drawer.jpg) | +| Channel chat | [channel-chat.png](assets/android/channel-chat.png) | +| Channel menu | [channel-chat-menu.png](assets/android/channel-chat-menu.png) | +| Packet path of a message | [channel-message-path.png](assets/android/channel-message-path.png) | +| Packet path on the map | [channel-path-map.png](assets/android/channel-path-map.png) | +| Channel actions | [channel-actions.jpg](assets/android/channel-actions.jpg) | +| Phone notifications for a channel | [channel-phone-notifications.jpg](assets/android/channel-phone-notifications.jpg) | +| Radio sound for a channel | [channel-radio-sound.jpg](assets/android/channel-radio-sound.jpg) | +| Radio tone for a channel: built-in tones | [channel-radio-tone.jpg](assets/android/channel-radio-tone.jpg) | +| Radio tone for a channel: custom tunes | [channel-radio-tone-your-tunes.jpg](assets/android/channel-radio-tone-your-tunes.jpg) | + +## Map + +| Screen | Image | +|---|---| +| Node map | [map.png](assets/android/map.png) | +| Map filters | [map-drawer.png](assets/android/map-drawer.png) | +| Path trace | [map-path-trace.png](assets/android/map-path-trace.png) | +| Line of sight | [line-of-sight.png](assets/android/line-of-sight.png) | +| Offline map cache | [map-cache.png](assets/android/map-cache.png) | + +## Settings + +| Screen | Image | +|---|---| +| Settings | [settings.jpg](assets/android/settings.jpg) | +| Settings, lower half | [settings-more.png](assets/android/settings-more.png) | +| Node settings | [node-settings.jpg](assets/android/node-settings.jpg) | +| Button actions | [node-button-actions.png](assets/android/node-button-actions.png) | +| Screen | [node-screen.png](assets/android/node-screen.png) | +| Battery | [node-battery.png](assets/android/node-battery.png) | +| Display and LED | [node-display-and-led.png](assets/android/node-display-and-led.png) | +| Radio settings, USA preset | [radio-settings-usa.jpg](assets/android/radio-settings-usa.jpg) | +| Radio settings, USA - QueenCityCon preset | [radio-settings-usa-queencitycon.jpg](assets/android/radio-settings-usa-queencitycon.jpg) | +| Radio settings: off-grid repeat and path hash mode | [radio-settings-path-hash-mode.jpg](assets/android/radio-settings-path-hash-mode.jpg) | +| Radio presets, USA section | [radio-presets-usa.jpg](assets/android/radio-presets-usa.jpg) | +| Location | [location.jpg](assets/android/location.jpg) | +| Radio stats | [radio-stats.png](assets/android/radio-stats.png) | +| Privacy settings | [privacy-settings.png](assets/android/privacy-settings.png) | +| Contacts: automatic discovery | [settings-contacts.png](assets/android/settings-contacts.png) | +| Blocked | [blocked-list.png](assets/android/blocked-list.png) | +| Message settings | [message-settings.jpg](assets/android/message-settings.jpg) | +| Buzzer and tones | [buzzer-and-tones.jpg](assets/android/buzzer-and-tones.jpg) | +| Buzzer and tones: custom tunes | [buzzer-and-tones-custom-tunes.jpg](assets/android/buzzer-and-tones-custom-tunes.jpg) | +| App settings | [app-settings.jpg](assets/android/app-settings.jpg) | +| App settings: translation, battery, screen | [app-settings-translation-battery.png](assets/android/app-settings-translation-battery.png) | +| App settings: map, units, storage | [app-settings-map-storage.png](assets/android/app-settings-map-storage.png) | +| Device info | [device-info.png](assets/android/device-info.png) | +| Actions | [actions.png](assets/android/actions.png) | +| Experimental | [experimental.png](assets/android/experimental.png) | +| About | [about.png](assets/android/about.png) | + +## Debug + +| Screen | Image | +|---|---| +| Debug | [debug.png](assets/android/debug.png) | +| Companion debug log | [companion-debug-log.png](assets/android/companion-debug-log.png) | +| App debug log | [app-debug-log.png](assets/android/app-debug-log.png) | +| Mesh topology | [mesh-topology.png](assets/android/mesh-topology.png) | diff --git a/lib/connector/meshcore_connector.dart b/lib/connector/meshcore_connector.dart index 6904ad4e..3bfe1555 100644 --- a/lib/connector/meshcore_connector.dart +++ b/lib/connector/meshcore_connector.dart @@ -56,7 +56,6 @@ import '../storage/client_id_store.dart'; import '../storage/contact_discovery_store.dart'; import '../storage/contact_settings_store.dart'; import '../storage/contact_store.dart'; -import '../storage/factory_reset_store.dart'; import '../storage/message_store.dart'; import '../storage/radio_data_wipe.dart'; import '../storage/unread_store.dart'; @@ -236,8 +235,16 @@ enum ChannelWrite { /// An edit to a new key cleared the old channel, but the new one was not /// confirmed, so the slot is now empty. (#1026) clearedNotAdded, + + /// The radio took the new key, but the old key's message history, which + /// the user chose to keep, could not be moved to it. (#1128) + historyNotMoved, } +/// What a channel key change does with the old key's message history. The +/// user is asked; history is never kept hidden (#1128). +enum KeyChangeHistory { keep, delete } + /// Result of [MeshCoreConnector.exportPrivateKey]. [identity] is /// non-null only when [outcome] is [IdentityTransfer.ok]. (#578) class IdentityExportResult { @@ -308,16 +315,7 @@ enum FactoryResetStatus { sentBle, sent, - /// The radio came back with a new identity and its app data was deleted. - complete, - - /// New identity; the user chose to keep the app data. - completeKept, - - /// Same identity on reconnect: the radio was not wiped. Nothing deleted. - notReset, - - /// New identity, but deleting the old app data failed. Retried next connect. + /// Sent, but deleting the radio's app data failed. deleteFailed, } @@ -548,6 +546,11 @@ class MeshCoreConnector extends ChangeNotifier { bool _batteryRequested = false; bool _awaitingSelfInfo = false; bool _hasReceivedDeviceInfo = false; + + /// This connection's device info has said how many channel slots the radio + /// has, on every transport ([_hasReceivedDeviceInfo] is set only where the + /// initial sync is gated on it). (#1128) + bool _slotCountKnown = false; // Initial sync is serialized for predictable progress. Firmware exposes one // FIFO queued-message stream, so direct/room frames are buffered until after // contacts are known. @@ -1161,9 +1164,23 @@ class MeshCoreConnector extends ChangeNotifier { bool get supportsScreenSettings => firmwareSupportsScreenSettings(_offbandCaps2); - /// Whether this radio has a settable display or LED (#523, caps byte 2 - /// `0x04`). Which of the two it has, it says only by refusing the other. - bool get supportsIndicators => firmwareSupportsIndicators(_offbandCaps2); + /// Whether this radio's display mode can be set (#1132, firmware #2069). + /// See [resolveIndicatorSupport] for the precedence between the advert tags + /// and caps2 `0x04`. + bool get supportsDisplayControl => resolveIndicatorSupport( + offbandCaps2: _offbandCaps2, + advert: _capabilityAdvert, + ).display; + + /// Whether this radio's status LED can be set (#1132, firmware #2069). + bool get supportsLedControl => resolveIndicatorSupport( + offbandCaps2: _offbandCaps2, + advert: _capabilityAdvert, + ).led; + + /// Whether this radio has a settable display or LED, so the Indicators page + /// has anything to show (#523, #1132). + bool get supportsIndicators => supportsDisplayControl || supportsLedControl; /// The LED and display state the radio last reported, from device-info or a /// reply. Null when it has not said. @@ -1468,6 +1485,8 @@ class MeshCoreConnector extends ChangeNotifier { '${advert ?? 'UNSUPPORTED, falling back to device-info offsets'}' ' chanNotify=$supportsChannelNotify' ' rotation=$supportsDisplayRotation' + ' display=$supportsDisplayControl' + ' led=$supportsLedControl' ' ackCapacity=${ackCapacity ?? 'absent'}', tag: 'DeviceUI', ); @@ -1887,9 +1906,10 @@ class MeshCoreConnector extends ChangeNotifier { Future _sendIndicatorSet( String what, DeviceUiSurface surface, - Uint8List frame, - ) async { - if (!_deviceUiGateOpen(what, advertised: supportsIndicators)) return; + Uint8List frame, { + required bool advertised, + }) async { + if (!_deviceUiGateOpen(what, advertised: advertised)) return; _deviceUiError = null; _deviceUiErrorSurface = null; _pendingDeviceUiWrite = surface; @@ -1901,6 +1921,7 @@ class MeshCoreConnector extends ChangeNotifier { 'display SET', DeviceUiSurface.display, buildDisplaySetFrame(mode), + advertised: supportsDisplayControl, ); /// Refused locally until the radio has answered the rotation GET, so @@ -1917,6 +1938,7 @@ class MeshCoreConnector extends ChangeNotifier { 'rotation SET', DeviceUiSurface.rotation, buildRotationSetFrame(degrees), + advertised: supportsIndicators, ); } @@ -1942,6 +1964,7 @@ class MeshCoreConnector extends ChangeNotifier { 'led SET', DeviceUiSurface.led, buildLedSetFrame(on: on), + advertised: supportsLedControl, ); /// Re-read whatever headless-UI state this radio supports. Called after every @@ -4597,6 +4620,8 @@ class MeshCoreConnector extends ChangeNotifier { storageService?.setPublicKeyHex = ''; // Device-scoped: the next radio's device info supplies its own pin (#1100). _deviceBlePin = null; + // Kept history a key change could not land belongs to this radio (#1128). + _sparedFromPurge.clear(); _applySelfKeyToBlockService(); } @@ -4611,6 +4636,7 @@ class MeshCoreConnector extends ChangeNotifier { _selfInfoRetryTimer?.cancel(); _selfInfoRetryTimer = null; _hasReceivedDeviceInfo = false; + _slotCountKnown = false; // Drop the previous radio's in-memory history before a new connection loads // its own. These caches are keyed by channel index / contact key, not by // radio, so without this a radio switch would keep showing the prior @@ -4699,6 +4725,10 @@ class MeshCoreConnector extends ChangeNotifier { void setAppDebugLogServiceForTest(AppDebugLogService service) => _appDebugLogService = service; + @visibleForTesting + void setAppSettingsServiceForTest(AppSettingsService service) => + _appSettingsService = service; + /// The state a BLE link leaves behind: a radio to go back to. (#997) @visibleForTesting void primeAutoReconnectForTest(String deviceId) { @@ -5094,6 +5124,7 @@ class MeshCoreConnector extends ChangeNotifier { _batteryRequested = false; _awaitingSelfInfo = false; _hasReceivedDeviceInfo = false; + _slotCountKnown = false; _maxContacts = _defaultMaxContacts; _maxChannels = _defaultMaxChannels; _resetSyncProgressState(); @@ -6880,7 +6911,6 @@ class MeshCoreConnector extends ChangeNotifier { await sendFrame(buildRebootFrame()); } - final FactoryResetStore _factoryResetStore = FactoryResetStore(); FactoryResetStatus? _factoryResetStatus; FactoryResetStatus? get factoryResetStatus => _factoryResetStatus; @@ -6889,19 +6919,6 @@ class MeshCoreConnector extends ChangeNotifier { notifyListeners(); } - @visibleForTesting - String? transportIdentityForTest; - - /// Which physical device the link goes to, independent of its identity, - /// which a factory reset replaces. - String? get _transportIdentity => - transportIdentityForTest ?? - switch (_activeTransport) { - MeshCoreTransportType.bluetooth => _deviceId, - MeshCoreTransportType.usb => activeUsbPort, - MeshCoreTransportType.tcp => activeTcpEndpoint, - }; - String? get _radioPrefix { final hex = selfPublicKeyHex; return hex.length >= 10 ? hex.substring(0, 10) : null; @@ -6909,30 +6926,19 @@ class MeshCoreConnector extends ChangeNotifier { /// Wipes the connected radio (#1054). Null when sent, else why not. /// - /// The app data is NOT deleted here. The radio drops the link before it - /// formats, so nothing proves the wipe until it reconnects with a new - /// identity; see [_resolvePendingFactoryReset]. The session is ended on - /// purpose so it does not auto-reconnect into a wiped radio. + /// With [deleteAppData], the radio's app data is deleted once the link is + /// closed, so nothing from this session writes it back. Future factoryResetDevice({ required bool deleteAppData, }) async { - final deviceId = _transportIdentity; final prefix = _radioPrefix; - if (!isConnected || deviceId == null || prefix == null) { + if (!isConnected || prefix == null) { return FactoryResetRefusal.notConnected; } - await _factoryResetStore.save( - PendingFactoryReset( - deviceId: deviceId, - radioPrefix: prefix, - deleteAppData: deleteAppData, - ), - ); final overBle = _activeTransport == MeshCoreTransportType.bluetooth; _appDebugLogService?.info( - 'Factory reset sent device=$deviceId radio=$prefix ' - 'deleteAppData=$deleteAppData', + 'Factory reset sent radio=$prefix deleteAppData=$deleteAppData', tag: 'Connection', ); await sendFrame(buildFactoryResetFrame()); @@ -6943,64 +6949,27 @@ class MeshCoreConnector extends ChangeNotifier { // Give the frame time to leave before the transport closes. await Future.delayed(const Duration(milliseconds: 500)); await disconnect(); - return null; - } - /// Settles a pending factory reset on the first SELF_INFO of a connect. - /// - /// Only a connect to the same device decides anything. Same identity means - /// the wipe did not happen and every byte of app data stays. A failed delete - /// keeps the record, so the next connect tries again. - Future _resolvePendingFactoryReset() async { - final pending = _factoryResetStore.load(); - final deviceId = _transportIdentity; - final prefix = _radioPrefix; - if (pending == null || deviceId == null || prefix == null) return; - final outcome = resolveFactoryReset( - pending, - deviceId: deviceId, - radioPrefix: prefix, - ); - if (outcome == null) return; - - if (outcome == FactoryResetOutcome.wipeAppData) { + if (deleteAppData) { try { - final removed = await wipeRadioData(pending.radioPrefix); - await _appSettingsService?.forgetRadio(pending.radioPrefix); + final removed = await wipeRadioData(prefix); + await _appSettingsService?.forgetRadio(prefix); _appDebugLogService?.info( - 'Factory reset confirmed, removed $removed stored items for ' - '${pending.radioPrefix}', + 'Factory reset removed $removed stored items for $prefix', tag: 'Connection', ); } catch (e) { _appDebugLogService?.error( - 'Factory reset confirmed but deleting ${pending.radioPrefix} ' - 'failed, will retry next connect: $e', + 'Factory reset: deleting app data for $prefix failed: $e', tag: 'Connection', ); _factoryResetStatus = FactoryResetStatus.deleteFailed; notifyListeners(); - return; } } - - await _factoryResetStore.clear(); - _factoryResetStatus = switch (outcome) { - FactoryResetOutcome.wipeAppData => FactoryResetStatus.complete, - FactoryResetOutcome.keepAppData => FactoryResetStatus.completeKept, - FactoryResetOutcome.notReset => FactoryResetStatus.notReset, - }; - _appDebugLogService?.info( - 'Factory reset resolved: $outcome', - tag: 'Connection', - ); - notifyListeners(); + return null; } - @visibleForTesting - Future resolvePendingFactoryResetForTest() => - _resolvePendingFactoryReset(); - Future setPrivacyMode(bool enabled) async { await sendCliCommand('set privacy ${enabled ? 'on' : 'off'}'); } @@ -7180,6 +7149,10 @@ class MeshCoreConnector extends ChangeNotifier { '[ChannelSync] Sync complete: received ${_channels.length}/$_totalChannelsToRequest channels' '${_unconfirmedChannelSlots.isEmpty ? '' : ', unconfirmed slots: $_unconfirmedChannelSlots'}', ); + // A sync before device info, or one asked for fewer slots, has not seen + // every channel, so it cannot say what the radio does not hold (#1128). + final askedSlots = _totalChannelsToRequest; + final sawEverySlot = _slotCountKnown && askedSlots >= _maxChannels; _cleanupChannelSync(completed: true); @@ -7226,6 +7199,7 @@ class MeshCoreConnector extends ChangeNotifier { 'channel(s) retained); use Restore to write them back to the radio.', tag: 'ChannelSync', ); + _logHistoryCheckSkipped('the radio has erased slots (Restore case)'); } else if (_unconfirmedChannelSlots.isEmpty) { // Full confirmation: the fresh list is the truth, replace the cache. _cachedChannels = List.from(_channels); @@ -7237,6 +7211,18 @@ class MeshCoreConnector extends ChangeNotifier { ); }), ); + // Only here: an erased slot means the radio lost channels that Restore + // can put back with their history, and a hole means the list is not + // known. Neither is a list to judge history against (#1128). + if (sawEverySlot) { + unawaited(_purgeHistoryNotOnRadio()); + } else { + _logHistoryCheckSkipped( + _slotCountKnown + ? 'this sync read $askedSlots of the radio\'s $_maxChannels slots' + : 'device info has not said how many slots the radio has', + ); + } } else { // Holes: keep the last fully-confirmed persisted list for offline use // rather than overwriting it with a partial one. The holes are surfaced @@ -7247,6 +7233,9 @@ class MeshCoreConnector extends ChangeNotifier { 'Retry the sync to confirm them.', tag: 'ChannelSync', ); + _logHistoryCheckSkipped( + 'slots $_unconfirmedChannelSlots are unconfirmed', + ); } _recalculateCachedChannelsUnreadTotal(); @@ -7414,6 +7403,7 @@ class MeshCoreConnector extends ChangeNotifier { int _channelWritesInFlight = 0; bool _channelSyncDeferredByWrite = false; + final Set _sparedFromPurge = {}; /// True while the channel list cannot be trusted to show which slots are /// free: a sync is re-reading it, or a write has not been answered yet. A @@ -7552,9 +7542,11 @@ class MeshCoreConnector extends ChangeNotifier { /// OffbandMesh/meshcore-firmware#1864 refuses a different channel over an /// occupied slot, and that is what a new key in place is. /// - /// A new key is a slot reassignment for history purposes, the same as - /// before the clear-then-add: the old key's PSK-keyed history is kept, so - /// it comes back if that key is ever re-added (#1063). + /// A new key needs [history], the user's answer to what happens to the old + /// key's messages (#1128). It is applied as soon as the radio confirms the + /// clear, never waiting on the add, so the old key's history is never left + /// hidden: Keep moves it and the notify mode to the new key, Delete removes + /// it as Delete Channel would. /// /// If the clear lands and the add does not, the slot is left empty and this /// returns [ChannelWrite.clearedNotAdded], so the user is told the channel is @@ -7562,10 +7554,17 @@ class MeshCoreConnector extends ChangeNotifier { Future editChannel( Channel channel, String name, - Uint8List psk, - ) async { + Uint8List psk, { + KeyChangeHistory? history, + }) async { if (!isConnected) return ChannelWrite.noReply; - if (listEquals(channel.psk, psk)) { + final keyChanges = !listEquals(channel.psk, psk); + if (keyChanges && history == null) { + throw ArgumentError( + 'A key change needs the keep-or-delete history answer (#1128)', + ); + } + if (!keyChanges) { return _setChannel( channel.index, name, @@ -7581,6 +7580,15 @@ class MeshCoreConnector extends ChangeNotifier { _syncAfterChannelWrites(); return cleared; } + final newPskHex = Channel( + index: channel.index, + name: name, + psk: psk, + ).pskHex; + final moved = await _applyKeyChangeHistory(channel, newPskHex, history!); + // The user said keep. What could not be moved stays under the old key, + // and the sync after this write must not delete it as hidden. + if (!moved) _sparedFromPurge.add(channel.pskHex); await _retireSlotOccupant(channel.index); final added = await _setChannel( channel.index, @@ -7589,9 +7597,14 @@ class MeshCoreConnector extends ChangeNotifier { occupantPsk: null, refresh: true, ); - return added == ChannelWrite.ok - ? ChannelWrite.ok - : ChannelWrite.clearedNotAdded; + if (added != ChannelWrite.ok) { + // The kept history now waits under a key the radio does not hold, for + // the user to add the channel again; the sync after this write must + // not delete it as hidden (#1128). + if (history == KeyChangeHistory.keep) _sparedFromPurge.add(newPskHex); + return ChannelWrite.clearedNotAdded; + } + return moved ? ChannelWrite.ok : ChannelWrite.historyNotMoved; } finally { _endChannelWrite(); } @@ -7705,13 +7718,80 @@ class MeshCoreConnector extends ChangeNotifier { /// - legacy slot-index keys (pre-#194) would be adopted onto the new /// occupant by the store's one-time migration; purge them (#193/#1063). /// - the in-memory conversation map is slot-keyed; drop this slot's entry. - /// The old occupant's PSK-keyed history is deliberately left intact: if - /// that channel is ever re-added (any slot), its history comes back (#1063). + /// The old occupant's PSK-keyed history is settled by the full sync every + /// write ends with, not here: firmware that moves a channel out of the way + /// (#1896) still holds it, so it keeps its history, and a channel the radio + /// no longer holds has its history deleted by that sync (#1128). Future _retireSlotOccupant(int index) async { await _channelMessageStore.clearLegacySlotHistory(index); _channelMessages.remove(index); } + /// Applies the user's keep-or-delete answer for a key change once the radio + /// has confirmed the clear (#1128). Returns false when Keep could not move + /// the history; the store has logged why and left it under the old key. + Future _applyKeyChangeHistory( + Channel channel, + String newPskHex, + KeyChangeHistory history, + ) async { + _appDebugLogService?.info( + 'Key change on slot ${channel.index} "${channel.name}": user chose to ' + '${history.name} its message history', + tag: 'ChannelWrite', + ); + if (history == KeyChangeHistory.delete) { + await _channelMessageStore.deleteChannelHistory(channel.pskHex); + return true; + } + final moved = await _channelMessageStore.moveChannelHistory( + channel.pskHex, + newPskHex, + ); + await _appSettingsService?.moveChannelNotifyMode( + devicePrefix: selfPublicKeyHex, + fromPskHex: channel.pskHex, + toPskHex: newPskHex, + ); + return moved != null; + } + + /// Every sync says what became of the hidden-history check, so a log never + /// leaves "ran and found nothing" indistinguishable from "did not run". + void _logHistoryCheckSkipped(String why) => _appDebugLogService?.info( + 'Hidden channel history check skipped for radio ' + '${_channelMessageStore.publicKeyHex}: $why. Nothing deleted (#1128)', + tag: 'Storage', + ); + + /// Deletes this radio's channel history that no channel on it shows, after + /// a sync the radio fully confirmed with nothing erased (#1128). Not while a + /// write is waiting on the radio: the list could be mid-change. + /// + /// [_sparedFromPurge] holds keys whose kept history a key change could not + /// put on the radio: the add was not confirmed, or the move failed. It lasts + /// for this connection, and a key leaves it once the radio holds it again, + /// so a later delete of that channel is judged normally. + Future _purgeHistoryNotOnRadio() async { + if (_channelWritesInFlight > 0) { + _logHistoryCheckSkipped('a channel write is waiting on the radio'); + return; + } + final onRadio = _channels.where((c) => !c.isUnusable).toList(); + _sparedFromPurge.removeAll(onRadio.map((c) => c.pskHex)); + try { + await _channelMessageStore.purgeHistoryNotOnRadio( + radioPskHex: {...onRadio.map((c) => c.pskHex), ..._sparedFromPurge}, + occupiedSlots: onRadio.map((c) => c.index).toSet(), + ); + } catch (e) { + _appDebugLogService?.error( + 'Could not delete history no channel on the radio shows: $e', + tag: 'Storage', + ); + } + } + // --- Offband GPS query (CMD_OFFBAND_GPS / RESP_CODE_OFFBAND_GPS = 0xC1) (#135) OffbandGpsStatus? _latestOffbandGpsStatus; Completer? _offbandGpsCompleter; @@ -9056,10 +9136,6 @@ class MeshCoreConnector extends ChangeNotifier { // another radio's data. storageService?.setPublicKeyHex = selfPublicKeyHex; - // A factory reset is proven or disproven here, by the identity this - // device now reports (#1054). - unawaited(_resolvePendingFactoryReset()); - // Now that we have self info, we can load all the persisted data for this // node. Each step is timed: this sequence has stalled the UI isolate for // ~40s on a large store, and the timings say which step is responsible. @@ -9164,7 +9240,7 @@ class MeshCoreConnector extends ChangeNotifier { /// LED (byte 85) and display mode (byte 86), appended unconditionally on /// v21+ (firmware #542). Each is null when the frame stops short of it. Like /// the FEM byte, presence says nothing about capability: - /// [supportsIndicators] does. + /// [supportsDisplayControl] and [supportsLedControl] do. /// /// Bytes 82 to 86 keep working and are explicitly untouched by the advert /// contract (§7). Nothing here reads 87, and nothing may: rotation is read @@ -9181,6 +9257,7 @@ class MeshCoreConnector extends ChangeNotifier { if (_shouldGateInitialChannelSync) { _hasReceivedDeviceInfo = true; } + _slotCountKnown = true; _firmwareVerCode = frame[1]; // Readable build date / model / firmware version, NUL-terminated strings @@ -11841,6 +11918,7 @@ class MeshCoreConnector extends ChangeNotifier { // Preserve deviceId and displayName for UI display during reconnection // They're only cleared on manual disconnect via disconnect() method _hasReceivedDeviceInfo = false; + _slotCountKnown = false; // But NOT the identity that scopes stored data (#158). A manual // disconnect() clears _selfPublicKey; an unexpected drop did not, so // every per-radio store, and the one channels_screen builds from diff --git a/lib/connector/offband_capability_advert.dart b/lib/connector/offband_capability_advert.dart index 48c8a04d..955c79ae 100644 --- a/lib/connector/offband_capability_advert.dart +++ b/lib/connector/offband_capability_advert.dart @@ -33,6 +33,13 @@ const int offbandUiInfoGet = 0x1C; const int offbandInfoTagChanNotify = 0x01; const int offbandInfoTagDisplayRotation = 0x02; const int offbandInfoTagAckCapacity = 0x03; + +/// Display control and LED control are separate capabilities (firmware #2067, +/// PR OffbandMesh/meshcore-firmware#2080, merged `c835aeca`): a board can have +/// one without the other, and caps2 `0x04` INDICATORS answers both with one +/// bit. Values are read over `0x05`/`0x06` and `0x07`/`0x08`. +const int offbandInfoTagDisplayControl = 0x04; +const int offbandInfoTagLedControl = 0x05; const int offbandInfoTagContinue = 0xFF; /// `0x00` is not a valid tag. diff --git a/lib/connector/offband_indicators.dart b/lib/connector/offband_indicators.dart index 8b7ed3ad..5ea4d747 100644 --- a/lib/connector/offband_indicators.dart +++ b/lib/connector/offband_indicators.dart @@ -1,5 +1,6 @@ import 'dart:typed_data'; +import 'offband_capability_advert.dart'; import 'offband_device_ui.dart'; /// The radio's display and LED over `0xC5` (#523, #944): display mode, display @@ -32,7 +33,9 @@ import 'offband_device_ui.dart'; /// advert, NOT by caps2 `0x04` INDICATORS and NOT by probing `0x1A` and /// watching for a refusal. Contract §3 forbids that probing outright: /// "what is forbidden is discovering support by trying each feature's sub-code -/// and watching for errors." Display mode and the LED keep the INDICATORS bit. +/// and watching for errors." Display mode and the LED each have their own +/// advert tag, with the INDICATORS bit as the fallback: see +/// [resolveIndicatorSupport]. /// /// A board without a display, or without a controllable LED, refuses that /// half with reason 6; a display that cannot turn refuses rotation with 10. @@ -52,6 +55,42 @@ const List displayRotations = [0, 180]; bool firmwareSupportsIndicators(int? offbandCaps2) => offbandCaps2 != null && (offbandCaps2 & offbandCap2Indicators) != 0; +/// Which indicator controls this radio has, each on its own (#1132, firmware +/// #2069). +/// +/// caps2 `0x04` answers display AND LED with one bit, so a board with a real +/// display and no controllable LED showed an LED switch the radio then refused +/// with `[0xC5][0x7F][0x06]` (firmware #2065: a T096, a T1000-E, a QCC badge). +/// Precedence, from the firmware header on `firmware-base`, the same shape as +/// channel notify: +/// +/// - the advert carries `TAG_DISPLAY_CONTROL` and/or `TAG_LED_CONTROL`: the +/// tags decide, each control on its own, and the bit is ignored; +/// - the advert answered with neither tag: firmware from before the tags, so +/// the bit answers both, as it always has; +/// - no advert (the radio predates `0x1C`, or has not answered yet): the bit +/// answers both. +/// +/// The bit is not retired: radios on firmware 1.7.0 and earlier answer the +/// advert without these tags, and dropping the bit would hide working display +/// control on them. Support is never found by sending a GET and reading the +/// refusal (contract §3). +({bool display, bool led}) resolveIndicatorSupport({ + required int? offbandCaps2, + required OffbandCapabilityAdvert? advert, +}) { + if (advert != null && + (advert.has(offbandInfoTagDisplayControl) || + advert.has(offbandInfoTagLedControl))) { + return ( + display: advert.has(offbandInfoTagDisplayControl), + led: advert.has(offbandInfoTagLedControl), + ); + } + final bit = firmwareSupportsIndicators(offbandCaps2); + return (display: bit, led: bit); +} + /// When the radio's screen is lit. Values are the wire encoding. enum DisplayMode { auto(0, 'Auto', 'On while in use, then off after the screen timeout'), diff --git a/lib/helpers/channel_slot_ui.dart b/lib/helpers/channel_slot_ui.dart index be007131..4bfa822b 100644 --- a/lib/helpers/channel_slot_ui.dart +++ b/lib/helpers/channel_slot_ui.dart @@ -85,12 +85,51 @@ bool explainUnconfirmedChannelWrite(BuildContext context, ChannelWrite result) { ChannelWrite.rejected => l10n.channels_writeRejected, ChannelWrite.noReply => l10n.channels_writeNoReply, ChannelWrite.clearedNotAdded => l10n.channels_writeClearedNotAdded, + ChannelWrite.historyNotMoved => l10n.channels_writeHistoryNotMoved, }; if (message == null) return false; showChannelBlockedMessage(context, message); return true; } +/// Asks what a key change does with [channelName]'s message history: kept +/// under the new key, or deleted. Null means the user backed out, and nothing +/// may be written (#1128). +Future askKeyChangeHistory( + BuildContext context, + String channelName, +) { + return showDialog( + context: context, + builder: (dialogContext) { + final l10n = dialogContext.l10n; + return AlertDialog( + title: Text(l10n.channels_keyChangeHistoryTitle), + content: Text(l10n.channels_keyChangeHistoryBody(channelName)), + actions: [ + TextButton( + onPressed: () => Navigator.pop(dialogContext), + child: Text(l10n.common_cancel), + ), + TextButton( + style: TextButton.styleFrom( + foregroundColor: Theme.of(dialogContext).colorScheme.error, + ), + onPressed: () => + Navigator.pop(dialogContext, KeyChangeHistory.delete), + child: Text(l10n.channels_keyChangeDeleteHistory), + ), + FilledButton( + onPressed: () => + Navigator.pop(dialogContext, KeyChangeHistory.keep), + child: Text(l10n.channels_keyChangeKeepHistory), + ), + ], + ); + }, + ); +} + /// Refuses a second Public channel, and says so. Returns true if it refused. /// /// Public is identified by its PSK (`Channel.isPublicChannel`), not by name or diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index cb528347..b2f3fda3 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -439,15 +439,10 @@ "settings_factoryResetDeleteAppData": "Also delete this radio's data stored in the app", "settings_factoryResetNotConnected": "Factory reset not sent: no radio is connected.", "factoryResetSentTitle": "Factory reset sent", - "factoryResetSentBody": "The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.", - "factoryResetSentBleBody": "The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer's Bluetooth settings, then reconnect to finish.", - "factoryResetCompleteTitle": "Factory reset complete", - "factoryResetCompleteBody": "The radio has a new identity. Its old data was deleted from the app.", - "factoryResetCompleteKeptBody": "The radio has a new identity. Its old data was kept in the app.", - "factoryResetNotResetTitle": "Factory reset did not happen", - "factoryResetNotResetBody": "The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.", - "factoryResetDeleteFailedTitle": "Factory reset done, app cleanup failed", - "factoryResetDeleteFailedBody": "The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.", + "factoryResetSentBody": "The radio is erasing itself and will restart with a new identity.", + "factoryResetSentBleBody": "The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer's Bluetooth settings, then reconnect.", + "factoryResetDeleteFailedTitle": "Factory reset sent, app cleanup failed", + "factoryResetDeleteFailedBody": "The reset was sent, but deleting this radio's data from the app failed.", "settings_blePin": "BLE pairing PIN", "settings_blePinDefault": "Firmware default", "settings_blePinHelp": "6 digits (100000-999999). New phones and PCs must enter it when pairing. Reset to default to return to the firmware's built-in behavior.", @@ -508,6 +503,12 @@ "settings_aboutWebsite": "Offband website", "settings_aboutPlayStore": "Google Play", "settings_aboutDonate": "Donate or sponsor", + "sponsorPrompt_title": "Support Offband", + "sponsorPrompt_body": "Offband MeshCore is free, open source, and built by an independent developer. If it's useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.", + "sponsorPrompt_sponsor": "Sponsor", + "sponsorPrompt_anytime": "You can support Offband anytime from About in Settings, or at offband.org/donate.", + "sponsorPrompt_notNow": "Not now", + "sponsorPrompt_never": "Never Show Again", "settings_aboutLinkFailed": "Could not open the link", "settings_aboutOpenMeteoAttribution": "LOS elevation data: Open-Meteo (CC BY 4.0)", "settings_aboutPresetsAttribution": "Regional radio presets: MeshCore's suggested settings, maintained by Liam Cottle (api.meshcore.nz), with Offband additions.", @@ -1092,6 +1093,31 @@ "@channels_writeClearedNotAdded": { "description": "A channel key change is clear-then-add; the clear landed and the add did not, so the edited channel is gone from the radio. Persistent (#1026)." }, + "channels_writeHistoryNotMoved": "The channel was changed, but its message history could not be moved to it. The app log has the details.", + "@channels_writeHistoryNotMoved": { + "description": "The user chose to keep message history across a key change; the radio took the new key but the app could not move the stored messages. Persistent (#1128)." + }, + "channels_keyChangeHistoryTitle": "Keep message history?", + "@channels_keyChangeHistoryTitle": { + "description": "Title of the question asked before a channel's key changes (a hashtag rename, or a new private key) (#1128)." + }, + "channels_keyChangeHistoryBody": "This gives \"{name}\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.", + "@channels_keyChangeHistoryBody": { + "description": "Body of the keep-or-delete question for a channel key change (#1128).", + "placeholders": { + "name": { + "type": "String" + } + } + }, + "channels_keyChangeKeepHistory": "Keep message history", + "@channels_keyChangeKeepHistory": { + "description": "Moves the channel's stored messages to its new key (#1128)." + }, + "channels_keyChangeDeleteHistory": "Delete message history", + "@channels_keyChangeDeleteHistory": { + "description": "Deletes the channel's stored messages, as Delete Channel does (#1128)." + }, "channels_sortBy": "Sort by", "channels_sortManual": "Manual", "channels_sortAZ": "A-Z", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 381ddb78..cd0b9837 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -1525,55 +1525,25 @@ abstract class AppLocalizations { /// No description provided for @factoryResetSentBody. /// /// In en, this message translates to: - /// **'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'** + /// **'The radio is erasing itself and will restart with a new identity.'** String get factoryResetSentBody; /// No description provided for @factoryResetSentBleBody. /// /// In en, this message translates to: - /// **'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'** + /// **'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'** String get factoryResetSentBleBody; - /// No description provided for @factoryResetCompleteTitle. - /// - /// In en, this message translates to: - /// **'Factory reset complete'** - String get factoryResetCompleteTitle; - - /// No description provided for @factoryResetCompleteBody. - /// - /// In en, this message translates to: - /// **'The radio has a new identity. Its old data was deleted from the app.'** - String get factoryResetCompleteBody; - - /// No description provided for @factoryResetCompleteKeptBody. - /// - /// In en, this message translates to: - /// **'The radio has a new identity. Its old data was kept in the app.'** - String get factoryResetCompleteKeptBody; - - /// No description provided for @factoryResetNotResetTitle. - /// - /// In en, this message translates to: - /// **'Factory reset did not happen'** - String get factoryResetNotResetTitle; - - /// No description provided for @factoryResetNotResetBody. - /// - /// In en, this message translates to: - /// **'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'** - String get factoryResetNotResetBody; - /// No description provided for @factoryResetDeleteFailedTitle. /// /// In en, this message translates to: - /// **'Factory reset done, app cleanup failed'** + /// **'Factory reset sent, app cleanup failed'** String get factoryResetDeleteFailedTitle; /// No description provided for @factoryResetDeleteFailedBody. /// /// In en, this message translates to: - /// **'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'** + /// **'The reset was sent, but deleting this radio\'s data from the app failed.'** String get factoryResetDeleteFailedBody; /// No description provided for @settings_blePin. @@ -1768,6 +1738,42 @@ abstract class AppLocalizations { /// **'Donate or sponsor'** String get settings_aboutDonate; + /// No description provided for @sponsorPrompt_title. + /// + /// In en, this message translates to: + /// **'Support Offband'** + String get sponsorPrompt_title; + + /// No description provided for @sponsorPrompt_body. + /// + /// In en, this message translates to: + /// **'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'** + String get sponsorPrompt_body; + + /// No description provided for @sponsorPrompt_sponsor. + /// + /// In en, this message translates to: + /// **'Sponsor'** + String get sponsorPrompt_sponsor; + + /// No description provided for @sponsorPrompt_anytime. + /// + /// In en, this message translates to: + /// **'You can support Offband anytime from About in Settings, or at offband.org/donate.'** + String get sponsorPrompt_anytime; + + /// No description provided for @sponsorPrompt_notNow. + /// + /// In en, this message translates to: + /// **'Not now'** + String get sponsorPrompt_notNow; + + /// No description provided for @sponsorPrompt_never. + /// + /// In en, this message translates to: + /// **'Never Show Again'** + String get sponsorPrompt_never; + /// No description provided for @settings_aboutLinkFailed. /// /// In en, this message translates to: @@ -3376,6 +3382,36 @@ abstract class AppLocalizations { /// **'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'** String get channels_writeClearedNotAdded; + /// The user chose to keep message history across a key change; the radio took the new key but the app could not move the stored messages. Persistent (#1128). + /// + /// In en, this message translates to: + /// **'The channel was changed, but its message history could not be moved to it. The app log has the details.'** + String get channels_writeHistoryNotMoved; + + /// Title of the question asked before a channel's key changes (a hashtag rename, or a new private key) (#1128). + /// + /// In en, this message translates to: + /// **'Keep message history?'** + String get channels_keyChangeHistoryTitle; + + /// Body of the keep-or-delete question for a channel key change (#1128). + /// + /// In en, this message translates to: + /// **'This gives \"{name}\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'** + String channels_keyChangeHistoryBody(String name); + + /// Moves the channel's stored messages to its new key (#1128). + /// + /// In en, this message translates to: + /// **'Keep message history'** + String get channels_keyChangeKeepHistory; + + /// Deletes the channel's stored messages, as Delete Channel does (#1128). + /// + /// In en, this message translates to: + /// **'Delete message history'** + String get channels_keyChangeDeleteHistory; + /// No description provided for @channels_sortBy. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_bg.dart b/lib/l10n/app_localizations_bg.dart index de9ee51a..16074096 100644 --- a/lib/l10n/app_localizations_bg.dart +++ b/lib/l10n/app_localizations_bg.dart @@ -833,37 +833,19 @@ class AppLocalizationsBg extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -983,6 +965,26 @@ class AppLocalizationsBg extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1931,6 +1933,24 @@ class AppLocalizationsBg extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Сортирай по'; diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 7116eebb..86d2d4ac 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -830,37 +830,19 @@ class AppLocalizationsDe extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -978,6 +960,26 @@ class AppLocalizationsDe extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1926,6 +1928,24 @@ class AppLocalizationsDe extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Sortiere nach'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 1784ff17..c31afc87 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -821,37 +821,19 @@ class AppLocalizationsEn extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -969,6 +951,26 @@ class AppLocalizationsEn extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1904,6 +1906,24 @@ class AppLocalizationsEn extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Sort by'; diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index 4fa57309..4a731d04 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -831,37 +831,19 @@ class AppLocalizationsEs extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -979,6 +961,26 @@ class AppLocalizationsEs extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1927,6 +1929,24 @@ class AppLocalizationsEs extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Ordenar por'; diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index 07bee59b..ca1692eb 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -835,37 +835,19 @@ class AppLocalizationsFr extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -983,6 +965,26 @@ class AppLocalizationsFr extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1932,6 +1934,24 @@ class AppLocalizationsFr extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Trier par'; diff --git a/lib/l10n/app_localizations_hu.dart b/lib/l10n/app_localizations_hu.dart index 6f7db77c..f8276eeb 100644 --- a/lib/l10n/app_localizations_hu.dart +++ b/lib/l10n/app_localizations_hu.dart @@ -833,37 +833,19 @@ class AppLocalizationsHu extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -981,6 +963,26 @@ class AppLocalizationsHu extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1932,6 +1934,24 @@ class AppLocalizationsHu extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Szűrés'; diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index cd01fdd5..aa91e014 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -833,37 +833,19 @@ class AppLocalizationsIt extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -981,6 +963,26 @@ class AppLocalizationsIt extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1929,6 +1931,24 @@ class AppLocalizationsIt extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Ordina per'; diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index cf5f5651..e7acd1d5 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -807,37 +807,19 @@ class AppLocalizationsJa extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -954,6 +936,26 @@ class AppLocalizationsJa extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1870,6 +1872,24 @@ class AppLocalizationsJa extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => '並び替え'; diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index 6497537a..0739a01d 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -807,37 +807,19 @@ class AppLocalizationsKo extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -954,6 +936,26 @@ class AppLocalizationsKo extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1865,6 +1867,24 @@ class AppLocalizationsKo extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => '정렬 기준 선택'; diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index dd1d3798..f54677a7 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -827,37 +827,19 @@ class AppLocalizationsNl extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -975,6 +957,26 @@ class AppLocalizationsNl extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1917,6 +1919,24 @@ class AppLocalizationsNl extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Sorteren door'; diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index 9a781304..455aa673 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -835,37 +835,19 @@ class AppLocalizationsPl extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -983,6 +965,26 @@ class AppLocalizationsPl extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1938,6 +1940,24 @@ class AppLocalizationsPl extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Sortuj po'; diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index c923805f..c46b31ee 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -833,37 +833,19 @@ class AppLocalizationsPt extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -981,6 +963,26 @@ class AppLocalizationsPt extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1926,6 +1928,24 @@ class AppLocalizationsPt extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Ordenar por'; diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index d7cc917f..a9332831 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -832,37 +832,19 @@ class AppLocalizationsRu extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -980,6 +962,26 @@ class AppLocalizationsRu extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1927,6 +1929,24 @@ class AppLocalizationsRu extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Сортировка'; diff --git a/lib/l10n/app_localizations_sk.dart b/lib/l10n/app_localizations_sk.dart index 5ecf0703..18142185 100644 --- a/lib/l10n/app_localizations_sk.dart +++ b/lib/l10n/app_localizations_sk.dart @@ -827,37 +827,19 @@ class AppLocalizationsSk extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -975,6 +957,26 @@ class AppLocalizationsSk extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1918,6 +1920,24 @@ class AppLocalizationsSk extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Triediť podľa'; diff --git a/lib/l10n/app_localizations_sl.dart b/lib/l10n/app_localizations_sl.dart index 48b620f9..f2ea851f 100644 --- a/lib/l10n/app_localizations_sl.dart +++ b/lib/l10n/app_localizations_sl.dart @@ -825,37 +825,19 @@ class AppLocalizationsSl extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -972,6 +954,26 @@ class AppLocalizationsSl extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1915,6 +1917,24 @@ class AppLocalizationsSl extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Sortiraj po'; diff --git a/lib/l10n/app_localizations_sv.dart b/lib/l10n/app_localizations_sv.dart index def070e3..84f5f16a 100644 --- a/lib/l10n/app_localizations_sv.dart +++ b/lib/l10n/app_localizations_sv.dart @@ -822,37 +822,19 @@ class AppLocalizationsSv extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -970,6 +952,26 @@ class AppLocalizationsSv extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1907,6 +1909,24 @@ class AppLocalizationsSv extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Sortera efter'; diff --git a/lib/l10n/app_localizations_uk.dart b/lib/l10n/app_localizations_uk.dart index 2626bffb..2877c165 100644 --- a/lib/l10n/app_localizations_uk.dart +++ b/lib/l10n/app_localizations_uk.dart @@ -829,37 +829,19 @@ class AppLocalizationsUk extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -978,6 +960,26 @@ class AppLocalizationsUk extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1922,6 +1924,24 @@ class AppLocalizationsUk extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => 'Сортувати за'; diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index 803195ad..d23c2d3d 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -800,37 +800,19 @@ class AppLocalizationsZh extends AppLocalizations { @override String get factoryResetSentBody => - 'The radio is erasing itself and will restart with a new identity. Reconnect to it to finish.'; + 'The radio is erasing itself and will restart with a new identity.'; @override String get factoryResetSentBleBody => - 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect to finish.'; - - @override - String get factoryResetCompleteTitle => 'Factory reset complete'; - - @override - String get factoryResetCompleteBody => - 'The radio has a new identity. Its old data was deleted from the app.'; - - @override - String get factoryResetCompleteKeptBody => - 'The radio has a new identity. Its old data was kept in the app.'; - - @override - String get factoryResetNotResetTitle => 'Factory reset did not happen'; - - @override - String get factoryResetNotResetBody => - 'The radio reconnected with the same identity, so it was not erased. Nothing was deleted from the app.'; + 'The radio is erasing itself and will restart with a new identity. Its Bluetooth pairing is erased too: remove the old pairing for this radio in your phone or computer\'s Bluetooth settings, then reconnect.'; @override String get factoryResetDeleteFailedTitle => - 'Factory reset done, app cleanup failed'; + 'Factory reset sent, app cleanup failed'; @override String get factoryResetDeleteFailedBody => - 'The radio was erased, but deleting its old data from the app failed. The app will try again the next time this radio connects.'; + 'The reset was sent, but deleting this radio\'s data from the app failed.'; @override String get settings_blePin => 'BLE pairing PIN'; @@ -946,6 +928,26 @@ class AppLocalizationsZh extends AppLocalizations { @override String get settings_aboutDonate => 'Donate or sponsor'; + @override + String get sponsorPrompt_title => 'Support Offband'; + + @override + String get sponsorPrompt_body => + 'Offband MeshCore is free, open source, and built by an independent developer. If it\'s useful to you, sponsoring helps keep it maintained and improving. Thank you for using it.'; + + @override + String get sponsorPrompt_sponsor => 'Sponsor'; + + @override + String get sponsorPrompt_anytime => + 'You can support Offband anytime from About in Settings, or at offband.org/donate.'; + + @override + String get sponsorPrompt_notNow => 'Not now'; + + @override + String get sponsorPrompt_never => 'Never Show Again'; + @override String get settings_aboutLinkFailed => 'Could not open the link'; @@ -1851,6 +1853,24 @@ class AppLocalizationsZh extends AppLocalizations { String get channels_writeClearedNotAdded => 'The old channel was removed, but the radio did not confirm the new one, so that slot is now empty. Add the channel again.'; + @override + String get channels_writeHistoryNotMoved => + 'The channel was changed, but its message history could not be moved to it. The app log has the details.'; + + @override + String get channels_keyChangeHistoryTitle => 'Keep message history?'; + + @override + String channels_keyChangeHistoryBody(String name) { + return 'This gives \"$name\" a new key. Keep its message history under the new key, or delete it? Deleted history cannot be recovered.'; + } + + @override + String get channels_keyChangeKeepHistory => 'Keep message history'; + + @override + String get channels_keyChangeDeleteHistory => 'Delete message history'; + @override String get channels_sortBy => '排序方式'; diff --git a/lib/main.dart b/lib/main.dart index a1646dda..5a042e93 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -43,6 +43,7 @@ import 'widgets/storage_unavailable_banner.dart'; import 'storage/prefs_manager.dart'; import 'utils/app_logger.dart'; import 'widgets/keep_screen_awake.dart'; +import 'widgets/sponsor_prompt.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -393,7 +394,7 @@ class MeshCoreApp extends StatelessWidget { }, home: (PlatformInfo.isWeb && !PlatformInfo.isChrome) ? const ChromeRequiredScreen() - : const ScannerScreen(), + : const SponsorPromptGate(child: ScannerScreen()), ); }, ), diff --git a/lib/screens/channels_screen.dart b/lib/screens/channels_screen.dart index 569f2dc3..f26888a8 100644 --- a/lib/screens/channels_screen.dart +++ b/lib/screens/channels_screen.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:math'; +import 'package:flutter/foundation.dart' show listEquals; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:meshcore_open/storage/channel_message_store.dart'; @@ -1823,12 +1824,29 @@ class _ChannelsScreenState extends State return; } + // #1128: a new key asks what happens to the old key's history. + // Backing out leaves this dialog open and writes nothing. + KeyChangeHistory? history; + if (!listEquals(psk, channel.psk)) { + history = await askKeyChangeHistory( + dialogContext, + channel.name, + ); + appLogger.info( + 'Key change for slot ${channel.index} "${channel.name}": ' + 'history answer ${history?.name ?? 'cancelled'}', + tag: 'ChannelWrite', + ); + if (history == null || !dialogContext.mounted) return; + } + Navigator.pop(dialogContext); try { final result = await connector.editChannel( channel, name, psk, + history: history, ); if (result != ChannelWrite.ok) { if (!context.mounted) return; diff --git a/lib/screens/settings/indicators_view.dart b/lib/screens/settings/indicators_view.dart index e6d6a607..b079b570 100644 --- a/lib/screens/settings/indicators_view.dart +++ b/lib/screens/settings/indicators_view.dart @@ -7,12 +7,13 @@ import '../../connector/offband_indicators.dart'; import '../../widgets/device_ui_error_banner.dart'; /// The radio's display and LED (#523, #944): display mode, rotation and the -/// status LED. Gated on caps byte 2 `0x04`; the Node Settings row that leads -/// here is gated the same way. +/// status LED. Each block shows only when the radio has that control +/// ([MeshCoreConnector.supportsDisplayControl], +/// [MeshCoreConnector.supportsLedControl], #1132); the Node Settings row that +/// leads here shows when it has either. /// -/// Every control draws from what the radio reported, never from the tap. A -/// board without a display or without a controllable LED refuses that write -/// and says so in the banner. English-only, matching [DeviceUiView]. +/// Every control draws from what the radio reported, never from the tap. +/// English-only, matching [DeviceUiView]. class IndicatorsView extends StatelessWidget { const IndicatorsView({super.key}); @@ -33,28 +34,31 @@ class IndicatorsView extends StatelessWidget { message: error, onDismiss: connector.clearDeviceUiError, ), - const _Header('Display'), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: SegmentedButton( - segments: [ - for (final m in DisplayMode.values) - ButtonSegment(value: m, label: Text(m.label)), - ], - selected: {?mode}, - emptySelectionAllowed: true, - onSelectionChanged: (v) { - if (v.isNotEmpty) connector.setDisplayMode(v.first); - }, + if (connector.supportsDisplayControl) ...[ + const _Header('Display'), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SegmentedButton( + segments: [ + for (final m in DisplayMode.values) + ButtonSegment(value: m, label: Text(m.label)), + ], + selected: {?mode}, + emptySelectionAllowed: true, + onSelectionChanged: (v) { + if (v.isNotEmpty) connector.setDisplayMode(v.first); + }, + ), ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(16, 8, 16, 0), - child: Text( - mode?.description ?? 'The radio has not reported its display mode', - style: Theme.of(context).textTheme.bodySmall, + Padding( + padding: const EdgeInsets.fromLTRB(16, 8, 16, 0), + child: Text( + mode?.description ?? + 'The radio has not reported its display mode', + style: Theme.of(context).textTheme.bodySmall, + ), ), - ), + ], if (connector.supportsDisplayRotation) ...[ const _Header('Rotation'), Padding( @@ -76,17 +80,19 @@ class IndicatorsView extends StatelessWidget { ), ), ], - const _Header('LED'), - SwitchListTile( - title: const Text('Status LED'), - subtitle: Text( - led == null - ? 'The radio has not reported its LED' - : 'Turn off to save battery or to stay unseen', + if (connector.supportsLedControl) ...[ + const _Header('LED'), + SwitchListTile( + title: const Text('Status LED'), + subtitle: Text( + led == null + ? 'The radio has not reported its LED' + : 'Turn off to save battery or to stay unseen', + ), + value: led ?? false, + onChanged: connector.setLedEnabled, ), - value: led ?? false, - onChanged: connector.setLedEnabled, - ), + ], ], ); } diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 5ad90988..beefeb89 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -497,8 +497,8 @@ class _SettingsScreenState extends State { ), ), ], - // Display mode, rotation and LED (#523). Strictly on the 0x04 - // bit: no bit, no row, no command. + // Display mode, rotation and LED (#523). Shown when the radio + // has display control or LED control (#1132). if (connector.supportsIndicators) ...[ const Divider(height: 1), ListTile( diff --git a/lib/services/app_settings_service.dart b/lib/services/app_settings_service.dart index 86882c18..a4c1b35d 100644 --- a/lib/services/app_settings_service.dart +++ b/lib/services/app_settings_service.dart @@ -404,6 +404,30 @@ class AppSettingsService extends ChangeNotifier { ); } + /// Carries a channel's notify mode from its old key to its new one, when a + /// key change keeps the channel's history (#1128). + Future moveChannelNotifyMode({ + required String devicePrefix, + required String fromPskHex, + required String toPskHex, + }) async { + final prefix = radioScopePrefix(devicePrefix); + final mode = _settings.channelNotifyModesByRadio[prefix]?[fromPskHex]; + if (prefix.isEmpty || fromPskHex == toPskHex || mode == null) return; + final byRadio = _copyByRadio(); + final radioModes = byRadio[prefix]!; + radioModes.remove(fromPskHex); + radioModes[toPskHex] = mode; + await updateSettings( + _settings.copyWith(channelNotifyModesByRadio: byRadio), + ); + appLogger.info( + 'Notify mode ${mode.name} moved with the channel on radio $prefix: psk ' + '${pskFingerprint(fromPskHex)} -> ${pskFingerprint(toPskHex)}', + tag: 'NotifyMode', + ); + } + /// Drops [devicePrefix]'s notify modes, the per-radio part of this global /// blob, after that radio was factory reset (#1054). Future forgetRadio(String devicePrefix) async { diff --git a/lib/storage/channel_message_store.dart b/lib/storage/channel_message_store.dart index adc5b5be..04e92f76 100644 --- a/lib/storage/channel_message_store.dart +++ b/lib/storage/channel_message_store.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'package:crypto/crypto.dart'; import 'package:flutter/foundation.dart'; import 'package:meshcore_open/utils/app_logger.dart'; @@ -405,6 +406,199 @@ class ChannelMessageStore { } } + String _pskKey(String pskHex) => '$keyFor$_pskMarker$pskHex'; + + /// Moves every message stored under [fromPskHex] to [toPskHex], for a key + /// change the user chose to keep history across (#1128). + /// + /// Copy, verify, then delete: an interruption leaves the history under both + /// keys, never under neither. A message already under the new key keeps + /// that copy. Only the copied rows are deleted, and the pass repeats, so a + /// message saved to the old key mid-move is moved too rather than lost. + /// Returns how many messages the new key gained, or null when the move + /// could not be done safely, in which case whatever was not yet moved is + /// left under the old key and the reason is logged as an error. + Future moveChannelHistory(String fromPskHex, String toPskHex) async { + final what = + 'channel history psk ${_fingerprint(fromPskHex)} -> ' + '${_fingerprint(toPskHex)}'; + if (publicKeyHex.isEmpty || fromPskHex.isEmpty || toPskHex.isEmpty) { + appLogger.error( + 'NOT moving $what: no radio key or no channel key', + tag: 'Storage', + ); + return null; + } + if (fromPskHex == toPskHex) return 0; + final from = _pskKey(fromPskHex); + final to = _pskKey(toPskHex); + final blobs = BlobStore.instance; + + for (final key in [from, to]) { + if (!await blobs.ensureMessageRowsMigrated(key, channelHistoryToRows)) { + appLogger.error( + 'NOT moving $what: $key could not be moved onto rows. Both keys ' + 'are unchanged.', + tag: 'Storage', + ); + return null; + } + } + + var moved = 0; + var gained = 0; + for (var pass = 0; pass < 3; pass++) { + final payloads = await blobs.messagePayloads(from); + if (payloads.isEmpty) break; + final already = await blobs.messageMergeKeys(to); + final sourceKeys = {}; + final rows = []; + for (final payload in payloads) { + final ChannelMessage m; + try { + m = _messageFromJson(jsonDecode(payload) as Map); + } catch (e) { + appLogger.error( + 'NOT moving $what: a stored message will not decode ($e). ' + '$moved message(s) were moved before this; the rest stay under ' + 'the old key.', + tag: 'Storage', + ); + return null; + } + final mergeKey = _mergeKey(m); + sourceKeys.add(mergeKey); + if (already.contains(mergeKey)) continue; + rows.add( + MessageRowInput( + mergeKey: mergeKey, + timestampMs: m.timestamp.millisecondsSinceEpoch, + payload: payload, + ), + ); + } + + await blobs.upsertMessageRows(to, rows); + final missing = sourceKeys.difference(await blobs.messageMergeKeys(to)); + if (missing.isNotEmpty) { + appLogger.error( + 'NOT finishing $what: ${missing.length} of ${sourceKeys.length} ' + 'messages did not read back under the new key. They stay under the ' + 'old key.', + tag: 'Storage', + ); + return null; + } + await blobs.deleteMessageRowsIn(from, sourceKeys); + moved += sourceKeys.length; + gained += rows.length; + } + + final left = await blobs.messageRowCount(from); + if (left > 0) { + appLogger.error( + 'NOT finishing $what: $left message(s) kept arriving under the old ' + 'key; they stay there.', + tag: 'Storage', + ); + return null; + } + await blobs.deleteEverywhere(from); + appLogger.info( + 'Moved $what: $moved message(s), $gained new to the new key (#1128)', + tag: 'Storage', + ); + return gained; + } + + /// Deletes everything stored under [pskHex] for this radio, the history + /// half of Delete Channel, addressed by key rather than slot (#1128). + Future deleteChannelHistory(String pskHex) async { + if (publicKeyHex.isEmpty || pskHex.isEmpty) { + appLogger.error( + 'NOT deleting channel history psk ${_fingerprint(pskHex)}: no radio ' + 'key or no channel key', + tag: 'Storage', + ); + return; + } + final key = _pskKey(pskHex); + final blobs = BlobStore.instance; + final count = await blobs.messageRowCount(key); + await blobs.deleteEverywhere(key); + await blobs.deleteMessageRows(key); + appLogger.info( + 'Deleted channel history psk ${_fingerprint(pskHex)}: $count message ' + 'row(s) (#1128)', + tag: 'Storage', + ); + } + + /// Deletes this radio's channel history that no channel on it can show: + /// history under a key the radio does not hold, and pre-#194 slot history + /// for a slot that holds nothing. History is never kept hidden (#1128). + /// + /// The caller passes the radio's fully confirmed channel list, with no + /// erased slots. Restore (#1117) only has work when slots are erased, so + /// its channels' history is never what this sees. + /// + /// Returns the deleted keys, each logged with its row count. + Future> purgeHistoryNotOnRadio({ + required Set radioPskHex, + required Set occupiedSlots, + }) async { + if (publicKeyHex.isEmpty) return const []; + if (radioPskHex.isEmpty) { + appLogger.warn( + 'Radio $publicKeyHex reports no channels at all; not deleting any ' + 'channel history on that (#1128)', + tag: 'Storage', + ); + return const []; + } + final blobs = BlobStore.instance; + final pskPrefix = '$keyFor$_pskMarker'; + final slotKey = RegExp('^${RegExp.escape(keyFor)}(\\d+)\$'); + final candidates = { + ...await blobs.keysWithPrefix(keyFor), + ...(await blobs.messageStoreKeys()).where((k) => k.startsWith(keyFor)), + }; + + final deleted = []; + for (final key in candidates.toList()..sort()) { + final String label; + if (key.startsWith(pskPrefix)) { + final pskHex = key.substring(pskPrefix.length); + if (radioPskHex.contains(pskHex)) continue; + label = 'psk ${_fingerprint(pskHex)}'; + } else { + final slot = slotKey.firstMatch(key)?.group(1); + if (slot == null || occupiedSlots.contains(int.parse(slot))) continue; + label = 'empty slot $slot (pre-#194)'; + } + final count = await blobs.messageRowCount(key); + await blobs.deleteEverywhere(key); + await blobs.deleteMessageRows(key); + deleted.add(key); + appLogger.info( + 'Deleted hidden channel history of radio $publicKeyHex, $label: ' + '$count message row(s), no channel on the radio shows it (#1128)', + tag: 'Storage', + ); + } + appLogger.info( + 'Hidden channel history check for radio $publicKeyHex: ' + '${candidates.length} stored key(s) against ${radioPskHex.length} ' + 'channel(s) on the radio, ${deleted.length} deleted (#1128)', + tag: 'Storage', + ); + return deleted; + } + + static String _fingerprint(String pskHex) => pskHex.isEmpty + ? 'none' + : sha256.convert(utf8.encode(pskHex)).toString().substring(0, 8); + /// Clear all channel messages Future clearAllChannelMessages() async { final blobs = BlobStore.instance; diff --git a/lib/storage/drift/blob_store.dart b/lib/storage/drift/blob_store.dart index e14662cc..c4d360c2 100644 --- a/lib/storage/drift/blob_store.dart +++ b/lib/storage/drift/blob_store.dart @@ -381,6 +381,26 @@ class BlobStore { .go(); } + /// Removes the messages under [storeKey] whose identity is in [mergeKeys], + /// and no others, so a message saved meanwhile survives (#1128). Chunked + /// under SQLite's bound-variable limit. + Future deleteMessageRowsIn( + String storeKey, + Iterable mergeKeys, + ) async { + final keys = mergeKeys.toList(); + for (var i = 0; i < keys.length; i += 500) { + final chunk = keys.sublist( + i, + i + 500 > keys.length ? keys.length : i + 500, + ); + await (_db.delete( + _db.messageRecords, + )..where((t) => t.storeKey.equals(storeKey) & t.mergeKey.isIn(chunk))) + .go(); + } + } + /// Removes every message under [storeKey], for the stores' clear paths. Future deleteMessageRows(String storeKey) async { await (_db.delete( diff --git a/lib/storage/factory_reset_store.dart b/lib/storage/factory_reset_store.dart deleted file mode 100644 index 5e71a36f..00000000 --- a/lib/storage/factory_reset_store.dart +++ /dev/null @@ -1,100 +0,0 @@ -import 'dart:convert'; - -import 'prefs_manager.dart'; - -/// A factory reset that was sent and not yet proven (#1054). -/// -/// The firmware disables the link before it formats, so the client never -/// hears whether the wipe worked. The proof is the next connect to the same -/// device: a new identity means it worked. Until then this record keeps the -/// old radio's data alive, so a reset that failed cannot cost the user their -/// history. -class PendingFactoryReset { - const PendingFactoryReset({ - required this.deviceId, - required this.radioPrefix, - required this.deleteAppData, - }); - - /// The transport identity the reset went to: BLE remote id, USB port key or - /// TCP endpoint. A connect to anything else says nothing about this reset. - final String deviceId; - - /// First 10 hex of the radio's key before the reset. - final String radioPrefix; - - /// The user's choice in the confirm dialog. - final bool deleteAppData; - - Map toJson() => { - 'device_id': deviceId, - 'radio_prefix': radioPrefix, - 'delete_app_data': deleteAppData, - }; - - static PendingFactoryReset? fromJson(Map json) { - final deviceId = json['device_id']; - final radioPrefix = json['radio_prefix']; - final deleteAppData = json['delete_app_data']; - if (deviceId is! String || - radioPrefix is! String || - deleteAppData is! bool) { - return null; - } - return PendingFactoryReset( - deviceId: deviceId, - radioPrefix: radioPrefix, - deleteAppData: deleteAppData, - ); - } -} - -enum FactoryResetOutcome { - /// New identity, and the user asked for the app data to go. - wipeAppData, - - /// New identity, and the user asked to keep the app data. - keepAppData, - - /// Same identity: the radio was not wiped. Nothing is deleted. - notReset, -} - -/// What connecting to [deviceId] as [radioPrefix] says about [pending]. -/// -/// Null when it is a different device, so the record stays and nothing is -/// decided on the strength of some other radio. -FactoryResetOutcome? resolveFactoryReset( - PendingFactoryReset pending, { - required String deviceId, - required String radioPrefix, -}) { - if (deviceId != pending.deviceId) return null; - if (radioPrefix == pending.radioPrefix) return FactoryResetOutcome.notReset; - return pending.deleteAppData - ? FactoryResetOutcome.wipeAppData - : FactoryResetOutcome.keepAppData; -} - -/// Survives an app restart between the reset and the reconnect, so closing -/// the app in between does not quietly skip the delete the user asked for. -class FactoryResetStore { - static const String _key = 'factory_reset_pending'; - - PendingFactoryReset? load() { - final raw = PrefsManager.instance.getString(_key); - if (raw == null) return null; - try { - return PendingFactoryReset.fromJson( - jsonDecode(raw) as Map, - ); - } catch (_) { - return null; - } - } - - Future save(PendingFactoryReset pending) => - PrefsManager.instance.setString(_key, jsonEncode(pending.toJson())); - - Future clear() => PrefsManager.instance.remove(_key); -} diff --git a/lib/storage/scoping_inventory.dart b/lib/storage/scoping_inventory.dart index 51532961..3afb895a 100644 --- a/lib/storage/scoping_inventory.dart +++ b/lib/storage/scoping_inventory.dart @@ -248,15 +248,6 @@ const List storageSurfaces = [ reason: 'keyed by repeater node, same reasoning as repeater_passwords', owner: 'lib/services/storage_service.dart', ), - StorageSurface( - 'factory_reset_pending', - verdict: ScopingVerdict.globalOnPurpose, - reason: - 'one factory reset awaiting proof (#1054). It spans two identities of ' - 'the same device, the key before the wipe and the key after, so it ' - 'cannot live under either. It names the old radio inside the record', - owner: 'lib/storage/factory_reset_store.dart', - ), StorageSurface( 'map_removed_marker_ids', verdict: ScopingVerdict.globalOnPurpose, @@ -284,6 +275,46 @@ const List storageSurfaces = [ 'previously audited: surfaced by this inventory', owner: 'lib/services/radio_preset_service.dart', ), + StorageSurface( + 'sponsor_prompt_first_launch_ms', + verdict: ScopingVerdict.globalOnPurpose, + reason: + 'when the app first launched with the sponsor window (#1129), for its ' + '7-day first wait. A fact about the app install, not a radio', + owner: 'lib/widgets/sponsor_prompt.dart', + ), + StorageSurface( + 'sponsor_prompt_launches', + verdict: ScopingVerdict.globalOnPurpose, + reason: + 'how many times the app has launched, for the sponsor window\'s ' + '3-launch first wait (#1129). Counts app launches, not radios', + owner: 'lib/widgets/sponsor_prompt.dart', + ), + StorageSurface( + 'sponsor_prompt_next_ms', + verdict: ScopingVerdict.globalOnPurpose, + reason: + 'the earliest time the sponsor window may show again (#1129), set by ' + 'Not now or Sponsor. A choice about the app, not about a radio', + owner: 'lib/widgets/sponsor_prompt.dart', + ), + StorageSurface( + 'sponsor_prompt_off', + verdict: ScopingVerdict.globalOnPurpose, + reason: + "the user's Never Show Again for the sponsor window (#1129). A choice " + 'about the app, not about a radio', + owner: 'lib/widgets/sponsor_prompt.dart', + ), + StorageSurface( + 'sponsor_prompt_shown_for', + verdict: ScopingVerdict.globalOnPurpose, + reason: + 'the test build (version and commit) the sponsor window last showed ' + 'for (#1129). Follows the installed app, not a radio', + owner: 'lib/widgets/sponsor_prompt.dart', + ), StorageSurface( 'anr_last_exit_ts_ms', verdict: ScopingVerdict.globalOnPurpose, diff --git a/lib/widgets/factory_reset_banner.dart b/lib/widgets/factory_reset_banner.dart index c9ea51fc..d1584a90 100644 --- a/lib/widgets/factory_reset_banner.dart +++ b/lib/widgets/factory_reset_banner.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; import '../connector/meshcore_connector.dart'; import '../l10n/l10n.dart'; -/// Shown above the whole app while a factory reset is outstanding and once it -/// settles (#1054). The settings screen is gone by then, because the reset -/// ends the session, so the outcome is reported here and stays until -/// dismissed. Sits in `MaterialApp.builder`, like [ContactSyncShortfallBanner]. +/// Shown above the whole app after a factory reset is sent (#1054). The +/// settings screen is gone by then, because the reset ends the session, so it +/// is reported here and stays until dismissed. Sits in `MaterialApp.builder`, +/// like [ContactSyncShortfallBanner]. class FactoryResetBanner extends StatelessWidget { final FactoryResetStatus? status; final VoidCallback onDismiss; @@ -34,9 +34,7 @@ class FactoryResetBanner extends StatelessWidget { Widget _banner(BuildContext context, FactoryResetStatus current) { final l10n = context.l10n; final scheme = Theme.of(context).colorScheme; - final failed = - current == FactoryResetStatus.notReset || - current == FactoryResetStatus.deleteFailed; + final failed = current == FactoryResetStatus.deleteFailed; final background = failed ? scheme.errorContainer : scheme.secondaryContainer; @@ -52,18 +50,6 @@ class FactoryResetBanner extends StatelessWidget { l10n.factoryResetSentTitle, l10n.factoryResetSentBody, ), - FactoryResetStatus.complete => ( - l10n.factoryResetCompleteTitle, - l10n.factoryResetCompleteBody, - ), - FactoryResetStatus.completeKept => ( - l10n.factoryResetCompleteTitle, - l10n.factoryResetCompleteKeptBody, - ), - FactoryResetStatus.notReset => ( - l10n.factoryResetNotResetTitle, - l10n.factoryResetNotResetBody, - ), FactoryResetStatus.deleteFailed => ( l10n.factoryResetDeleteFailedTitle, l10n.factoryResetDeleteFailedBody, diff --git a/lib/widgets/sponsor_prompt.dart b/lib/widgets/sponsor_prompt.dart new file mode 100644 index 00000000..5efae469 --- /dev/null +++ b/lib/widgets/sponsor_prompt.dart @@ -0,0 +1,184 @@ +import 'package:flutter/material.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import '../helpers/snack_bar_builder.dart'; +import '../l10n/l10n.dart'; +import '../storage/prefs_manager.dart'; +import '../utils/app_logger.dart'; +import '../utils/platform_info.dart'; + +enum _Choice { never, later, sponsor } + +/// The sponsor window (#1129). App-wide, never per radio. Owner's rules, +/// 2026-11-09: +/// - first shown once the app has been launched [minLaunches] times and at +/// least [firstWait] has passed since its first launch; +/// - after Not now (or closing it), not again for [notNowWait]; +/// - after Sponsor, not again for [afterSponsorWait]; +/// - Never Show Again ends it on this install. +/// Test builds (built with `--dart-define=GIT_SHA=`) show it once per +/// commit and skip every wait, so each test build can be checked. +class SponsorPrompt { + static const String firstLaunchKey = 'sponsor_prompt_first_launch_ms'; + static const String launchesKey = 'sponsor_prompt_launches'; + static const String nextKey = 'sponsor_prompt_next_ms'; + static const String offKey = 'sponsor_prompt_off'; + static const String shownForKey = 'sponsor_prompt_shown_for'; + + static const int minLaunches = 3; + static const Duration firstWait = Duration(days: 7); + static const Duration notNowWait = Duration(days: 30); + static const Duration afterSponsorWait = Duration(days: 90); + + static final Uri sponsorUri = Uri.parse('https://offband.org/donate'); + + /// The commit a test build was made from. Empty in release builds. + static const String buildSha = String.fromEnvironment('GIT_SHA'); + + /// What one installed build is known by: `1.8.0+69`, or `1.8.0+69@`. + static String buildId(String version, {String sha = buildSha}) => + sha.isEmpty ? version : '$version@$sha'; + + /// Called once per app launch. Counts the launch, then shows the window if + /// the rules above say it's due. The next due time is saved before the + /// window opens, so a crash can't make it show again straight away. + static Future onLaunch( + BuildContext context, { + String sha = buildSha, + bool? isIOS, + SharedPreferences? prefs, + DateTime Function()? clock, + Future Function()? installedVersion, + Future Function(Uri)? open, + }) async { + if (isIOS ?? PlatformInfo.isIOS) return; + final store = prefs ?? PrefsManager.instance; + final now = (clock ?? DateTime.now)(); + final launches = (store.getInt(launchesKey) ?? 0) + 1; + await store.setInt(launchesKey, launches); + final first = store.getInt(firstLaunchKey); + if (first == null) { + await store.setInt(firstLaunchKey, now.millisecondsSinceEpoch); + } + + if (sha.isNotEmpty) { + final version = await (installedVersion ?? _installedVersion)(); + if (version == null) return; + final id = buildId(version, sha: sha); + if (store.getString(shownForKey) == id) return; + await store.setString(shownForKey, id); + } else { + if (store.getBool(offKey) ?? false) return; + if (launches < minLaunches || first == null) return; + if (now.difference(_at(first)) < firstWait) return; + final next = store.getInt(nextKey); + if (next != null && now.isBefore(_at(next))) return; + } + + await _setNext(store, now, notNowWait); + if (!context.mounted) return; + final choice = await showDialog<_Choice>( + context: context, + builder: (_) => const _SponsorDialog(), + ); + if (choice == _Choice.never) { + await store.setBool(offKey, true); + } else if (choice == _Choice.sponsor) { + await _setNext(store, now, afterSponsorWait); + if (await _open(open ?? _openExternally)) return; + if (context.mounted) { + showDismissibleSnackBar( + context, + content: Text(context.l10n.settings_aboutLinkFailed), + persist: true, + ); + } + } + } + + static DateTime _at(int ms) => DateTime.fromMillisecondsSinceEpoch(ms); + + static Future _setNext( + SharedPreferences store, + DateTime now, + Duration wait, + ) => store.setInt(nextKey, now.add(wait).millisecondsSinceEpoch); + + static Future _open(Future Function(Uri) open) async { + try { + return await open(sponsorUri); + } catch (e) { + appLogger.warn('Sponsor link did not open: $e', tag: 'Sponsor'); + return false; + } + } + + static Future _openExternally(Uri uri) => + launchUrl(uri, mode: LaunchMode.externalApplication); + + static Future _installedVersion() async { + try { + final info = await PackageInfo.fromPlatform(); + return '${info.version}+${info.buildNumber}'; + } catch (e) { + appLogger.error('Sponsor prompt: no app version: $e', tag: 'Sponsor'); + return null; + } + } +} + +/// Wraps the app's first screen. Each app launch builds it once, so it counts +/// the launch and offers the window after the screen has drawn. +class SponsorPromptGate extends StatefulWidget { + const SponsorPromptGate({super.key, required this.child}); + + final Widget child; + + @override + State createState() => _SponsorPromptGateState(); +} + +class _SponsorPromptGateState extends State { + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) SponsorPrompt.onLaunch(context); + }); + } + + @override + Widget build(BuildContext context) => widget.child; +} + +class _SponsorDialog extends StatelessWidget { + const _SponsorDialog(); + + @override + Widget build(BuildContext context) { + final l10n = context.l10n; + void choose(_Choice choice) => Navigator.of(context).pop(choice); + return AlertDialog( + title: Text(l10n.sponsorPrompt_title), + content: Text( + '${l10n.sponsorPrompt_body}\n\n${l10n.sponsorPrompt_anytime}', + ), + actions: [ + TextButton( + onPressed: () => choose(_Choice.never), + child: Text(l10n.sponsorPrompt_never), + ), + TextButton( + onPressed: () => choose(_Choice.later), + child: Text(l10n.sponsorPrompt_notNow), + ), + FilledButton( + onPressed: () => choose(_Choice.sponsor), + child: Text(l10n.sponsorPrompt_sponsor), + ), + ], + ); + } +} diff --git a/play/1.8.0.txt b/play/1.8.0.txt new file mode 100644 index 00000000..a2f97c95 --- /dev/null +++ b/play/1.8.0.txt @@ -0,0 +1,3 @@ +Offband MeshCore 1.8.0 + +Message history now follows the channel, not its slot on the radio. History for channels your radio no longer holds is cleared on the first sync. Changing a channel's key asks whether to keep or delete its history. Adds can't overwrite another channel, and wiped channels can be restored. With Offband firmware 1.7.0: per-channel radio sound, display and LED settings. Also a Bluetooth PIN setting and factory reset. diff --git a/pubspec.yaml b/pubspec.yaml index 028e881f..fe2e5471 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.7.0+68 +version: 1.8.0+69 environment: sdk: ^3.9.2 diff --git a/release-notes/1.8.0.md b/release-notes/1.8.0.md new file mode 100644 index 00000000..a7fa8bb7 --- /dev/null +++ b/release-notes/1.8.0.md @@ -0,0 +1,170 @@ +## Offband MeshCore 1.8.0 + +A channels release. Message history now belongs to the channel itself, not to the slot it +happens to occupy on your radio, and the app no longer keeps history out of sight where it +could reappear later. Every channel write now waits for the radio to confirm it, adds can't +overwrite another channel, and a radio whose channel storage was wiped can be put back from +the app. Alongside that: control of your radio's own channel sounds, display, status LED and +Bluetooth PIN, a factory reset, and a macOS download. + +### Now on iPhone + +Offband MeshCore is on the **App Store**: +https://apps.apple.com/us/app/offband-meshcore/id6829124741. It needs iOS 16.4 or newer. The +App Store has 1.7.0 today. 1.8.0 goes up once Apple has reviewed it. + +### Which radios get what + +- **Any MeshCore companion radio** the app already supported gets the channel changes, the + Bluetooth PIN setting, and Factory Reset. +- **Offband firmware 1.7.0 or newer** is needed for Radio sound per channel, the Display and + LED settings, and display rotation. On other firmware those controls stay hidden. + +### Please read before updating + +**Hidden history is cleared.** Earlier versions could keep a channel's messages out of sight +after the channel left your radio, and bring them back if the same channel was added again. +1.8.0 stops doing that. The first time it fully syncs with a radio, it deletes the stored +history of any channel that radio no longer holds. Messages for the channels on your radio are +not touched. It only does this after a sync in which the radio answered for every slot. If any +slot was unanswered or erased, or the radio reported no channels at all, nothing is deleted. +If a reflash wipes a radio's channel storage outright, the app recognizes the erased slots, +keeps the history, and offers **Restore to radio** instead (#1128, #1060). + +**Slot 0 is kept for Public on every radio.** The app never puts any other channel in slot 0, +which matches Offband firmware 1.7.0. On stock or older firmware, that means one slot goes +unused if you don't have Public. A channel that is already in slot 0 is left where it is +(#1117). + +**New text is in English only.** The 65 new messages and labels in this release are English in +every language for now. Translations will follow. + +### Channels you can trust + +- **History follows the channel.** Messages, unread counts and notification settings are tied + to the channel's key. A channel that moves to another slot keeps them, and the channel that + takes its old slot doesn't inherit them. When a sync finds a different channel in a slot, + the app tells you in a notice you can dismiss (#1063, #1064). +- **The app confirms your channel list before using it.** Channel messages that arrive while + the list is still being confirmed are held and filed once it is, so they can't land in the + wrong channel. A slot the radio never answers for is shown as unknown, with a **Retry sync** + banner. It never borrows the previous list, and it doesn't send notifications. Sending to a + channel the app hasn't confirmed on this connection is refused with a message saying why. + An incomplete sync never overwrites the last fully confirmed list, and a sync that fails + while you're connected retries by itself (#1062). +- **Every channel write waits for the radio.** Adding, editing and deleting a channel now wait + for the radio's answer. Success shows only after the radio confirms. If the radio refuses or + doesn't answer within 5 seconds, a message stays on screen saying what happened, and the + channel's history is kept (#1026). +- **Adds can't overwrite another channel.** The slot is chosen when you press Add, not when the + dialog opened. Adding is refused while a sync is running, or when the radio is full, instead + of silently writing over slot 0. This covers the channels screen, QR shares, joining a + community and config import (#1021, #1022, #1023). A community join shows its green + "joined" message only when the channel was actually written. A config import started during + a sync imports nothing and lists each channel as skipped. +- **Changing a channel's key asks first.** Renaming a hashtag channel or giving a private + channel a new key asks whether to **keep** its message history under the new key or + **delete** it. Keep also carries the channel's phone notification setting. A rename that + keeps the same key asks nothing. If the radio takes the new key but the history can't be + moved, a message says so and the history is kept. If the radio removes the old channel but + refuses the new one, a message says the slot is now empty and to add the channel again + (#1128, #1025). +- **Public stays Public.** It goes in slot 0. It can't be deleted, and trying says why. Its key + can't be edited, and while Public is on the radio no other channel can be given its key. + Typing "public" as a hashtag channel, in any case and with or without the #, adds the real + Public channel instead of a lookalike (#1117, #1029). +- **Hashtag channels in Edit Channel.** The key is shown read-only, with a copy button, and is + recomputed as you rename. A name that stops being a hashtag, or starts with "##", is + refused. For a community hashtag channel, the name and key are both read-only (#1103). +- **Edit Channel refuses a stale save.** If a sync replaced the channel in that slot while the + dialog was open, Save is refused with a message instead of overwriting it (#1103). +- **Restore to radio.** When a radio comes back with its channel storage erased, a banner + offers to write your channels back. It lists only the channels the radio is missing. Public + goes to slot 0, and every other channel goes to its old slot if that's free, or else the + lowest free one. A channel already on the radio is never overwritten. Afterwards it reports + how many channels the radio confirmed, and names any it didn't (#1060, #1117). +- Channels that showed up as rows of replacement characters (�) after a radio lost its + channel storage are no longer adopted, and any an earlier version saved are dropped (#1060). + +### Notifications + +- **Radio sound per channel**: choose whether the radio itself beeps for all messages, mentions + only, or never, or leave it to the radio's own setting. This is separate from your phone's + notifications, and the existing control is now labeled **Phone notifications** so the two + can't be confused. The Radio sound row shows what the channel will actually do: "Follows the + radio" when it's left to the radio, and "Silent" when the radio's own setting is None + (#1068). +- Fixed: a channel you had set to None on the radio could start sounding again after it moved + to another slot. The setting now follows the channel (#1060). + +### Your radio's settings + +- **Display and LED** under Node Settings: display mode, status LED, and display rotation for + a screen mounted upside down (#523). The display and LED controls are shown separately, each + only when the radio says it can change it (#1132). See Known issues for radios on firmware + 1.7.0. +- **BLE pairing PIN** in the device Actions: set a 6-digit PIN the radio asks for when a phone + or PC pairs, or reset it to the firmware default. It's shown in plain text, because any app + connected to the radio can read it anyway. Devices already paired may need to forget the + radio and pair again (#1100). +- **Factory Reset**, in Settings, with a red confirm like Reboot. It erases the radio's + identity, contacts, channels and settings, and can't be undone. A box, on by default, also + deletes that radio's data stored in the app. The radio drops the connection before it + erases, so the app can't confirm the reset happened. With the box ticked, the app deletes + its data as soon as the reset is sent. Over Bluetooth, remove the radio's old pairing from + your phone or PC before reconnecting, because the reset erases it (#1057, #1118). +- The app now asks an Offband radio what it supports instead of inferring it from a version + number (#1094, #1065). Fixed along with it: **blocks stored on the radio**, the radio's + capture log in **Serial capture**, **CoreScope observer counts** and **observer settings** + could be hidden on Offband firmware that supports them, because the app was checking a + version number. Settings added in 1.7.0 for Offband radios, such as GPS power save and + custom tunes, appear once the radio runs Offband firmware 1.7.0. + +### Everything else + +- **macOS:** a desktop build is now part of each release. It's signed with an Apple Developer + ID and notarized by Apple, so it opens like any downloaded app. It's added to this page once + Apple accepts it, which can be a while after the other downloads appear. If Apple doesn't + accept it, the release goes out without a macOS download rather than with an unchecked one. + This is its first release, and it hasn't had a full test pass yet (#1108, #1109). +- **Share logs** and **About** are reachable from the connect screen with no radio connected, + through a new settings icon. A failed log export now shows a message that stays until you + dismiss it (#693). +- If a Bluetooth scan can't start, the app says why and keeps the message on screen. On + Android 11 and older, that usually means Location is turned off (#1033). +- Map tile requests now identify the app as Offband MeshCore, as OpenStreetMap's tile policy + requires, and every map shows the OpenStreetMap credit (#1111). +- Long menus scroll, so items at the bottom (such as a room server's Delete Contact) can be + reached, and a link right beside an @mention can be tapped (#1074, #1075). +- The app is spelled **Offband MeshCore** everywhere: launcher, window title, notifications + and web. On Windows your data folder keeps its old name, so nothing moves (#1050). +- **iOS:** the Google Play link, Donate and the Experimental section are hidden, channels get a + back arrow and the edge swipe works, and tapping or dragging the messages dismisses the + keyboard (#1048, #1051, #1052). +- After you've used the app for a while (the third launch, at least 7 days after the first), + it asks once whether you'd like to support its development. **Not now** puts it off for 30 + days, **Sponsor** opens the page and puts it off for 90, and **Never Show Again** means + exactly that. It isn't shown on iOS. You can always find it under About in Settings (#1129). + +### For troubleshooting + +- The app log now records every channel notification decision and every save of a + notification setting, and each channel sync records what it checked before clearing any + history, or why it skipped the check (#1122, #1128). + +### Known issues + +- **Phone notifications set to Off for a channel can still notify.** Under investigation + (#1121). +- **Factory reset from one phone leaves that radio's old data on your other phones** and PCs. + Only the phone that sent the reset deletes its copy (#1123). +- **On a radio with a screen but no switchable LED** (the SenseCAP T1000-E, the QCC badge, the + Heltec T096) running Offband firmware 1.7.0, the Status LED switch still appears and the + radio turns the change down. Firmware 1.7.0 doesn't report the display and LED separately + yet. A later firmware release does, and the app then hides that switch (#1132). +- **A Display or LED change can be undone** by the radio's older reading arriving just after + it (#1124). +- **Adding a contact when the radio's contact table is full shows it as added**, and direct + messages to it fail silently after 8 seconds (#1028). +- **On a SenseCAP T1000-E, Position Reporting Interval says "Location updated"** even though + the radio refused the value (#1134). diff --git a/test/connector/channel_write_history_identity_test.dart b/test/connector/channel_write_history_identity_test.dart index a1e3dc78..7c078f47 100644 --- a/test/connector/channel_write_history_identity_test.dart +++ b/test/connector/channel_write_history_identity_test.dart @@ -1,11 +1,13 @@ -// #1026 on top of #1063: what a confirmed channel write does to PSK-keyed -// history. +// #1128 on top of #1026/#1063: what a confirmed channel write does to +// PSK-keyed history. // -// History is keyed by the channel's PSK (#194). Giving a slot to a different -// channel is a reassignment: the old channel's history is kept, so it comes -// back if that channel is ever re-added (#1063). Deleting a channel is the one -// path that removes its history outright. Both happen only after the radio's -// OK (#1026). Exercised through the real store, not the in-memory map. +// History is never kept hidden. A key change asks: Keep moves the old key's +// history (and phone notify mode) to the new key, Delete removes it, both as +// soon as the radio confirms the clear. A different channel written over a +// slot is settled by the next sync that saw every slot: history no channel on +// the radio shows is deleted, and a channel the firmware moved keeps its own. +// A radio with erased slots (the Restore case) or a partial sync deletes +// nothing. Exercised through the real store, not the in-memory map. import 'dart:typed_data'; @@ -13,12 +15,16 @@ import 'package:drift/native.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:meshcore_open/connector/meshcore_connector.dart'; import 'package:meshcore_open/connector/meshcore_protocol.dart'; +import 'package:meshcore_open/models/app_settings.dart'; import 'package:meshcore_open/models/channel.dart'; import 'package:meshcore_open/models/channel_message.dart'; +import 'package:meshcore_open/services/app_debug_log_service.dart'; +import 'package:meshcore_open/services/app_settings_service.dart'; import 'package:meshcore_open/storage/channel_message_store.dart'; import 'package:meshcore_open/storage/drift/blob_store.dart'; import 'package:meshcore_open/storage/drift/offband_database.dart'; import 'package:meshcore_open/storage/prefs_manager.dart'; +import 'package:meshcore_open/utils/app_logger.dart'; import 'package:shared_preferences/shared_preferences.dart'; Uint8List psk(int fill) => Uint8List.fromList(List.filled(16, fill)); @@ -40,19 +46,52 @@ ChannelMessage msg(String text) => ChannelMessage( messageId: text, ); +const int slots = 2; + void main() { TestWidgetsFlutterBinding.ensureInitialized(); late OffbandDatabase db; late MeshCoreConnector connector; + late AppSettingsService settings; + late List sent; + late AppDebugLogService log; + + /// What the exported log says about the hidden-history check, newest last. + List historyChecks() => [ + for (final e in log.entries) + if (e.message.startsWith('Hidden channel history check')) e.message, + ]; final weather = Channel(index: 0, name: 'Weather', psk: psk(0x22)); + final empty = Uint8List(16); - /// Reads the history stored under [weather]'s PSK, whatever slot it is in. - late ChannelMessageStore weatherHistory; + /// History stored under a key, whatever slot that channel is in. + ChannelMessageStore historyOf(Uint8List key) => ChannelMessageStore() + ..setPublicKeyHex = connector.selfPublicKeyHex + ..channelPskResolver = (_) => Channel(index: 0, name: '', psk: key).pskHex; + + Future settle([int turns = 1]) async { + for (var i = 0; i < turns; i++) { + await Future.delayed(Duration.zero); + } + } - Future settle() => Future.delayed(Duration.zero); void ok() => connector.handleFrameForTest([respCodeOk]); + /// The radio answers a sync of every slot with [bySlot] (null = empty). + Future radioHolds( + List<(String, Uint8List)?> bySlot, { + bool start = true, + }) async { + if (start) await connector.getChannels(maxChannels: slots, force: true); + for (var i = 0; i < slots; i++) { + final c = bySlot[i]; + connector.handleFrameForTest(channelInfo(i, c?.$1 ?? '', c?.$2 ?? empty)); + await settle(); + } + await settle(50); + } + setUp(() async { SharedPreferences.setMockInitialValues({}); PrefsManager.reset(); @@ -60,25 +99,30 @@ void main() { db = OffbandDatabase(NativeDatabase.memory()); BlobStore.overrideForTest(BlobStore(db)); + sent = []; connector = MeshCoreConnector(); - connector.sendFrameOverrideForTest = (_) {}; + connector.sendFrameOverrideForTest = sent.add; connector.setConnectedForTest(); connector.setSelfPublicKeyForTest( Uint8List.fromList(List.generate(32, (i) => i)), ); connector.wireMessageStoreForTest(); + settings = AppSettingsService(); + await settings.loadSettings(); + connector.setAppSettingsServiceForTest(settings); + log = AppDebugLogService()..setEnabled(true); + appLogger.initialize(log, enabled: true); + connector.setAppDebugLogServiceForTest(log); - // The radio holds Weather in slot 0. - await connector.getChannels(maxChannels: 1, force: true); - connector.handleFrameForTest(channelInfo(0, weather.name, weather.psk)); + // Device info says the radio has [slots] channel slots. + connector.handleFrameForTest([respCodeDeviceInfo, 14, 100, slots]); await settle(); - expect(connector.channels.single.pskHex, weather.pskHex); - weatherHistory = ChannelMessageStore() - ..setPublicKeyHex = connector.selfPublicKeyHex - ..channelPskResolver = (_) => weather.pskHex; - await weatherHistory.saveChannelMessages(0, [msg('kept')]); - expect(await weatherHistory.loadChannelMessages(0), hasLength(1)); + await radioHolds([(weather.name, weather.psk), null]); + expect(connector.channels.first.pskHex, weather.pskHex); + + await historyOf(weather.psk).saveChannelMessages(0, [msg('kept')]); + expect(await historyOf(weather.psk).loadChannelMessages(0), hasLength(1)); }); tearDown(() async { @@ -86,28 +130,256 @@ void main() { await db.close(); }); - test( - 'a slot given to another channel keeps the old one\'s history', - () async { - final write = connector.setChannel(0, 'Other', psk(0x33), refresh: false); + /// Runs a key-change edit of Weather to [newKey], with the radio answering + /// the clear OK and the add with [addReply]. + Future changeKey( + Uint8List newKey, + KeyChangeHistory history, { + List? addReply, + }) async { + int setFrames() => + sent.where((f) => f.isNotEmpty && f[0] == cmdSetChannel).length; + final before = setFrames(); + final edit = connector.editChannel( + weather, + 'Weather', + newKey, + history: history, + ); + Future untilSetFrames(int n) async { + // The history move can decode on another isolate, so wait in real time + // for the frame rather than a fixed number of microtask turns. + for (var i = 0; i < 500 && setFrames() < before + n; i++) { + await Future.delayed(const Duration(milliseconds: 5)); + } + expect(setFrames(), before + n, reason: 'set-channel frame $n sent'); + } + + await untilSetFrames(1); + ok(); // the clear + await untilSetFrames(2); + connector.handleFrameForTest(addReply ?? [respCodeOk]); + return edit; + } + + group('key change', () { + test( + 'Keep moves the history to the new key, none left under the old', + () async { + expect( + await changeKey(psk(0x99), KeyChangeHistory.keep), + ChannelWrite.ok, + ); + await radioHolds([('Weather', psk(0x99)), null], start: false); + + expect(await historyOf(psk(0x99)).loadChannelMessages(0), hasLength(1)); + expect(await historyOf(weather.psk).loadChannelMessages(0), isEmpty); + }, + ); + + test('Keep carries the phone notify mode to the new key', () async { + await settings.setChannelNotifyMode( + devicePrefix: connector.selfPublicKeyHex, + pskHex: weather.pskHex, + channelName: 'Weather', + mode: ChannelNotifyMode.off, + ); + + await changeKey(psk(0x99), KeyChangeHistory.keep); + + final newHex = Channel(index: 0, name: '', psk: psk(0x99)).pskHex; + expect( + settings.channelNotifyMode( + devicePrefix: connector.selfPublicKeyHex, + pskHex: newHex, + ), + ChannelNotifyMode.off, + ); + expect( + settings + .resolveChannelNotifyMode( + devicePrefix: connector.selfPublicKeyHex, + pskHex: weather.pskHex, + ) + .source, + 'default, nothing saved', + ); + }); + + test('Delete removes the old key\'s history and moves nothing', () async { + expect( + await changeKey(psk(0x99), KeyChangeHistory.delete), + ChannelWrite.ok, + ); + + expect(await historyOf(weather.psk).loadChannelMessages(0), isEmpty); + expect(await historyOf(psk(0x99)).loadChannelMessages(0), isEmpty); + }); + + test( + 'a key change with no answer is refused before anything is sent', + () async { + sent.clear(); + expect( + () => connector.editChannel(weather, 'Weather', psk(0x99)), + throwsArgumentError, + ); + expect(sent, isEmpty); + expect( + await historyOf(weather.psk).loadChannelMessages(0), + hasLength(1), + ); + }, + ); + + test('a refused clear leaves history where it was', () async { + final edit = connector.editChannel( + weather, + 'Weather', + psk(0x99), + history: KeyChangeHistory.delete, + ); + await settle(); + connector.handleFrameForTest([respCodeErr, errCodeNotFound]); + + expect(await edit, ChannelWrite.rejected); + expect(await historyOf(weather.psk).loadChannelMessages(0), hasLength(1)); + }); + + test('a same-key rename asks nothing and keeps history', () async { + final edit = connector.editChannel(weather, 'Wx', weather.psk); + await settle(); ok(); + expect(await edit, ChannelWrite.ok); + expect(await historyOf(weather.psk).loadChannelMessages(0), hasLength(1)); + }); + + test('Keep with a failed add holds the history for a re-add, ' + 'through the sync that follows', () async { + expect( + await changeKey( + psk(0x99), + KeyChangeHistory.keep, + addReply: [respCodeErr, errCodeNotFound], + ), + ChannelWrite.clearedNotAdded, + ); + // The write's own re-read: the slot is empty on the radio now. Another + // channel is there, so the no-channels guard is not what spares it. + await radioHolds([null, ('Other', psk(0x33))], start: false); + + expect(await historyOf(psk(0x99)).loadChannelMessages(0), hasLength(1)); + }); + }); + + group('kept history a key change could not land', () { + test('a Keep whose move fails says so, and the old key survives the ' + 'sync that follows', () async { + final oldKey = + 'channel_messages_${connector.selfPublicKeyHex.substring(0, 10)}' + 'psk_${weather.pskHex}'; + await BlobStore.instance.deleteMessageRows(oldKey); + BlobStore.instance.resetMigratedKeyCache(); + await BlobStore.instance.write('__msgrows_migrated', '[]'); + await BlobStore.instance.write(oldKey, 'not json'); + BlobStore.instance.resetMigratedKeyCache(); + + expect( + await changeKey(psk(0x99), KeyChangeHistory.keep), + ChannelWrite.historyNotMoved, + ); + await radioHolds([('Weather', psk(0x99)), null], start: false); + + expect(await BlobStore.instance.read(oldKey), 'not json'); + }); + + test( + 'a spared key is judged normally once the radio holds it again', + () async { + await changeKey( + psk(0x99), + KeyChangeHistory.keep, + addReply: [respCodeErr, errCodeNotFound], + ); + await radioHolds([null, ('Other', psk(0x33))], start: false); + // Re-added (here: the radio reports it), then deleted elsewhere. + await radioHolds([('Weather', psk(0x99)), null]); + await radioHolds([('Other', psk(0x33)), null]); + + expect(await historyOf(psk(0x99)).loadChannelMessages(0), isEmpty); + }, + ); + }); + + group('a different channel written over a slot', () { + test('its old occupant\'s history goes once a full sync shows the radio ' + 'no longer holds it', () async { + final write = connector.setChannel(0, 'Other', psk(0x33), refresh: false); + ok(); expect(await write, ChannelWrite.ok); - expect(await weatherHistory.loadChannelMessages(0), hasLength(1)); - }, - ); - test('a new key by edit keeps the old key\'s history too', () async { - final edit = connector.editChannel(weather, 'Weather', psk(0x99)); - await settle(); - ok(); // the clear - for (var i = 0; i < 50; i++) { - await settle(); - } - ok(); // the add + await radioHolds([('Other', psk(0x33)), null]); + + expect(await historyOf(weather.psk).loadChannelMessages(0), isEmpty); + expect( + historyChecks().last, + allOf(contains('against 1 channel(s)'), contains('1 deleted')), + ); + }); + + test( + 'a channel the firmware moved out of the way keeps its history', + () async { + final write = connector.setChannel( + 0, + 'Other', + psk(0x33), + refresh: false, + ); + ok(); + expect(await write, ChannelWrite.ok); + + await radioHolds([('Other', psk(0x33)), (weather.name, weather.psk)]); + + expect( + await historyOf(weather.psk).loadChannelMessages(0), + hasLength(1), + ); + }, + ); + }); + + group('syncs that cannot judge history delete nothing', () { + test('erased slots (the Restore case)', () async { + await radioHolds([('\u{FFFD}', psk(0xFF)), null]); + + expect(connector.canRestoreChannelsToRadio, isTrue); + expect(await historyOf(weather.psk).loadChannelMessages(0), hasLength(1)); + expect(historyChecks().last, contains('skipped')); + expect(historyChecks().last, contains('erased slots')); + }); + + test('a sync asked for fewer slots than the radio has', () async { + await connector.getChannels(maxChannels: 1, force: true); + connector.handleFrameForTest(channelInfo(0, 'Other', psk(0x33))); + await settle(50); + + expect(await historyOf(weather.psk).loadChannelMessages(0), hasLength(1)); + expect( + historyChecks().last, + contains( + 'skipped for radio 0001020304: this sync read 1 of the ' + 'radio\'s 2 slots', + ), + ); + }); + + test('a radio that reports no channels at all', () async { + await radioHolds([null, null]); - expect(await edit, ChannelWrite.ok); - expect(await weatherHistory.loadChannelMessages(0), hasLength(1)); + expect(await historyOf(weather.psk).loadChannelMessages(0), hasLength(1)); + }); }); test('a confirmed delete removes the channel\'s history', () async { @@ -115,7 +387,7 @@ void main() { ok(); expect(await delete, ChannelWrite.ok); - expect(await weatherHistory.loadChannelMessages(0), isEmpty); + expect(await historyOf(weather.psk).loadChannelMessages(0), isEmpty); }); test('a refused delete keeps it', () async { @@ -123,6 +395,6 @@ void main() { connector.handleFrameForTest([respCodeErr, errCodeNotFound]); expect(await delete, ChannelWrite.rejected); - expect(await weatherHistory.loadChannelMessages(0), hasLength(1)); + expect(await historyOf(weather.psk).loadChannelMessages(0), hasLength(1)); }); } diff --git a/test/connector/channel_write_reply_test.dart b/test/connector/channel_write_reply_test.dart index cb0da868..cc9d9855 100644 --- a/test/connector/channel_write_reply_test.dart +++ b/test/connector/channel_write_reply_test.dart @@ -183,7 +183,12 @@ void main() { }); test('a new key is clear-then-add, so #1864 firmware accepts it', () async { - final edit = connector.editChannel(current, 'Weather', psk(0x99)); + final edit = connector.editChannel( + current, + 'Weather', + psk(0x99), + history: KeyChangeHistory.delete, + ); await untilSetFrames(1); // The clear: an empty name. expect(setFrames()[0][2], 0); @@ -198,7 +203,12 @@ void main() { }); test('a refused clear writes nothing more and keeps the history', () async { - final edit = connector.editChannel(current, 'Weather', psk(0x99)); + final edit = connector.editChannel( + current, + 'Weather', + psk(0x99), + history: KeyChangeHistory.delete, + ); await untilSetFrames(1); err(errCodeNotFound); @@ -210,7 +220,12 @@ void main() { test( 'a clear that lands and an add that fails says the slot is empty', () async { - final edit = connector.editChannel(current, 'Weather', psk(0x99)); + final edit = connector.editChannel( + current, + 'Weather', + psk(0x99), + history: KeyChangeHistory.keep, + ); await untilSetFrames(1); ok(); // the clear lands diff --git a/test/connector/factory_reset_test.dart b/test/connector/factory_reset_test.dart index 6f5b7705..e3c76e2e 100644 --- a/test/connector/factory_reset_test.dart +++ b/test/connector/factory_reset_test.dart @@ -1,8 +1,5 @@ -// #1057 (epic #1054): factory reset of the connected radio. -// -// The radio drops the link before it formats, so success is only ever seen as -// the same device coming back with a new identity. These pin that the app data -// waits for that proof, and that every branch where it cannot tell keeps it. +// #1057 (epic #1054): factory reset of the connected radio. With the box +// ticked, the radio's app data is deleted as soon as the reset is sent (#1118). import 'dart:typed_data'; @@ -12,7 +9,6 @@ import 'package:meshcore_open/connector/meshcore_connector.dart'; import 'package:meshcore_open/connector/meshcore_protocol.dart'; import 'package:meshcore_open/storage/drift/blob_store.dart'; import 'package:meshcore_open/storage/drift/offband_database.dart'; -import 'package:meshcore_open/storage/factory_reset_store.dart'; import 'package:meshcore_open/storage/prefs_manager.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -23,9 +19,8 @@ void main() { late MeshCoreConnector connector; late List sent; - const oldPrefix = 'aaaaaaaaaa'; - const newPrefix = 'bbbbbbbbbb'; - Uint8List keyOf(int fill) => Uint8List.fromList(List.filled(32, fill)); + const radioPrefix = 'aaaaaaaaaa'; + const otherPrefix = 'bbbbbbbbbb'; setUp(() async { SharedPreferences.setMockInitialValues({}); @@ -36,8 +31,7 @@ void main() { sent = []; connector = MeshCoreConnector() ..sendFrameOverrideForTest = sent.add - ..transportIdentityForTest = 'dev-1' - ..setSelfPublicKeyForTest(keyOf(0xaa)) + ..setSelfPublicKeyForTest(Uint8List.fromList(List.filled(32, 0xaa))) ..setFirmwareVerCodeForTest(14); }); @@ -46,37 +40,33 @@ void main() { BlobStore.clearTestOverride(); }); - Future seedOldRadio() async { - await BlobStore.instance.write('contacts$oldPrefix', '[]'); - await PrefsManager.instance.setString('channels$oldPrefix', '[]'); + Future seed(String prefix) async { + await BlobStore.instance.write('contacts$prefix', '[]'); + await PrefsManager.instance.setString('channels$prefix', '[]'); } - Future oldRadioDataExists() async => - (await BlobStore.instance.keysWithPrefix( - 'contacts$oldPrefix', - )).isNotEmpty || - PrefsManager.instance.getString('channels$oldPrefix') != null; + Future dataExists(String prefix) async => + (await BlobStore.instance.keysWithPrefix('contacts$prefix')).isNotEmpty || + PrefsManager.instance.getString('channels$prefix') != null; test('the frame is the command then "reset"', () { expect(buildFactoryResetFrame(), [cmdFactoryReset, ...'reset'.codeUnits]); expect(cmdFactoryReset, 51); }); - group('refusals send nothing', () { - test('not connected', () async { - final refusal = await connector.factoryResetDevice(deleteAppData: true); + test('not connected: nothing sent, nothing deleted', () async { + await seed(radioPrefix); - expect(refusal, FactoryResetRefusal.notConnected); - expect(sent, isEmpty); - expect(FactoryResetStore().load(), isNull); - }); + final refusal = await connector.factoryResetDevice(deleteAppData: true); + + expect(refusal, FactoryResetRefusal.notConnected); + expect(sent, isEmpty); + expect(await dataExists(radioPrefix), isTrue); }); - // Owner ruling: no FIRMWARE_VER_CODE gating. A radio that cannot reset keeps - // its identity, so the next connect resolves the record as "not reset". + // Owner ruling: no FIRMWARE_VER_CODE gating. for (final verCode in [null, 0, 6]) { test('ver code $verCode is never consulted: the reset is sent', () async { - await seedOldRadio(); connector ..setConnectedForTest() ..setFirmwareVerCodeForTest(verCode); @@ -88,93 +78,29 @@ void main() { }); } - test('a sent reset records the pending wipe, keeps the data, and ends the ' - 'session', () async { - await seedOldRadio(); + test('box ticked: the radio\'s app data is deleted on send, and only ' + 'that radio\'s', () async { + await seed(radioPrefix); + await seed(otherPrefix); connector.setConnectedForTest(); final refusal = await connector.factoryResetDevice(deleteAppData: true); expect(refusal, isNull); expect(sent.single, buildFactoryResetFrame()); - final pending = FactoryResetStore().load(); - expect(pending?.deviceId, 'dev-1'); - expect(pending?.radioPrefix, oldPrefix); - expect(pending?.deleteAppData, isTrue); - expect(await oldRadioDataExists(), isTrue); expect(connector.state, MeshCoreConnectionState.disconnected); - expect(connector.factoryResetStatus, isNotNull); + expect(connector.factoryResetStatus, FactoryResetStatus.sentBle); + expect(await dataExists(radioPrefix), isFalse); + expect(await dataExists(otherPrefix), isTrue); }); - group('the next connect settles it', () { - Future pend({bool deleteAppData = true}) => FactoryResetStore().save( - PendingFactoryReset( - deviceId: 'dev-1', - radioPrefix: oldPrefix, - deleteAppData: deleteAppData, - ), - ); - - test('new identity, box ticked: old data deleted', () async { - await seedOldRadio(); - await pend(); - connector.setSelfPublicKeyForTest(keyOf(0xbb)); - - await connector.resolvePendingFactoryResetForTest(); - - expect(await oldRadioDataExists(), isFalse); - expect(FactoryResetStore().load(), isNull); - expect(connector.factoryResetStatus, FactoryResetStatus.complete); - }); - - test('new identity, box unticked: old data kept', () async { - await seedOldRadio(); - await pend(deleteAppData: false); - connector.setSelfPublicKeyForTest(keyOf(0xbb)); - - await connector.resolvePendingFactoryResetForTest(); - - expect(await oldRadioDataExists(), isTrue); - expect(FactoryResetStore().load(), isNull); - expect(connector.factoryResetStatus, FactoryResetStatus.completeKept); - }); - - test('same identity: not reset, data kept', () async { - await seedOldRadio(); - await pend(); - - await connector.resolvePendingFactoryResetForTest(); - - expect(await oldRadioDataExists(), isTrue); - expect(FactoryResetStore().load(), isNull); - expect(connector.factoryResetStatus, FactoryResetStatus.notReset); - }); - - test('a different device: nothing decided, data and record kept', () async { - await seedOldRadio(); - await pend(); - connector - ..transportIdentityForTest = 'dev-2' - ..setSelfPublicKeyForTest(keyOf(0xbb)); - - await connector.resolvePendingFactoryResetForTest(); - - expect(await oldRadioDataExists(), isTrue); - expect(FactoryResetStore().load(), isNotNull); - expect(connector.factoryResetStatus, isNull); - }); - - test('the new radio\'s own data is never touched', () async { - await pend(); - await BlobStore.instance.write('contacts$newPrefix', '[]'); - connector.setSelfPublicKeyForTest(keyOf(0xbb)); + test('box unticked: the app data is kept', () async { + await seed(radioPrefix); + connector.setConnectedForTest(); - await connector.resolvePendingFactoryResetForTest(); + await connector.factoryResetDevice(deleteAppData: false); - expect( - await BlobStore.instance.keysWithPrefix('contacts$newPrefix'), - isNotEmpty, - ); - }); + expect(sent.single, buildFactoryResetFrame()); + expect(await dataExists(radioPrefix), isTrue); }); } diff --git a/test/connector/indicators_connector_test.dart b/test/connector/indicators_connector_test.dart index 2b1109c3..9ecc8b0b 100644 --- a/test/connector/indicators_connector_test.dart +++ b/test/connector/indicators_connector_test.dart @@ -174,6 +174,165 @@ void main() { expect(sentSub(offbandUiRotationGet), isFalse); }); + // #1132 (firmware #2069): display control and LED control are separate tags + // in the advert. Precedence from the firmware header: the tags decide when + // the advert carries either; otherwise caps2 0x04 answers both. + group('display and LED gate on their own tags', () { + void connectWith({required int caps2, List? tags}) { + connector.handleFrameForTest(deviceInfo(caps2: caps2)); + if (tags != null) { + connector.handleFrameForTest(Uint8List.fromList(advert(tags))); + } + } + + test( + 'display tag only: display shown, LED hidden and never sent', + () async { + connectWith( + caps2: offbandCap2Indicators, + tags: [offbandInfoTagDisplayControl], + ); + sent.clear(); + + expect(connector.supportsDisplayControl, isTrue); + expect(connector.supportsLedControl, isFalse); + expect(connector.supportsIndicators, isTrue); + + await connector.setLedEnabled(false); + await connector.setDisplayMode(DisplayMode.alwaysOn); + expect(sentSub(offbandUiLedSet), isFalse); + expect(sentSub(offbandUiDisplaySet), isTrue); + }, + ); + + test('LED tag only: LED shown, display hidden and never sent', () async { + connectWith( + caps2: offbandCap2Indicators, + tags: [offbandInfoTagLedControl], + ); + sent.clear(); + + expect(connector.supportsDisplayControl, isFalse); + expect(connector.supportsLedControl, isTrue); + + await connector.setDisplayMode(DisplayMode.alwaysOn); + await connector.setLedEnabled(false); + expect(sentSub(offbandUiDisplaySet), isFalse); + expect(sentSub(offbandUiLedSet), isTrue); + }); + + test('both tags: both shown', () { + connectWith( + caps2: offbandCap2Indicators, + tags: [offbandInfoTagDisplayControl, offbandInfoTagLedControl], + ); + + expect(connector.supportsDisplayControl, isTrue); + expect(connector.supportsLedControl, isTrue); + }); + + test('a tag decides even with caps2 0x04 clear', () { + connectWith(caps2: 0x01, tags: [offbandInfoTagLedControl]); + + expect(connector.supportsDisplayControl, isFalse); + expect(connector.supportsLedControl, isTrue); + expect(connector.supportsIndicators, isTrue); + }); + + test('advert without either tag: caps2 0x04 answers both, as today', () { + connectWith( + caps2: offbandCap2Indicators, + tags: [offbandInfoTagDisplayRotation], + ); + + expect(connector.supportsDisplayControl, isTrue); + expect(connector.supportsLedControl, isTrue); + }); + + test('advert without either tag and caps2 0x04 clear: no Indicators', () { + connectWith(caps2: 0x01, tags: [offbandInfoTagChanNotify]); + + expect(connector.supportsDisplayControl, isFalse); + expect(connector.supportsLedControl, isFalse); + expect(connector.supportsIndicators, isFalse); + }); + + test('a radio that predates the advert: caps2 0x04 answers both', () { + connector.handleFrameForTest(deviceInfo()); + connector.handleFrameForTest(Uint8List.fromList(advertUnsupported())); + + expect( + connector.capabilityAdvertState, + CapabilityAdvertState.unsupported, + ); + expect(connector.supportsDisplayControl, isTrue); + expect(connector.supportsLedControl, isTrue); + }); + + test('a radio that predates the advert, caps2 0x04 clear: nothing', () { + connector.handleFrameForTest(deviceInfo(caps2: 0x01)); + connector.handleFrameForTest(Uint8List.fromList(advertUnsupported())); + + expect(connector.supportsIndicators, isFalse); + }); + + test('before the advert answers, caps2 0x04 answers both', () { + connectWith(caps2: offbandCap2Indicators); + + expect(connector.capabilityAdvertState, CapabilityAdvertState.unknown); + expect(connector.supportsDisplayControl, isTrue); + expect(connector.supportsLedControl, isTrue); + }); + + test('the next radio does not inherit the previous radio\'s tags', () { + // Radio A: tags say LED only, bit clear. + connectWith(caps2: 0x01, tags: [offbandInfoTagLedControl]); + expect(connector.supportsDisplayControl, isFalse); + + // Radio B predates the advert and sets the bit. Its device-info drops + // A's advert, so the bit answers both. + connector.handleFrameForTest(deviceInfo()); + connector.handleFrameForTest(Uint8List.fromList(advertUnsupported())); + + expect(connector.supportsDisplayControl, isTrue); + expect(connector.supportsLedControl, isTrue); + }); + + test('support is never probed: no display or LED GET is sent', () { + connectWith( + caps2: offbandCap2Indicators, + tags: [offbandInfoTagDisplayControl], + ); + + expect(sentSub(offbandUiDisplayGet), isFalse); + expect(sentSub(offbandUiLedGet), isFalse); + }); + + test('an unknown tag is skipped by its length and kept', () { + final reply = parseCapabilityAdvertReply([ + cmdOffbandDeviceUi, + offbandUiInfoGet, + offbandInfoTagLedControl, + 0x00, + 0x06, + 0x02, + 0xAA, + 0xBB, + 0x07, + 0x00, + ])!; + + expect(reply.malformed, isFalse); + expect(reply.has(offbandInfoTagLedControl), isTrue); + expect(reply.tags[0x06], [0xAA, 0xBB]); + expect(reply.has(0x07), isTrue); + expect(resolveIndicatorSupport(offbandCaps2: 0, advert: reply), ( + display: false, + led: true, + )); + }); + }); + group('rotation', () { test('the INDICATORS bit alone does NOT open rotation', () { // The gate moved to the advert tag. 0x04 means indicators, which is a diff --git a/test/storage/channel_message_store_identity_test.dart b/test/storage/channel_message_store_identity_test.dart index b2f8e0be..de14431c 100644 --- a/test/storage/channel_message_store_identity_test.dart +++ b/test/storage/channel_message_store_identity_test.dart @@ -9,9 +9,9 @@ import 'package:shared_preferences/shared_preferences.dart'; /// #1063 (Epic B of #1061): slot reassignment must not move history between /// channel identities. Persisted history is PSK-keyed (#194); the remnants a -/// reassignment has to deal with are the LEGACY slot-index keys, and only -/// those - the outgoing occupant's PSK-keyed history survives so re-adding -/// that channel brings its messages back. +/// reassignment clears are the LEGACY slot-index keys. Whether the outgoing +/// occupant's PSK-keyed history stays is the full sync's call (#1128): it is +/// deleted when no channel on the radio shows it, never kept hidden. void main() { late OffbandDatabase db; late BlobStore blobs; @@ -93,21 +93,164 @@ void main() { expect(await store(psk: pskB).loadChannelMessages(0), isEmpty); }); - test('the outgoing occupant\'s history survives a reassignment and comes ' - 'back when the channel is re-added', () async { + test('clearing a slot\'s legacy keys leaves PSK-keyed history for the sync ' + 'to judge', () async { // Channel A lives in slot 0 with PSK-keyed history. final asA = store(psk: pskA); await asA.saveChannelMessages(0, [chan(1, text: 'kept')]); - // Slot 0 is reassigned to channel B. + // Slot 0 is reassigned to channel B. Firmware may have moved A rather + // than overwritten it (#1896), so the write alone must not delete A's. await store(psk: pskB).clearLegacySlotHistory(0); await store(psk: pskB).saveChannelMessages(0, [chan(9, text: 'b-msg')]); - // Channel A is re-added (any slot; identity is the PSK, not the slot). final loaded = await store(psk: pskA).loadChannelMessages(5); expect(loaded.single.text, 'kept'); }); + group('#1128 move, delete and purge by key', () { + test( + 'a move lands every message under the new key and empties the old', + () async { + await store(psk: pskA).saveChannelMessages(0, [chan(1), chan(2)]); + + expect(await store().moveChannelHistory(pskA, pskB), 2); + + expect(await store(psk: pskB).loadChannelMessages(0), hasLength(2)); + expect(await store(psk: pskA).loadChannelMessages(0), isEmpty); + expect( + await blobs.readWithPrefsFallback( + 'channel_messages_ddddddddddpsk_$pskA', + ), + isNull, + ); + }, + ); + + test('a move merges into what the new key already holds, keeping its ' + 'copy of a shared message', () async { + await store( + psk: pskA, + ).saveChannelMessages(0, [chan(1, text: 'old copy'), chan(2)]); + await store( + psk: pskB, + ).saveChannelMessages(0, [chan(1, text: 'new copy')]); + + expect(await store().moveChannelHistory(pskA, pskB), 1); + + final moved = await store(psk: pskB).loadChannelMessages(0); + expect(moved.map((m) => m.text), unorderedEquals(['new copy', 'm2'])); + }); + + test('the move\'s delete takes only the rows it copied', () async { + const key = 'channel_messages_ddddddddddpsk_$pskA'; + await store(psk: pskA).saveChannelMessages(0, [chan(1), chan(2)]); + + await blobs.deleteMessageRowsIn(key, ['id:id1']); + + expect(await blobs.messageMergeKeys(key), {'id:id2'}); + }); + + test('a move reads an old key still on the blob', () async { + await blobs.write( + 'channel_messages_ddddddddddpsk_$pskA', + ChannelMessageStore.encodeHistoryForTest([chan(1), chan(2), chan(3)]), + ); + + expect(await store().moveChannelHistory(pskA, pskB), 3); + expect(await store(psk: pskB).loadChannelMessages(0), hasLength(3)); + expect(await store(psk: pskA).loadChannelMessages(0), isEmpty); + }); + + test('a move that cannot read the old key changes neither key', () async { + await blobs.write('channel_messages_ddddddddddpsk_$pskA', 'not json'); + + expect(await store().moveChannelHistory(pskA, pskB), isNull); + expect( + await blobs.readWithPrefsFallback( + 'channel_messages_ddddddddddpsk_$pskA', + ), + 'not json', + ); + expect(await store(psk: pskB).loadChannelMessages(0), isEmpty); + }); + + test( + 'deleteChannelHistory removes rows and blob for that key only', + () async { + await store(psk: pskA).saveChannelMessages(0, [chan(1)]); + await store(psk: pskB).saveChannelMessages(1, [chan(2)]); + + await store().deleteChannelHistory(pskA); + + expect(await store(psk: pskA).loadChannelMessages(0), isEmpty); + expect(await store(psk: pskB).loadChannelMessages(1), hasLength(1)); + }, + ); + + test('the purge deletes keys no radio channel shows and empty-slot ' + 'legacy keys, and nothing else', () async { + const pskC = 'cccccccccccccccccccccccccccccccc'; + await store(psk: pskA).saveChannelMessages(0, [chan(1)]); + await store(psk: pskB).saveChannelMessages(1, [chan(2)]); + await blobs.write( + 'channel_messages_ddddddddddpsk_$pskC', + ChannelMessageStore.encodeHistoryForTest([chan(3)]), + ); + // Legacy slot keys: slot 0 holds a channel, slot 7 holds nothing. + for (final slot in [0, 7]) { + await blobs.write( + 'channel_messages_dddddddddd$slot', + ChannelMessageStore.encodeHistoryForTest([chan(4)]), + ); + } + // Another radio's history is never this radio's to judge. + await (ChannelMessageStore() + ..setPublicKeyHex = 'e' * 20 + ..channelPskResolver = (_) => pskB) + .saveChannelMessages(0, [chan(5)]); + + final deleted = await store().purgeHistoryNotOnRadio( + radioPskHex: {pskA}, + occupiedSlots: {0}, + ); + + expect( + deleted, + unorderedEquals([ + 'channel_messages_ddddddddddpsk_$pskB', + 'channel_messages_ddddddddddpsk_$pskC', + 'channel_messages_dddddddddd7', + ]), + ); + expect(await store(psk: pskA).loadChannelMessages(0), hasLength(1)); + expect( + await blobs.readWithPrefsFallback('channel_messages_dddddddddd0'), + isNotNull, + ); + expect( + await (ChannelMessageStore() + ..setPublicKeyHex = 'e' * 20 + ..channelPskResolver = (_) => pskB) + .loadChannelMessages(0), + hasLength(1), + ); + }); + + test('the purge deletes nothing for a radio with no channels', () async { + await store(psk: pskA).saveChannelMessages(0, [chan(1)]); + + expect( + await store().purgeHistoryNotOnRadio( + radioPskHex: {}, + occupiedSlots: {}, + ), + isEmpty, + ); + expect(await store(psk: pskA).loadChannelMessages(0), hasLength(1)); + }); + }); + test('clearChannelMessages (true delete) removes the PSK-keyed history ' 'and the legacy index key', () async { final s = store(psk: pskA); diff --git a/test/storage/radio_data_wipe_test.dart b/test/storage/radio_data_wipe_test.dart index c60db357..82240625 100644 --- a/test/storage/radio_data_wipe_test.dart +++ b/test/storage/radio_data_wipe_test.dart @@ -2,13 +2,12 @@ import 'package:drift/native.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:meshcore_open/storage/drift/blob_store.dart'; import 'package:meshcore_open/storage/drift/offband_database.dart'; -import 'package:meshcore_open/storage/factory_reset_store.dart'; import 'package:meshcore_open/storage/prefs_manager.dart'; import 'package:meshcore_open/storage/radio_data_wipe.dart'; import 'package:meshcore_open/storage/scoping_inventory.dart'; import 'package:shared_preferences/shared_preferences.dart'; -/// #1057: the factory-reset app-data wipe and the reconnect decision. +/// #1057: the factory-reset app-data wipe. void main() { late OffbandDatabase db; @@ -106,69 +105,4 @@ void main() { } expect(await allKeys(), before); }); - - group('resolveFactoryReset', () { - const pending = PendingFactoryReset( - deviceId: 'dev-1', - radioPrefix: wiped, - deleteAppData: true, - ); - - test('new key on the same device with the box ticked wipes', () { - expect( - resolveFactoryReset(pending, deviceId: 'dev-1', radioPrefix: other), - FactoryResetOutcome.wipeAppData, - ); - }); - - test('new key with the box unticked keeps', () { - const keep = PendingFactoryReset( - deviceId: 'dev-1', - radioPrefix: wiped, - deleteAppData: false, - ); - expect( - resolveFactoryReset(keep, deviceId: 'dev-1', radioPrefix: other), - FactoryResetOutcome.keepAppData, - ); - }); - - test('same key means the radio was not reset', () { - expect( - resolveFactoryReset(pending, deviceId: 'dev-1', radioPrefix: wiped), - FactoryResetOutcome.notReset, - ); - }); - - test('a different device decides nothing', () { - expect( - resolveFactoryReset(pending, deviceId: 'dev-2', radioPrefix: other), - isNull, - ); - }); - }); - - test('the pending record survives a restart and clears', () async { - final store = FactoryResetStore(); - await store.save( - const PendingFactoryReset( - deviceId: 'COM7', - radioPrefix: wiped, - deleteAppData: true, - ), - ); - - final reloaded = FactoryResetStore().load(); - expect(reloaded?.deviceId, 'COM7'); - expect(reloaded?.radioPrefix, wiped); - expect(reloaded?.deleteAppData, isTrue); - - await store.clear(); - expect(FactoryResetStore().load(), isNull); - }); - - test('an unreadable pending record loads as none', () async { - await PrefsManager.instance.setString('factory_reset_pending', '{oops'); - expect(FactoryResetStore().load(), isNull); - }); } diff --git a/test/widgets/indicators_view_test.dart b/test/widgets/indicators_view_test.dart index 1f8d8815..edbb2416 100644 --- a/test/widgets/indicators_view_test.dart +++ b/test/widgets/indicators_view_test.dart @@ -12,6 +12,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:provider/provider.dart'; import 'package:meshcore_open/connector/meshcore_connector.dart'; +import 'package:meshcore_open/connector/offband_indicators.dart'; import 'package:meshcore_open/screens/settings/indicators_view.dart'; /// Rotation is advertised, but the radio has not answered the GET yet. This is @@ -82,6 +83,30 @@ void main() { expect(button.selected, {180}); }); + // #1132: display and LED show independently. + testWidgets('display control only: no Status LED switch', (tester) async { + await _pump(tester, _Controls(display: true, led: false)); + + expect(find.text('Display'), findsOneWidget); + expect(find.text('Status LED'), findsNothing); + expect(find.byType(SwitchListTile), findsNothing); + }); + + testWidgets('LED control only: no Display block', (tester) async { + await _pump(tester, _Controls(display: false, led: true)); + + expect(find.text('Display'), findsNothing); + expect(find.byType(SegmentedButton), findsNothing); + expect(find.text('Status LED'), findsOneWidget); + }); + + testWidgets('both controls: both shown', (tester) async { + await _pump(tester, _Controls(display: true, led: true)); + + expect(find.text('Display'), findsOneWidget); + expect(find.text('Status LED'), findsOneWidget); + }); + testWidgets('a radio that does not advertise rotation gets no control', ( tester, ) async { @@ -93,3 +118,13 @@ void main() { } class _DummyConnector extends MeshCoreConnector {} + +class _Controls extends MeshCoreConnector { + _Controls({required this.display, required this.led}); + final bool display; + final bool led; + @override + bool get supportsDisplayControl => display; + @override + bool get supportsLedControl => led; +} diff --git a/test/widgets/sponsor_prompt_test.dart b/test/widgets/sponsor_prompt_test.dart new file mode 100644 index 00000000..33ddf35b --- /dev/null +++ b/test/widgets/sponsor_prompt_test.dart @@ -0,0 +1,280 @@ +// Sponsor window timing (#1129), owner's rules of 2026-11-09: first shown +// after 3 launches and 7 days, Not now sleeps 30 days, Sponsor 90 days, Never +// Show Again ends it, and test builds show it once per commit. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:meshcore_open/l10n/app_localizations.dart'; +import 'package:meshcore_open/storage/prefs_manager.dart'; +import 'package:meshcore_open/widgets/sponsor_prompt.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +final _day0 = DateTime(2026, 11, 9, 12); + +Future _prefs([Map values = const {}]) { + SharedPreferences.setMockInitialValues(values); + return SharedPreferences.getInstance(); +} + +/// One app launch at [at]. A button stands in for the gate's post-frame call. +Future _launch( + WidgetTester tester, + SharedPreferences prefs, { + required DateTime at, + String sha = '', + String version = '1.8.0+69', + bool isIOS = false, + Future Function(Uri)? open, +}) async { + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Builder( + builder: (context) => Scaffold( + body: TextButton( + onPressed: () => SponsorPrompt.onLaunch( + context, + sha: sha, + isIOS: isIOS, + prefs: prefs, + clock: () => at, + installedVersion: () async => version, + open: open, + ), + child: const Text('launch'), + ), + ), + ), + ), + ); + await tester.tap(find.text('launch')); + await tester.pumpAndSettle(); +} + +/// Launches twice on day 0, then once at [at]: the third launch. +Future _thirdLaunchAt( + WidgetTester tester, + SharedPreferences prefs, + DateTime at, +) async { + await _launch(tester, prefs, at: _day0); + await _launch(tester, prefs, at: _day0); + await _launch(tester, prefs, at: at); +} + +Future _choose(WidgetTester tester, String button) async { + await tester.tap(find.text(button)); + await tester.pumpAndSettle(); +} + +final _title = find.text('Support Offband'); +DateTime _days(int n) => _day0.add(Duration(days: n)); + +void main() { + group('first show waits for 3 launches and 7 days', () { + testWidgets('a fresh install never shows it on day 0', (tester) async { + final prefs = await _prefs(); + for (var i = 0; i < 5; i++) { + await _launch(tester, prefs, at: _day0); + expect(_title, findsNothing); + } + }); + + testWidgets('3 launches inside 7 days do not show it', (tester) async { + final prefs = await _prefs(); + await _thirdLaunchAt(tester, prefs, _days(6)); + expect(_title, findsNothing); + }); + + testWidgets('7 days but only 2 launches do not show it', (tester) async { + final prefs = await _prefs(); + await _launch(tester, prefs, at: _day0); + await _launch(tester, prefs, at: _days(8)); + expect(_title, findsNothing); + }); + + testWidgets('the 3rd launch after 7 days shows it, with all choices', ( + tester, + ) async { + final prefs = await _prefs(); + await _thirdLaunchAt(tester, prefs, _days(7)); + expect(_title, findsOneWidget); + expect(find.text('Sponsor'), findsOneWidget); + expect(find.text('Not now'), findsOneWidget); + expect(find.text('Never Show Again'), findsOneWidget); + expect( + find.textContaining('anytime from About in Settings'), + findsOneWidget, + ); + // Saved while the window is still open, so a crash can't loop it. + expect( + prefs.getInt(SponsorPrompt.nextKey), + _days(37).millisecondsSinceEpoch, + ); + }); + }); + + testWidgets('Not now sleeps 30 days', (tester) async { + final prefs = await _prefs(); + await _thirdLaunchAt(tester, prefs, _days(7)); + await _choose(tester, 'Not now'); + + await _launch(tester, prefs, at: _days(36)); + expect(_title, findsNothing); + await _launch(tester, prefs, at: _days(37)); + expect(_title, findsOneWidget); + }); + + testWidgets('closing it without a choice counts as Not now', (tester) async { + final prefs = await _prefs(); + await _thirdLaunchAt(tester, prefs, _days(7)); + await tester.tapAt(const Offset(5, 5)); + await tester.pumpAndSettle(); + expect(_title, findsNothing); + + await _launch(tester, prefs, at: _days(36)); + expect(_title, findsNothing); + await _launch(tester, prefs, at: _days(37)); + expect(_title, findsOneWidget); + }); + + testWidgets('Sponsor opens the page and sleeps 90 days', (tester) async { + final prefs = await _prefs(); + final opened = []; + Future open(Uri uri) async { + opened.add(uri); + return true; + } + + await _launch(tester, prefs, at: _day0, open: open); + await _launch(tester, prefs, at: _day0, open: open); + await _launch(tester, prefs, at: _days(7), open: open); + await _choose(tester, 'Sponsor'); + expect(opened, [Uri.parse('https://offband.org/donate')]); + expect(find.text('Could not open the link'), findsNothing); + + await _launch(tester, prefs, at: _days(96)); + expect(_title, findsNothing); + await _launch(tester, prefs, at: _days(97)); + expect(_title, findsOneWidget); + }); + + testWidgets('upgrades alone do not bring it back', (tester) async { + final prefs = await _prefs(); + await _thirdLaunchAt(tester, prefs, _days(7)); + await _choose(tester, 'Not now'); + for (final version in ['1.8.1+70', '1.8.2+71', '1.9.0+72']) { + await _launch(tester, prefs, at: _days(10), version: version); + expect(_title, findsNothing); + } + }); + + testWidgets('Never Show Again never returns', (tester) async { + final prefs = await _prefs(); + await _thirdLaunchAt(tester, prefs, _days(7)); + await _choose(tester, 'Never Show Again'); + expect(prefs.getBool(SponsorPrompt.offKey), isTrue); + for (final day in [40, 100, 400, 2000]) { + await _launch(tester, prefs, at: _days(day), version: '9.0.0+999'); + expect(_title, findsNothing); + } + }); + + testWidgets('iOS never shows it and records nothing', (tester) async { + final prefs = await _prefs(); + await _launch(tester, prefs, at: _day0, isIOS: true); + await _launch(tester, prefs, at: _day0, isIOS: true); + await _launch(tester, prefs, at: _days(30), isIOS: true); + expect(_title, findsNothing); + expect(prefs.getInt(SponsorPrompt.launchesKey), isNull); + }); + + group('test builds', () { + testWidgets('show it on the first launch, once per commit, no waits', ( + tester, + ) async { + final prefs = await _prefs(); + await _launch(tester, prefs, at: _day0, sha: 'abc1234'); + expect(_title, findsOneWidget); + await _choose(tester, 'Not now'); + + await _launch(tester, prefs, at: _day0, sha: 'abc1234'); + expect(_title, findsNothing); + + await _launch(tester, prefs, at: _day0, sha: 'def5678'); + expect(_title, findsOneWidget); + }); + + testWidgets('a new commit shows it even after Never Show Again', ( + tester, + ) async { + final prefs = await _prefs(); + await _launch(tester, prefs, at: _day0, sha: 'abc1234'); + await _choose(tester, 'Never Show Again'); + await _launch(tester, prefs, at: _day0, sha: 'def5678'); + expect(_title, findsOneWidget); + }); + + test('are known by version and commit, releases by version', () { + expect(SponsorPrompt.buildId('1.8.0+69', sha: ''), '1.8.0+69'); + expect( + SponsorPrompt.buildId('1.8.0+69', sha: 'abc1234'), + '1.8.0+69@abc1234', + ); + }); + }); + + for (final failure in ['returns false', 'throws']) { + testWidgets('a Sponsor link that $failure says so and the message stays', ( + tester, + ) async { + final prefs = await _prefs(); + Future open(Uri uri) async { + if (failure == 'throws') throw Exception('no browser'); + return false; + } + + await _launch(tester, prefs, at: _day0, sha: 'abc1234', open: open); + await _choose(tester, 'Sponsor'); + expect(find.text('Could not open the link'), findsOneWidget); + await tester.pump(const Duration(seconds: 10)); + expect(find.text('Could not open the link'), findsOneWidget); + }); + } + + testWidgets('the first screen counts each launch through the gate', ( + tester, + ) async { + SharedPreferences.setMockInitialValues({}); + PrefsManager.reset(); + await PrefsManager.initialize(); + addTearDown(PrefsManager.reset); + PackageInfo.setMockInitialValues( + appName: 'Offband MeshCore', + packageName: 'app.offband.meshcore', + version: '1.8.0', + buildNumber: '69', + buildSignature: '', + ); + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: const SponsorPromptGate(child: Scaffold(body: Text('scanner'))), + ), + ); + await tester.pumpAndSettle(); + expect(PrefsManager.instance.getInt(SponsorPrompt.launchesKey), 1); + expect( + PrefsManager.instance.getInt(SponsorPrompt.firstLaunchKey), + isNotNull, + ); + // A release build waits; a test build (GIT_SHA defined) shows at once. + expect( + _title, + SponsorPrompt.buildSha.isEmpty ? findsNothing : findsOneWidget, + ); + }); +} diff --git a/untranslated.json b/untranslated.json index 74e91850..0bce3ab7 100644 --- a/untranslated.json +++ b/untranslated.json @@ -87,11 +87,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -117,6 +112,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -178,6 +179,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -481,11 +487,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -511,6 +512,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -572,6 +579,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -875,11 +887,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -905,6 +912,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -966,6 +979,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -1269,11 +1287,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -1299,6 +1312,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -1360,6 +1379,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -1663,11 +1687,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -1693,6 +1712,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -1754,6 +1779,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -2057,11 +2087,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -2087,6 +2112,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -2148,6 +2179,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -2451,11 +2487,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -2481,6 +2512,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -2542,6 +2579,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -2845,11 +2887,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -2875,6 +2912,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -2936,6 +2979,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -3239,11 +3287,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -3269,6 +3312,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -3330,6 +3379,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -3633,11 +3687,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -3663,6 +3712,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -3724,6 +3779,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -4027,11 +4087,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -4057,6 +4112,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -4118,6 +4179,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -4421,11 +4487,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -4451,6 +4512,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -4512,6 +4579,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -4815,11 +4887,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -4845,6 +4912,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -4906,6 +4979,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -5209,11 +5287,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -5239,6 +5312,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -5300,6 +5379,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -5603,11 +5687,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -5633,6 +5712,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -5694,6 +5779,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -5997,11 +6087,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -6027,6 +6112,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -6088,6 +6179,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause", @@ -6391,11 +6487,6 @@ "factoryResetSentTitle", "factoryResetSentBody", "factoryResetSentBleBody", - "factoryResetCompleteTitle", - "factoryResetCompleteBody", - "factoryResetCompleteKeptBody", - "factoryResetNotResetTitle", - "factoryResetNotResetBody", "factoryResetDeleteFailedTitle", "factoryResetDeleteFailedBody", "settings_blePin", @@ -6421,6 +6512,12 @@ "settings_aboutWebsite", "settings_aboutPlayStore", "settings_aboutDonate", + "sponsorPrompt_title", + "sponsorPrompt_body", + "sponsorPrompt_sponsor", + "sponsorPrompt_anytime", + "sponsorPrompt_notNow", + "sponsorPrompt_never", "settings_aboutLinkFailed", "settings_aboutPresetsAttribution", "settings_infoFirmware", @@ -6482,6 +6579,11 @@ "channels_writeRejected", "channels_writeNoReply", "channels_writeClearedNotAdded", + "channels_writeHistoryNotMoved", + "channels_keyChangeHistoryTitle", + "channels_keyChangeHistoryBody", + "channels_keyChangeKeepHistory", + "channels_keyChangeDeleteHistory", "composerBudgetBlockedTitle", "composerBudgetLimitedTitle", "composerBudgetBluetoothCause",