breadwallet / breadwallet-android

The Android version of the Bread bitcoin wallet.
MIT License
389 stars 424 forks source link

App is not reproducible, many diffs when comparing apks #192

Closed emanuelb closed 3 years ago

emanuelb commented 3 years ago

I Build latest commit for version 4.9.1 https://github.com/breadwallet/breadwallet-android/commit/a6b8add794ced98b2ea77c3dcecaadd7a91dfdd7

git clone --depth 1 https://github.com/breadwallet/breadwallet-android
cd breadwallet-android/

with 2 containers (1 alpine based, 1 debian based):

Containerfile.alpine:

FROM frolvlad/alpine-glibc

RUN set -ex; \
    apk update; \
    apk add --no-cache \
        openjdk8; \
    adduser -D appuser;

USER appuser

COPY --chown=appuser:root . /app/brd/

ENV ANDROID_SDK_ROOT="/app/sdk" \
    ANDROID_HOME="/app/sdk"

WORKDIR /app/brd/

RUN set -ex; \
    mkdir -p "/app/sdk/licenses"; \
    printf "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "/app/sdk/licenses/android-sdk-license"; \
    ./gradlew assembleRelease

Containerfile.debian:

FROM debian:sid-slim

RUN set -ex; \
    mkdir -p /usr/share/man/man1/; \
    apt-get update; \
    apt-get install --yes --no-install-recommends openjdk-11-jdk; \
    rm -rf /var/lib/apt/lists/*; \
    useradd -ms /bin/bash appuser;

USER appuser

ENV ANDROID_HOME=/app/sdk/ \
    ANDROID_SDK_ROOT="/app/sdk"

COPY --chown=appuser:root . /app/brd/

WORKDIR /app/brd/

RUN set -ex; \
    mkdir -p "/app/sdk/licenses"; \
    printf "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "/app/sdk/licenses/android-sdk-license"; \
    ./gradlew assembleRelease

build with:

podman build --rm -t brd_build_apk -f Containerfile.alpine .
podman build --rm -t brd_build_apk -f Containerfile.debian .

Comparing them & to the apk from google-play, result in difference in many files.

see also related issue about this topic: https://github.com/breadwallet/breadwallet-android/issues/117

Giszmo commented 3 years ago

They closed the other issue. I have little hope they will fix it.

As a solution to the concern about projects that fork this one and leave in the api keys, OP left me a message in Twitter I'm not sure he meant the following but the correct approach would probably be to:

  1. Change the applicationId to something generic
  2. Add a non-default branch for BRD releases where the applicationId is changed back to the BRD-ish com.breadwallet
  3. Add the keys on that non-default branch, together with legal threats towards projects that use those API keys. That warning would best fit next to the applicationId.
DrewCarlson commented 3 years ago

Thanks for your interest in the project. As mentioned in the issue you linked, we do not plan to change the production build environment or disable features that improve the user experience. While we do our best to maintain the ability for anyone to build the BRD mobile applications locally, it is intended for personal use and not to replicate production builds. Currently Play Store APKs are produced from a M1 Mac and this is not something the development team can change.