diff --git a/android/mc-webui-wrapper.apk b/android/mc-webui-wrapper.apk index 3d440e8..dd8c72e 100644 Binary files a/android/mc-webui-wrapper.apk and b/android/mc-webui-wrapper.apk differ diff --git a/android/src/app/src/main/java/it/wojtaszek/mc/wrapper/MainActivity.kt b/android/src/app/src/main/java/it/wojtaszek/mc/wrapper/MainActivity.kt index efae762..b974777 100644 --- a/android/src/app/src/main/java/it/wojtaszek/mc/wrapper/MainActivity.kt +++ b/android/src/app/src/main/java/it/wojtaszek/mc/wrapper/MainActivity.kt @@ -140,7 +140,8 @@ class MainActivity : AppCompatActivity() { override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean = handleUrl(request?.url) - @Suppress("DEPRECATION") + // Deprecated, but it is the only one Android 5.x calls + @Suppress("DEPRECATION", "OVERRIDE_DEPRECATION") override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean = handleUrl(if (url == null) null else Uri.parse(url)) @@ -228,7 +229,7 @@ class MainActivity : AppCompatActivity() { setMimeType(mimeType) setTitle(fileName) setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName) - setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFIED) + setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) if (!userAgent.isNullOrEmpty()) addRequestHeader("User-Agent", userAgent) CookieManager.getInstance().getCookie(url)?.let { addRequestHeader("Cookie", it) } } diff --git a/docs/android-app.md b/docs/android-app.md index 33611d1..23f5e2b 100644 --- a/docs/android-app.md +++ b/docs/android-app.md @@ -31,10 +31,10 @@ along the way. The steps below cover those warnings. |---|---| | **File** | [`android/mc-webui-wrapper.apk`](../android/mc-webui-wrapper.apk) | | **Direct link** | https://github.com/MarekWo/mc-webui/raw/main/android/mc-webui-wrapper.apk | -| **Size** | 5.7 MB | +| **Size** | 4.6 MB | | **App version** | 1.0 | | **Package** | `it.wojtaszek.mc.wrapper` | -| **SHA-256** | `12e1e388e01a68e0de73672808033a2ff8417df7075a229e3be9eccc6f7ff82c` | +| **SHA-256** | `eaeccbb2016f67517adb2940375604b327ba049fe69ae5682f8f0881de888f08` | Download it directly on the phone, or copy it over from a computer. @@ -114,27 +114,34 @@ The address is remembered, so every later launch goes straight into mc-webui. ### Changing the address later -The app returns to the address screen when you press **Back** on the main -mc-webui page, and also when it cannot reach the server (wrong address, server -down, phone off the network). Enter the address again — corrected if it was -wrong, unchanged if the server was simply unreachable — and tap **SAVE & -CONNECT**. +Press **Back** on the first mc-webui page and the app asks what you want: +**Change server** brings up the address form, **Exit** closes the app, **Cancel** +stays where you were. (Deeper inside the interface, Back simply goes back a +page, as in a browser.) + +The address form also appears on its own when the app cannot reach the server — +wrong address, server down, phone off the network. Either way the form opens +**pre-filled with the address you are using**, and nothing is overwritten until +you tap **SAVE & CONNECT**: a dropped connection never costs you the address. --- ## What works, and what doesn't -Everything you do in mc-webui itself works exactly as in the browser: channels, -direct messages, contacts, the console, My Repeaters, the Path Analyzer, maps, -settings, themes. A few things live outside the page and are not wired up in -this version of the wrapper: +Everything you do in mc-webui itself works as in the browser: channels, direct +messages, contacts, the console, My Repeaters, the Path Analyzer, maps, +settings, themes. Links to other sites — a URL in a message, the packet +analyzer — open in your normal browser, so the app stays on your instance. -| Feature | In the app | Instead | -|---|---|---| -| **Notifications** for new messages | Not available — the app has no access to the browser notification system | Install mc-webui as a **PWA** in Chrome for notifications ([how](user-guide.md#installing-as-pwa)); the two can live side by side | -| **Scanning a QR code** (Add Contact → Scan QR) | Not available — the app does not request camera access | **Paste URI** or **Manual entry** on the same screen | -| **Downloading files** (database backup, saving a QR image) | Does nothing when tapped | Do it from a browser on the phone or from a computer | -| **HTTPS with a self-signed certificate** | Refused, with an "SSL Error" message | Use a valid certificate (e.g. Let's Encrypt), or plain `http://` on the local network | +Two things depend on how your instance is reachable, and one is not available +at all: + +| Feature | In the app | +|---|---| +| **Notifications** for new messages | **Not available.** The app has no access to the browser's notification system. If you want notifications, also install mc-webui as a **PWA** in Chrome ([how](user-guide.md#installing-as-pwa)) — the app and the PWA can live side by side | +| **Scanning a QR code** (Add Contact → Scan QR) | **Works on `https://` instances.** Android asks for camera permission the first time. Over plain `http://` the camera stays blocked — that is a browser rule, not an app limitation, and Chrome on the same phone behaves identically. Use **Paste URI** or **Manual entry** there | +| **Downloading files** (e.g. database backups) | **Works.** Files land in the phone's **Downloads** folder, with the usual download notification | +| **HTTPS with a self-signed certificate** | **Refused,** with an "SSL error" message. Use a valid certificate (e.g. Let's Encrypt), or plain `http://` on the local network | --- @@ -150,7 +157,13 @@ this version of the wrapper: certificate. On a home network that is fine; over the internet, put mc-webui behind a reverse proxy with HTTPS and some form of access control — the app adds no authentication of its own -- The app requests a single Android permission: **internet access** +- **Permissions:** internet access; the camera, only when you use QR scanning + and only after you allow it; and file storage on Android 9 and older, only + for saving a download. Nothing else — no contacts, no location, no background + services +- Every release is **signed with the same key** (certificate SHA-256 + `42:58:57:b3:60:0c:1b:89:2f:8d:3b:2a:5c:46:8b:fe:17:c0:d2:1f:6c:12:24:33:a4:e1:1b:51:be:9b:d2:30`), + which is also why updates install straight over the previous version --- diff --git a/docs/whatsnew.md b/docs/whatsnew.md index 7a07cd5..c1a29b1 100644 --- a/docs/whatsnew.md +++ b/docs/whatsnew.md @@ -12,7 +12,7 @@ For deep technical notes, see [architecture.md](architecture.md). For the full g ### New features -- **There is an Android app now.** A small companion app opens your own instance full screen — no address bar, its own icon in the app drawer, and it looks like a proper Android app rather than a page in a browser. It holds no mesh logic of its own: on first run it asks for the address of your server (`http://192.168.1.100:5000` on the local network, or your `https://` hostname behind a reverse proxy), remembers it, and from then on launches straight into mc-webui. Everything still runs on your server and your MeshCore device. It is not on Google Play, so you download the `.apk` from the repository and install it yourself — the new [Android App guide](android-app.md) walks through that, including the "unknown sources" permission and the Play Protect notice Android shows for any app that didn't come from the Play Store. Two things still belong to the browser: notifications and QR scanning, so if you rely on those, keep the Chrome "Add to Home Screen" install — the two can live side by side. +- **There is an Android app now.** A small companion app opens your own instance full screen — no address bar, its own icon in the app drawer, and it looks like a proper Android app rather than a page in a browser. It holds no mesh logic of its own: on first run it asks for the address of your server (`http://192.168.1.100:5000` on the local network, or your `https://` hostname behind a reverse proxy), remembers it, and from then on launches straight into mc-webui. Everything still runs on your server and your MeshCore device. It is not on Google Play, so you download the `.apk` from the repository and install it yourself — the new [Android App guide](android-app.md) walks through that, including the "unknown sources" permission and the Play Protect notice Android shows for any app that didn't come from the Play Store. Scanning contact QR codes works (on `https://` instances — over plain `http://` the camera is blocked by the same browser rule that applies in Chrome), and database backups download to the phone's Downloads folder. One thing stays with the browser: **notifications**, which the app has no access to — if you rely on them, keep the Chrome "Add to Home Screen" install alongside it, the two work happily side by side. The app's [source](../android/src) sits next to the `.apk`, so you can read what you are installing or build it yourself. ---