Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
Repro script: check argc at the start
Browse files Browse the repository at this point in the history
  • Loading branch information
goebelUB committed Aug 8, 2021
1 parent 380d4ac commit 840d6b3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
13 changes: 7 additions & 6 deletions REPRODUCIBLE_BUILDS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@

# Reproducible Builds

## Install Docker

Download and install [Docker](https://www.docker.com/).

## Download the App open-source code
## Download the app's source code

1. Make sure you have `git` installed
2. Clone the Github repository
3. Checkout the Tag that corresponds to the version of your app (e.g., 1.0.0)
3. Checkout the tag that corresponds to the version of your app (e.g., 1.0.0)

```shell
git clone https://github.com/admin-ch/CovidCertificate-App-Android.git ~/CovidCertificate-App-Android
Expand Down Expand Up @@ -118,7 +117,9 @@ python ../apkdiff.py verifier-built.apk verifier-store.apk

## Building and checking with script

As an alternative you can also start the build and comparison process with the buildAndCompare.sh script. The script will ask you for the relevant input:
As an alternative you can also run the build and comparison process with the buildAndCompare.sh script.
The script expects the path to the APK to compare with and will ask you for all other inputs:

```shell
./buildAndCompare.sh path/to/store/apk
```
./buildAndCompare.sh path/to/store.apk
```
26 changes: 15 additions & 11 deletions buildAndCompare.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
#!/bin/bash
set -e

echo "Which app would you like to build (type 'wallet' or 'verifier')?"
if [[ $# -ne 1 ]]; then
echo "Pass the path/to/store.apk as an argument!"
exit 1
fi

echo "Which app would you like to build ('wallet' or 'verifier')?"
read appName

echo Please enter KeystoreFile name:
echo "Please enter the keystore filename:"
read keystoreFile

echo Please enter Keystore Password:
echo "Please enter the keystore password:"
read -s keystorePassword

echo Please enter KeyAlias:
echo "Please enter the keyAlias:"
read keyAlias

echo Please enter KeyAlias Password:
echo "Please enter the keyAlias password:"
read -s keyAliasPassword

echo Please enter Build Timestamp:
echo "Please enter the build timestamp:"
read buildTimestamp

#make sure we have a full clean build
# Make sure we have a full clean build
rm -rf $appName/build
rm -rf .gradle

echo "Building apk from source..."
docker build -t covidcertificate-builder .
currentPath=`pwd`
docker run --rm -v $currentPath:/home/covidcertificate -w /home/covidcertificate covidcertificate-builder gradle $appName:assembleProdRelease -PkeystorePassword=$keystorePassword -PkeyAlias=$keyAlias -PkeyAliasPassword=$keyAliasPassword -PkeystoreFile=$keystoreFile -PbuildTimestamp=$buildTimestamp

cp $appName/build/outputs/apk/prod/release/$appName-prod-release.apk $appName-built.apk

if [[ $# -eq 1 ]] ; then
echo Comparing the built APK with the reference:
python apkdiff.py $appName-built.apk $1
fi
echo "Comparing the APK built from source with the reference APK..."
python apkdiff.py $appName-built.apk $1

0 comments on commit 840d6b3

Please sign in to comment.