Download and install Docker.
- Make sure you have
git
installed - Clone the Github repository
- Checkout the tag that corresponds to the version of your app (e.g., 1.0.0)
git clone https://github.com/admin-ch/CovidCertificate-App-Android.git ~/CovidCertificate-App-Android
cd ~/CovidCertificate-App-Android
git checkout 1.0.0
- Open the app
- Click on the
i
button in the top-right corner - Check the app version in the top right corner
- Check the build timestamp in the bottom right corner, which is the number before the slash (e.g., 1622186583268), and record its value to be used later
- Build a Docker Image with the required Android Tools
- Build the App in the Docker Container while specifying the build timestamp that was recorded earlier (e.g., 1595936711208)
- Copy the freshly-built APK
cd ~/CovidCertificate-App-Android
docker build -t covidcertificate-builder .
docker run --rm -v ~/CovidCertificate-App-Android:/home/covidcertificate -w /home/covidcertificate covidcertificate-builder gradle wallet:assembleProdRelease -PkeystorePassword=securePassword -PkeyAlias=keyAlias -PkeyAliasPassword=securePassword -PkeystoreFile=build.keystore -PbuildTimestamp=1622186583268
cp wallet/build/outputs/apk/prod/release/wallet-prod-release.apk wallet-built.apk
- Make sure you have
adb
installed - Connect your phone to your computer
- Extract the APK from the phone
cd ~/CovidCertificate-App-Android/wallet
adb pull `adb shell pm path ch.admin.bag.covidcertificate.wallet | cut -d':' -f2` wallet-store.apk
If you want to check the version of the APK you are pulling from your device:
adb shell dumpsys package ch.admin.bag.covidcertificate.wallet | grep versionName=| cut -d '=' -f 2
- Make sure you have
python
installed - Use the
apkdiff
script to compare the APKs
cd ~/CovidCertificate-App-Android/wallet
python ../apkdiff.py wallet-built.apk wallet-store.apk
- Open the app
- Click on the
i
button in the top-right corner - Check the app version in the top right corner
- Check the build timestamp in the bottom right corner, which is the number before the slash (e.g., 1622186583268), and record its value to be used later
- Build a Docker Image with the required Android Tools
- Build the App in the Docker Container while specifying the build timestamp that was recorded earlier (e.g., 1595936711208)
- Copy the freshly-built APK
cd ~/CovidCertificate-App-Android
docker build -t covidcertificate-builder .
docker run --rm -v ~/CovidCertificate-App-Android:/home/covidcertificate -w /home/covidcertificate covidcertificate-builder gradle verifier:assembleProdRelease -PkeystorePassword=securePassword -PkeyAlias=keyAlias -PkeyAliasPassword=securePassword -PkeystoreFile=build.keystore -PbuildTimestamp=1622186583268
cp verifier/build/outputs/apk/prod/release/verifier-prod-release.apk verifier-built.apk
- Make sure you have
adb
installed - Connect your phone to your computer
- Extract the APK from the phone
cd ~/CovidCertificate-App-Android/verifier
adb pull `adb shell pm path ch.admin.bag.covidcertificate.verifier | cut -d':' -f2` wallet-store.apk
If you want to check the version of the APK you are pulling from your device:
adb shell dumpsys package ch.admin.bag.covidcertificate.verifier | grep versionName=| cut -d '=' -f 2
- Make sure you have
python
installed - Use the
apkdiff
script to compare the APKs
cd ~/CovidCertificate-App-Android/verifier
python ../apkdiff.py verifier-built.apk verifier-store.apk
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:
./buildAndCompare.sh path/to/store.apk