ProtonWallet / flutter-app

Proton Wallet application
GNU General Public License v3.0
36 stars 6 forks source link

Please Provide Build Instructions + Dockerfile #4

Open xrviv opened 3 months ago

xrviv commented 3 months ago

Greetings team @ProtonWallet!

Hi! I'm Danny and I work with walletscrutiny.com. We verify the reproducibility of Bitcoin apps and devices. We have scrutinized over 6000+ bitcoin-related apps and devices.

I am trying to build from the command line using this Dockerfile, but always wound up with some errors:

# Use an Ubuntu 22.04 image as a parent image
FROM ubuntu:22.04

# Set environment variables for non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary tools and dependencies
RUN apt-get update && apt-get install -y \
    curl \
    unzip \
    git \
    make \
    openjdk-17-jdk \
    wget \
    zip \
    lib32stdc++6 \
    lib32z1 \
    lib32z1-dev \
    libssl-dev \
    build-essential \
    pkg-config \
    ca-certificates \
    clang \
    cmake \
    ninja-build \
    libclang-dev \
    libcurl4-openssl-dev \
    libz-dev \
    libx11-dev \
    libxcb1-dev \
    libx11-xcb-dev \
    libxrender-dev \
    libxrandr-dev \
    libxi-dev \
    libgl1-mesa-dev \
    && rm -rf /var/lib/apt/lists/*

# Install Flutter
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}"

# Enable flutter web and other setup
RUN flutter config --enable-web && \
    flutter doctor -v

# Accept Android SDK licenses
RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && \
    wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip -O cmdline-tools.zip && \
    unzip cmdline-tools.zip -d /opt/android-sdk/cmdline-tools && \
    rm cmdline-tools.zip && \
    mv /opt/android-sdk/cmdline-tools/cmdline-tools /opt/android-sdk/cmdline-tools/tools && \
    yes | /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager --sdk_root=/opt/android-sdk --licenses

# Install Android SDK components
RUN /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager --sdk_root=/opt/android-sdk \
    "platform-tools" \
    "platforms;android-33" \
    "build-tools;33.0.0" \
    "ndk;25.1.8937393"

ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=${ANDROID_HOME}/cmdline-tools/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}

# Install Rust and Cargo
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Update Rust to the latest stable version
RUN rustup update stable

# Install Rust targets for Android
RUN rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

# Verify Rust and Cargo installation
RUN rustc --version && cargo --version

# Set the working directory
WORKDIR /workspace

# Clone Proton Wallet repository
ARG REPO=https://github.com/ProtonWallet/flutter-app.git
ARG TAG=v1.0.0+66
RUN git clone --branch $TAG $REPO /workspace

# Get Flutter dependencies
RUN flutter pub get

# Expose the terminal for interactive debugging
CMD ["/bin/bash"]

From there I run $ docker build -t proton-build .

Then run:

docker run --rm -it proton-build

Inside the workspace directory I move to ./rust to find the cargo.toml file. I then try to run:

cargo build --target aarch64-linux-android --release --verbose

which results in:

error: failed to parse manifest at `/workspace/rust/Cargo.toml`

Caused by:
  registry index was not found in any configuration: `proton_internal`

From my understanding, this seems to be an internal registry that is causing the build to fail.

Request to provide Dockerfile to build the app

  1. My first request is for the provision for explicit build instructions done via the terminal, and related to this:
  2. The provision of an official Dockerfile that could build the app from source.

We would appreciate it!

geekley commented 11 hours ago

Yes, please do. If reproducibility is already important to achieve in the other apps, like Mail, VPN, etc, let alone in a wallet app, where it's 10x more crucial! Open-source (specially in this type of software) without independently verifiable reproducibility is just not trustworthy and almost as bad as closed source, if I can be blunt.

I'm aware this is still in early access; I'm just commenting to ask to please make it a priority from the get go, instead of prioritizing features and whatnot. And it's important to publish on F-Droid too (not so much for the user base itself, but mainly because it can count as a proof of reproducibility).


Also, @xrviv I believe both "issue" links in https://walletscrutiny.com/android/me.proton.wallet.android/ are pointing to a different wallet app instead of here?