Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

with:
name: apk
path: apk/apolloui-prod-release-unsigned.apk
path: apk/apolloui-prod-*-release-unsigned.apk

- name: Upload mapping
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # Matches tag v4.3.3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:

with:
name: apk
path: apk/apolloui-prod-release-unsigned.apk
path: apk/apolloui-prod-*-release-unsigned.apk
6 changes: 6 additions & 0 deletions android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ follow [https://changelog.md/](https://changelog.md/) guidelines.

## [Unreleased]

## [53.4] - 2025-05-29

### CHANGED

- Added multi APK support to bypass 100MB APK size limit.

## [53.3] - 2025-04-08

### FIXED
Expand Down
5 changes: 4 additions & 1 deletion android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ RUN tools/bootstrap-gomobile.sh \

FROM scratch

COPY --from=build /src/android/apolloui/build/outputs/apk/prod/release/apolloui-prod-release-unsigned.apk apolloui-prod-release-unsigned.apk
COPY --from=build /src/android/apolloui/build/outputs/apk/prod/release/apolloui-prod-arm64-v8a-release-unsigned.apk apolloui-prod-arm64-v8a-release-unsigned.apk
COPY --from=build /src/android/apolloui/build/outputs/apk/prod/release/apolloui-prod-armeabi-v7a-release-unsigned.apk apolloui-prod-armeabi-v7a-release-unsigned.apk
COPY --from=build /src/android/apolloui/build/outputs/apk/prod/release/apolloui-prod-x86-release-unsigned.apk apolloui-prod-x86-release-unsigned.apk
COPY --from=build /src/android/apolloui/build/outputs/apk/prod/release/apolloui-prod-x86_64-release-unsigned.apk apolloui-prod-x86_64-release-unsigned.apk
COPY --from=build /src/android/apolloui/build/outputs/mapping/prodRelease/mapping.txt mapping.txt
38 changes: 36 additions & 2 deletions android/apolloui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ android {
applicationId "io.muun.apollo"
minSdk 19
targetSdk 34
versionCode 1303
versionName "53.3"
versionCode 1304
versionName "53.4"

// Needed to make sure these classes are available in the main DEX file for API 19
// See: https://spin.atomicobject.com/2018/07/16/support-kitkat-multidex/
Expand Down Expand Up @@ -146,6 +146,15 @@ android {
shrinkResources true

buildConfigField("boolean", "RELEASE", "true")

splits {
abi {
enable true
reset()
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
universalApk false
}
}
}
}

Expand Down Expand Up @@ -450,6 +459,31 @@ task startStaging(type: Exec, dependsOn: 'assembleStaging') {
commandLine "${rootProject.rootDir}/tools/run-apollo.sh", "staging"
}

android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def baseVersionCode = versionCode as int
def buildVersionSuffix = project.hasProperty('buildSuffix') ? project.buildSuffix : "000"

if (!buildVersionSuffix.matches("\\d{3}")) {
throw new GradleException("buildSuffix must be a number with 3 digits: '$buildVersionSuffix'")
}

def abiVersionCodeMap = ["x86": 2, "x86_64": 3, "armeabi-v7a": 4, "arm64-v8a": 5]
def abi = output.getFilter(com.android.build.OutputFile.ABI)
def abiCode = 0

if (abi != null) {
abiCode = abiVersionCodeMap.get(abi) ?: 0
}

output.versionCodeOverride = (baseVersionCode.toString() + buildVersionSuffix + abiCode.toString()) as int

if (System.getenv("CI")) {
println "ABI: ${abi ?: 'universal'}, Final versionCode: ${output.versionCodeOverride}"
}
}
}

apply plugin: 'com.google.gms.google-services' // Google Services plugin
// We should delete this as soon as we can. google services plugin introduces a dependency strict
// checking that checks against other projects deps too. There's a conflict with
Expand Down
66 changes: 60 additions & 6 deletions tools/verify-apollo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,76 @@ cd $(git rev-parse --show-toplevel)

tmp=$(mktemp -d)

# Ensure temp directory is deleted when script exits
trap 'rm -rf "$tmp"' EXIT

# Prepare paths to extract APKs
mkdir -p "$tmp/to_verify" "$tmp/baseline"

echo "Building the APK from source. This might take a while (10-20 minutes)..."

echo "Building the APKs from source. This might take a while (10-20 minutes)..."
mkdir -p apk
DOCKER_BUILDKIT=1 docker build -f android/Dockerfile -o apk .

unzip -q -d "$tmp/to_verify" "$apk_to_verify"
unzip -q -d "$tmp/baseline" "apk/apolloui-prod-release-unsigned.apk"
# Clean to_verify directory before unzipping
rm -rf "$tmp/to_verify"

# Unzip the APK to verify
mkdir -p "$tmp/to_verify"
unzip -q -o "$apk_to_verify" -d "$tmp/to_verify"

# TODO: verify the signature

# Remove the signature since OSS users won't have Muuns private signing key
rm -r "$tmp"/{to_verify,baseline}/{META-INF,resources.arsc}
rm -r "$tmp"/to_verify/{META-INF,resources.arsc}

# Compare /lib first
lib_dirs_in_verify=($(find "$tmp/to_verify/lib" -mindepth 1 -maxdepth 1 -type d 2>/dev/null || true))

echo "Found lib directory in APK to verify: ${lib_dirs_in_verify[*]}"

if [ ${#lib_dirs_in_verify[@]} -ne 1 ]; then
echo "Unexpected lib directory structure in APK to verify."
exit 3
fi

diff -r "$tmp/to_verify" "$tmp/baseline" && echo "Verification success!" || echo "Verification failed :("
lib_dir_name=$(basename "${lib_dirs_in_verify[0]}")
echo "Using lib architecture: $lib_dir_name"

baseline_apk_dir=""

# Pick baseline based on lib architecture
case "$lib_dir_name" in
arm64-v8a)
baseline_apk_dir="apk/apolloui-prod-arm64-v8a-release-unsigned.apk"
;;
armeabi-v7a)
baseline_apk_dir="apk/apolloui-prod-armeabi-v7a-release-unsigned.apk"
;;
x86)
baseline_apk_dir="apk/apolloui-prod-x86-release-unsigned.apk"
;;
x86_64)
baseline_apk_dir="apk/apolloui-prod-x86_64-release-unsigned.apk"
;;
*)
echo "Unknown architecture: $lib_dir_name"
exit 4
;;
esac

# Clean baseline directory before unzipping
rm -rf "$tmp/baseline"/*

unzip -q -o "$baseline_apk_dir" -d "$tmp/baseline"
rm -r "$tmp"/baseline/{META-INF,resources.arsc}

echo "Comparing files..."

diff_non_lib=$(diff -r "$tmp/to_verify" "$tmp/baseline" || true)

if [ -n "$diff_non_lib" ]; then
echo "Verification failed :("
exit 5
fi

echo "Verification success!"