Separate architectures into separate APKs

Hi F-Droid team,

This is a question regarding app com.bringyour.network:

If we want to publish separate APKs, one per architecture, what naming convention do we follow? We’d still like to publish a single fat APK, but then offer separated APKs that are signed with the same key.

Brien

1 Like

you can offer per arch apk yes, make sure that each has a different version code, eg: for version code 123 you’d have armv7 with 12301, arm64 with 12302, x86 with 12303 and x86_64 with 12304

Using separate version codes would be a bit complex for us at the moment.

Thats like one gradle block away, like https://codeberg.org/iNPUTmice/Conversations/src/branch/master/build.gradle#L252-L261

Got it, thanks. We can use that approach.

For the fat/universal APK, for signature verification, does the name in our release need to change to match the output artifact? It appears that the output includes “-universal”?

What do we need to do with our F-Droid config to hook in the split APKs?

We now have these output APKs:

com.bringyour.network-2025.5.2-outerwerld-61410743-github-x86_64-release.apk
com.bringyour.network-2025.5.2-outerwerld-61410743-github-armeabi-v7a-release.apk
com.bringyour.network-2025.5.2-outerwerld-61410743-github-universal-release.apk

you’ll add build blocks for each arch that builds that arch and has output: blahblah/com.bringyour.network-*-x86_64-release.apk

but why only armv7 and x86_64? you’ll have arm64 too? x86?

Why don’t F-Droid support split apks ?
What are the challenges that is preventing F-Droid from supporting it ?

I just explained that it supports that and how to setup it in the recipe.

What did you ask?

F-Droid dosen’t want to leak your device locale. Which split apks would.

We have a Binaries: https://github.com/urnetwork/build/releases/download/v%v-%c/com.bringyour.network-%v-%c-github-release.apk for reproducible builds. How do we parameterize this for ABI?

that’s about something else

com.bringyour.network-%v-%c-armv7-github-release.apk

com.bringyour.network-%v-%c-arm64-github-release.apk

It’s still not clear. Does the Binaries: section accept a list?

you can always look at fdroiddata/metadata :slight_smile:

https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/dev.imranr.obtainium.fdroid.yml#L6430-L6575

ref: Build Metadata Reference | F-Droid - Free and Open Source Android App Repository search for binary: (will fix docs link asap)

random example:

Builds:
  - versionName: 1.1.50
    versionCode: 23071
...
    output: build/app/outputs/flutter-apk/app-x86_64-fdroid-release.apk
    binary: https://github.com/ImranR98/Obtainium/releases/download/v%v/app-x86_64-fdroid-release.apk
    build:
      - .flutter/bin/flutter build apk --release --split-per-abi --target-platform="android-x64"

  - versionName: 1.1.50
    versionCode: 23072
...
    output: build/app/outputs/flutter-apk/app-armeabi-v7a-fdroid-release.apk
    binary: https://github.com/ImranR98/Obtainium/releases/download/v%v/app-armeabi-v7a-fdroid-release.apk
    build:
      - .flutter/bin/flutter build apk --release --split-per-abi --target-platform="android-arm"
...
etc

but notice this is per version block binary:, and not global Binaries:

Ah thanks. I think last question is how does the CurrentVersion/CurrentVersionCode change? Now we have one current version and three current version codes. Does CurrentVersionCode accept a list?

Do I need to basically add this?

VercodeOperation:
  - '%c'
  - '%c + 1'
  - '%c + 2'

each arch needs its own version code, so based on android/app/app/build.gradle at main · urnetwork/android · GitHub you’ll need to add that *10 here too android/app/app/build.gradle at main · urnetwork/android · GitHub

and adapt as

VercodeOperation:
  - '%c * 10 + 1'
  - '%c * 10 + 2'
  - '%c * 10 + 3'

right?

I had to trace back how I did this. I made the base version code always a multiple of 10, so that we add ABI-variant codes directly to it. This makes it so that our tagging is directly related to the base version code.

Ok I think this all makes sense now. I’ll send over a PR in 1-2 days.

1 Like