Files
IronFox/scripts/ci-build.sh
celenity 9ee53aa6c0 IronFox v144.0.1
ironfox-oss/IronFox!94
____

## Important

We are currently unable to provide updates to IronFox on **Accrescent**, [due to ongoing client and server issues that Accrescent is facing](https://infosec.exchange/@accrescent/115408303090609483). This impacts **all** apps on Accrescent, and is not just limited to IronFox.

**For the time being, we would highly recommend Accrescent users use our `Nightly` CI builds**. As we now use a separate package ID for these builds, it is possible to install Nightly builds *alongside* your existing, standard install of IronFox. This ensures that you can continue to receive the latest security updates and fixes from us, without losing any existing data. **Once updates resume on Accrescent, you can *(and **should**)* simply switch back to your existing standard install.**

Please see [here](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/docs/FAQ.md#how-can-i-download-nightly-builds) for details on how to install our `Nightly` builds.

## Changes

- [Enabled the display of certain advanced options](bb47aee7e6) at [`about:support`](about:support).
- [Implemented support to block/filter unwanted Remote Settings collections on the Application Services level](33373ec291), similar to [the current Remote Settings Blocker patch](e6c69ef28d/patches/gecko-rs-blocker.patch) *(derived from LibreWolf)* for Gecko. This is necessary due to this Remote Settings instance being separate from Gecko's instance.
- Replaced the `Enable WebGL` settings toggle with a **`Disable WebGL`** toggle that disables WebGL instead, to improve clarity and help avoid confusion.
- Updated to Firefox [`144.0.1`](https://firefox.com/firefox/android/144.0.1/releasenotes/).
- [Other minor tweaks and adjustments](https://gitlab.com/ironfox-oss/IronFox/-/merge_requests/94/diffs).

MR-author: celenity <celenity@celenity.dev>
Co-authored-by: Weblate <hosted@weblate.org>
Co-authored-by: Akash Yadav <itsaky01@gmail.com>
Approved-by: Akash Yadav <itsaky01@gmail.com>
Merged-by: celenity <celenity@celenity.dev>
2025-10-22 19:20:53 +00:00

113 lines
3.3 KiB
Bash
Executable File

#!/bin/bash
## This script is expected to be executed in a CI environment, or possibly in our Docker image instance
## DO NOT execute this manually!
set -eu
set -o pipefail
set -o xtrace
source "$(realpath $(dirname "$0"))/versions.sh"
case "${BUILD_VARIANT}" in
arm)
BUILD_TYPE='apk'
BUILD_ABI='armeabi-v7a'
;;
x86_64)
BUILD_TYPE='apk'
BUILD_ABI='x86_64'
;;
arm64)
BUILD_TYPE='apk'
BUILD_ABI='arm64-v8a'
;;
bundle)
BUILD_TYPE='bundle'
;;
*)
echo "Unknown build variant: '$BUILD_VARIANT'." >&2
exit 1
;;
esac
if [[ "${CI_COMMIT_REF_NAME}" == "${PRODUCTION_BRANCH}" ]]; then
# Set uBO assets to production variant
# shellcheck disable=2183
IRONFOX_UBO_ASSETS_URL="https://gitlab.com/ironfox-oss/assets/-/raw/main/uBlock/assets.${PRODUCTION_BRANCH}.json"
export IRONFOX_UBO_ASSETS_URL
echo "Using uBO Assets: ${IRONFOX_UBO_ASSETS_URL}"
# Target release
export IRONFOX_RELEASE=1
echo "Preparing to build IronFox (Release)..."
fi
# Setup environment variables. See Dockerfile.
source "/opt/env_docker.sh"
# Setup Android SDK
source "scripts/setup-android-sdk.sh"
# Get sources
bash -x ./scripts/get_sources.sh
# Update environment variables for this build
source "scripts/env_local.sh"
# Prepare sources
bash -x ./scripts/prebuild.sh "$BUILD_VARIANT"
# If we're building an APK set, the following environment variables are required
if [[ "$BUILD_TYPE" == "bundle" ]]; then
export MOZ_ANDROID_FAT_AAR_ARM64_V8A="$AAR_ARTIFACTS/geckoview-arm64-v8a.zip"
export MOZ_ANDROID_FAT_AAR_ARMEABI_V7A="$AAR_ARTIFACTS/geckoview-armeabi-v7a.zip"
export MOZ_ANDROID_FAT_AAR_X86_64="$AAR_ARTIFACTS/geckoview-x86_64.zip"
export MOZ_ANDROID_FAT_AAR_ARCHITECTURES="armeabi-v7a,arm64-v8a,x86_64"
fi
# Set the build date to the date of commmit to ensure that the
# MOZ_BUILDID is consistent across CI build jobs
export MOZ_BUILD_DATE="$(date -d "$CI_PIPELINE_CREATED_AT" "+%Y%m%d%H%M%S")"
export IF_BUILD_DATE="$CI_PIPELINE_CREATED_AT"
# Build
bash -x scripts/build.sh "$BUILD_TYPE"
if [[ "$BUILD_TYPE" == "apk" ]]; then
# Create GeckoView AAR archives
pushd "$mozilla_release/obj/gradle"
mkdir -vp geckoview-aar
mv maven geckoview-aar/geckoview
popd
pushd "$mozilla_release/obj/gradle/geckoview-aar"
zip -r -FS "$AAR_ARTIFACTS/geckoview-$BUILD_ABI.zip" *
popd
# Sign APK
APK_IN="$mozilla_release/obj/gradle/build/mobile/android/fenix/app/outputs/apk/fenix/release/app-fenix-$BUILD_ABI-release-unsigned.apk"
APK_OUT="$APK_ARTIFACTS/IronFox-v${IRONFOX_VERSION}-${BUILD_ABI}.apk"
"$ANDROID_HOME/build-tools/$BUILDTOOLS_VERSION/apksigner" sign \
--ks="$KEYSTORE" \
--ks-pass="pass:$KEYSTORE_PASS" \
--ks-key-alias="$KEYSTORE_KEY_ALIAS" \
--key-pass="pass:$KEYSTORE_KEY_PASS" \
--out="$APK_OUT" \
"$APK_IN"
fi
if [[ "$BUILD_TYPE" == "bundle" ]]; then
# Build signed APK set
AAB_IN="$(ls "$mozilla_release"/obj/gradle/build/mobile/android/fenix/app/outputs/bundle/fenixRelease/*.aab)"
APKS_OUT="$APKS_ARTIFACTS/IronFox-v${IRONFOX_VERSION}.apks"
"$builddir"/bundletool build-apks \
--bundle="$AAB_IN" \
--output="$APKS_OUT" \
--ks="$KEYSTORE" \
--ks-pass="pass:$KEYSTORE_PASS" \
--ks-key-alias="$KEYSTORE_KEY_ALIAS" \
--key-pass="pass:$KEYSTORE_KEY_PASS"
fi