build.android 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. ext_dir=assets/distribution/extensions
  4. qa_apk=[% dest_dir %]/[% c('filename') %]/tor-browser-[% c("version") %]-[% c("var/osname") %]-multi-qa.apk
  5. apk=$rootdir/[% c('input_files_by_name/firefox') %]/tor-browser-unsigned-unaligned.apk
  6. mkdir -p /var/tmp/build/$ext_dir [% dest_dir _ '/' _ c('filename') %]
  7. cd /var/tmp/build
  8. mv $rootdir/[% c('input_files_by_name/https-everywhere') %] $ext_dir/https-everywhere-eff@eff.org.xpi
  9. mv $rootdir/[% c('input_files_by_name/noscript') %] $ext_dir/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi
  10. [% c("var/touch") %] $ext_dir $ext_dir/*
  11. zip -d $apk META-INF/\*
  12. [% c('zip', {
  13. zip_src => [ '$ext_dir' ],
  14. zip_args => '$apk',
  15. }) %]
  16. unzip $apk lib/*
  17. zip -d $apk lib/\*
  18. [% IF c("var/android-x86") %]
  19. [% c('zip', {
  20. zip_src => [ 'lib/x86/*' ],
  21. zip_args => '$apk',
  22. }) %]
  23. [% ELSIF c("var/android-armv7") %]
  24. [% c('zip', {
  25. zip_src => [ 'lib/armeabi-v7a/*' ],
  26. zip_args => '$apk',
  27. }) %]
  28. [% ELSIF c("var/android-aarch64") %]
  29. [% c('zip', {
  30. zip_src => [ 'lib/arm64-v8a/*' ],
  31. zip_args => '$apk',
  32. }) %]
  33. [% END %]
  34. rm -fR lib
  35. # Sign a QA build. This apk is not a debug version and doesn't contain a debug flag in the manifest
  36. java -jar /usr/share/apksigner/apksigner.jar sign --verbose --min-sdk-version [% c("var/android_min_api") %] --ks $rootdir/android-qa.keystore --out $qa_apk --in $apk --ks-key-alias androidqakey --key-pass pass:android --ks-pass pass:android