summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2022-11-28 16:26:31 +0100
committerAlbin <albin@mullvad.net>2022-11-28 16:36:56 +0100
commit2b03e326d4005531e5ef4f20b655903b14e5bc96 (patch)
treeb6f9ee8e6a9b9adadd1bf555f2d34f38f8bb3126
parent760d987a9422725c71b9154289b768c2ec87e60c (diff)
downloadmullvadvpn-2b03e326d4005531e5ef4f20b655903b14e5bc96.tar.xz
mullvadvpn-2b03e326d4005531e5ef4f20b655903b14e5bc96.zip
Set android build daemon stripping conditionally
The default behavior is to strip, but this can be set using either the environment variable `SKIP_STRIPPING=yes` or by running the build script with the skip stripping flag: `./build-apk.sh --skip-stripping`
-rwxr-xr-xbuild-apk.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/build-apk.sh b/build-apk.sh
index 75b14c7d03..f3484e677b 100755
--- a/build-apk.sh
+++ b/build-apk.sh
@@ -21,6 +21,7 @@ CARGO_ARGS="--release"
EXTRA_WGGO_ARGS=""
BUILD_BUNDLE="no"
CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"target"}
+SKIP_STRIPPING=${SKIP_STRIPPING:-"no"}
while [ ! -z "${1:-""}" ]; do
if [[ "${1:-""}" == "--dev-build" ]]; then
@@ -41,6 +42,8 @@ while [ ! -z "${1:-""}" ]; do
BUILD_BUNDLE="yes"
elif [[ "${1:-""}" == "--no-docker" ]]; then
EXTRA_WGGO_ARGS="--no-docker"
+ elif [[ "${1:-""}" == "--skip-stripping" ]]; then
+ SKIP_STRIPPING="yes"
fi
shift 1
@@ -111,11 +114,10 @@ for ARCHITECTURE in ${ARCHITECTURES:-aarch64 armv7 x86_64 i686}; do
TARGET_LIB_PATH="$SCRIPT_DIR/android/app/build/extraJni/$ABI/libmullvad_jni.so"
UNSTRIPPED_LIB_PATH="$CARGO_TARGET_DIR/$TARGET/$BUILD_TYPE/libmullvad_jni.so"
-
- if [[ "$BUILD_TYPE" != "debug" ]]; then
- $STRIP_TOOL --strip-debug --strip-unneeded -o "$TARGET_LIB_PATH" "$UNSTRIPPED_LIB_PATH"
- else
+ if [[ "$SKIP_STRIPPING" == "yes" ]]; then
cp "$UNSTRIPPED_LIB_PATH" "$TARGET_LIB_PATH"
+ else
+ $STRIP_TOOL --strip-debug --strip-unneeded -o "$TARGET_LIB_PATH" "$UNSTRIPPED_LIB_PATH"
fi
done