Skip to content

Commit

Permalink
updated docker file and sign_android.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorPopelyaev committed Apr 14, 2022
1 parent d5e13aa commit 822e5a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This dockerfile is based on Bitrise but with a lot of extra cruft we don't need removed
FROM ubuntu:focal
MAINTAINER Parity Technologies <admin@parity.io>
LABEL maintainer="Parity Technologies <admin@parity.io>"

ENV ANDROID_SDK_ROOT /opt/android-sdk-linux
ENV ANDROID_HOME /opt/android-sdk-linux
Expand All @@ -14,7 +14,7 @@ RUN apt-get -y update && apt-get -y install default-jdk wget unzip curl clang
# NDK setup is taken from https://github.com/bitrise-io/android-ndk/blob/master/Dockerfile

RUN cd /opt \
&& wget -q https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip -O android-commandline-tools.zip \
&& wget -q https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip -O android-commandline-tools.zip \
&& mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& unzip -q android-commandline-tools.zip -d /tmp/ \
&& mv /tmp/cmdline-tools/ ${ANDROID_SDK_ROOT}/cmdline-tools/latest \
Expand All @@ -25,6 +25,7 @@ ENV PATH ${PATH}:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/cmdline-
RUN yes | sdkmanager --licenses
# We need at least one set of build-tools installed for apksigner
RUN yes | sdkmanager "build-tools;30.0.3"
RUN echo "y" | sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}

RUN mkdir /opt/android-ndk-tmp && \
cd /opt/android-ndk-tmp && \
Expand All @@ -49,6 +50,8 @@ ENV PATH=/usr/local/cargo/bin:$PATH
WORKDIR /build

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# install additional rust targets
RUN rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android

COPY scripts /tmp/scripts/
RUN bash /tmp/scripts/init.sh
Expand Down
6 changes: 3 additions & 3 deletions scripts/sign_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
set -e

keystore="$(readlink -f "$1")"
keypass="$2"
version="$2"

# Get latest android-sdk-linux version for apksigner path
ANDROID_BUILD_TOOLS_PATH=$(find /opt/android-sdk-linux/build-tools/ -maxdepth 1 -type d | sort -V | tail -n 1)

pushd "$(dirname "${0}")"/../android
echo "[+] Signing bundle"
"$ANDROID_BUILD_TOOLS_PATH/apksigner" sign --ks "$keystore" --ks-pass "pass:$keypass" app/build/outputs/apk/release/app-release-unsigned.apk
cp app/build/outputs/apk/release/app-release-unsigned.apk ../signer-ci-build.apk
"$ANDROID_BUILD_TOOLS_PATH/apksigner" sign --ks "$keystore" ../android/app/build/outputs/apk/release/app-release-unsigned.apk
cp ../android/app/build/outputs/apk/release/app-release-unsigned.apk ../signer-"$version"-build.apk
popd

0 comments on commit 822e5a0

Please sign in to comment.