Skip to content

build(security): pin release verification - #6546

Open
SeniorZhai wants to merge 2 commits into
masterfrom
fix/release-verification
Open

build(security): pin release verification#6546
SeniorZhai wants to merge 2 commits into
masterfrom
fix/release-verification

Conversation

@SeniorZhai

@SeniorZhai SeniorZhai commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Pin the Bugsnag Gradle plugin, Android build container, and Bundletool release.
  • Build the Google Play app bundle and generate the device-specific base and ABI split APKs.
  • Verify the signing certificate and non-signature contents of every installed APK.
  • Fail closed when the installed and generated APK sets or their contents differ.

Why

Google Play generates device-specific split APKs from the uploaded app bundle.
Comparing only the installed base.apk with a standalone release APK does not
represent the artifact delivered to users. The previous verification also
relied on mutable tooling and excluded more metadata than the signing process
requires.

Impact

There is no runtime app behavior change. The verification workflow now checks
the same base and ABI split layout used by Google Play and requires
EXPECTED_CERT_SHA256 before running.

Validation

  • bash -n verify-mixin-apk.sh
  • Verified the pinned Bundletool release digest against the published asset.
  • Exercised a base plus ABI split APK set with different signing metadata.
  • Confirmed non-signature META-INF differences fail verification.
  • ./gradlew help --task :app:bundleGooglePlayRelease --no-daemon
  • Generated app-googlePlay-release.aab locally; the later Crashlytics mapping
    upload stopped on an external TLS handshake.

- Pin build tooling and the Android container image to immutable versions.
- Verify trusted signing identity and compare complete release APK contents.
Copilot AI review requested due to automatic review settings July 30, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Strengthens release APK verification and build reproducibility.

Changes:

  • Pins build tooling to immutable versions.
  • Adds signing-certificate validation.
  • Makes APK-content mismatches fail closed.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.

File Description
verify-mixin-apk.sh Tightens certificate and APK-content verification.
build.gradle.kts Pins the Bugsnag plugin version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread verify-mixin-apk.sh Outdated
Comment on lines +43 to +46
docker run --rm \
-v $(pwd):/project \
-v $(pwd)/output-apk:/home/gradle/app/build/outputs/apk/release \
mingc/android-build-box bash -c 'cd /project; ./gradlew :app:assembleRelease'
-v "$repo_root":/project \
mingc/android-build-box@sha256:de4a27cbc13a22563f82e93fde01c7366a5cda2c8ff113353d3e24e75c9ae8b6 \
bash -c 'cd /project; ./gradlew :app:assembleGooglePlayRelease'
Comment thread verify-mixin-apk.sh Outdated

# Remove the signature since OSS users won't have Mixin private signing key
rm -r "$tmp"/{to_verify,baseline}/{META-INF,resources.arsc}
rm -rf "$tmp/to_verify/META-INF" "$tmp/baseline/META-INF"
Comment thread verify-mixin-apk.sh Outdated

adb pull $(adb shell pm path one.mixin.messenger | grep "/base.apk" | sed 's/^package://') mixin-store.apk
wait
device_apk=$(adb shell pm path one.mixin.messenger | sed -n 's/^package:\\(.*\\/base\\.apk\\)$/\\1/p' | tr -d '\r' | head -1)
@SeniorZhai SeniorZhai added the testing Now testing, but you can review label Jul 30, 2026
Build device-specific APKs from the release bundle so verification
matches Google Play delivery. Preserve non-signature metadata and
fail closed when any installed split differs.
Copilot AI review requested due to automatic review settings July 30, 2026 07:10
@SeniorZhai
SeniorZhai marked this pull request as ready for review July 30, 2026 07:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

verify-mixin-apk.sh:24

  • sort -V is a GNU extension and is unsupported by the BSD sort shipped with macOS. With set -euo pipefail, the script exits here before verification on a standard macOS Android development environment, even when Build Tools are correctly installed. Please select the newest Build Tools version using a portable method (or document and check for GNU coreutils).
  apksigner_bin=$(find "${ANDROID_HOME:?ANDROID_HOME is required}/build-tools" -type f -name apksigner | sort -V | tail -1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Now testing, but you can review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants