Skip to content
Snippets Groups Projects
Verified Commit 23474930 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

Bug 41066: Compress the APKs more

Our APK was refused by the Play Store as too big.
As a workaround, for this release we can try to compress the APK more,
by extracting it and repacking it with 7-zip.
The preferred and long-term solution would be to switch to Android App
Bundles, but this might require some changes to our signing scripts.
parent ef63c83c
No related branches found
No related tags found
No related merge requests found
......@@ -46,13 +46,19 @@ mv $rootdir/[% c('input_files_by_name/noscript') %] "$noscript_path"
mv $rootdir/allowed_addons.json $assets_dir/allowed_addons.json
[% c('zip', {
zip_src => [ '$assets_dir' ],
zip_args => '$apk',
}) %]
mkdir apk
pushd apk
7zz x "$apk"
cp -R ../assets ./
find -type f -exec touch -m -t '[% USE date; date.format(pc("firefox-android", "timestamp"), format = "%Y%m%d%H%M") %]' {} \;
find -type f ! -name resources.arsc -printf '%P\n' | sort > ../files.txt
7zz a -tzip -mx9 -mtc- -spf ../repacked.apk @../files.txt
# resources.arsc must not be compressed as per the APK specifications
7zz a -tzip -mm=Copy -mtc- ../repacked.apk resources.arsc
popd
aligned_apk=$(basename $apk .apk)_aligned.apk
zipalign -vp 4 $apk $aligned_apk
zipalign -vp 4 repacked.apk $aligned_apk
# Sign a QA build. This .apk is not a debug version and doesn't contain a debug
# flag in the manifest.
......
......
......@@ -46,7 +46,13 @@ targets:
var:
verify_allowed_addons: 1
arch_deps:
- openjdk-11-jdk-headless
- 7zip
- openjdk-17-jdk-headless
container:
# 7zip is in backports in bullseye, and we can already use Java 17 for
# apksigner.
suite: bookworm
arch: amd64
torbrowser:
var:
prefs_file: 000-tor-browser.js
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment