Note: reproducible builds work starting version 1.0.3
Download and install Docker.
- Open the SwissCovid app
- Click on the
i
button in the top-right corner - Check the app version in the top right corner, which is the text between 'Version' and the comma (e.g., 1.0.8), and record its value to be used later
- Check the build timestamp in the bottom right corner, which is the number before the slash (e.g., 1591722151141), and record its value to be used later
- Make sure you have
git
installed - Clone the Github repository
- Checkout the Tag that corresponds to the version of your SwissCovid app (e.g., 1.0.8)
git clone https://github.com/DP-3T/dp3t-app-android-ch.git ~/dp3t-app-android-ch
cd ~/dp3t-app-android-ch
git checkout 1.0.8
- 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 ~/dp3t-app-android-ch
docker build -t swisscovid-builder .
docker run --rm -v ~/dp3t-app-android-ch:/home/swisscovid -w /home/swisscovid swisscovid-builder gradle assembleProdRelease -PkeystorePassword=securePassword -PkeyAliasPassword=securePassword -PkeystoreFile=build.keystore -PbuildTimestamp=1595936711208
cp app/build/outputs/apk/prod/release/app-prod-release.apk swisscovid-built.apk
- Make sure you have
adb
installed - Connect your phone to your computer
- Extract the APK from the phone
cd ~/dp3t-app-android-ch
adb pull `adb shell pm path ch.admin.bag.dp3t | cut -d':' -f2` swisscovid-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.dp3t | grep versionName=| cut -d '=' -f 2
- Make sure you have
python
installed - Use the
apkdiff
script to compare the APKs
cd ~/dp3t-app-android-ch
python apkdiff.py swisscovid-built.apk swisscovid-store.apk