From 3c26f67392dab983e1d53acdb6864da228d914a2 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 3 Jun 2015 16:00:09 -0400 Subject: [PATCH 01/16] update ant setup script to get all settings from their original sources * target comes from project.properties * --- .gitignore | 4 ++++ BUILD | 2 +- setup-ant | 28 ++++++++++++++++++++++++++++ update-ant-build.sh | 7 ------- 4 files changed, 33 insertions(+), 8 deletions(-) create mode 100755 setup-ant delete mode 100755 update-ant-build.sh diff --git a/.gitignore b/.gitignore index 64134ea8..028e6d10 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,7 @@ builds /patches/* obj releases + +# ant build products +build.xml +proguard-project.txt diff --git a/BUILD b/BUILD index bd535871..625252e0 100644 --- a/BUILD +++ b/BUILD @@ -54,7 +54,7 @@ into < 1M chunks because some Android devices don't like resources larger than Now build the Android app - ./update-ant-build + ./setup-ant ant release This will produce an unsigned Tor package in ./bin/Orbot-unsigned.apk! diff --git a/setup-ant b/setup-ant new file mode 100755 index 00000000..fab844e1 --- /dev/null +++ b/setup-ant @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e +set -x + +if ! which android > /dev/null; then + if [ -z $ANDROID_HOME ]; then + if [ -e ~/.android/bashrc ]; then + . ~/.android/bashrc + else + echo "'android' not found, ANDROID_HOME must be set!" + exit + fi + else + export PATH="${ANDROID_HOME}/tools:$PATH" + fi +fi + +# fetch target from project.properties +eval `grep '^target=' project.properties` + +projectname=`sed -n 's,.*name="app_name">\(.*\)<.*,\1,p' res/values/strings.xml` + +android update project --path . --name $projectname --target $target --subprojects + +for lib in `sed -n 's,^android\.library\.reference\.[0-9][0-9]*=\(.*\),\1,p' project.properties`; do + android update lib-project --path $lib --target $target +done diff --git a/update-ant-build.sh b/update-ant-build.sh deleted file mode 100755 index 2fa1bca7..00000000 --- a/update-ant-build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# make sure your Android SDK tools path is set in SDK_BASE -android update project -t android-21 --path . --name Orbot --subprojects -android update lib-project -t android-21 --path external/appcompat -android update lib-project -t android-21 --path external/superuser-commands/RootCommands-Library/ -android update lib-project -t android-21 --path external/jsocks/jsockslib From 663cade62d47ddc594727c66260af3fae240ab63 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 3 Jun 2015 16:04:05 -0400 Subject: [PATCH 02/16] ./jenkins-build script for standard Guardian Project Jenkins build --- jenkins-build | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 jenkins-build diff --git a/jenkins-build b/jenkins-build new file mode 100755 index 00000000..c56d5b0d --- /dev/null +++ b/jenkins-build @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e +set -x + +if [ -z $ANDROID_HOME ]; then + if [ -e ~/.android/bashrc ]; then + . ~/.android/bashrc + else + echo "ANDROID_HOME must be set!" + exit + fi +fi + +if [ -z $ANDROID_NDK_HOME ]; then + if which ndk-build 2>&1 /dev/null; then + ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'` + else + echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH" + exit + fi +fi + +# reset version code/name to current date +versionCodeDate=`date +%s` +versionNameDate=`date +%Y-%m-%d_%H.%M.%S` + +sed -i \ + -e "s,android:versionCode=\"[0-9][0-9]*\",android:versionCode=\"$versionCodeDate\"," \ + -e "s,android:versionName=\"\([^\"][^\"]*\)\",android:versionName=\"\1.$versionNameDate\"," \ + AndroidManifest.xml + +make -C external +./setup-ant From cf43fa247d3bc81a1927c7385fcaae9cd0fda84f Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 3 Jun 2015 16:13:18 -0400 Subject: [PATCH 03/16] switch to standard NDK env var: ANDROID_NDK_HOME ANDROID_NDK_HOME is hardcoded in gradle as the name of the env var: https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/internal/Sdk.groovy --- BUILD | 2 +- external/Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BUILD b/BUILD index 625252e0..196dc636 100644 --- a/BUILD +++ b/BUILD @@ -27,7 +27,7 @@ Be sure that you have all of the git submodules up-to-date: To begin building, from the Orbot root directory, you first need to build all external C/native dependencies: - export NDK_BASE={PATH TO YOUR NDK INSTALL} + export ANDROID_NDK_HOME={PATH TO YOUR NDK INSTALL} make -C external At this point, you'll have Tor and Polipo binaries that can be run on an diff --git a/external/Makefile b/external/Makefile index 39752e32..c4b91b22 100644 --- a/external/Makefile +++ b/external/Makefile @@ -22,7 +22,7 @@ else endif # Android NDK setup -NDK_BASE ?= /opt/android-ndk +ANDROID_NDK_HOME ?= /opt/android-ndk NDK_PLATFORM_LEVEL ?= 16 NDK_TOOLCHAIN_VERSION=4.8 APP_ABI ?= armeabi @@ -33,7 +33,7 @@ endif ifneq ($(filter arm64%, $(APP_ABI)),) NDK_ABI := arm64 endif -NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI) +NDK_SYSROOT=$(ANDROID_NDK_HOME)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI) NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]') ifneq ($(filter mips%, $(NDK_ABI)),) HOST := $(NDK_ABI)el-linux-android @@ -55,11 +55,11 @@ NDK_TOOLCHAIN := $(HOST)-$(NDK_TOOLCHAIN_VERSION) ifneq ($(filter x86%, $(NDK_ABI)),) NDK_TOOLCHAIN := $(NDK_ABI)-$(NDK_TOOLCHAIN_VERSION) endif -NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/$(NDK_TOOLCHAIN)/prebuilt/$(NDK_UNAME)-$(NDK_PROCESSOR) +NDK_TOOLCHAIN_BASE=$(ANDROID_NDK_HOME)/toolchains/$(NDK_TOOLCHAIN)/prebuilt/$(NDK_UNAME)-$(NDK_PROCESSOR) # include Android's build flags TARGET_ARCH_ABI = $(APP_ABI) -include $(NDK_BASE)/toolchains/$(NDK_TOOLCHAIN)/setup.mk +include $(ANDROID_NDK_HOME)/toolchains/$(NDK_TOOLCHAIN)/setup.mk CC := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-gcc --sysroot=$(NDK_SYSROOT) CXX := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-g++ --sysroot=$(NDK_SYSROOT) From 0e6ba61ac0369072b6ff83a5df124b931b7f73f6 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 3 Jun 2015 16:35:43 -0400 Subject: [PATCH 04/16] remove Firefox ProxyMob recommendation, ProxyMob is no longer supported --- res/layout/layout_wizard_tips.xml | 9 --------- res/values/strings.xml | 6 ------ .../android/ui/wizard/PromoAppsActivity.java | 13 ------------- 3 files changed, 28 deletions(-) diff --git a/res/layout/layout_wizard_tips.xml b/res/layout/layout_wizard_tips.xml index f42a6036..43afc43c 100644 --- a/res/layout/layout_wizard_tips.xml +++ b/res/layout/layout_wizard_tips.xml @@ -63,15 +63,6 @@ android:drawableLeft="@drawable/ic_duckduckgo" android:text="@string/wizard_tips_duckgo" /> -