Skip to content

Build is not reproducible (diffs in classes2.dex & png files) #4

Open
@emanuelb

Description

@emanuelb

Building last commit with: ./gradlew assembleRelease; ./gradlew clean; ./gradlew assembleRelease or by building container: podman build --rm -t bitstash_build_apk -f Containerfile.alpine

Containerfile.alpine:

FROM frolvlad/alpine-glibc

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

USER appuser

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

RUN set -ex; \
    mkdir -p "/home/appuser/app/sdk/licenses" "/home/appuser/app/bitstash/"; \
    printf "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "/home/appuser/app/sdk/licenses/android-sdk-license"; \
    cd /home/appuser/app/bitstash/; \
    wget https://github.com/bitstashco/BitStash-Android-Wallet/archive/refs/heads/master.zip; \
    unzip master.zip; \
    rm master.zip;
    
WORKDIR /home/appuser/app/bitstash/BitStash-Android-Wallet-master/
RUN set -ex; \
    (./gradlew assembleRelease || ./gradlew clean); \
    ./gradlew assembleRelease

Comparing the generated apk to one from google-play, result in difference in many files.

  1. many diffs in .png files, probably cause build process optimize the PNG, which should be avoided, see disabling cruncherEnabled at: https://f-droid.org/en/docs/Reproducible_Builds/#png-crushcrunch or maybe other setting like vectorDrawables.useSupportLibrary = true, etc..
  2. classes2.dex files are different

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions