Update BUILD doc to reflect changes in build.

This commit is contained in:
Jordan 2014-08-11 11:00:26 -07:00
parent bacdf5438d
commit d02c5ea594
1 changed files with 25 additions and 16 deletions

41
BUILD
View File

@ -1,5 +1,6 @@
This document explains how to properly build an Android package of Orbot from source. This document explains how to properly build an Android package of Orbot from
source.
Orbot includes, in the external directory, git repo submodules of: Orbot includes, in the external directory, git repo submodules of:
- Tor - Tor
@ -7,45 +8,53 @@ Orbot includes, in the external directory, git repo submodules of:
- LibEvent - LibEvent
- JTorControl: The Tor Control Library for Java - JTorControl: The Tor Control Library for Java
The Orbot repo also includes the Privoxy source code of a recent stable release. The Orbot repo also includes the Polipo source code of a recent stable release.
Please install the following prerequisites (instructions for each follows): Please install the following prerequisites (instructions for each follows):
ant: http://ant.apache.org/ ant: http://ant.apache.org/
Android Native Dev Kit or NDK (for C/C++ code): http://developer.android.com/sdk/ndk/index.html Android Native Dev Kit or NDK (for C/C++ code):
Android Software Dev Kit or SDK (for Java code): http://developer.android.com/sdk/index.html http://developer.android.com/sdk/ndk/index.html
Android Software Dev Kit or SDK (for Java code):
http://developer.android.com/sdk/index.html
You will need to run the 'android' command in the SDK to install the necessary Android platform supports (ICS 4.x or android-15) You will need to run the 'android' command in the SDK to install the necessary
Android platform supports (ICS 4.x or android-15)
Be sure that you have all of the git submodules up-to-date: Be sure that you have all of the git submodules up-to-date:
git submodule init git submodule update --init --recursive
git submodule update
To begin building, from the Orbot root directory, you first need to build all external C/native dependencies: 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 NDK_BASE={PATH TO YOUR NDK INSTALL}
make -C external make -C external
At this point, you'll have Tor and Privoxy binaries that can be run on an Android handset. At this point, you'll have Tor and Polipo binaries that can be run on an
You can verify the ARM binary was properly built using the following command: Android handset. You can verify the ARM binary was properly built using the
following command:
file res/raw/tor file external/bin/tor external/bin/polipo
file res/raw/privoxy
You should see something like: You should see something like:
src/or/tor: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped external/bin/tor: ELF 32-bit LSB executable, ARM, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped
external/bin/polipo: ELF 32-bit LSB executable, ARM, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped
This isn't enough though and we'll now sew up the binary into a small package This isn't enough though and we'll now sew up the binary into a small package
that will handle basic Tor controlling features. that will handle basic Tor controlling features.
android update project --name Orbot --target android-15 --path . android update project --name Orbot --target android-15 --path .
#Now you need to split and copy the tor binary into res/raw. We split it into < 1M chunks Now you need to split and copy the tor binary into external/bin. We split it
#because some Android devices don't like resources larger than 1M. into < 1M chunks because some Android devices don't like resources larger than
#split --bytes=1m $DROID_ROOT/external/tor/tor/src/or/tor res/raw/tor 1M.
split --bytes=1m ./external/tor/src/or/tor ./external/bin/tor
Now build the Android app Now build the Android app
./update-ant-build
ant release ant release
This will produce an unsigned Tor package in ./bin/Orbot-unsigned.apk! This will produce an unsigned Tor package in ./bin/Orbot-unsigned.apk!