commit 1eeda4986c5f88f07bf53a2801e9e32ba3dba80b Author: Georg Koppen gk@torproject.org Date: Fri May 31 13:01:30 2019 +0000
Bug 28119: Tor Browser for aarch64
Thanks to boklm for help with this patch. --- Makefile | 15 +++++++++ projects/android-toolchain/build | 8 ++--- projects/firefox/mozconfig-android-aarch64 | 50 ++++++++++++++++++++++++++++++ projects/release/build | 3 ++ projects/release/config | 10 ++++++ projects/rust/config | 4 +++ projects/tor-browser/build.android | 9 ++++-- rbm.conf | 14 ++++++++- 8 files changed, 104 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile index 285b49d..94a26f6 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ release-android-armv7: submodule-update release-android-x86: submodule-update $(rbm) build release --target release --target torbrowser-android-x86
+release-android-aarch64: submodule-update + $(rbm) build release --target release --target torbrowser-android-aarch64 + release-linux-x86_64: submodule-update $(rbm) build release --target release --target torbrowser-linux-x86_64
@@ -41,6 +44,9 @@ alpha-android-armv7: submodule-update alpha-android-x86: submodule-update $(rbm) build release --target alpha --target torbrowser-android-x86
+alpha-android-aarch64: submodule-update + $(rbm) build release --target alpha --target torbrowser-android-aarch64 + alpha-linux-x86_64: submodule-update $(rbm) build release --target alpha --target torbrowser-linux-x86_64
@@ -71,6 +77,9 @@ nightly-android-armv7: submodule-update nightly-android-x86: submodule-update $(rbm) build release --target nightly --target torbrowser-android-x86
+nightly-android-aarch64: submodule-update + $(rbm) build release --target nightly --target torbrowser-android-aarch64 + nightly-linux-x86_64: submodule-update $(rbm) build release --target nightly --target torbrowser-linux-x86_64
@@ -101,6 +110,9 @@ alpha_nightly-android-armv7: submodule-update alpha_nightly-android-x86: submodule-update $(rbm) build release --target alpha_nightly --target torbrowser-android-x86
+alpha_nightly-android-aarch64: submodule-update + $(rbm) build release --target alpha_nightly --target torbrowser-android-aarch64 + alpha_nightly-linux-x86_64: submodule-update $(rbm) build release --target alpha_nightly --target torbrowser-linux-x86_64
@@ -128,6 +140,9 @@ testbuild-android-armv7: submodule-update testbuild-android-x86: submodule-update $(rbm) build release --target testbuild --target torbrowser-android-x86
+testbuild-android-aarch64: submodule-update + $(rbm) build release --target testbuild --target torbrowser-android-aarch64 + testbuild-linux-x86_64: submodule-update $(rbm) build release --target testbuild --target torbrowser-linux-x86_64
diff --git a/projects/android-toolchain/build b/projects/android-toolchain/build index 9fe40f7..e0f59a9 100644 --- a/projects/android-toolchain/build +++ b/projects/android-toolchain/build @@ -18,11 +18,9 @@ cd $NDK_HOME mv android-ndk-r15c/* . rm -fR android-ndk-r15c
-# The architectures we support -archs="arm x86" -for arch in $archs; do - ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api") %] --arch $arch --install-dir=./$arch -done +./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_armv7") %] --arch arm --install-dir=./arm +./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_x86") %] --arch x86 --install-dir=./x86 +./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_aarch64") %] --arch arm64 --install-dir=./arm64
# Tool Archives cd $SDK_HOME diff --git a/projects/firefox/mozconfig-android-aarch64 b/projects/firefox/mozconfig-android-aarch64 new file mode 100644 index 0000000..2a9eb67 --- /dev/null +++ b/projects/firefox/mozconfig-android-aarch64 @@ -0,0 +1,50 @@ +mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-aarch64-linux-android +mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser" +export MOZILLA_OFFICIAL=1 + +ac_add_options --enable-optimize +ac_add_options --enable-official-branding + +ac_add_options --enable-application=mobile/android +ac_add_options --target=aarch64-linux-android +ac_add_options --with-android-ndk=/var/tmp/dist/android-toolchain/android-ndk +ac_add_options --with-android-sdk=/var/tmp/dist/android-toolchain/android-sdk-linux +ac_add_options --with-gradle=/var/tmp/dist/android-toolchain/gradle/gradle-4.1/bin/gradle +ac_add_options --with-android-version=21 + +# Android NDK does not contain llvm-config so set clang path in options +ac_add_options --with-libclang-path=/var/tmp/dist/android-toolchain/android-ndk/arm64/lib64 +ac_add_options --with-clang-path=/var/tmp/dist/android-toolchain/android-ndk/arm64/bin/clang + +ac_add_options --with-android-distribution-directory=@TOPSRCDIR@/mobile/android/torbrowser +ac_add_options --with-l10n-base=/var/tmp/dist/locales + +# We do not use Tor Launcher on Android: +ac_add_options --disable-tor-launcher + +if [ -z "${TB_BUILD_WITH_UPDATER}" ]; then +# Because Google Play will likely be the primary distribution medium, +# we disable updating and rely on Google Play by default. The +# Developer Policy explicitly prohibits in-app updating: +# An app distributed via Google Play may not modify, replace, or +# update itself using any method other than Google Plays update +# mechanism. +# https://play.google.com/about/privacy-security-deception/malicious-behavior/ + + ac_add_options --disable-tor-browser-update + ac_add_options --disable-signmar + ac_add_options --disable-verify-mar +fi + +ac_add_options --enable-strip +ac_add_options --disable-tests +ac_add_options --disable-debug +ac_add_options --disable-rust-debug +ac_add_options --disable-maintenance-service +ac_add_options --disable-crashreporter +ac_add_options --disable-webrtc + +ac_add_options --without-google-play-services + +# Let's make sure no preference is enabling either Adobe's or Google's CDM. +ac_add_options --disable-eme diff --git a/projects/release/build b/projects/release/build index af9d673..3e930e0 100644 --- a/projects/release/build +++ b/projects/release/build @@ -10,6 +10,9 @@ mkdir -p "$destdir" [% IF c("var/torbrowser-android-x86") -%] mv [% c('input_files_by_name/android-x86') %]/* "$destdir"/ [% END -%] +[% IF c("var/torbrowser-android-aarch64") -%] + mv [% c('input_files_by_name/android-aarch64') %]/* "$destdir"/ +[% END -%] [% IF c("var/torbrowser-windows-i686") -%] mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/ mv [% c('input_files_by_name/windows-expert-bundle') %]/* "$destdir"/ diff --git a/projects/release/config b/projects/release/config index ddb17d1..1623083 100644 --- a/projects/release/config +++ b/projects/release/config @@ -24,6 +24,9 @@ targets: torbrowser-android-x86: var: torbrowser-android-x86: 1 + torbrowser-android-aarch64: + var: + torbrowser-android-aarch64: 1 torbrowser-linux-x86_64: var: torbrowser-linux-x86_64: 1 @@ -117,6 +120,13 @@ input_files: - '[% c("var/build_target") %]' - torbrowser-android-x86
+ - name: android-aarch64 + project: tor-browser + enable: '[% c("var/torbrowser-android-aarch64") %]' + target: + - '[% c("var/build_target") %]' + - torbrowser-android-aarch64 + - name: linux-x86_64 project: tor-browser enable: '[% c("var/torbrowser-linux-x86_64") %]' diff --git a/projects/rust/config b/projects/rust/config index 0c3b280..e2b0999 100644 --- a/projects/rust/config +++ b/projects/rust/config @@ -30,6 +30,10 @@ targets: var: configure_opt: --enable-local-rust --enable-vendor --enable-extended --release-channel=stable --sysconfdir=etc --target=i686-linux-android --set=target.i686-linux-android.cc=$ANDROID_NDK_HOME/x86/bin/i686-linux-android-gcc
+ android-aarch64: + var: + configure_opt: --enable-local-rust --enable-vendor --enable-extended --release-channel=stable --sysconfdir=etc --target=aarch64-linux-android --set=target.aarch64-linux-android.cc=$ANDROID_NDK_HOME/arm64/bin/aarch64-linux-android-gcc + linux: var: rust_arch: x86_64 diff --git a/projects/tor-browser/build.android b/projects/tor-browser/build.android index be36abc..b90c8b9 100644 --- a/projects/tor-browser/build.android +++ b/projects/tor-browser/build.android @@ -24,13 +24,16 @@ zip -d $apk lib/* zip_src => [ 'lib/x86/*' ], zip_args => '$apk', }) %] -[% END %] - -[% IF c("var/android-armv7") %] +[% ELSIF c("var/android-armv7") %] [% c('zip', { zip_src => [ 'lib/armeabi-v7a/*' ], zip_args => '$apk', }) %] +[% ELSIF c("var/android-aarch64") %] + [% c('zip', { + zip_src => [ 'lib/arm64-v8a/*' ], + zip_args => '$apk', + }) %] [% END %]
rm -fR lib diff --git a/rbm.conf b/rbm.conf index 831f918..0ad63c1 100644 --- a/rbm.conf +++ b/rbm.conf @@ -190,12 +190,24 @@ targets: var: android-x86: 1 osname: android-x86 + torbrowser-android-aarch64: + - android-aarch64 + - android + android-aarch64: + arch: aarch64 + var: + android-aarch64: 1 + osname: android-aarch64 android: var: android: 1 compiler: android-toolchain # API 16 is the minimum we currently support for Tor Browser on Android - android_min_api: 16 + android_min_api: '[% GET c("var/android_min_api_" _ c("arch")) %]' + # API 21 is the minimum we currently support for arm64 on Android + android_min_api_aarch64: 21 + android_min_api_armv7: 16 + android_min_api_x86: 16 snowflake: 0 fteproxy: 0 container: