You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6973037
Browse filesBrowse the repository at this point in the historyBrowse files
Never show an old or wrong number as current:
- The widget hides the value after 5 minutes without a new reading, and
clears itself when there are none (the launcher kept the old view).
- The home screen clears too, instead of keeping the last value.
- Notification and widgets are redrawn every minute and on screen-on
from memory, and each fetch has a 30 s overall deadline.
- Stale readings: no delta, and the plain drop instead of the number in
the status bar.
- Nightscout LOW (39) and HIGH (401) codes shown as LOW/HIGH, no trend.
- Thresholds must be plausible, catching typos and unit mix-ups.
- Readings are tied to their source: a new address or turning fake
readings off drops the old ones instead of showing them unlabelled.
Security:
- Plain http only with a token, never the API secret; localhost refused.
- The saved secret is never shown again and only kept for the same site.
- Addresses are cleaned; credentials pasted inside them are moved out.
- The notification shows a generic error, never one naming the site.
- The widget ignores ids in the broadcast, catches errors per widget and
clamps sizes; the network task catches Throwable.
- Empty taskAffinity, no autofill on the settings fields, guarded
battery-optimisation request, "Example" label on a made-up preview.
- Quiet notification channel (default importance, no sound, light or
badge); with the screen off it is only reposted when the value,
arrow or stale state changes, which stops HyperOS lighting the edges.
Repository: official Gradle 8.14.3 wrapper with distributionSha256Sum,
CI with read-only token, SHA-pinned actions and wrapper validation,
signing certificate fingerprint in the README, debug APK no longer
published.
The settings preview follows the fixed scale as it is typed (Reddit).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,8 @@ What it deliberately does **not** do: alarms, treatments, uploading, statistics.
33
33
34
34
## Install
35
35
36
-
1. On your phone, [download the APK](https://github.com/federicomameli1/sugarglass/releases/latest/download/sugarglass.apk) and open it. Android will ask you to **allow installing apps** from your browser or file manager the first time: allow it, then tap **Install**. If Google Play Protect warns that the app comes from an unknown developer, that is because it isn't on the Play Store: tap **More details → Install anyway**. Updates install the same way, over the old version, and keep your settings.
37
-
2. Open Sugarglass, enter your Nightscout address and, if your site is not public, a token (recommended, with the `readable` role) or your API secret. Tap **Save and start**. A Nightscout on your home network (`http://192.168.…`) works too.
36
+
1. On your phone, [download the APK](https://github.com/federicomameli1/sugarglass/releases/latest/download/sugarglass.apk) and open it. Android will ask you to **allow installing apps** from your browser or file manager the first time: allow it, then tap **Install**. If Google Play Protect warns that the app comes from an unknown developer, that is because it isn't on the Play Store: tap **More details → Install anyway**. Updates install the same way, over the old version, and keep your settings. If an update ever refuses to install over the app you have ("package conflicts"), **don't uninstall**: it may not be a genuine build. Check it as described under [Is it the real one?](#is-it-the-real-one) and open an issue.
37
+
2. Open Sugarglass, enter your Nightscout address and, if your site is not public, a token (recommended, with the `readable` role) or your API secret. Tap **Save and start**. A Nightscout on your home network (`http://192.168.…`) works too, with a token rather than the API secret.
38
38
3. Allow notifications and let it **ignore battery optimisation**: without that Android may stop it.
39
39
4. Long-press the home screen and add the Sugarglass widget.
40
40
@@ -53,13 +53,24 @@ Tested on HyperOS only so far; if the steps for your phone differ, please open a
53
53
54
54
Sugarglass talks to your Nightscout site and nothing else. Your address and token stay on your phone. No analytics, no ads, no account.
55
55
56
-
- Your token only travels encrypted: plain `http://` is accepted just for addresses on your home network (like `192.168.x.x` or `nightscout.local`), everything else needs `https://`.
56
+
- Your credentials only travel encrypted: plain `http://` is accepted just for addresses on your home network (like `192.168.x.x` or `nightscout.local`), and there only with a `readable` token, never the API secret. Everything else needs `https://`. Addresses on the phone itself (`localhost`) are refused, since any app on it could pretend to be Nightscout.
57
+
- The saved token is never shown again, and stays with the site it was given to: change the address and you type it again.
57
58
- If your site redirects somewhere else, Sugarglass stops and tells you the new address instead of following it with your credentials.
58
59
- The settings are left out of Android's cloud backups and phone-to-phone transfers, so the token never leaves the phone; on a new phone you enter it again.
59
60
- Prefer a token with only the `readable` role over the API secret: it can read your data but not change anything.
60
61
61
62
Permissions: internet (Nightscout), notifications, foreground service (to stay alive), start at boot, and the request to be excluded from battery optimisation.
62
63
64
+
## Is it the real one?
65
+
66
+
Every Sugarglass release is signed with the same key. Its certificate's SHA-256 fingerprint is:
Check a downloaded APK with `apksigner verify --print-certs sugarglass.apk`, or on the phone with an app like AppVerifier. If it doesn't match, don't install it.
73
+
63
74
## Not a medical device
64
75
65
76
Sugarglass is a hobby project and is not a medical device. It can show old, wrong or missing data. **Do not use it to make treatment decisions**; always check your CGM app or a meter.
@@ -72,7 +83,7 @@ JDK 17 and the Android SDK (platform 34).
72
83
./gradlew test assembleDebug
73
84
```
74
85
75
-
The debug build installs next to the real app as **Sugarglass debug**, and its settings have a Debug page with fake readings: pick any value, trend or a stale reading and see the widget, notification and status bar with it. While fake readings are on, everything showing them says **DEMO**. A prebuilt one is attached to each release.
86
+
The debug build installs next to the real app as **Sugarglass debug**, and its settings have a Debug page with fake readings: pick any value, trend or a stale reading and see the widget, notification and status bar with it. While fake readings are on, everything showing them says **DEMO**. It is not published: it is debuggable and signed with a development key, so build it yourself (`./gradlew assembleDebug`) or take the one from the latest CI run.
76
87
77
88
Release builds are signed with a key kept outside the repo: create `keystore.properties` in the project root with `storeFile`, `storePassword`, `keyAlias` and `keyPassword`, then `./gradlew assembleRelease`.
0 commit comments