Skip to content

Instantly share code, notes, and snippets.

Last active October 10, 2021 12:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Mycelium v3.11.0.4 reproducible build

Mycelium v3.11.0.4 repro



  • Digital Ocean Debian 11 x64
# Setup Docker
apt update && 
apt install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update && \
apt install -y \
    docker-ce \
    docker-ce-cli \


git clone
pushd wallet-android
git submodule update --init --recursive
git checkout v3.11.0.4
docker build . --tag mycelium-wallet

# Use disorderfs to eliminate non-determinism caused by file ordering
apt install -y disorderfs
mkdir /tmp/s
disorderfs --sort-dirents=yes --reverse-dirents=no --multi-user=yes $PWD /tmp/s
pushd /tmp/s

# Build Mycelium using Docker
docker run --rm --volume $(pwd):/project --workdir /project -it mycelium-wallet bash
yes | /opt/android-sdk/tools/bin/sdkmanager "build-tools;28.0.3"
./gradlew clean :mbw:assProdRel


Pull APK from phone using macOS

brew install android-platform-tools
export FILENAME=`adb shell dumpsys package com.mycelium.wallet | grep versionName | awk -F "=" '{printf "mycelium-%s.apk\n",$2}'`
adb pull `adb shell pm path com.mycelium.wallet | awk -F ":" '{print $NF}'` $FILENAME
shasum -a 256 $FILENAME
# Copy APK to Digital Ocean disposable VM 
scp $FILENAME root@<digital-ocean-vm-ip-goes-here>:


apt install -y unzip
unzip -d unsigned /tmp/s/mbw/build/outputs/apk/prodnet/release/mbw-prodnet-release.apk
unzip -d signed mycelium-

# If no files except CERT.RSA, CERT.SF and MANIFEST.MF differ then we have a reproducible build
diff -qr signed unsigned | grep -v "META-INF/CERT.RSA\|META-INF/CERT.SF\|META-INF/MANIFEST.MF"

docker run --rm --volume $(pwd)/signed:/signed --workdir /signed -it mycelium-wallet keytool -printcert -file META-INF/CERT.RSA
sha256sum mycelium-


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