on main help sign in
Sign the APK with the test key unless signing secrets are set

The APK job pointed Gradle at TMessagesProj/config/release.keystore, which is Forkgram's own key with secret passwords, so packaging failed after the full native build. Without secrets the job now leaves RELEASE_KEYSTORE_FILE unset, and Forkgram's build signs with its public test key. With the optional MULTIGRAM_KEYSTORE_BASE64, MULTIGRAM_KEYSTORE_PASSWORD, MULTIGRAM_KEY_ALIAS and MULTIGRAM_KEY_PASSWORD secrets it signs with the owner's key, decoded outside the repository. README updated to match. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mVy1fu8zBn38wHgJqmLNz

commite7f86ba4d3d76938e4098d3f0356a65c4ccf68e8 authorClaude <noreply@anthropic.com> dateSun 27 Sep 2026, 08:31 (2 weeks ago) parent6ed4fa7
2 files changed+26−6
.github/workflows/build.yml+20−2 README.md+6−4
.github/workflows/build.yml+20−2
@@ -90,6 +90,10 @@ jobs:
9090 env:
9191 APP_ID: ${{ secrets.MULTIGRAM_APP_ID }}
9292 APP_HASH: ${{ secrets.MULTIGRAM_APP_HASH }}
93+ KEYSTORE_BASE64: ${{ secrets.MULTIGRAM_KEYSTORE_BASE64 }}
94+ KEYSTORE_PASSWORD: ${{ secrets.MULTIGRAM_KEYSTORE_PASSWORD }}
95+ KEY_ALIAS: ${{ secrets.MULTIGRAM_KEY_ALIAS }}
96+ KEY_PASSWORD: ${{ secrets.MULTIGRAM_KEY_PASSWORD }}
9397 run: |
9498 vars=gradle.properties
9599 echo "org.gradle.workers.max=1" >> $vars
@@ -99,11 +103,25 @@ jobs:
99103 echo "org.gradle.parallel=false" >> $vars
100104 [ -n "$APP_ID" ] && echo "APP_ID=$APP_ID" >> $vars
101105 [ -n "$APP_HASH" ] && echo "APP_HASH=$APP_HASH" >> $vars
102− echo "RELEASE_KEYSTORE_FILE=$PWD/TMessagesProj/config/release.keystore" >> $vars
106+ signing=()
107+ if [ -n "$KEYSTORE_BASE64" ]; then
108+ # Your own release key, from the MULTIGRAM_KEYSTORE_* secrets; it never touches the repository.
109+ echo "$KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/release.keystore"
110+ signing=(
111+ "-PRELEASE_KEYSTORE_FILE=$RUNNER_TEMP/release.keystore"
112+ "-PRELEASE_STORE_PASSWORD=$KEYSTORE_PASSWORD"
113+ "-PRELEASE_KEY_ALIAS=$KEY_ALIAS"
114+ "-PRELEASE_KEY_PASSWORD=${KEY_PASSWORD:-$KEYSTORE_PASSWORD}"
115+ )
116+ else
117+ # Without RELEASE_KEYSTORE_FILE the build signs with the public test key in
118+ # TMessagesProj/config/test.keystore: fine for testing, not for an APK you give out.
119+ echo "::warning::No MULTIGRAM_KEYSTORE_BASE64 secret: the APK is signed with the public test key."
120+ fi
103121 sudo apt update
104122 sudo apt -y install ninja-build meson nasm gperf pkg-config unzip
105123 rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
106− ./gradlew :TMessagesProj_App:assembleAfatRelease
124+ ./gradlew "${signing[@]}" :TMessagesProj_App:assembleAfatRelease
107125 - uses: actions/upload-artifact@v4
108126 with:
109127 name: multigram-apk
README.md+6−4
@@ -23,10 +23,12 @@ Set these in **Settings > Secrets and variables > Actions**:
2323
2424- `MULTIGRAM_APP_ID` and `MULTIGRAM_APP_HASH`: your own API id and hash from
2525 https://my.telegram.org (API development tools). Without them the APK cannot log in.
26−- Signing: the APK job signs with `TMessagesProj/config/release.keystore` from the tree, whose
27− passwords are public, so anyone could sign an "update" for it. That is fine for testing. For
28− an APK you give to people, sign with your own key and keep it out of the repository (see
29− "Signing and updates" in `multigram/rebrand/README.md`); the workflow has no keystore secret yet.
26+- Signing (optional): `MULTIGRAM_KEYSTORE_BASE64` (your release keystore, `base64 -w0 release.keystore`),
27+ `MULTIGRAM_KEYSTORE_PASSWORD`, `MULTIGRAM_KEY_ALIAS` and `MULTIGRAM_KEY_PASSWORD` (if it differs
28+ from the store password). Without them the APK is signed with Forkgram's public test key
29+ (`TMessagesProj/config/test.keystore`), which is fine for testing but lets anyone sign an
30+ "update" for it. Keep the same key for every build you give out, or phones can't update. The
31+ rebrand toolkit can make a key for you (see "Signing and updates" in `multigram/rebrand/README.md`).
3032
3133## How the sync works
3234