Skip to content

Instantly share code, notes, and snippets.

@eriknylund
Last active October 26, 2021 19:57
Show Gist options
  • Save eriknylund/0b5e07a044684b12b555209483007436 to your computer and use it in GitHub Desktop.
Save eriknylund/0b5e07a044684b12b555209483007436 to your computer and use it in GitHub Desktop.
Simple Bitcoin Wallet 2.2.16

SBW: Simple Bitcoin Wallet 2.2.16 repro

Instructions

Setup

  • Digital Ocean Debian 11 x64

Build

As root

set -ex
mkdir -p /usr/share/man/man1/ /app/
useradd -ms /bin/bash appuser
chown appuser /app/
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install --yes -o APT::Install-Suggests=false --no-install-recommends openjdk-11-jdk git wget unzip

As appuser

su appuser

export ANDROID_SDK_ROOT="/app/sdk"
export ANDROID_HOME="/app/sdk"
export ANDROID_NDK_HOME="/app/sdk/ndk/22.1.7171670/"
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"

set -ex
mkdir -p "/app/sdk/licenses" "/app/sdk/ndk" "/app/simplebitcoinwallet/"
printf "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "/app/sdk/licenses/android-sdk-license"
pushd /app/sdk/
wget https://dl.google.com/android/repository/android-ndk-r22b-linux-x86_64.zip
unzip android-ndk-r22b-linux-x86_64.zip
mv android-ndk-r22b "/app/sdk/ndk/22.1.7171670/"

pushd /app/simplebitcoinwallet
git clone https://github.com/btcontract/wallet
pushd wallet
git checkout 2.2.16
pushd app/src/main/assets/
wget https://github.com/btcontract/wallet/releases/download/2.2.16/graph.snapshot-mainnet.zlib
sha256sum graph.snapshot-mainnet.zlib

popd
./gradlew assembleRelease
popd

Verify

wget https://github.com/btcontract/wallet/releases/download/2.2.16/SBW-2.2.16.apk
unzip -d signed SBW-2.2.16.apk
unzip -d unsigned wallet/app/build/outputs/apk/release/SBW-2.2.16.apk

# If no files except BITCOINS.RSA, BITCOINS.SF and MANIFEST.MF differ then we have a reproducible build
diff -qr signed unsigned

keytool -printcert -file signed/META-INF/BITCOINS.RSA
sha256sum SBW-2.2.16.apk

Video

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