Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ jobs:
|| { echo "::error::The google-play environment lacks ANDROID_UPLOAD_KEYSTORE_B64 or ANDROID_UPLOAD_KEYSTORE_PASS"; exit 1; }
umask 077
mkdir -p "$RUNNER_TEMP/keys"
printf '%s' "$KEYSTORE_B64" | base64 -d > "$RUNNER_TEMP/keys/helfer-upload.p12"
printf '%s' "$KEYSTORE_PASS" > "$RUNNER_TEMP/keys/helfer-upload.pass"
printf '%s' "$KEYSTORE_B64" | base64 -d > "$RUNNER_TEMP/keys/fwassist-upload.p12"
printf '%s' "$KEYSTORE_PASS" > "$RUNNER_TEMP/keys/fwassist-upload.pass"
- name: Publish
env:
VERSION: ${{ needs.version.outputs.version }}
Expand All @@ -120,10 +120,10 @@ jobs:
"-p:ApplicationVersion=${VERSION_CODE}"
"-p:ApplicationDisplayVersion=${VERSION}"
"-p:Version=${VERSION}"
"-p:AndroidSigningKeyStore=${RUNNER_TEMP}/keys/helfer-upload.p12"
-p:AndroidSigningKeyAlias=helfer-upload
"-p:AndroidSigningStorePass=file:${RUNNER_TEMP}/keys/helfer-upload.pass"
"-p:AndroidSigningKeyPass=file:${RUNNER_TEMP}/keys/helfer-upload.pass"
"-p:AndroidSigningKeyStore=${RUNNER_TEMP}/keys/fwassist-upload.p12"
-p:AndroidSigningKeyAlias=fwassist-upload
"-p:AndroidSigningStorePass=file:${RUNNER_TEMP}/keys/fwassist-upload.pass"
"-p:AndroidSigningKeyPass=file:${RUNNER_TEMP}/keys/fwassist-upload.pass"
-o publish-android
- name: Remove the upload keystore
if: always()
Expand All @@ -147,7 +147,7 @@ jobs:
env:
VERSION: ${{ needs.version.outputs.version }}
run: |
# The SDK writes an unsigned de.codeforfire.helfer.aab beside the -Signed one, and
# The SDK writes an unsigned de.codeforfire.fwassist.aab beside the -Signed one, and
# `find | head` once picked the unsigned bundle in Lagebuch, which Play refused
# (lagebuch v0.9.3-rc.1). Name the signed files exactly.
apk=$(find publish-android -name "*-Signed.apk" | head -n1)
Expand Down Expand Up @@ -293,11 +293,11 @@ jobs:
**Installation ohne Play Store.** Aktiviere einmalig *Installation aus unbekannten
Quellen* für den Browser oder Dateimanager, mit dem die APK geöffnet wird.

**Update von 0.1.0 oder älter.** Bis 0.1.0 war jede APK mit einem anderen Schlüssel
signiert. Ab dieser Version ist der Schlüssel fest, deshalb die alte App einmalig
deinstallieren und diese APK neu installieren. Das löscht die gespeicherten
Einstellungen und Schaummittel-Eingaben. Danach installieren sich Updates
einfach darüber.
**Update von 0.3.0-alpha.2 oder älter.** Bis dahin war FwAssist ein anderes Paket,
und jede APK war mit einem anderen Schlüssel signiert. Diese APK installiert sich
deshalb neben der alten App. Die alte App einmalig deinstallieren; ihre
Einstellungen und Schaummittel-Eingaben werden nicht übernommen. Danach
installieren sich Updates einfach darüber.
EOF
# `gh release create` could do this too (zizmor's superfluous-actions); swapping a working
# release step is a change of its own, tested on a tag.
Expand Down Expand Up @@ -347,7 +347,7 @@ jobs:
- uses: r0adkll/upload-google-play@e738b9dd8f2476ea806d921b64aacd24f34515a5 # v1.1.5
with:
serviceAccountJson: ${{ steps.auth.outputs.credentials_file_path }}
packageName: de.codeforfire.helfer
packageName: de.codeforfire.fwassist
releaseFiles: play/*.aab
tracks: ${{ steps.track.outputs.track }}
status: draft
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ StrykerOutput/
*.trx
artifacts/

# Signing material. The Google Play upload key lives in ~/.config/helfer/, never in the
# Signing material. The Google Play upload key lives in ~/.config/fwassist/, never in the
# tree — see docs/releasing.md. These patterns are defence in depth, not the mechanism.
*.p12
*.jks
Expand Down
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ each can have its own launcher icon on the phone's home screen.
`<Name>Views.Register(ViewRegistry)`.
3. `CompositionRoot.Modules` and `CompositionRoot.RegisterViews`, and the
project reference in `FwAssist.Composition.csproj`.
4. An `<activity-alias>` named `de.codeforfire.helfer.launcher.<id>` in
4. An `<activity-alias>` named `de.codeforfire.fwassist.launcher.<id>` in
`src/FwAssist.App.Android/AndroidManifest.xml`, with its icon as
`Resources/drawable/ic_helper_<id>.xml`, `ic_helper_<id>_foreground.xml` and
`drawable-anydpi-v26/ic_helper_<id>.xml` (copy the Stoppuhr's three files).
The `helfer` in that name is the applicationId, `de.codeforfire.helfer`,
and it stays although the app is now FwAssist: changing it would turn
every installed copy into a separate app that never receives an update.
The `fwassist` in that name is the applicationId, `de.codeforfire.fwassist`,
and it is permanent: changing it would turn every installed copy into a
separate app that never receives an update.
5. `tests/FwAssist.Helpers.<Name>.Tests/` with a `stryker-config.json`, and the
project in `MUTATE_PROJECTS` (Makefile) and in both lists in
`.github/workflows/mutation.yml`.
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CONFIG ?= Debug
SLN := FwAssist.sln
SLNF := FwAssist.Host.slnf
ANDROID_PROJ := src/FwAssist.App.Android/FwAssist.App.Android.csproj
APP_ID := de.codeforfire.helfer
APP_ID := de.codeforfire.fwassist
FILTER ?=
PROJECT ?=
VERSION ?= 0.1.0
Expand All @@ -27,9 +27,9 @@ ABI ?=

# Google Play upload key. Outside the work tree on purpose — signing material is never
# committed, and $(DOCKER_HOME) is a build cache that gets wiped. See docs/releasing.md.
KEYSTORE ?= $(HOME)/.config/helfer/helfer-upload.p12
KEYSTORE_PASS ?= $(HOME)/.config/helfer/helfer-upload.pass
KEY_ALIAS ?= helfer-upload
KEYSTORE ?= $(HOME)/.config/fwassist/fwassist-upload.p12
KEYSTORE_PASS ?= $(HOME)/.config/fwassist/fwassist-upload.pass
KEY_ALIAS ?= fwassist-upload
# Derived from VERSION by scripts/android-version-code.sh, which the release workflow uses too.
# Set it only to override that; Google Play burns a versionCode permanently on first upload, so
# a number typed by hand is a mistake that cannot be taken back.
Expand All @@ -44,10 +44,10 @@ AVD ?= Medium_Phone_API_35
TABLET_AVD ?= Tablet_API_35
# The same Dockerfile as Lagebuch's, so IMAGE=lagebuch-android-build reuses an image already built.
IMAGE ?= fwassist-android-build
# DOCKER_HOME is the container's /home/build and so holds the debug signing key. It keeps
# the old name, like KEY_ALIAS: the applicationId is still de.codeforfire.helfer, and a new
# path would mean a new debug key that cannot update a debug build already on a device.
DOCKER_HOME ?= $(HOME)/.cache/helfer-android-build
# DOCKER_HOME is the container's /home/build and so holds the debug signing key. Keep the
# path: a new one would mean a new debug key that cannot update a debug build already on a
# device.
DOCKER_HOME ?= $(HOME)/.cache/fwassist-android-build
APK := src/FwAssist.App.Android/bin/$(CONFIG)/net10.0-android/$(APP_ID)-Signed.apk
# `aab` always builds Release, whatever CONFIG says — a debug bundle is not uploadable.
AAB := src/FwAssist.App.Android/bin/Release/net10.0-android/$(APP_ID)-Signed.aab
Expand Down Expand Up @@ -258,7 +258,7 @@ install: apk ## Install the APK on the attached device/emulator
}

run-android: emulator install ## Boot the emulator, install and launch the app
$(ADB) shell am start -n $(APP_ID)/de.codeforfire.helfer.MainActivity
$(ADB) shell am start -n $(APP_ID)/de.codeforfire.fwassist.MainActivity

logcat: ## Follow logcat for the running app
@pid=$$($(ADB) shell pidof -s $(APP_ID) 2>/dev/null | tr -d '\r'); \
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ Die APK für Android 7.0 und neuer liegt bei den
Dateimanager *Installation aus unbekannten Quellen* erlaubt werden. Ein Eintrag
im Play Store ist in Vorbereitung.

Bis Version 0.1.0 war jede APK mit einem anderen Schlüssel signiert. Wer eine
solche Version installiert hat, deinstalliert sie einmalig vor dem nächsten
Update. Das löscht die gespeicherten Einstellungen und Schaummittel-Eingaben.
Danach installieren sich neue Versionen einfach darüber.
Bis Version 0.3.0-alpha.2 war FwAssist ein anderes Paket, und jede APK war mit
einem anderen Schlüssel signiert. Eine solche Version wird nicht aktualisiert:
Die neue App installiert sich daneben. Die alte App einmalig deinstallieren;
ihre Einstellungen und Schaummittel-Eingaben werden nicht übernommen. Danach
installieren sich neue Versionen einfach darüber.

### Downloads prüfen

Expand Down
1 change: 1 addition & 0 deletions changelog.d/+app-id-fwassist.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Android package is now `de.codeforfire.fwassist`, so it matches the app's name before the first Play release; an install of 0.3.0-alpha.2 or older is a different app that stays beside the new one and has to be uninstalled once, without its settings carrying over.
2 changes: 1 addition & 1 deletion changelog.d/+play-upload.changed.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Release APKs are now signed with the fixed Google Play upload key, so each release installs over the previous one; an install of 0.1.0 or older has to be removed once.
Release APKs are now signed with the fixed Google Play upload key, so each release installs over the previous one.
39 changes: 20 additions & 19 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,27 +146,28 @@ stays a person's decision, taken in the Console. The credentials are contained:
reach a single device until someone rolls it out in the Console.

Because the sideload `.apk` is extracted from the same signed bundle, it carries
the upload key's certificate too. Up to v0.1.0 every CI build was signed with a
debug key the runner generated fresh, so each APK had a different certificate
and Android refused to install one over the other. From the first release
signed with the upload key on, a sideloaded install updates in place. The last
debug-signed APK has to be uninstalled once; the release body says so.
the upload key's certificate too. Up to v0.3.0-alpha.2 every CI build was
signed with a debug key the runner generated fresh, so each APK had a different
certificate and Android refused to install one over the other; those builds
were also still the package `de.codeforfire.helfer`. From the first release
signed with the upload key on, a sideloaded install updates in place. An older
install is a different app: the new one installs beside it, and the old one has
to be uninstalled once. The release body says so.

### One-time setup

The upload key is generated once, on a laptop, and never committed
(`.gitignore` carries `*.p12`, `*.jks`, `*.keystore`, `*.pass` as defence in
depth — the mechanism is that it lives outside the tree). Its path and alias
keep the `helfer` name, like the applicationId:
depth — the mechanism is that it lives outside the tree):

```bash
mkdir -p ~/.config/helfer && chmod 700 ~/.config/helfer
mkdir -p ~/.config/fwassist && chmod 700 ~/.config/fwassist
keytool -genkeypair -v \
-keystore ~/.config/helfer/helfer-upload.p12 -storetype PKCS12 \
-alias helfer-upload -keyalg RSA -keysize 4096 -validity 10000 \
-keystore ~/.config/fwassist/fwassist-upload.p12 -storetype PKCS12 \
-alias fwassist-upload -keyalg RSA -keysize 4096 -validity 10000 \
-dname "CN=CodeForFire, O=CodeForFire, C=DE"
printf '%s' '<password>' > ~/.config/helfer/helfer-upload.pass
chmod 600 ~/.config/helfer/helfer-upload.pass
printf '%s' '<password>' > ~/.config/fwassist/fwassist-upload.pass
chmod 600 ~/.config/fwassist/fwassist-upload.pass
```

`-validity 10000` is about 27 years, past Play's 2033 minimum. Use one password
Expand All @@ -180,10 +181,10 @@ project with one maintainer — but recovery is a support round-trip, not a
convenience.

Three things can never be changed after the first upload: the package name
(`de.codeforfire.helfer`), the app signing key, and the account type. **Confirm
the package name is final before that first upload.** It stays `helfer` although
the app is now FwAssist, because it already identifies every sideloaded install
(see `AGENTS.md`, *Helpers*).
(`de.codeforfire.fwassist`), the app signing key, and the account type. The
package name matches the app's name and is final; it replaced
`de.codeforfire.helfer` before anything reached Play, so no Play install carries
the old one.

#### Handing the key and Play access to CI

Expand All @@ -197,10 +198,10 @@ publish the other.
only the tag pattern `v*`.
2. **Keystore secrets** in that Environment, not in the repository:
```bash
base64 -w0 ~/.config/helfer/helfer-upload.p12 \
base64 -w0 ~/.config/fwassist/fwassist-upload.p12 \
| gh secret set ANDROID_UPLOAD_KEYSTORE_B64 --env google-play --repo CodeForFire/FwAssist
gh secret set ANDROID_UPLOAD_KEYSTORE_PASS --env google-play --repo CodeForFire/FwAssist \
< ~/.config/helfer/helfer-upload.pass
< ~/.config/fwassist/fwassist-upload.pass
```
3. **Workload Identity Federation**, in the project that already has the *Google
Play Android Developer API* enabled for Lagebuch:
Expand Down Expand Up @@ -285,7 +286,7 @@ The keystore path, password file and alias are overridable (`KEYSTORE=`,
refuses to run without a keystore and a password file.

Then, in the Play Console: pick the track → *Create new release* → upload
`de.codeforfire.helfer-Signed.aab` → German release notes → roll out. Never
`de.codeforfire.fwassist-Signed.aab` → German release notes → roll out. Never
upload by hand a version the workflow already uploaded: Play refuses the
`versionCode` a second time.

Expand Down
40 changes: 20 additions & 20 deletions src/FwAssist.App.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<!-- singleTask: a helper's own icon brings the running app forward and arrives through
OnNewIntent, instead of stacking a second copy of the app on top of the first. -->
<activity android:name="de.codeforfire.helfer.MainActivity"
<activity android:name="de.codeforfire.fwassist.MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
Expand All @@ -60,12 +60,12 @@
</activity>

<!-- One alias per helper: its own icon on the home screen, opening that helper directly.
The name is de.codeforfire.helfer.launcher.<IHelperModule.Id>; MainActivity reads the
The name is de.codeforfire.fwassist.launcher.<IHelperModule.Id>; MainActivity reads the
helper from it and AndroidLauncherIcons switches it on and off. Renaming one removes
the icon from every home screen it was placed on. LauncherAliasTests keeps this list
and CompositionRoot.Modules in step. -->
<activity-alias android:name="de.codeforfire.helfer.launcher.stoppuhr"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.stoppuhr"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Stoppuhr"
android:icon="@drawable/ic_helper_stoppuhr"
android:exported="true"
Expand All @@ -76,8 +76,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.funkalphabet"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.funkalphabet"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Buchstabieralphabet"
android:icon="@drawable/ic_helper_funkalphabet"
android:exported="true"
Expand All @@ -88,8 +88,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.schaummittel"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.schaummittel"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Schaummittel"
android:icon="@drawable/ic_helper_schaummittel"
android:exported="true"
Expand All @@ -100,8 +100,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.rthlandeplatz"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.rthlandeplatz"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="RTH-Landeplatz"
android:icon="@drawable/ic_helper_rthlandeplatz"
android:exported="true"
Expand All @@ -112,8 +112,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.dekonplatz"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.dekonplatz"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Dekon-Platz"
android:icon="@drawable/ic_helper_dekonplatz"
android:exported="true"
Expand All @@ -124,8 +124,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.hydranten"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.hydranten"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Hydrantenkarte"
android:icon="@drawable/ic_helper_hydranten"
android:exported="true"
Expand All @@ -136,8 +136,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.kennzeichnungen"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.kennzeichnungen"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Kennzeichnungen"
android:icon="@drawable/ic_helper_kennzeichnungen"
android:exported="true"
Expand All @@ -148,8 +148,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.strahlenschutz"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.strahlenschutz"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Strahlenschutz"
android:icon="@drawable/ic_helper_strahlenschutz"
android:exported="true"
Expand All @@ -160,8 +160,8 @@
</intent-filter>
</activity-alias>

<activity-alias android:name="de.codeforfire.helfer.launcher.sandsack"
android:targetActivity="de.codeforfire.helfer.MainActivity"
<activity-alias android:name="de.codeforfire.fwassist.launcher.sandsack"
android:targetActivity="de.codeforfire.fwassist.MainActivity"
android:label="Sandsack"
android:icon="@drawable/ic_helper_sandsack"
android:exported="true"
Expand Down
Loading