[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser-build][maint-13.0] Bug 41066: Compress the APKs more



Title: GitLab

richard pushed to branch maint-13.0 at The Tor Project / Applications / tor-browser-build

Commits:

  • 4ae6c26c
    by Pier Angelo Vendrame at 2024-01-23T10:48:57+01:00
    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.
    

2 changed files:

Changes:

  • projects/browser/build.android
    ... ... @@ -31,13 +31,19 @@ mv $rootdir/[% c('input_files_by_name/noscript') %] "$noscript_path"
    31 31
     
    
    32 32
     mv $rootdir/allowed_addons.json $assets_dir/allowed_addons.json
    
    33 33
     
    
    34
    -[% c('zip', {
    
    35
    -        zip_src => [ '$assets_dir' ],
    
    36
    -        zip_args => '$apk',
    
    37
    -    }) %]
    
    34
    +mkdir apk
    
    35
    +pushd apk
    
    36
    +7zz x "$apk"
    
    37
    +cp -R ../assets ./
    
    38
    +find -type f -exec touch -m -t '[% USE date; date.format(pc("firefox-android", "timestamp"), format = "%Y%m%d%H%M") %]' {} \;
    
    39
    +find -type f ! -name resources.arsc -printf '%P\n' | sort > ../files.txt
    
    40
    +7zz a -tzip -mx9 -mtc- -spf ../repacked.apk @../files.txt
    
    41
    +# resources.arsc must not be compressed as per the APK specifications
    
    42
    +7zz a -tzip -mm=Copy -mtc- ../repacked.apk resources.arsc
    
    43
    +popd
    
    38 44
     
    
    39 45
     aligned_apk=$(basename $apk .apk)_aligned.apk
    
    40
    -zipalign -vp 4 $apk $aligned_apk
    
    46
    +zipalign -vp 4 repacked.apk $aligned_apk
    
    41 47
     
    
    42 48
     # Sign a QA build. This .apk is not a debug version and doesn't contain a debug
    
    43 49
     # flag in the manifest.
    

  • projects/browser/config
    ... ... @@ -46,7 +46,13 @@ targets:
    46 46
         var:
    
    47 47
           verify_allowed_addons: 1
    
    48 48
           arch_deps:
    
    49
    -        - openjdk-11-jdk-headless
    
    49
    +        - 7zip
    
    50
    +        - openjdk-17-jdk-headless
    
    51
    +      container:
    
    52
    +        # 7zip is in backports in bullseye, and we can already use Java 17 for
    
    53
    +        # apksigner.
    
    54
    +        suite: bookworm
    
    55
    +        arch: amd64
    
    50 56
       torbrowser:
    
    51 57
         var:
    
    52 58
           prefs_file: 000-tor-browser.js
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits