Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

chore:3046: Remove natives libs from release eOS apk, reduce size

Guillaume Jacquart requested to merge 0-remove_libs_from_release_apk into main

Description

Native libs used by AdvancedPrivacy (tor, maplibre, ...) are copied in a specific directory during the /e/OS image construction ( https://gitlab.e.foundation/e/os/android_prebuilts_prebuiltapks_lfs/-/blob/main/AdvancedPrivacy/Android.mk?ref_type=heads ), as priv-app apps looks to work like that.

But we still embed them in the APK, for 4 different target platform, which weight around 156MB useless.

This changes in the build allow to not embed these in the APK and save weight for the /e/OS image.

Tests

I did a build with the obtained apk, and observed weight reduction, even if the gain is way smaller than expected on the zip :

Sep 26 09:00 out/target/product/FP3/IMG-e-2.2-u-20240926-UNOFFICIAL-FP3.zip -> 1 580 599 658 Bytes
Feb 21 09:54 out/target/product/FP3/IMG-e-2.2-u-20250221-UNOFFICIAL-FP3.zip -> 1 567 190 555 Bytes

AdvancedPrivacy still worked, and re-extracting the APK from the installed image let us observe the weight difference :

AdvancedPrivacy_240926.apk -> 176MB
AdvancedPrivacy.apk -> 23MB

Issues

https://gitlab.e.foundation/e/os/backlog/-/issues/3046

10 commandments of code reviews

👪 ❤️ https://gitlab.e.foundation/internal/wiki/-/wikis/mobile-team/guidelines/Code-review

Edited by Guillaume Jacquart

Merge request reports

Loading