Merge upstream/dev (12 commits) [upstream-sync]

This commit is contained in:
upstream-sync-bot committed 2026-11-08 04:51:28 +00:00
commit 4152695996
64 files changed
+1120 -164

No files matched your search

+4 -4
View File
@@ -56,7 +56,7 @@ jobs:
- name: Install Linux build deps
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config jq libgtk-3-dev librsvg2-dev libgirepository1.0-dev libgtk-3-bin libgdk-pixbuf2.0-bin libgdk-pixbuf-2.0-dev dpkg-dev patchelf file desktop-file-utils xdg-user-dirs shellcheck libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libasound2-dev libsecret-1-dev
sudo apt-get install -y clang cmake ninja-build pkg-config jq libgtk-3-dev librsvg2-dev libgirepository1.0-dev libgtk-3-bin libgdk-pixbuf2.0-bin libgdk-pixbuf-2.0-dev dpkg-dev patchelf file desktop-file-utils xdg-user-dirs shellcheck libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libasound2-dev libsecret-1-dev libgpg-error0
- uses: actions/cache@v4
with:
path: ~/.cache/meshcore-open/appimage
@@ -87,7 +87,7 @@ jobs:
- name: Test AppImage in clean Ubuntu
run: |
mkdir -p build/appimage-runtime
docker run --rm --stop-timeout 15 --user "$(id -u):$(id -g)" --mount "type=bind,source=$PWD/build/linux/x64/release/meshcore-open-x86_64.AppImage,target=/artifact.AppImage,readonly" --mount "type=bind,source=$PWD/scripts/appimage/test_runtime.sh,target=/test_runtime.sh,readonly" --mount "type=bind,source=$PWD/build/appimage-runtime,target=/results" meshcore-appimage-runtime:ci timeout --verbose --signal=TERM --kill-after=15s 300s xvfb-run -a bash /test_runtime.sh /artifact.AppImage /results
docker run --rm --stop-timeout 15 --user "$(id -u):$(id -g)" --mount "type=bind,source=$PWD/build/linux/x64/release/meshcore-open-x86_64.AppImage,target=/artifact.AppImage,readonly" --mount "type=bind,source=$PWD/scripts/appimage/test_runtime.sh,target=/test_runtime.sh,readonly" --mount "type=bind,source=$PWD/scripts/appimage/dependencies.sh,target=/dependencies.sh,readonly" --mount "type=bind,source=$PWD/build/appimage-runtime,target=/results" meshcore-appimage-runtime:ci env MESHCORE_APPIMAGE_DEPENDENCIES=/dependencies.sh timeout --verbose --signal=TERM --kill-after=15s 300s xvfb-run -a bash /test_runtime.sh /artifact.AppImage /results
- uses: actions/upload-artifact@v4
if: always()
with:
@@ -126,7 +126,7 @@ jobs:
- name: Install Linux build deps
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config jq libgtk-3-dev librsvg2-dev libgirepository1.0-dev libgtk-3-bin libgdk-pixbuf2.0-bin libgdk-pixbuf-2.0-dev dpkg-dev patchelf file desktop-file-utils xdg-user-dirs shellcheck libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libasound2-dev libsecret-1-dev
sudo apt-get install -y clang cmake ninja-build pkg-config jq libgtk-3-dev librsvg2-dev libgirepository1.0-dev libgtk-3-bin libgdk-pixbuf2.0-bin libgdk-pixbuf-2.0-dev dpkg-dev patchelf file desktop-file-utils xdg-user-dirs shellcheck libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libasound2-dev libsecret-1-dev libgpg-error0
- uses: actions/cache@v4
with:
path: ~/.cache/meshcore-open/appimage
@@ -163,7 +163,7 @@ jobs:
- name: Test ARM64 AppImage in clean Ubuntu
run: |
mkdir -p build/appimage-runtime
docker run --rm --stop-timeout 15 --platform linux/arm64 --user "$(id -u):$(id -g)" --mount "type=bind,source=$PWD/build/linux/arm64/release/meshcore-open-aarch64.AppImage,target=/artifact.AppImage,readonly" --mount "type=bind,source=$PWD/scripts/appimage/test_runtime.sh,target=/test_runtime.sh,readonly" --mount "type=bind,source=$PWD/build/appimage-runtime,target=/results" meshcore-appimage-runtime-arm64:ci timeout --verbose --signal=TERM --kill-after=15s 300s xvfb-run -a bash /test_runtime.sh /artifact.AppImage /results
docker run --rm --stop-timeout 15 --platform linux/arm64 --user "$(id -u):$(id -g)" --mount "type=bind,source=$PWD/build/linux/arm64/release/meshcore-open-aarch64.AppImage,target=/artifact.AppImage,readonly" --mount "type=bind,source=$PWD/scripts/appimage/test_runtime.sh,target=/test_runtime.sh,readonly" --mount "type=bind,source=$PWD/scripts/appimage/dependencies.sh,target=/dependencies.sh,readonly" --mount "type=bind,source=$PWD/build/appimage-runtime,target=/results" meshcore-appimage-runtime-arm64:ci env MESHCORE_APPIMAGE_DEPENDENCIES=/dependencies.sh timeout --verbose --signal=TERM --kill-after=15s 300s xvfb-run -a bash /test_runtime.sh /artifact.AppImage /results
- uses: actions/upload-artifact@v4
if: always()
with:
+37
View File
@@ -0,0 +1,37 @@
name: Deploy blog to GitHub Pages
on:
push:
branches:
- dev
paths:
- 'blog/**'
- '.github/workflows/pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: blog
- id: deployment
uses: actions/deploy-pages@v4
+11 -7
View File
@@ -241,7 +241,7 @@ dependencies:
```bash
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev \
librsvg2-dev libgirepository1.0-dev libgtk-3-bin libgdk-pixbuf2.0-bin \
libgdk-pixbuf-2.0-dev dpkg-dev patchelf binutils curl jq file desktop-file-utils xdg-user-dirs
libgdk-pixbuf-2.0-dev dpkg-dev patchelf binutils curl jq file desktop-file-utils xdg-user-dirs libgpg-error0
```
The build automatically downloads checksum-verified architecture-matched
@@ -267,12 +267,16 @@ container can write the host-owned output and cache directories. The original
native bundle is retained. Custom targets, obfuscation and split-debug-info
require a bundle-only build when container rebuilding is needed.
The image includes Flutter assets, native plugins, ONNX Runtime and
redistributable GTK dependencies. It does not include graphics drivers, BlueZ
services, USB permissions, downloaded inference models or user data. The GTK
packaging plugin uses X11, so Wayland sessions need XWayland. The host still
needs compatible glibc and graphics libraries (`libgl1`, `libegl1`, and
`libgles2` on Ubuntu). Launch normally, or without
The image includes Flutter assets, native plugins, ONNX Runtime and the
transitive redistributable runtime libraries. Packaging audits every bundled
ELF and fails if a portable dependency resolves from the build host instead of
the AppDir. Host display-stack libraries (X11/XCB/Wayland) and graphics drivers
remain external so they stay ABI-compatible with the system's EGL/GL driver.
The image also relies on host glibc/the ELF loader, BlueZ services and USB
permissions; downloaded inference models and user data are not included. The
GTK packaging plugin uses X11, so Wayland sessions need XWayland. The host needs
compatible graphics libraries (`libgl1`, `libegl1`, and `libgles2` on Ubuntu).
Launch normally, or without
FUSE by extracting:
```bash
+10
View File
@@ -0,0 +1,10 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>meshcore-open blog</title>
<style>:root{--bg:#fff;--fg:#222;--link:#0645ad}@media (prefers-color-scheme:dark){:root{--bg:#161616;--fg:#e4e4e4;--link:#8ab4f8}}
body{background:var(--bg);color:var(--fg);font:17px/1.55 Georgia,serif;margin:0}main{max-width:740px;margin:0 auto;padding:32px 16px}a{color:var(--link)}</style>
</head><body><main>
<h1>meshcore-open blog</h1>
<ul><li><a href="meshos-claims.html">I checked the MeshOS "exposed" post. It doesn't hold up.</a> (November 7, 2026)</li></ul>
<p><a href="https://github.com/zjs81/meshcore-open">meshcore-open on GitHub</a></p>
</main></body></html>
+181
View File
@@ -0,0 +1,181 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Checking the MeshOS "exposed" post</title>
<style>
:root { --bg:#fff; --fg:#222; --dim:#666; --rule:#ddd; --pre:#f5f5f5; --link:#0645ad; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) { --bg:#161616; --fg:#e4e4e4; --dim:#b8b8b8; --rule:#3a3a3a; --pre:#2a2a2a; --link:#8ab4f8; }
}
:root[data-theme="dark"] { --bg:#161616; --fg:#e4e4e4; --dim:#b8b8b8; --rule:#3a3a3a; --pre:#2a2a2a; --link:#8ab4f8; }
body { background:var(--bg); color:var(--fg); margin:0; font:17px/1.55 Georgia, "Times New Roman", serif; }
article { max-width:740px; margin:0 auto; padding:32px 16px 60px; }
h1 { font-size:1.7em; margin:0 0 4px; }
h2 { font-size:1.2em; margin:2em 0 .4em; }
.date { color:var(--dim); margin:0 0 1.5em; }
a { color:var(--link); }
code, pre, .h { font-family: Menlo, Consolas, monospace; font-size:.82em; }
code { background:var(--pre); color:var(--fg); padding:0 3px; border-radius:3px; }
pre { background:var(--pre); padding:10px 12px; overflow-x:auto; line-height:1.4; }
table { border-collapse:collapse; width:100%; font-size:.9em; margin:.6em 0 1em; }
.scroll { overflow-x:auto; }
td, th { border:1px solid var(--rule); padding:5px 8px; text-align:left; vertical-align:top; }
th { font-weight:bold; }
.h { word-break:break-all; }
img.blue { float:right; width:90px; height:90px; margin:4px 0 8px 16px; border:1px solid var(--rule); }
hr { border:0; border-top:1px solid var(--rule); margin:2em 0; }
small { color:var(--dim); }
</style>
</head>
<body>
<article>
<h1>I checked the MeshOS "exposed" post. It doesn't hold up.</h1>
<p class="date">November 7, 2026</p>
<p>A post on meshoskey.com claims the MeshOS Companion Android app has a hidden pipeline that scores your photos, reads your contacts and texts, and quietly uploads it all to the developer. That's a serious accusation, so I spent the day checking it. I'm the developer of meshcore-open (a different, open source MeshCore client) and have no connection to MeshOS. I just wanted to know if it was true.</p>
<p>Short version: it isn't. The post says it analysed v1.0.31. I pulled that exact build apart and none of the things it describes are in there. The strings it quotes don't exist, the addresses it gives point at unrelated code, and the app doesn't even have the Android permissions needed to read contacts or SMS. I also ran it with fake contacts, texts and photos planted on the phone and decrypted all of its traffic. None of the planted data ever left the device.</p>
<p>Details below so anyone can check my work.</p>
<h2>The APKs</h2>
<p>All from the official releases page, <a href="https://github.com/andymux/meshos-releases/releases">github.com/andymux/meshos-releases</a>. The SHA-256s match the digests GitHub publishes for each release:</p>
<div class="scroll"><table>
<tr><th>Version</th><th>SHA-256</th></tr>
<tr><td>1.0.31</td><td class="h">fd4970e1b1446ddb0d2985c3b54837857a970da663b212fdb3d3c1f07ac47103</td></tr>
<tr><td>1.0.32</td><td class="h">a6a3b04dcc741a6a59525f7dc2ab883f57927665edf9c30826db0a1af679a18b</td></tr>
<tr><td>1.0.33</td><td class="h">f42f8834a010499e72dad5f5138b054e7c1a2e6a3155c15edf37ebfd76543183</td></tr>
<tr><td>1.0.34</td><td class="h">426d43cabfaba76a0119715e4160c6369449ee50aa7858b0fb023a3533dcf6ec</td></tr>
<tr><td>1.0.35</td><td class="h">50264287e2ccd4e02cc6615879f4b54eb2392d9b1eb56329f001a65360f8422e</td></tr>
</table></div>
<p>I did the deep analysis on 1.0.31 (the one the post is about) and 1.0.35 (latest). For the others I checked permissions and strings. The Dart code lives in <code>lib/arm64-v8a/libapp.so</code>; for 1.0.31 that file hashes to <code>cdc8abe1…ec83402</code>, so you can make sure you're looking at the same bytes I was.</p>
<h2>Contacts and SMS: not possible</h2>
<p>This one is simple. To read contacts or texts on Android an app has to declare <code>READ_CONTACTS</code> / <code>READ_SMS</code> and the user has to grant them. None of the five versions declare either one, or any permission to browse the photo library. The permission list is identical across all five. Without those permissions Android just refuses, no matter what the code tries to do.</p>
<p>I looked anyway. There's no contacts or SMS code in the Java side, in the Dart side, or in any of the bundled native libraries. When the app says "contacts" it means radio/mesh contacts.</p>
<h2>The strings the post quotes</h2>
<p>The post names a lot of specific identifiers. If the pipeline existed, these would have to be in the binary. I searched 1.0.31 for every one of them (raw file, the Dart constant pool, and the Java bytecode):</p>
<pre>harvest_v1 harvest_seq harvest_blob
mqtt.meshcore.co.uk meshcore/companion/.../harvest/kill img/kill
com.meshcore.companion/harvest /contacts /sms /upload /mqtt
content://com.android.providers.contacts raw_contacts
Pictures/Insta Snapchat/Sent Snapchat/Received Telegram/Image
Selfie ootd lingerie battery_level screen_on_duration
ImageUpload: harvest_seq= USER_PRESENT</pre>
<p>Zero hits for all of them. The post says the strings are XOR'd with 0xB3, so I XOR'd the whole file with 0xB3 and searched again. Still nothing. I also tried every other single-byte key. Nothing.</p>
<p>The only identifier from the post that does exist is <code>com.meshcore.companion/signing</code>, which the post itself says is normal.</p>
<h2>The addresses</h2>
<p>The post gives exact locations (offsets) in the app's code file for each piece of the supposed pipeline, and even for a few text strings and a licence key. Those are easy to check: you jump to that spot in the file and see what's there. In this file the offsets map directly onto the code, so there's no room for an "it's a different kind of address" mix-up.</p>
<p>Two things to know when reading the table. First, a function, a piece of text and a key are different kinds of things and live in different parts of the file. Text and keys sit in a data area. The code area only holds instructions. Second, a real function has a clear starting point, and pointing into the middle of one makes no sense.</p>
<div class="scroll"><table>
<tr><th>Offset</th><th>The post says it's</th><th>What's actually there</th></tr>
<tr><td>0x8A1C40</td><td>the photo tag scanner</td><td>The middle of Dart's own built-in networking code, which ships with every Flutter app. Nothing to do with photos.</td></tr>
<tr><td>0x8A2080</td><td>a lookup table for photo tags</td><td>A single instruction in that same networking function. Not a table.</td></tr>
<tr><td>0x8A20A0</td><td>a table of folder names</td><td>Another instruction in the same function, one that jumps to other code. No folder names anywhere.</td></tr>
<tr><td>0x8B4100</td><td>the text of the contacts database address</td><td>An instruction that compares two numbers. Not text.</td></tr>
<tr><td>0x8B4210</td><td>the code that reads contacts and SMS</td><td>The middle of Flutter's screen-layout code (the part that works out where things go on screen).</td></tr>
<tr><td>0x8C1A00</td><td>the code that packs up the stolen data</td><td>The middle of Flutter's image-effects code (blur and colour filters).</td></tr>
<tr><td>0x8C1A58</td><td>the word "nonce"</td><td>An instruction that unpacks a number. Not text.</td></tr>
<tr><td>0x8C1A60</td><td>the word "harvest_v1"</td><td>An instruction that reads a value from memory. Not text.</td></tr>
<tr><td>0x8C1A80</td><td>the app's licence key</td><td>Instructions that compare numbers. The real licence key is somewhere else entirely, stored with the app's data where it belongs.</td></tr>
<tr><td>0x8D0400</td><td>where the hidden upload starts</td><td>The middle of a big number math routine used by the encryption library. It's an instruction that jumps backwards within that routine.</td></tr>
<tr><td>0x8E2000</td><td>the remote "kill switch" handler</td><td>A function that only compares decimal numbers and has no text in it at all, so it can't be handling server messages or topic names.</td></tr>
</table></div>
<p>So none of the "functions" are where functions start, and the "text" and "key" are actually program instructions. The special number the post says marks a "harvest" upload (0x1DD3) isn't used anywhere in the app either. I can't explain where these locations came from, but they don't describe this app.</p>
<p style="font-size:.85em">If you want to check the raw details: at 0x8A2080 the instruction is <code>ldr x16, [x26,#0x48]</code>, at 0x8C1A58 it's <code>sbfx x6, x0, #1, #0x1f</code>, at 0x8C1A60 it's <code>ldur w7, [x3, #0xb]</code>, the "licence key" bytes at 0x8C1A80 start <code>22 7c 41 93 df 00 02 eb</code>, and at 0x8D0400 it's <code>b #0x8d01e0</code>.</p>
<h2>What the app really does with photos</h2>
<p>Some of what the post describes is real. It just isn't hidden. There is an upload to <code>https://tiles.meshcore.co.uk/img</code>, it is <code>application/octet-stream</code>, it does send <code>X-MeshOS-Enc: gcm</code>, and it is AES-GCM. That's the "Send a photo" button.</p>
<p>When you send a photo the app picks it through the normal Android picker, generates a random key, encrypts the image, uploads the ciphertext and puts a link in the chat like <code>…/i/abc.jpg#k=KEY</code>. Everything after the <code>#</code> never goes to the server. So the server only stores data it can't open, and only people who can read the chat message can view the photo. The upload code is only reached from three places: sending a photo or voice note in a DM, sending one in a channel, and broadcasting your own profile picture. All three are things you do on purpose. The upload format is a 12-byte nonce, the ciphertext, then a 16-byte tag. I suspect that 12 is where the post's "12-field blob" came from. The image code also has an 8-step loop that lowers JPEG quality until the file is small enough, which might be where "eight thumbnails" came from.</p>
<p>The key isn't derived from the licence or a device ID. It's random every time. You'll see why I'm sure about that in the next part.</p>
<h2>Running it with bait</h2>
<p>I set up an Android 15 emulator, forced every connection through mitmproxy with its certificate installed as a system cert (the app doesn't pin certs, so all HTTPS decrypted fine), and kept a packet capture running. Then I planted things the post says the app goes after:</p>
<ul>
<li>three contacts: Alice Baitwell, Bob Decoy, Carol Canary, with example.com emails</li>
<li>four texts, including a fake bank code, a gate code, and one tagged BAITSMS-ALPHA</li>
<li>solid colour images in DCIM/Camera, Pictures/Screenshots and Pictures/Snapchat</li>
</ul>
<p>I used 1.0.35 and 1.0.31 normally. I sent a photo, set a profile picture, chatted, rebooted, locked and unlocked, and left them idle. Every upload I saw lined up with something I did:</p>
<ul>
<li><b>1.0.35:</b> one <code>POST /img</code> (2,909 bytes), when I sent a photo.</li>
<li><b>1.0.31:</b> a signed <code>POST /avatar</code> with <code>"delete":true</code> on first start (clears any old profile pic for the new identity), and another <code>POST /avatar</code> when I set my profile picture.</li>
<li><b>Both:</b> MQTT login, subscriptions, the node advert, a tiny diagnostics message, and my chat messages.</li>
</ul>
<p>Everything else was downloads: map tiles, avatars, a version check. None of the bait names, numbers, codes or filenames showed up anywhere in the traffic.</p>
<p><img class="blue" alt="decrypted upload" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADb/2wCEAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx4BBQUFBwYHDggIDh4UERQeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIAQABAAMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APMq/fT4UKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoA/wD/2Q==">For the one photo upload, I took the key out of the app's own message store (<code>#k=0uiiv2YsDTlgwpR1KRRpSQ</code>) and decrypted the 2,909 bytes I'd captured. Out came a 2,881-byte JPEG: the blue square from the Snapchat folder that I had picked, and nothing else. No extra data, no metadata, no bait text. That's the image on the right.</p>
<p style="clear:both">Unlock triggers don't exist either. Nothing in the app listens for unlock or screen-on events. The only startup hook is a boot receiver that opens the app if you've turned on "start on boot", which is off by default.</p>
<h2>Second opinions</h2>
<p>I didn't want to rely only on my own reading, so I also gave the decompiled code and the post's claims to three AI models: OpenAI's Codex, Z.ai's GLM 5.3 and Claude Mythos 5.1. I didn't tell any of them what I'd found. All three came back with the same answer on the main question: none of the claimed harvesting exists. Codex and Mythos each re-checked every offset against the raw 1.0.31 binary and got the same instructions I did.</p>
<p>I didn't just take their word on the details either. Everything new they raised, I checked myself before it went in here, and anything that didn't hold up was left out.</p>
<h2>Things I'd actually flag to the developer</h2>
<p>The app isn't spyware, but there are real issues worth fixing:</p>
<ul>
<li>MQTT goes to <code>167.99.90.25:1883</code> with no TLS, using one username and password baked into every copy of the app. Adverts and presence are readable on the wire. (Credentials left out here on purpose.) On a fresh install it connected within seconds of first launch, before I'd touched anything.</li>
<li>The <code>X-MeshOS-Key</code> header on uploads is a shared key that anyone can pull out of the APK.</li>
<li>If a user turns on location in adverts, the lat/lon goes out over that unencrypted MQTT connection.</li>
<li>Photos are re-encoded as JPEG (quality 85, then 78, 68, 58 until under about 450 KB), but if decoding fails the original file is uploaded as-is. I couldn't confirm whether location data gets stripped in the normal case, because my test images didn't have any to begin with. Someone should test this with a real phone photo that has GPS data in it.</li>
<li>The <code>meshos/chat/control</code> up/down message isn't signed.</li>
<li>A small diagnostics message (app version, uptime, Android build) is sent as soon as MQTT connects and doesn't seem to be disclosed.</li>
<li>The manifest allows unencrypted HTTP everywhere (<code>usesCleartextTraffic="true"</code>). It's needed for updating repeaters over local Wi-Fi, but it isn't limited to that.</li>
<li>Profile pictures are stored publicly, which is expected but worth knowing.</li>
</ul>
<h2>What I didn't check</h2>
<p>I can't see the server. I only tested the Android app, versions 1.0.31 to 1.0.35, not the T-Deck build or anything older. My disassembly covered about 95% of the Dart code; the rest can't get around Android permissions anyway. Each live session ran for around half an hour, not days.</p>
<h2>Check it yourself</h2>
<ol>
<li>Grab the APKs from the releases page and compare the hashes above.</li>
<li><code>aapt dump permissions MeshOS-v1.0.31.apk</code>. No contacts, SMS or media permissions.</li>
<li><code>unzip MeshOS-v1.0.31.apk lib/arm64-v8a/libapp.so</code>, then <code>grep -c harvest libapp.so</code>. You'll get 0.</li>
<li><code>xxd -s 0x8C1A60 -l 16 libapp.so</code> and the other offsets. Run the bytes through any ARM64 disassembler.</li>
<li>For the code: <a href="https://github.com/worawit/blutter">blutter</a> for the Dart side, <a href="https://github.com/skylot/jadx">jadx</a> for Java.</li>
<li>For traffic: emulator with <code>-http-proxy</code> pointed at mitmproxy and the mitmproxy CA added as a system cert.</li>
</ol>
<hr>
<p>I did this because I think it's the right thing to do. Accusing a developer of secretly building spyware is serious, and people deserve to know whether it's true. I'd want the same if it were my app. Everything above can be checked by anyone, and if I've got something wrong I'd like to hear about it.</p>
<p>- Zach</p>
</article>
</body>
</html>
+43 -90
View File
@@ -9,6 +9,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
import '../utils/advert_signature.dart';
import '../models/channel.dart';
import '../models/channel_message.dart';
import '../models/companion_radio_stats.dart';
@@ -6433,6 +6434,13 @@ class MeshCoreConnector extends ChangeNotifier {
_contactsStorageFull = false; // capacity freed up since the warning
}
_hasLoadedContacts = true;
if (!_preserveContactsOnRefresh && !_contactSyncUsesSinceFilter) {
// A full sync replaced _contacts; drop keys the radio no longer
// holds so removed nodes reappear in discovery.
_knownContactKeys
..clear()
..addAll(_contacts.map((c) => c.publicKeyHex));
}
_preserveContactsOnRefresh = false;
_telemetryFixesDuringSync.clear();
_contactSyncUsesSinceFilter = false;
@@ -9383,13 +9391,15 @@ class MeshCoreConnector extends ChangeNotifier {
final rawPacket = frame.sublist(3);
switch (payloadType) {
case payloadTypeADVERT:
_handlePayloadAdvertReceived(
rawPacket,
payload,
pathBytes,
pathHashWidth,
routeType,
snr,
unawaited(
_verifyThenHandleAdvert(
rawPacket,
payload,
pathBytes,
pathHashWidth,
routeType,
snr,
),
);
break;
default:
@@ -9400,89 +9410,32 @@ class MeshCoreConnector extends ChangeNotifier {
}
}
void importContact(Uint8List frame) {
final packet = BufferReader(frame);
int payloadType = 0;
Uint8List pathBytes = Uint8List(0);
int pathHashWidth = 1;
try {
packet.skipBytes(1); // Skip frame type byte
packet.skipBytes(1); // Skip SNR byte
packet.skipBytes(1); // Skip RSSI byte
final header = packet.readByte();
final routeType = header & 0x03;
payloadType = (header >> 2) & 0x0F;
if (routeType == _routeTransportFlood ||
routeType == _routeTransportDirect) {
packet.skipBytes(4); // Skip transport-specific bytes
}
//final payloadVer = (header >> 6) & 0x03;
final pathLenRaw = packet.readByte();
final pathByteLen = decodePathByteLen(pathLenRaw);
pathHashWidth = decodePathHashWidth(pathLenRaw);
pathBytes = packet.readBytes(pathByteLen);
} catch (e) {
appLogger.warn('Malformed RX frame: $e', tag: 'Connector');
/// Drops adverts whose Ed25519 signature does not verify against the
/// advertised public key, so forged adverts cannot add or update a contact
/// of any type (chat, repeater, room, sensor).
Future<void> _verifyThenHandleAdvert(
Uint8List rawPacket,
Uint8List payload,
Uint8List path,
int pathHashWidth,
int routeType,
double snr,
) async {
if (!await verifyAdvertSignature(payload)) {
appLogger.warn(
'Dropped advert with invalid signature'
'${payload.length >= 4 ? ' from ${pubKeyToHex(payload.sublist(0, 4))}' : ''}',
tag: 'Connector',
);
return;
}
double? latitude;
double? longitude;
String name = '';
Uint8List publicKey = Uint8List(0);
int type = 0;
int timestamp = 0;
bool hasLocation = false;
bool hasName = false;
if (payloadType != payloadTypeADVERT) {
appLogger.warn('Unexpected payload type: $payloadType', tag: 'Connector');
return;
}
try {
publicKey = packet.readBytes(32);
timestamp = packet.readInt32LE();
//TODO add signature verification
packet.skipBytes(64); // Skip signature for now
final flags = packet.readByte();
type = flags & 0x0F;
hasLocation = (flags & 0x10) != 0;
hasName = (flags & 0x80) != 0;
if (hasLocation && packet.remaining >= 8) {
latitude = packet.readInt32LE() / 1e6;
longitude = packet.readInt32LE() / 1e6;
}
// Two optional 16-bit feature fields sit between the location and the
// name (AdvertDataParser in MeshCore AdvertDataHelpers.cpp). Skip them
// so their bytes aren't read as the start of the name.
for (final featureMask in const [0x20, 0x40]) {
if ((flags & featureMask) != 0 && packet.remaining >= 2) {
packet.skipBytes(2);
}
}
if (hasName && packet.remaining > 0) {
name = packet.readCString();
}
} catch (e) {
appLogger.warn('Malformed advert frame: $e', tag: 'Connector');
return;
}
importDiscoveredContact(
Contact(
rawPacket: frame,
publicKey: publicKey,
name: name,
type: type,
pathLength: pathBytes.isEmpty
? -1
: (pathBytes.length ~/ pathHashWidth),
// Store hop order reversed for easier outgoing messages; keep bytes
// inside each multi-byte hop in their original order.
path: _reversePathByHop(pathBytes, pathHashWidth),
pathHashWidth: pathHashWidth,
latitude: latitude,
longitude: longitude,
lastSeen: DateTime.fromMillisecondsSinceEpoch(timestamp * 1000),
),
_handlePayloadAdvertReceived(
rawPacket,
payload,
path,
pathHashWidth,
routeType,
snr,
);
}
@@ -9522,8 +9475,8 @@ class MeshCoreConnector extends ChangeNotifier {
.join();
timestamp = advert.readInt32LE();
//TODO add signature verification
advert.skipBytes(64); // Skip signature for now
// Signature already checked by _verifyThenHandleAdvert.
advert.skipBytes(signatureSize);
final flags = advert.readByte();
type = flags & 0x0F;
hasLocation = (flags & 0x10) != 0;
+1
View File
@@ -1017,6 +1017,7 @@
"repeater_received": "Получено",
"repeater_duplicates": "Дубликати",
"repeater_daysHoursMinsSecs": "{days} дни {hours}ч {minutes}м {seconds}с",
"repeater_hoursMinsSecs": "{hours}ч {minutes}м {seconds}с",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1039,6 +1039,7 @@
"repeater_received": "Empfangen",
"repeater_duplicates": "Duplikate",
"repeater_daysHoursMinsSecs": "{days} Tage {hours}h {minutes}m {seconds}s",
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+14
View File
@@ -1716,6 +1716,20 @@
}
}
},
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_hoursMinsSecs": {
"placeholders": {
"hours": {
"type": "int"
},
"minutes": {
"type": "int"
},
"seconds": {
"type": "int"
}
}
},
"repeater_packetTxTotal": "Total: {total}, Flood: {flood}, Direct: {direct}",
"@repeater_packetTxTotal": {
"placeholders": {
+1
View File
@@ -1031,6 +1031,7 @@
"repeater_received": "Recibidos",
"repeater_duplicates": "Duplicados",
"repeater_daysHoursMinsSecs": "{days} días {hours}h {minutes} min {seconds} s",
"repeater_hoursMinsSecs": "{hours}h {minutes} min {seconds} s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1031,6 +1031,7 @@
"repeater_received": "Reçu",
"repeater_duplicates": "Doublons",
"repeater_daysHoursMinsSecs": "{days} jours {hours}h {minutes}m {seconds}s",
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1245,6 +1245,7 @@
"repeater_received": "Fogadva",
"repeater_duplicates": "Ismétlődések",
"repeater_daysHoursMinsSecs": "{days} nap {hours}ó {minutes}p {seconds}s",
"repeater_hoursMinsSecs": "{hours}ó {minutes}p {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1076,6 +1076,7 @@
"repeater_received": "Ricevuto",
"repeater_duplicates": "Duplicati",
"repeater_daysHoursMinsSecs": "{days} giorni {hours}h {minutes}m {seconds}s",
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+2 -1
View File
@@ -1213,6 +1213,7 @@
"repeater_received": "受信済み",
"repeater_duplicates": "重複",
"repeater_daysHoursMinsSecs": "{days}日 {hours}時間 {minutes}分 {seconds}秒",
"repeater_hoursMinsSecs": "{hours}時間 {minutes}分 {seconds}秒",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
@@ -1257,7 +1258,7 @@
}
}
},
"repeater_duplicatesFloodDirect": "{flood}: {flood}, 直接: {direct}",
"repeater_duplicatesFloodDirect": "フラッド: {flood}, 直接: {direct}",
"@repeater_duplicatesFloodDirect": {
"placeholders": {
"flood": {
+1
View File
@@ -1195,6 +1195,7 @@
"repeater_received": "수신",
"repeater_duplicates": "중복",
"repeater_daysHoursMinsSecs": "{days}일 {hours}시간 {minutes}분 {seconds}초",
"repeater_hoursMinsSecs": "{hours}시간 {minutes}분 {seconds}초",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+6
View File
@@ -5654,6 +5654,12 @@ abstract class AppLocalizations {
int seconds,
);
/// No description provided for @repeater_hoursMinsSecs.
///
/// In en, this message translates to:
/// **'{hours}h {minutes}m {seconds}s'**
String repeater_hoursMinsSecs(int hours, int minutes, int seconds);
/// No description provided for @repeater_packetTxTotal.
///
/// In en, this message translates to:
+5
View File
@@ -3206,6 +3206,11 @@ class AppLocalizationsBg extends AppLocalizations {
return '$days дни $hoursч $minutesм $secondsс';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hoursч $minutesм $secondsс';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Общо: $total, Flood: $flood, Директно: $direct';
+5
View File
@@ -3205,6 +3205,11 @@ class AppLocalizationsDe extends AppLocalizations {
return '$days Tage ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Gesamt: $total, Flood: $flood, Direkt: $direct';
+5
View File
@@ -3154,6 +3154,11 @@ class AppLocalizationsEn extends AppLocalizations {
return '$days days ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Total: $total, Flood: $flood, Direct: $direct';
+5
View File
@@ -3193,6 +3193,11 @@ class AppLocalizationsEs extends AppLocalizations {
return '$days días ${hours}h $minutes min $seconds s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h $minutes min $seconds s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Total: $total, Inundación: $flood, Directo: $direct';
+5
View File
@@ -3204,6 +3204,11 @@ class AppLocalizationsFr extends AppLocalizations {
return '$days jours ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Total : $total, Tout le réseau : $flood, Direct : $direct';
+5
View File
@@ -3195,6 +3195,11 @@ class AppLocalizationsHu extends AppLocalizations {
return '$days nap $hoursó ${minutes}p ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hoursó ${minutes}p ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Összesen: $total, Elárasztás: $flood, Közvetlen: $direct';
+5
View File
@@ -3201,6 +3201,11 @@ class AppLocalizationsIt extends AppLocalizations {
return '$days giorni ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Totale: $total, Flood: $flood, Diretto: $direct';
+6 -1
View File
@@ -3066,6 +3066,11 @@ class AppLocalizationsJa extends AppLocalizations {
return '$days日 $hours時間 $minutes分 $seconds秒';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hours時間 $minutes分 $seconds秒';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return '合計: $total, フラッド: $flood, 直接: $direct';
@@ -3078,7 +3083,7 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String repeater_duplicatesFloodDirect(String flood, String direct) {
return '$flood: $flood, 直接: $direct';
return 'フラッド: $flood, 直接: $direct';
}
@override
+5
View File
@@ -3070,6 +3070,11 @@ class AppLocalizationsKo extends AppLocalizations {
return '$days일 $hours시간 $minutes분 $seconds초';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hours시간 $minutes분 $seconds초';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return '총: $total, 플러딩: $flood, 직접: $direct';
+5
View File
@@ -3182,6 +3182,11 @@ class AppLocalizationsNl extends AppLocalizations {
return '$days dagen $hours uur $minutes minuten $seconds seconden';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hours uur $minutes minuten $seconds seconden';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Totaal: $total, Flood: $flood, Direct: $direct';
+5
View File
@@ -3219,6 +3219,11 @@ class AppLocalizationsPl extends AppLocalizations {
return '$days dni ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Razem: $total, Flood: $flood, Bezpośrednio: $direct';
+5
View File
@@ -3194,6 +3194,11 @@ class AppLocalizationsPt extends AppLocalizations {
return '$days dias ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Total: $total, Inundação: $flood, Direto: $direct';
+5
View File
@@ -3200,6 +3200,11 @@ class AppLocalizationsRu extends AppLocalizations {
return '$days дн. $hoursч $minutesм $secondsс';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hoursч $minutesм $secondsс';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Всего: $total, Рассылка: $flood, Прямые: $direct';
+5
View File
@@ -3191,6 +3191,11 @@ class AppLocalizationsSk extends AppLocalizations {
return '$days dní ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Celkom: $total, Flood: $flood, Priame: $direct';
+5
View File
@@ -3184,6 +3184,11 @@ class AppLocalizationsSl extends AppLocalizations {
return '$days dni ${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '${hours}h ${minutes}m ${seconds}s';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Skupno: $total, Flood: $flood, Neposredno: $direct';
+5
View File
@@ -3170,6 +3170,11 @@ class AppLocalizationsSv extends AppLocalizations {
return '$days dagar $hours timmar $minutes minuter $seconds sekunder';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hours timmar $minutes minuter $seconds sekunder';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Totalt: $total, Flood: $flood, Direkt: $direct';
+5
View File
@@ -3193,6 +3193,11 @@ class AppLocalizationsUk extends AppLocalizations {
return '$days дн. $hours год $minutes хв $seconds с';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hours год $minutes хв $seconds с';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return 'Всього: $total, Через всю мережу: $flood, Прямі: $direct';
+5
View File
@@ -3025,6 +3025,11 @@ class AppLocalizationsZh extends AppLocalizations {
return '$days天 $hours小时 $minutes分 $seconds秒';
}
@override
String repeater_hoursMinsSecs(int hours, int minutes, int seconds) {
return '$hours小时 $minutes分 $seconds秒';
}
@override
String repeater_packetTxTotal(int total, String flood, String direct) {
return '总计:$total,泛洪:$flood,直连:$direct';
+1
View File
@@ -1044,6 +1044,7 @@
"repeater_received": "Ontvangen",
"repeater_duplicates": "Duplicaten",
"repeater_daysHoursMinsSecs": "{days} dagen {hours} uur {minutes} minuten {seconds} seconden",
"repeater_hoursMinsSecs": "{hours} uur {minutes} minuten {seconds} seconden",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1027,6 +1027,7 @@
"repeater_received": "Otrzymano",
"repeater_duplicates": "Powtórzenia",
"repeater_daysHoursMinsSecs": "{days} dni {hours}h {minutes}m {seconds}s",
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1009,6 +1009,7 @@
"repeater_received": "Recebido",
"repeater_duplicates": "Duplicatas",
"repeater_daysHoursMinsSecs": "{days} dias {hours}h {minutes}m {seconds}s",
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -627,6 +627,7 @@
"repeater_received": "Получено",
"repeater_duplicates": "Дубликаты",
"repeater_daysHoursMinsSecs": "{days} дн. {hours}ч {minutes}м {seconds}с",
"repeater_hoursMinsSecs": "{hours}ч {minutes}м {seconds}с",
"repeater_packetTxTotal": "Всего: {total}, Рассылка: {flood}, Прямые: {direct}",
"repeater_packetRxTotal": "Всего: {total}, Рассылка: {flood}, Прямые: {direct}",
"repeater_duplicatesFloodDirect": "Рассылка: {flood}, Прямые: {direct}",
+1
View File
@@ -1017,6 +1017,7 @@
"repeater_received": "Prijaté",
"repeater_duplicates": "Duplikáty",
"repeater_daysHoursMinsSecs": "{days} dní {hours}h {minutes}m {seconds}s",
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1009,6 +1009,7 @@
"repeater_received": "Prejeto",
"repeater_duplicates": "Duplikati",
"repeater_daysHoursMinsSecs": "{days} dni {hours}h {minutes}m {seconds}s",
"repeater_hoursMinsSecs": "{hours}h {minutes}m {seconds}s",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1010,6 +1010,7 @@
"repeater_received": "Mottaget",
"repeater_duplicates": "Dubbletter",
"repeater_daysHoursMinsSecs": "{days} dagar {hours} timmar {minutes} minuter {seconds} sekunder",
"repeater_hoursMinsSecs": "{hours} timmar {minutes} minuter {seconds} sekunder",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1027,6 +1027,7 @@
"repeater_received": "Отримано",
"repeater_duplicates": "Дублікати",
"repeater_daysHoursMinsSecs": "{days} дн. {hours} год {minutes} хв {seconds} с",
"repeater_hoursMinsSecs": "{hours} год {minutes} хв {seconds} с",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -1039,6 +1039,7 @@
"repeater_received": "接收",
"repeater_duplicates": "重复",
"repeater_daysHoursMinsSecs": "{days}天 {hours}小时 {minutes}分 {seconds}秒",
"repeater_hoursMinsSecs": "{hours}小时 {minutes}分 {seconds}秒",
"@repeater_daysHoursMinsSecs": {
"placeholders": {
"days": {
+1
View File
@@ -697,6 +697,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
}
void _handleQuickSwitch(int index, BuildContext context) {
FocusManager.instance.primaryFocus?.unfocus();
if (index == 1) return;
switch (index) {
case 0:
+10 -2
View File
@@ -796,7 +796,7 @@ class _ContactsScreenState extends State<ContactsScreen>
),
],
child: SizedBox(
height: 48,
height: _controlHeight(context),
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).colorScheme.outline),
@@ -822,6 +822,13 @@ class _ContactsScreenState extends State<ContactsScreen>
);
}
/// Height of the group/search controls; grows with the system font size so
/// larger text is not clipped.
double _controlHeight(BuildContext context) {
final textHeight = MediaQuery.textScalerOf(context).scale(16) * 1.5;
return (textHeight + 20).clamp(48.0, 120.0);
}
Widget _buildContactsBody(BuildContext context, MeshCoreConnector connector) {
final viewState = context.watch<UiViewStateService>();
final contacts = connector.contacts;
@@ -959,7 +966,7 @@ class _ContactsScreenState extends State<ContactsScreen>
width: viewState.contactsSearchExpanded
? searchExpandedWidth
: searchCollapsedWidth,
height: 48,
height: _controlHeight(context),
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(
@@ -1267,6 +1274,7 @@ class _ContactsScreenState extends State<ContactsScreen>
}
void _handleQuickSwitch(int index, BuildContext context) {
FocusManager.instance.primaryFocus?.unfocus();
if (index == 0) return;
switch (index) {
case 1:
@@ -1728,6 +1728,7 @@ class _LineOfSightMapScreenState extends State<LineOfSightMapScreen> {
}
void _handleQuickSwitch(int index, BuildContext context) {
FocusManager.instance.primaryFocus?.unfocus();
if (index == 2) {
Navigator.pop(context);
return;
+1
View File
@@ -3183,6 +3183,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
}
void _handleQuickSwitch(int index, BuildContext context) {
FocusManager.instance.primaryFocus?.unfocus();
if (index == 2) return;
switch (index) {
case 0:
@@ -178,6 +178,8 @@ class _RulesList extends StatelessWidget {
SnackBar(
content: Text(l10n.messageFilter_ruleDeleted),
duration: const Duration(seconds: 6),
// Newer Flutter persists snackbars with an action unless told not to.
persist: false,
action: SnackBarAction(
label: l10n.common_undo,
onPressed: () =>
+16 -4
View File
@@ -375,15 +375,24 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
final hours = (seconds % 86400) ~/ 3600;
final minutes = (seconds % 3600) ~/ 60;
final secs = seconds % 60;
if (days == 0) return l10n.repeater_hoursMinsSecs(hours, minutes, secs);
return l10n.repeater_daysHoursMinsSecs(days, hours, minutes, secs);
}
/// Puts each "Label: n" part of a multi-part stat on its own line. Matches
/// the comma separators used across locales (ASCII, fullwidth, ideographic,
/// Arabic); the values themselves are unformatted integers.
static final _partSeparator = RegExp(r'\s*[,\uFF0C\u3001\u060C]\s*');
String _multiLine(String text) => text.split(_partSeparator).join('\n');
String _packetTxText() {
if (_packetsSent == null) return '—';
final l10n = context.l10n;
final flood = _formatValue(_floodTx);
final direct = _formatValue(_directTx);
return l10n.repeater_packetTxTotal(_packetsSent!, flood, direct);
return _multiLine(
l10n.repeater_packetTxTotal(_packetsSent!, flood, direct),
);
}
String _packetRxText() {
@@ -391,7 +400,9 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
final l10n = context.l10n;
final flood = _formatValue(_floodRx);
final direct = _formatValue(_directRx);
return l10n.repeater_packetRxTotal(_packetsRecv!, flood, direct);
return _multiLine(
l10n.repeater_packetRxTotal(_packetsRecv!, flood, direct),
);
}
String _chanUtilText() {
@@ -404,7 +415,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
if (_dupFlood != null || _dupDirect != null) {
final flood = _formatValue(_dupFlood);
final direct = _formatValue(_dupDirect);
return l10n.repeater_duplicatesFloodDirect(flood, direct);
return _multiLine(l10n.repeater_duplicatesFloodDirect(flood, direct));
}
if (_packetsRecv == null || _floodRx == null || _directRx == null) {
return '—';
@@ -703,7 +714,8 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
final textScaler = MediaQuery.textScalerOf(context);
return LayoutBuilder(
builder: (context, constraints) {
final columns = constraints.maxWidth / textScaler.scale(1) < 320
// One full-width tile per row on phones; two columns on wide screens.
final columns = constraints.maxWidth / textScaler.scale(1) < 520
? 1
: 2;
// Rows size to their tallest tile, so labels that wrap at large
+4 -2
View File
@@ -569,7 +569,7 @@ class MeshTheme {
return TextStyle(
fontFamily: MeshFonts.sans,
fontFamilyFallback: MeshFonts.sansFallback,
fontSize: 11.5,
fontSize: 12,
fontWeight: selected ? FontWeight.w700 : FontWeight.w500,
letterSpacing: 0.1,
color: selected ? scheme.onPrimary : scheme.onSurfaceVariant,
@@ -602,7 +602,9 @@ class MeshTheme {
),
snackBarTheme: SnackBarThemeData(
backgroundColor: scheme.surfaceContainerHigh,
contentTextStyle: TextStyle(color: scheme.onSurface),
contentTextStyle: TextStyle(color: scheme.onSurface, fontSize: 16),
actionTextColor: scheme.onSurface,
disabledActionTextColor: scheme.onSurfaceVariant,
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(MeshRadii.md),
+73
View File
@@ -0,0 +1,73 @@
import 'dart:typed_data';
import 'package:cryptography/cryptography.dart';
/// Advert payload layout (MeshCore `Mesh::createAdvert`):
/// `[pub_key 32][timestamp u32 LE][signature 64][app_data …]`.
const int _pubKeyLen = 32;
const int _timestampLen = 4;
const int _signatureLen = 64;
const int advertSignedHeaderLen = _pubKeyLen + _timestampLen + _signatureLen;
final Ed25519 _ed25519 = Ed25519();
/// Verified results keyed by signature, so the same advert heard over
/// several paths is only checked once.
final Map<String, bool> _verifiedCache = <String, bool>{};
const int _verifiedCacheMax = 256;
/// Returns true when [payload] is an advert whose Ed25519 signature over
/// `pub_key || timestamp || app_data` verifies against its own public key.
/// Applies to every advert type (chat, repeater, room, sensor).
Future<bool> verifyAdvertSignature(Uint8List payload) async {
if (payload.length < advertSignedHeaderLen) return false;
final publicKey = Uint8List.sublistView(payload, 0, _pubKeyLen);
final timestamp = Uint8List.sublistView(
payload,
_pubKeyLen,
_pubKeyLen + _timestampLen,
);
final signature = Uint8List.sublistView(
payload,
_pubKeyLen + _timestampLen,
advertSignedHeaderLen,
);
final appData = Uint8List.sublistView(payload, advertSignedHeaderLen);
final cacheKey =
String.fromCharCodes(publicKey) + String.fromCharCodes(signature);
final cached = _verifiedCache[cacheKey];
if (cached != null) return cached;
final message = Uint8List(_pubKeyLen + _timestampLen + appData.length)
..setRange(0, _pubKeyLen, publicKey)
..setRange(_pubKeyLen, _pubKeyLen + _timestampLen, timestamp)
..setRange(
_pubKeyLen + _timestampLen,
_pubKeyLen + _timestampLen + appData.length,
appData,
);
bool valid;
try {
valid = await _ed25519.verify(
message,
signature: Signature(
Uint8List.fromList(signature),
publicKey: SimplePublicKey(
Uint8List.fromList(publicKey),
type: KeyPairType.ed25519,
),
),
);
} catch (_) {
valid = false;
}
if (_verifiedCache.length >= _verifiedCacheMax) {
_verifiedCache.remove(_verifiedCache.keys.first);
}
_verifiedCache[cacheKey] = valid;
return valid;
}
+3 -6
View File
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
/// App bar title that honors the system font size. Long titles are
/// ellipsized instead of being shrunk to fit.
class AdaptiveAppBarTitle extends StatelessWidget {
final String text;
@@ -7,11 +9,6 @@ class AdaptiveAppBarTitle extends StatelessWidget {
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) => SizedBox(
width: constraints.maxWidth,
child: FittedBox(fit: BoxFit.scaleDown, child: Text(text, maxLines: 1)),
),
);
return Text(text, maxLines: 1, overflow: TextOverflow.ellipsis);
}
}
+13
View File
@@ -100,6 +100,11 @@ class _FilterRuleDialogState extends State<_FilterRuleDialog> {
content: SizedBox(
width: 420,
child: SingleChildScrollView(
// The outlined field's floating label is painted above the field's
// box, outside the scroll content bounds. Without top padding the
// viewport clips it (worst when the focused field is scrolled flush
// to the top while the keyboard is open).
padding: const EdgeInsets.only(top: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -107,6 +112,14 @@ class _FilterRuleDialogState extends State<_FilterRuleDialog> {
TextField(
controller: _controller,
autofocus: true,
// Keep room above the field when it is scrolled into view, so
// the floating label (drawn above the box) is not clipped.
scrollPadding: EdgeInsets.fromLTRB(
20,
16 + MediaQuery.textScalerOf(context).scale(16),
20,
20,
),
minLines: 1,
maxLines: 4,
textInputAction: TextInputAction.done,
+19 -23
View File
@@ -261,7 +261,7 @@ class StatTile extends StatelessWidget {
label.toUpperCase(),
style: MeshTheme.accentLabel(
color: scheme.onSurfaceVariant,
fontSize: 12,
fontSize: 14,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
@@ -270,30 +270,26 @@ class StatTile extends StatelessWidget {
],
),
const SizedBox(height: 6),
FittedBox(
fit: BoxFit.scaleDown,
alignment: AlignmentDirectional.centerStart,
child: Text.rich(
TextSpan(
text: value,
style: MeshTheme.mono(
fontSize: 17,
fontWeight: FontWeight.w600,
color: scheme.onSurface,
),
children: [
if (unit != null)
TextSpan(
text: ' $unit',
style: MeshTheme.mono(
fontSize: 12,
color: scheme.onSurfaceVariant,
),
),
],
Text.rich(
TextSpan(
text: value,
style: MeshTheme.mono(
fontSize: 20,
fontWeight: FontWeight.w600,
color: scheme.onSurface,
),
maxLines: 1,
children: [
if (unit != null)
TextSpan(
text: ' $unit',
style: MeshTheme.mono(
fontSize: 12,
color: scheme.onSurfaceVariant,
),
),
],
),
softWrap: true,
),
],
),
+2
View File
@@ -2,6 +2,8 @@
set -eo pipefail
export APPDIR="${APPDIR:-$(cd "$(dirname "$0")" && pwd)}"
unset GIO_EXTRA_MODULES GIO_MODULE_DIR GI_TYPELIB_PATH GTK_PATH GTK_MODULES GDK_PIXBUF_MODULE_FILE
export GSETTINGS_SCHEMA_DIR="$APPDIR/usr/share/glib-2.0/schemas"
export PATH="$APPDIR/usr/bin:$PATH"
for hook in "$APPDIR"/apprun-hooks/*.sh; do
# shellcheck source=/dev/null
+2 -2
View File
@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
librsvg2-dev libgirepository1.0-dev libgdk-pixbuf-2.0-dev libgtk-3-bin \
libgdk-pixbuf2.0-bin binutils patchelf curl jq \
file desktop-file-utils xdg-user-dirs git rsync unzip xz-utils make g++ dpkg-dev \
libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libglu1-mesa-dev \
libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libglu1-mesa-dev libgpg-error0 \
libasound2-dev libsecret-1-dev \
&& rm -rf /var/lib/apt/lists/*
@@ -23,5 +23,5 @@ FROM ${BASE_IMAGE} AS runtime-test
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
xvfb xauth x11-utils x11-apps xdotool imagemagick dbus-x11 binutils libgl1 libegl1 libgles2 \
libgl1-mesa-dri fonts-dejavu-core \
libgl1-mesa-dri libgpg-error0 fonts-dejavu-core \
&& rm -rf /var/lib/apt/lists/*
+181
View File
@@ -0,0 +1,181 @@
#!/usr/bin/env bash
set -euo pipefail
fail() {
printf 'AppImage dependencies: %s\n' "$*" >&2
return 1
}
is_host_interface() {
case "$1" in
linux-vdso.so.*|ld-linux*.so.*|ld64.so.*|libc.so.*|libm.so.*|libpthread.so.*|\
libdl.so.*|librt.so.*|libresolv.so.*|libutil.so.*|libanl.so.*|\
libBrokenLocale.so.*|libnss_*.so.*|libGL.so.*|libGLX.so.*|libEGL.so.*|\
libGLES*.so.*|libOpenGL.so.*|libglapi.so.*|libvulkan.so.*|libdrm*.so.*|libgbm.so.*|\
libX*.so.*|libxcb*.so.*|libwayland*.so.*|libxkbcommon.so.*)
return 0
;;
*) return 1 ;;
esac
}
is_inside_appdir() {
[[ "$1" == "$2/"* ]]
}
copy_dependency() {
local appdir="$1" soname="$2" source="$3" source_real real_name library_dir target existing_real
source_real="$(realpath -e -- "$source")" || {
fail "Cannot resolve dependency $soname from $source"
return 1
}
[[ -f "$source_real" ]] || { fail "Dependency is not a regular file: $source_real"; return 1; }
real_name="${source_real##*/}"
library_dir="$appdir/usr/lib"
target="$library_dir/$real_name"
mkdir -p "$library_dir"
if [[ -e "$target" || -L "$target" ]]; then
existing_real="$(realpath -e -- "$target")" || {
fail "Broken bundled library path: $target"
return 1
}
if [[ "$existing_real" != "$source_real" ]] && ! cmp -s -- "$existing_real" "$source_real"; then
fail "Conflicting libraries map to $target"
return 1
fi
else
cp -p -- "$source_real" "$target"
fi
if [[ "$soname" != "$real_name" ]]; then
if [[ -e "$library_dir/$soname" || -L "$library_dir/$soname" ]]; then
existing_real="$(realpath -e -- "$library_dir/$soname")" || {
fail "Broken bundled SONAME link: $library_dir/$soname"
return 1
}
if [[ "$existing_real" != "$source_real" ]] && ! cmp -s -- "$existing_real" "$source_real"; then
fail "Conflicting libraries provide SONAME $soname"
return 1
fi
else
ln -s "$real_name" "$library_dir/$soname"
fi
fi
}
scan_appdir() {
local appdir="$1" report="$2" mode="$3" changed_name="$4"
local appdir_real search_path elf output status line soname resolution resolved resolved_real
local failed=0 copied_any=0
local -a elf_files=()
appdir_real="$(realpath -e -- "$appdir")"
search_path="$appdir/usr/lib:$appdir/usr/bin/lib"
: > "$report"
mapfile -d '' -t elf_files < <(find "$appdir/usr/bin" "$appdir/usr/lib" \
\( -type f -o -type l \) -print0 2>/dev/null || true)
for elf in "${elf_files[@]}"; do
readelf -h "$elf" >/dev/null 2>&1 || continue
printf '%s\n' "${elf#"$appdir/"}" >> "$report"
if output="$(LD_LIBRARY_PATH="$search_path" ldd "$elf" 2>&1)"; then
status=0
else
status=$?
fi
while IFS= read -r line; do
soname=''
resolution=''
if [[ "$line" =~ ^[[:space:]]*([^[:space:]]+)[[:space:]]*=\>[[:space:]]*(.*)$ ]]; then
soname="${BASH_REMATCH[1]}"
resolution="${BASH_REMATCH[2]}"
elif [[ "$line" =~ ^[[:space:]]*(/[^[:space:]]+) ]]; then
resolution="${BASH_REMATCH[1]}"
soname="${resolution##*/}"
else
continue
fi
soname="${soname##*/}"
if [[ "$resolution" == 'not found'* ]]; then
if is_host_interface "$soname"; then
printf ' %s => NOT PRESENT ON AUDIT HOST [host interface]\n' "$soname" >> "$report"
else
printf ' %s => NOT FOUND\n' "$soname" >> "$report"
printf 'AppImage dependencies: %s needs missing %s\n' "$elf" "$soname" >&2
failed=1
fi
continue
fi
resolved="$resolution"
if [[ "$resolved" =~ ^(.*)[[:space:]]+\(0x[[:xdigit:]]+\)$ ]]; then
resolved="${BASH_REMATCH[1]}"
fi
[[ "$resolved" == /* ]] || continue
if ! resolved_real="$(realpath -e -- "$resolved" 2>/dev/null)"; then
if is_host_interface "$soname"; then
printf ' %s => NOT PRESENT ON AUDIT HOST (%s) [host interface]\n' \
"$soname" "$resolved" >> "$report"
else
printf ' %s => UNRESOLVED (%s)\n' "$soname" "$resolved" >> "$report"
printf 'AppImage dependencies: %s resolves %s to missing path %s\n' \
"$elf" "$soname" "$resolved" >&2
failed=1
fi
continue
fi
if is_inside_appdir "$resolved_real" "$appdir_real"; then
printf ' %s => %s [bundled]\n' "$soname" "$resolved_real" >> "$report"
elif is_host_interface "$soname"; then
printf ' %s => %s [host interface]\n' "$soname" "$resolved_real" >> "$report"
elif [[ "$mode" == bundle ]]; then
printf ' %s => %s [bundling]\n' "$soname" "$resolved_real" >> "$report"
copy_dependency "$appdir" "$soname" "$resolved_real"
copied_any=1
else
printf ' %s => %s [unexpected host dependency]\n' "$soname" "$resolved_real" >> "$report"
printf 'AppImage dependencies: %s resolves non-allowlisted %s from %s\n' \
"$elf" "$soname" "$resolved_real" >&2
failed=1
fi
done <<< "$output"
if ((status != 0)) || [[ "$output" =~ version[[:space:]].*not[[:space:]]found ]]; then
printf 'AppImage dependencies: ldd dependency check failed for %s (exit %s): %s\n' \
"$elf" "$status" "$output" >&2
failed=1
fi
done
printf -v "$changed_name" '%s' "$copied_any"
((failed == 0))
}
bundle_appdir_dependencies() {
local appdir="$1" report="$2" pass changed
for ((pass = 1; pass <= 32; pass++)); do
scan_appdir "$appdir" "$report" bundle changed || return 1
((changed == 1)) || break
done
((pass <= 32)) || { fail 'Dependency closure did not converge after 32 passes'; return 1; }
audit_appdir_dependencies "$appdir" "$report"
}
audit_appdir_dependencies() {
local appdir="$1" report="$2" changed=0
scan_appdir "$appdir" "$report" audit changed
}
main() {
[[ $# == 3 ]] || { fail 'Usage: dependencies.sh bundle|audit APPDIR REPORT'; return 1; }
local mode="$1" appdir="$2" report="$3"
[[ -d "$appdir/usr/bin" && -d "$appdir/usr/lib" ]] || {
fail "Invalid AppDir: $appdir"
return 1
}
command -v readelf >/dev/null || { fail 'Missing readelf'; return 1; }
command -v ldd >/dev/null || { fail 'Missing ldd'; return 1; }
case "$mode" in
bundle) bundle_appdir_dependencies "$appdir" "$report" ;;
audit) audit_appdir_dependencies "$appdir" "$report" ;;
*) fail "Unknown mode: $mode"; return 1 ;;
esac
}
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
main "$@"
fi
+88
View File
@@ -147,4 +147,92 @@ mock_glibc=2.39
requires_container_rebuild "$temporary/bundle/meshcore_open" 2.39
unset -f readelf getconf
mkdir -p "$temporary/audit-appdir/usr/bin" "$temporary/audit-appdir/usr/lib" \
"$temporary/host" "$temporary/fakebin"
cp "$(type -P true)" "$temporary/audit-appdir/usr/bin/fixture"
printf 'test library\n' > "$temporary/host/libgpg-error.so.0.37.0"
ln -s libgpg-error.so.0.37.0 "$temporary/host/libgpg-error.so.0"
printf 'host display library\n' > "$temporary/host/libwayland-client.so.0"
cat > "$temporary/fakebin/ldd" <<'EOF'
#!/usr/bin/env bash
if [[ "${MESHCORE_TEST_LDD_VERSION_FAILURE:-0}" == 1 ]]; then
printf "%s: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.39' not found (required by %s)\n" \
"$MESHCORE_TEST_APPDIR/usr/bin/fixture" "$MESHCORE_TEST_APPDIR/usr/bin/fixture"
exit 1
fi
if [[ -e "$MESHCORE_TEST_HOST_WAYLAND" ]]; then
printf 'libwayland-client.so.0 => %s (0x0)\n' "$MESHCORE_TEST_HOST_WAYLAND"
else
printf 'libwayland-client.so.0 => not found\n'
fi
if [[ -e "$MESHCORE_TEST_APPDIR/usr/lib/libgpg-error.so.0" ]]; then
printf 'libgpg-error.so.0 => %s/usr/lib/libgpg-error.so.0 (0x0)\n' "$MESHCORE_TEST_APPDIR"
else
printf 'libgpg-error.so.0 => %s (0x0)\n' "$MESHCORE_TEST_HOST_LIBRARY"
fi
EOF
chmod +x "$temporary/fakebin/ldd"
MESHCORE_TEST_APPDIR="$temporary/audit-appdir" \
MESHCORE_TEST_HOST_LIBRARY="$temporary/host/libgpg-error.so.0" \
MESHCORE_TEST_HOST_WAYLAND="$temporary/host/libwayland-client.so.0" \
PATH="$temporary/fakebin:$PATH" \
bash "$project/scripts/appimage/dependencies.sh" bundle \
"$temporary/audit-appdir" "$temporary/dependency-audit.log"
[[ -L "$temporary/audit-appdir/usr/lib/libgpg-error.so.0" ]]
[[ -f "$temporary/audit-appdir/usr/lib/libgpg-error.so.0.37.0" ]]
[[ ! -e "$temporary/audit-appdir/usr/lib/libwayland-client.so.0" ]]
grep -Fq 'libgpg-error.so.0 =>' "$temporary/dependency-audit.log"
grep -Fq 'libwayland-client.so.0 =>' "$temporary/dependency-audit.log"
mkdir -p "$temporary/audit AppDir/usr/bin" "$temporary/audit AppDir/usr/lib"
cp "$temporary/audit-appdir/usr/bin/fixture" "$temporary/audit AppDir/usr/bin/fixture"
MESHCORE_TEST_APPDIR="$temporary/audit AppDir" \
MESHCORE_TEST_HOST_LIBRARY="$temporary/host/libgpg-error.so.0" \
MESHCORE_TEST_HOST_WAYLAND="$temporary/host/libwayland-client.so.0" \
PATH="$temporary/fakebin:$PATH" \
bash "$project/scripts/appimage/dependencies.sh" bundle \
"$temporary/audit AppDir" "$temporary/dependency-audit-spaces.log"
[[ -L "$temporary/audit AppDir/usr/lib/libgpg-error.so.0" ]]
grep -Fq 'libgpg-error.so.0 =>' "$temporary/dependency-audit-spaces.log"
mkdir -p "$temporary/audit-missing/usr/bin" "$temporary/audit-missing/usr/lib"
cp "$temporary/audit-appdir/usr/bin/fixture" "$temporary/audit-missing/usr/bin/fixture"
MESHCORE_TEST_APPDIR="$temporary/audit-missing" \
MESHCORE_TEST_HOST_LIBRARY="$temporary/host/libgpg-error.so.0" \
MESHCORE_TEST_HOST_WAYLAND="$temporary/host/missing-libwayland-client.so.0" \
PATH="$temporary/fakebin:$PATH" \
assert_fails bash "$project/scripts/appimage/dependencies.sh" audit \
"$temporary/audit-missing" "$temporary/dependency-rejected.log"
grep -Fq 'unexpected host dependency' "$temporary/dependency-rejected.log"
grep -Fq 'libwayland-client.so.0 => NOT PRESENT ON AUDIT HOST [host interface]' \
"$temporary/dependency-rejected.log"
MESHCORE_TEST_APPDIR="$temporary/audit-appdir" \
MESHCORE_TEST_HOST_LIBRARY="$temporary/host/libgpg-error.so.0" \
MESHCORE_TEST_HOST_WAYLAND="$temporary/host/libwayland-client.so.0" \
MESHCORE_TEST_LDD_VERSION_FAILURE=1 \
PATH="$temporary/fakebin:$PATH" \
assert_fails bash "$project/scripts/appimage/dependencies.sh" audit \
"$temporary/audit-appdir" "$temporary/dependency-version-rejected.log"
grep -Fq "version 'GLIBC_2.39' not found" "$temporary/error"
mkdir -p "$temporary/launcher-appdir/usr/bin"
cp "$project/scripts/appimage/AppRun" "$temporary/launcher-appdir/AppRun"
cat > "$temporary/launcher-appdir/usr/bin/meshcore_open" <<'EOF'
#!/usr/bin/env bash
env | sort
EOF
chmod +x "$temporary/launcher-appdir/usr/bin/meshcore_open"
env APPDIR="$temporary/launcher-appdir" \
GIO_EXTRA_MODULES=/host/gio/modules GIO_MODULE_DIR=/host/gio/modules \
GI_TYPELIB_PATH=/host/girepository GTK_PATH=/host/gtk/modules \
GTK_MODULES=host-module GDK_PIXBUF_MODULE_FILE=/host/pixbuf.loaders \
bash "$temporary/launcher-appdir/AppRun" > "$temporary/launcher-environment"
for variable in GIO_EXTRA_MODULES GIO_MODULE_DIR GI_TYPELIB_PATH GTK_PATH \
GTK_MODULES GDK_PIXBUF_MODULE_FILE; do
if grep -q "^$variable=" "$temporary/launcher-environment"; then
printf 'Host plugin environment leaked through AppRun: %s\n' "$variable" >&2
exit 1
fi
done
printf 'AppImage packaging contract tests passed\n'
+15 -22
View File
@@ -4,6 +4,11 @@ set -euo pipefail
image="$(realpath "$1")"
mkdir -p "$2"
output="$(realpath "$2")"
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
dependency_checker="${MESHCORE_APPIMAGE_DEPENDENCIES:-$script_dir/dependencies.sh}"
if [[ "$dependency_checker" != /* ]]; then
dependency_checker="$(realpath -e -- "$dependency_checker")"
fi
exec > >(tee -a "$output/runtime-test.log") 2>&1
log() {
@@ -86,33 +91,21 @@ log "ELF architecture audit passed ($elf_count files)"
dependencies="$output/dependencies.log"
: > "$dependencies"
run_timed 'check application dependencies' 20s "$workspace/ldd.log" \
ldd "$appdir/usr/bin/meshcore_open"
cat "$workspace/ldd.log" >> "$dependencies"
while IFS= read -r -d '' library; do
relative="${library#"$appdir/"}"
if run_timed "check dependencies: $relative" 20s "$workspace/ldd.log" ldd "$library"; then
cat "$workspace/ldd.log" >> "$dependencies"
else
status=$?
cat "$workspace/ldd.log" >> "$dependencies"
if [[ "$status" == 124 || "$status" == 137 ]]; then
exit "$status"
fi
log "ldd returned $status for $relative; continuing unresolved-dependency scan"
fi
done < <(find "$appdir/usr/bin/lib" "$appdir/usr/lib" -type f -name '*.so*' -print0)
if grep 'not found' "$dependencies"; then
log 'Unresolved AppImage dependencies'
exit 1
fi
log 'Dependency audit passed'
[[ -f "$dependency_checker" ]] || { log "Missing dependency checker: $dependency_checker"; exit 1; }
run_timed 'audit dependency origins' 120s "$workspace/dependency-audit.log" \
bash "$dependency_checker" audit "$appdir" "$dependencies"
cat "$workspace/dependency-audit.log" >> "$dependencies"
log 'Dependency origin audit passed'
mkdir -p "$workspace/home/Documents" "$workspace/home/config"
printf 'XDG_DOCUMENTS_DIR="%s/Documents"\n' "$workspace/home" > "$workspace/home/config/user-dirs.dirs"
log 'Starting AppRun under a private D-Bus session (also used as the system bus)'
# shellcheck disable=SC2016
env -u LD_LIBRARY_PATH -u GTK_PATH -u GSETTINGS_SCHEMA_DIR \
env -u LD_LIBRARY_PATH \
GIO_EXTRA_MODULES=/host/gio/modules GIO_MODULE_DIR=/host/gio/modules \
GI_TYPELIB_PATH=/host/girepository GTK_PATH=/host/gtk/modules \
GTK_MODULES=host-module GDK_PIXBUF_MODULE_FILE=/host/pixbuf.loaders \
GSETTINGS_SCHEMA_DIR=/host/glib-2.0/schemas \
HOME="$workspace/home" XDG_CONFIG_HOME="$workspace/home/config" \
XDG_DATA_HOME="$workspace/home/data" XDG_CACHE_HOME="$workspace/home/cache" \
dbus-run-session -- bash -c \
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $# != 2 ]]; then
printf 'Usage: verify_image.sh APPIMAGE REPORT\n' >&2
exit 2
fi
image="$(realpath -e -- "$1")"
report="$2"
dependency_checker="$(dirname "${BASH_SOURCE[0]}")/dependencies.sh"
workspace="$(mktemp -d)"
trap 'rm -rf "$workspace"' EXIT
mkdir -p "$(dirname "$report")"
cp -p -- "$image" "$workspace/extractor"
printf '\0\0\0' | dd of="$workspace/extractor" bs=1 seek=8 count=3 conv=notrunc status=none
(
cd "$workspace"
./extractor --appimage-extract >/dev/null
)
bash "$dependency_checker" audit "$workspace/squashfs-root" "$report"
printf 'AppImage dependency audit passed: %s\n' "$report"
+2
View File
@@ -156,6 +156,7 @@ package_direct() {
dependencies+=(--deploy-deps-only "$library")
done < <(find "$appdir/usr/bin/lib" -type f -print0)
"$linuxdeploy" --appdir "$appdir" "${dependencies[@]}"
bash "$project/scripts/appimage/dependencies.sh" bundle "$appdir" "$work/dependency-audit.txt"
while IFS= read -r -d '' library; do
readelf -h "$library" >/dev/null 2>&1 || continue
relative="$(realpath --relative-to="$(dirname "$library")" "$appdir/usr/lib")"
@@ -187,6 +188,7 @@ package_direct() {
cp "$MESHCORE_APPIMAGE_FLUTTER_ROOT/LICENSE" "$appdir/usr/share/doc/meshcore-open/Flutter-LICENSE"
fi
audit_appdir "$appdir" "$work/audit.txt"
cat "$work/dependency-audit.txt" >> "$work/audit.txt"
ARCH="$appimage_arch" "$appimagetool" --runtime-file "$cache/runtime" --no-appstream \
"$appdir" "$work/$appimage_name"
chmod +x "$work/$appimage_name"
+145
View File
@@ -0,0 +1,145 @@
import 'dart:typed_data';
import 'package:cryptography/cryptography.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/storage/prefs_manager.dart';
import 'package:meshcore_open/utils/advert_signature.dart';
import 'package:shared_preferences/shared_preferences.dart';
/// Builds an advert payload signed the way MeshCore's Mesh::createAdvert does.
Future<Uint8List> _signedAdvert(
int seedByte, {
required int type,
required String name,
int timestamp = 1700000000,
}) async {
final algo = Ed25519();
final keys = await algo.newKeyPairFromSeed(List<int>.filled(32, seedByte));
final pub = (await keys.extractPublicKey()).bytes;
final ts = Uint8List(4)
..buffer.asByteData().setUint32(0, timestamp, Endian.little);
final appData = [0x80 | type, ...name.codeUnits];
final sig = await algo.sign([...pub, ...ts, ...appData], keyPair: keys);
return Uint8List.fromList([...pub, ...ts, ...sig.bytes, ...appData]);
}
/// Wraps an advert payload in a PUSH_CODE_LOG_RX_DATA frame (flood, no path).
List<int> _rxFrame(Uint8List payload) => [
pushCodeLogRxData,
0, // snr
0, // rssi
(payloadTypeADVERT << 2) | 0x01, // header: flood route
0, // path length
...payload,
];
List<int> _contactFrame(int code, List<int> key, String name) {
final data = ByteData(1 + 32 + 3 + 64 + 32 + 4 + 12);
final bytes = data.buffer.asUint8List();
bytes[0] = code;
bytes.setRange(1, 33, key);
bytes[33] = advTypeRepeater;
bytes[35] = 0xFF;
bytes.setRange(100, 100 + name.length, name.codeUnits);
data.setUint32(132, 1700000000, Endian.little);
return bytes;
}
Future<void> _settle() async {
for (var i = 0; i < 20; i++) {
await Future<void>.delayed(Duration.zero);
}
}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
setUp(() async {
SharedPreferences.setMockInitialValues({});
PrefsManager.reset();
await PrefsManager.initialize();
});
group('verifyAdvertSignature', () {
for (final type in [
advTypeChat,
advTypeRepeater,
advTypeRoom,
advTypeSensor,
]) {
test('accepts a valid advert of type $type', () async {
final advert = await _signedAdvert(
type + 10,
type: type,
name: 'N$type',
);
expect(await verifyAdvertSignature(advert), isTrue);
});
}
test('rejects tampered app data', () async {
final advert = await _signedAdvert(1, type: advTypeRepeater, name: 'Rpt');
advert[advert.length - 1] ^= 0x01;
expect(await verifyAdvertSignature(advert), isFalse);
});
test('rejects a swapped public key', () async {
final advert = await _signedAdvert(2, type: advTypeChat, name: 'Bob');
final other = await _signedAdvert(3, type: advTypeChat, name: 'Bob');
advert.setRange(0, 32, other.sublist(0, 32));
expect(await verifyAdvertSignature(advert), isFalse);
});
test('rejects a short payload', () async {
expect(await verifyAdvertSignature(Uint8List(99)), isFalse);
});
});
group('RX advert handling', () {
test('valid advert is discovered', () async {
final connector = MeshCoreConnector();
final advert = await _signedAdvert(4, type: advTypeRoom, name: 'Room');
connector.handleFrameForTest(_rxFrame(advert));
await _settle();
expect(connector.discoveredContacts.map((c) => c.name), contains('Room'));
});
test('forged advert is dropped', () async {
final connector = MeshCoreConnector();
final advert = await _signedAdvert(
5,
type: advTypeRepeater,
name: 'Real',
);
// Rename without re-signing.
advert.setRange(advert.length - 4, advert.length, 'Fake'.codeUnits);
connector.handleFrameForTest(_rxFrame(advert));
await _settle();
expect(connector.discoveredContacts, isEmpty);
});
});
test('full contact sync forgets keys the radio dropped', () async {
final connector = MeshCoreConnector();
final kept = List<int>.generate(32, (i) => i + 1);
final dropped = List<int>.generate(32, (i) => 100 + i);
connector.handleFrameForTest([respCodeContactsStart, 0, 0, 0, 0]);
connector.handleFrameForTest(_contactFrame(respCodeContact, kept, 'Kept'));
connector.handleFrameForTest(
_contactFrame(respCodeContact, dropped, 'Gone'),
);
connector.handleFrameForTest([respCodeEndOfContacts, 0, 0, 0, 0]);
expect(connector.knownContactKeys.length, 2);
connector.handleFrameForTest([respCodeContactsStart, 0, 0, 0, 0]);
connector.handleFrameForTest(_contactFrame(respCodeContact, kept, 'Kept'));
connector.handleFrameForTest([respCodeEndOfContacts, 0, 0, 0, 0]);
await _settle();
expect(connector.contacts.map((c) => c.name), ['Kept']);
expect(connector.knownContactKeys, hasLength(1));
});
}
+57
View File
@@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:meshcore_open/theme/mesh_theme.dart';
double _contrast(Color a, Color b) {
final la = a.computeLuminance();
final lb = b.computeLuminance();
final hi = la > lb ? la : lb;
final lo = la > lb ? lb : la;
return (hi + 0.05) / (lo + 0.05);
}
void main() {
test('snackbar action text is readable in light and dark themes', () {
for (final theme in [MeshTheme.light(), MeshTheme.dark()]) {
final sb = theme.snackBarTheme;
expect(sb.actionTextColor, isNotNull);
expect(
_contrast(sb.actionTextColor!, sb.backgroundColor!),
greaterThanOrEqualTo(4.5),
);
}
});
testWidgets('snackbar with action and persist:false auto-dismisses', (
tester,
) async {
late BuildContext ctx;
await tester.pumpWidget(
MaterialApp(
theme: MeshTheme.light(),
home: Scaffold(
body: Builder(
builder: (c) {
ctx = c;
return const SizedBox();
},
),
),
),
);
ScaffoldMessenger.of(ctx).showSnackBar(
SnackBar(
content: const Text('Rule deleted'),
duration: const Duration(seconds: 6),
persist: false,
action: SnackBarAction(label: 'Undo', onPressed: () {}),
),
);
await tester.pump();
await tester.pump(const Duration(milliseconds: 500));
expect(find.text('Rule deleted'), findsOneWidget);
await tester.pump(const Duration(seconds: 7));
await tester.pumpAndSettle();
expect(find.text('Rule deleted'), findsNothing);
});
}
+48
View File
@@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:meshcore_open/l10n/app_localizations.dart';
import 'package:meshcore_open/widgets/filter_rule_dialog.dart';
void main() {
for (final scale in [1.0, 2.0]) {
testWidgets('floating label is not clipped with keyboard (scale $scale)', (
tester,
) async {
tester.view.physicalSize = const Size(1080, 1400);
tester.view.devicePixelRatio = 2.75;
addTearDown(tester.view.reset);
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
builder: (context, child) {
final mq = MediaQuery.of(context);
return MediaQuery(
data: mq.copyWith(
textScaler: TextScaler.linear(scale),
viewInsets: const EdgeInsets.only(bottom: 150),
),
child: child!,
);
},
home: Builder(
builder: (context) => TextButton(
onPressed: () => showFilterRuleDialog(context),
child: const Text('open'),
),
),
),
);
await tester.tap(find.text('open'));
await tester.pumpAndSettle();
final scrollRect = tester.getRect(find.byType(SingleChildScrollView));
final labelRect = tester.getRect(find.byType(InputDecorator));
// The floating label sits above the field box; the scroll viewport must
// start above the field with room for it.
final fieldTop = labelRect.top;
expect(fieldTop - scrollRect.top, greaterThanOrEqualTo(8 * scale));
});
}
}