commit
New signing keys, a signature check in CI, and no Codeberg mirror
Every app now has its own PKCS12 key (kept outside the repo; certificates in docs/releasing.md). CI runs apksigner on each signed APK and prints its certificate. The Codeberg mirror is retired. Co-Authored-By: Claude Opus 5.5 <[email protected]>
diff --git a/.github/workflows/android-app.yml b/.github/workflows/android-app.yml
index 963d237..044c045 100644
--- a/.github/workflows/android-app.yml
+++ b/.github/workflows/android-app.yml
@@ -141,7 +141,7 @@ jobs:
MODE: ${{ inputs.signing }}
PROPS_DIR: ${{ inputs.properties_dir }}
run: |
- store="$RUNNER_TEMP/release.jks"
+ store="$RUNNER_TEMP/release.p12"
echo "$KEYSTORE_BASE64" | base64 -d > "$store"
if [ "$MODE" = properties ]; then
umask 077
@@ -191,6 +191,14 @@ jobs:
echo "APK=$apk" >> "$GITHUB_ENV"
echo "META=$meta" >> "$GITHUB_ENV"
+ # Fails if the APK isn't validly signed, and prints the certificate so it
+ # can be checked against docs/releasing.md.
+ - name: Verify signature
+ if: env.HAS_SIGNING_KEY == 'true'
+ run: |
+ apksigner=$(ls -d "$ANDROID_HOME"/build-tools/*/ | sort -V | tail -1)apksigner
+ "$apksigner" verify --print-certs "$APK" | grep -E "certificate (DN|SHA-256)"
+
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact }}-${{ env.VERSION_NAME }}
diff --git a/.github/workflows/codeberg.yml b/.github/workflows/codeberg.yml
deleted file mode 100644
index 4dadf38..0000000
--- a/.github/workflows/codeberg.yml
+++ /dev/null
@@ -1,72 +0,0 @@
-# go to my backup
-name: Codeberg
-
-on:
- push:
-
-jobs:
- mirror:
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
-
- concurrency:
- group: mirror-${{ github.repository }}
- cancel-in-progress: false
-
- env:
- CODEBERG_HOST: codeberg.org
- CODEBERG_USERNAME: ${{ secrets.CODEBERG_USERNAME }}
- CODEBERG_REPO: ${{ secrets.CODEBERG_REPO }}
- CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
-
- steps:
- - name: Clone every ref
- env:
- SOURCE_TOKEN: ${{ github.token }}
- SERVER_URL: ${{ github.server_url }}
- run: |
- set -euo pipefail
-
- sourceHost="${SERVER_URL#https://}"
-
- git clone --mirror \
- "https://x-access-token:${SOURCE_TOKEN}@${sourceHost}/${GITHUB_REPOSITORY}.git" \
- source.git
-
- - name: Drop pull-request refs
- working-directory: source.git
- run: |
- set -euo pipefail
-
- git for-each-ref --format='%(refname)' 'refs/pull/*' \
- | while read -r ref; do
- git update-ref -d "$ref"
- done
-
- - name: Push mirror
- working-directory: source.git
- run: |
- set -euo pipefail
-
- if [ -z "$CODEBERG_USERNAME" ]; then
- echo "CODEBERG_USERNAME is not set" >&2
- exit 1
- fi
-
- if [ -z "$CODEBERG_REPO" ]; then
- echo "CODEBERG_REPO is not set" >&2
- exit 1
- fi
-
- targetUrl="https://${CODEBERG_HOST}/${CODEBERG_USERNAME}/${CODEBERG_REPO}.git"
-
- echo "Mirroring ${GITHUB_REPOSITORY} -> ${targetUrl}"
-
- git remote add mirror "$targetUrl"
-
- # Credentials go through a helper so the token never lands in .git/config
- git -c credential.helper= \
- -c "credential.helper=!f() { echo username=\"\$CODEBERG_USERNAME\"; echo password=\"\$CODEBERG_TOKEN\"; }; f" \
- push --mirror mirror
diff --git a/.gitignore b/.gitignore
index df5efca..b1dd24f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,8 @@ captures/
*.jks
*.keystore
keystore.properties
+*.p12
+*.pem
# Built APKs
*.apk
diff --git a/docs/releasing.md b/docs/releasing.md
index 9577192..26bcc8c 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -66,26 +66,59 @@ The apps read their key two ways, as they did before the move:
Pull requests build unsigned or debug-signed. Anything published (a tag, a
manual release, `inbox-latest`) fails rather than ship without the real key.
-### Repository secrets
-Set them with `gh secret set NAME -R doughmination/apps < file` (or paste the
-value when it asks). Base64 a keystore with `base64 -w0 key.jks`.
+### The keys
+
+Each app has a PKCS12 keystore (`<app>.p12`, alias `<app>`, the same password
+for store and key), made on 2026-11-02. They live outside every repository in
+`C:\Users\clove\.signing\doughmination-apps\`, with their passwords in
+`passwords.txt` there. **Back that folder up** (a password manager or an
+encrypted drive); if a key is lost, that app can never be updated in place
+again.
+
+| App | Certificate SHA-256 |
+|---|---|
+| Inbox | `79:7D:66:1F:F5:EE:00:FD:DB:E3:E0:7F:FF:07:C5:EF:AC:C3:50:8F:18:65:0F:60:F5:A6:A6:4B:95:30:A8:DD` |
+| Device Reporter | `D1:D0:FB:74:BA:38:5E:69:55:BF:58:97:FD:E7:18:4F:4F:2F:1B:91:FD:0E:FA:2D:9E:A8:FF:C0:59:B8:CF:D5` |
+| Doughmination Manager | `22:8D:A3:BC:CF:8B:ED:60:21:B8:E6:E0:17:C2:FE:62:F1:EC:52:9C:8C:D4:2C:8D:41:A1:35:FA:62:7B:E8:AA` |
+| Plural | `F1:0D:90:FE:C9:0C:97:18:C0:06:8B:70:5A:55:92:62:05:DF:11:74:95:62:A2:7D:30:B5:16:70:40:3E:1D:C1` |
+
+These are public: Inbox's goes in the mail server's
+`public/.well-known/assetlinks.json`, and they're the `signingCertSha256`
+values for the Manager manifest. CI prints each signed APK's certificate with
+`apksigner`, so a release signed by the wrong key is easy to spot.
+
+Inbox and Device Reporter were signed with different keys before the move, so
+copies installed from the old repositories have to be uninstalled once before
+these builds will install.
+
+### Repository secrets
| Secret | App | Value |
|---|---|---|
-| `INBOX_KEYSTORE_BASE64` | Inbox | base64 of `inbox.jks` |
-| `INBOX_KEYSTORE_PASSWORD` | Inbox | its store (and key) password |
+| `INBOX_KEYSTORE_BASE64` | Inbox | base64 of `inbox.p12` |
+| `INBOX_KEYSTORE_PASSWORD` | Inbox | its password (store and key) |
| `INBOX_GOOGLE_SERVICES_JSON` | Inbox | optional; base64 of `google-services.json`, overrides the committed one |
-| `DEVICE_REPORTER_KEYSTORE_BASE64` | Device Reporter | base64 of its keystore |
-| `DEVICE_REPORTER_STORE_PASSWORD` | Device Reporter | store password |
-| `DEVICE_REPORTER_KEY_ALIAS` | Device Reporter | key alias |
-| `DEVICE_REPORTER_KEY_PASSWORD` | Device Reporter | key password |
-| `MANAGER_*`, `PLURAL_*` | Manager, Plural | same four as Device Reporter, once they have keys |
-| `CODEBERG_USERNAME`, `CODEBERG_REPO`, `CODEBERG_TOKEN` | all | the Codeberg mirror (`codeberg.yml`) |
+| `DEVICE_REPORTER_KEYSTORE_BASE64` | Device Reporter | base64 of `device-reporter.p12` |
+| `DEVICE_REPORTER_STORE_PASSWORD` | Device Reporter | its password |
+| `DEVICE_REPORTER_KEY_ALIAS` | Device Reporter | `device-reporter` |
+| `DEVICE_REPORTER_KEY_PASSWORD` | Device Reporter | its password |
+| `MANAGER_*`, `PLURAL_*` | Manager, Plural | the same four, for `manager.p12` and `plural.p12` |
+
+To set one again from Windows PowerShell, in the keys folder:
+
+```powershell
+[Convert]::ToBase64String([IO.File]::ReadAllBytes("$PWD\inbox.p12")) | gh secret set INBOX_KEYSTORE_BASE64 -R doughmination/apps
+gh secret set INBOX_KEYSTORE_PASSWORD -R doughmination/apps # paste the password when asked
+```
-Make a new app's key once, and back it up before its first release:
+To make a key for a new app, in Git Bash (no JDK needed; `MSYS_NO_PATHCONV`
+stops Git Bash rewriting the `/CN=` subject as a path):
```sh
-keytool -genkeypair -v -keystore manager.jks -alias manager \
- -keyalg RSA -keysize 4096 -validity 10000
+export MSYS_NO_PATHCONV=1
+openssl req -x509 -newkey rsa:4096 -sha256 -days 10000 -nodes \
+ -subj "/CN=Doughmination myapp/O=Doughmination" -keyout myapp.key.pem -out myapp.cert.pem
+openssl pkcs12 -export -name myapp -inkey myapp.key.pem -in myapp.cert.pem -out myapp.p12
+rm myapp.key.pem
```