Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for release APK reproducibiltiy #7901

Conversation

kl
Copy link
Contributor

@kl kl commented Mar 26, 2025


This change is Reviewable

@kl kl added the Android Issues related to Android label Mar 26, 2025
Copy link

linear bot commented Mar 26, 2025

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions


android/BuildInstructions.md line 270 at r1 (raw file):

## Verifying that an official release is reproducible:

1. Obtain the release APK (2025.2-beta1 or newer) from [GitHub releases](https://github.com/mullvad/mullvadvpn-app/releases) or [releases.mullvad.net](https://releases.mullvad.net/android/)

I suggest we skip this part since it's not something we promote. However we can mention our website instead.

Code quote:

 or [releases.mullvad.net](https://releases.mullvad.net/android/)

android/BuildInstructions.md line 271 at r1 (raw file):

1. Obtain the release APK (2025.2-beta1 or newer) from [GitHub releases](https://github.com/mullvad/mullvadvpn-app/releases) or [releases.mullvad.net](https://releases.mullvad.net/android/)
2. Setup your environment so that you can build a [release build ](#release-build) of the app.

I believe we can use 1. for all list entries and let the markdown parser figure the index out, like we do here:

1. On Windows, build the C++ libraries:

Could be nice to do that for in the rest of the document as well

Code quote:

2.

android/BuildInstructions.md line 272 at r1 (raw file):

1. Obtain the release APK (2025.2-beta1 or newer) from [GitHub releases](https://github.com/mullvad/mullvadvpn-app/releases) or [releases.mullvad.net](https://releases.mullvad.net/android/)
2. Setup your environment so that you can build a [release build ](#release-build) of the app.
3. Make sure you have fetched all tags: `git fetch --tags`

We can skip this fetch step since we can rely on the user/developer following this to figure that out


android/BuildInstructions.md line 274 at r1 (raw file):

3. Make sure you have fetched all tags: `git fetch --tags`
4. Checkout the release tag: `git checkout android/<version>`
5. Build the APK using the containerized script: `../building/containerized-build.sh android`, alternatively build without the container: `./build.sh`. The resuling file is located at `app/build/outputs/apk/ossProd/release/app-oss-prod-release.apk`.

Can we shorten this step a bit? Maybe we can just refer to our build instructions since it's quite likely that they will have to also set up the signing stuff to proceed. For example we can just say: Build a release build using our [build instructions](...).


android/BuildInstructions.md line 275 at r1 (raw file):

4. Checkout the release tag: `git checkout android/<version>`
5. Build the APK using the containerized script: `../building/containerized-build.sh android`, alternatively build without the container: `./build.sh`. The resuling file is located at `app/build/outputs/apk/ossProd/release/app-oss-prod-release.apk`.
6. Delete the signatures from the two APKs by running `zip -d app-oss-prod-release.apk "META-INF/*"` and `new zip -d MullvadVPN-<version>.apk "META-INF/*"`

typo: remove "new"?

Code quote:

 and `new zip

4. Compare the checksums of the two APKs: `md5sum fdroid-container.apk app/build/outputs/apk/ossProd/fdroid/app-oss-prod-fdroid-unsigned.apk`
4. Compare the checksums of the two APKs: `sha256sum fdroid-container.apk app/build/outputs/apk/ossProd/fdroid/app-oss-prod-fdroid-unsigned.apk`

## Verifying that an official release is reproducible:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking but other headings do not end with : .

Suggested change
## Verifying that an official release is reproducible:
## Verifying that an official release is reproducible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 270 to 276
1. Obtain the release APK (2025.2-beta1 or newer) from [GitHub releases](https://github.com/mullvad/mullvadvpn-app/releases) or [releases.mullvad.net](https://releases.mullvad.net/android/)
2. Setup your environment so that you can build a [release build ](#release-build) of the app.
3. Make sure you have fetched all tags: `git fetch --tags`
4. Checkout the release tag: `git checkout android/<version>`
5. Build the APK using the containerized script: `../building/containerized-build.sh android`, alternatively build without the container: `./build.sh`. The resuling file is located at `app/build/outputs/apk/ossProd/release/app-oss-prod-release.apk`.
6. Delete the signatures from the two APKs by running `zip -d app-oss-prod-release.apk "META-INF/*"` and `new zip -d MullvadVPN-<version>.apk "META-INF/*"`
7. Compare the checksums of the two APKs: `sha256sum app-oss-prod-release.apk MullvadVPN-<version>.apk`. If the checksums are equal the build is reproducible.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. Obtain the release APK (2025.2-beta1 or newer) from [GitHub releases](https://github.com/mullvad/mullvadvpn-app/releases) or [releases.mullvad.net](https://releases.mullvad.net/android/)
2. Setup your environment so that you can build a [release build ](#release-build) of the app.
3. Make sure you have fetched all tags: `git fetch --tags`
4. Checkout the release tag: `git checkout android/<version>`
5. Build the APK using the containerized script: `../building/containerized-build.sh android`, alternatively build without the container: `./build.sh`. The resuling file is located at `app/build/outputs/apk/ossProd/release/app-oss-prod-release.apk`.
6. Delete the signatures from the two APKs by running `zip -d app-oss-prod-release.apk "META-INF/*"` and `new zip -d MullvadVPN-<version>.apk "META-INF/*"`
7. Compare the checksums of the two APKs: `sha256sum app-oss-prod-release.apk MullvadVPN-<version>.apk`. If the checksums are equal the build is reproducible.
1. Obtain the release APK (`2025.2-beta1` or newer) from [GitHub releases](https://github.com/mullvad/mullvadvpn-app/releases) or [releases.mullvad.net](https://releases.mullvad.net/android/)
2. Set up your environment so that you can build a [release build ](#release-build) of the app.
3. Make sure you have fetched all tags: `git fetch --tags`
4. Checkout the release tag: `git checkout android/<version>`
5. Build the APK using the containerized script: `../building/containerized-build.sh android`, alternatively build without the container: `./build.sh`. The resuling file is located at `app/build/outputs/apk/ossProd/release/app-oss-prod-release.apk`.
6. Delete the signatures from the two APKs by running `zip -d app-oss-prod-release.apk "META-INF/*"` and `new zip -d MullvadVPN-<version>.apk "META-INF/*"`
7. Compare the checksums of the two APKs: `sha256sum app-oss-prod-release.apk MullvadVPN-<version>.apk`. If the checksums are equal the build is reproducible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


### Troubleshooting reproducibility

If two APKs built from the same commit have different checksums the build is not reproducible. This could be because of either:

1. A build dependency on the local system has the wrong version.
2. There is a bug that breaks the build reproducibility.
3. The APK built is a version prior to 2025.2-beta1, which is the first version that supports reproducible builds.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
3. The APK built is a version prior to 2025.2-beta1, which is the first version that supports reproducible builds.
3. The APK built is a version prior to `2025.2-beta1`, which is the first version that supports reproducible builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@kl kl force-pushed the document-how-to-verify-that-a-release-apk-is-reproducible-droid-1847 branch from b8d0731 to d3b8482 Compare March 26, 2025 16:49
Copy link
Contributor Author

@kl kl left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @albin-mullvad and @MrChocolatine)


android/BuildInstructions.md line 270 at r1 (raw file):

Previously, albin-mullvad wrote…

I suggest we skip this part since it's not something we promote. However we can mention our website instead.

Done.


android/BuildInstructions.md line 271 at r1 (raw file):

Previously, albin-mullvad wrote…

I believe we can use 1. for all list entries and let the markdown parser figure the index out, like we do here:

1. On Windows, build the C++ libraries:

Could be nice to do that for in the rest of the document as well

The more you know! Fixed

4. Compare the checksums of the two APKs: `md5sum fdroid-container.apk app/build/outputs/apk/ossProd/fdroid/app-oss-prod-fdroid-unsigned.apk`
4. Compare the checksums of the two APKs: `sha256sum fdroid-container.apk app/build/outputs/apk/ossProd/fdroid/app-oss-prod-fdroid-unsigned.apk`

## Verifying that an official release is reproducible:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 270 to 276
1. Obtain the release APK (2025.2-beta1 or newer) from [GitHub releases](https://github.com/mullvad/mullvadvpn-app/releases) or [releases.mullvad.net](https://releases.mullvad.net/android/)
2. Setup your environment so that you can build a [release build ](#release-build) of the app.
3. Make sure you have fetched all tags: `git fetch --tags`
4. Checkout the release tag: `git checkout android/<version>`
5. Build the APK using the containerized script: `../building/containerized-build.sh android`, alternatively build without the container: `./build.sh`. The resuling file is located at `app/build/outputs/apk/ossProd/release/app-oss-prod-release.apk`.
6. Delete the signatures from the two APKs by running `zip -d app-oss-prod-release.apk "META-INF/*"` and `new zip -d MullvadVPN-<version>.apk "META-INF/*"`
7. Compare the checksums of the two APKs: `sha256sum app-oss-prod-release.apk MullvadVPN-<version>.apk`. If the checksums are equal the build is reproducible.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


### Troubleshooting reproducibility

If two APKs built from the same commit have different checksums the build is not reproducible. This could be because of either:

1. A build dependency on the local system has the wrong version.
2. There is a bug that breaks the build reproducibility.
3. The APK built is a version prior to 2025.2-beta1, which is the first version that supports reproducible builds.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @MrChocolatine)

Copy link
Contributor

@Pururun Pururun left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @MrChocolatine)

@albin-mullvad albin-mullvad force-pushed the document-how-to-verify-that-a-release-apk-is-reproducible-droid-1847 branch from d3b8482 to 216e599 Compare March 27, 2025 08:04
@albin-mullvad albin-mullvad merged commit 2f92582 into main Mar 27, 2025
16 of 17 checks passed
@albin-mullvad albin-mullvad deleted the document-how-to-verify-that-a-release-apk-is-reproducible-droid-1847 branch March 27, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants