2009-10-25 00:01:12 +00:00
|
|
|
This document explains how to properly build an Android package of Orbot from
|
|
|
|
source.
|
|
|
|
|
2009-10-25 02:47:27 +00:00
|
|
|
Please install the following prerequisites (instructions for each follows):
|
2009-10-25 00:47:19 +00:00
|
|
|
Android OS SDK
|
2009-10-25 00:01:12 +00:00
|
|
|
droid-wrapper: http://github.com/tmurakam/droid-wrapper
|
|
|
|
libevent source
|
|
|
|
Tor source (most recent git master branch)
|
|
|
|
|
2009-10-25 00:47:19 +00:00
|
|
|
Install and prepare the Android OS SDK ( http://source.android.com/download )
|
|
|
|
on Debian Lenny:
|
|
|
|
|
|
|
|
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf \
|
|
|
|
libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip \
|
2009-10-25 01:06:59 +00:00
|
|
|
curl libncurses5-dev zlib1g-dev valgrind
|
|
|
|
update-java-alternatives -s java-1.5.0-sun
|
2009-10-25 00:47:19 +00:00
|
|
|
|
|
|
|
curl http://android.git.kernel.org/repo >~/bin/repo
|
|
|
|
chmod a+x ~/bin/repo
|
|
|
|
|
|
|
|
mkdir ~/mydroid
|
|
|
|
cd ~/mydroid
|
|
|
|
|
|
|
|
repo init -u git://android.git.kernel.org/platform/manifest.git
|
|
|
|
repo sync
|
|
|
|
|
|
|
|
# Paste in key from http://source.android.com/download next...
|
|
|
|
gpg --import
|
|
|
|
|
|
|
|
cd ~/mydroid
|
2009-10-25 00:52:32 +00:00
|
|
|
|
|
|
|
# This takes a long while...
|
2009-10-25 00:47:19 +00:00
|
|
|
make
|
|
|
|
|
2009-10-25 00:52:32 +00:00
|
|
|
Install droid-wrapper:
|
|
|
|
|
|
|
|
cd /tmp
|
|
|
|
git clone git://github.com/tmurakam/droid-wrapper.git
|
|
|
|
cd droid-wrapper
|
|
|
|
sudo make install
|
|
|
|
|
2009-10-25 02:47:27 +00:00
|
|
|
zlib and OpenSSL are included with the Android OS SDK. You'll need to build
|
|
|
|
libevent and finally Tor. We'll create an externals directory for this code:
|
2009-10-25 01:06:59 +00:00
|
|
|
|
2009-10-25 02:47:27 +00:00
|
|
|
mkdir -p ~/mydroid/external/{libevent,tor}
|
2009-10-25 01:06:59 +00:00
|
|
|
|
2009-10-25 02:47:27 +00:00
|
|
|
We need to set to environment variables for droid-gcc:
|
|
|
|
export DROID_ROOT=~/mydroid/
|
|
|
|
export DROID_TARGET=generic
|
|
|
|
|
2009-10-25 03:36:52 +00:00
|
|
|
# XXX TODO:
|
|
|
|
# Do we need this?
|
2009-10-25 03:26:54 +00:00
|
|
|
Build zlib:
|
|
|
|
cd ~/mydroid/external/zlib
|
|
|
|
export ZLIBDIR=`pwd`
|
|
|
|
CC=droid-gcc LD=droid-ld ./configure
|
|
|
|
make
|
|
|
|
|
2009-10-25 03:36:52 +00:00
|
|
|
# XXX TODO:
|
|
|
|
# Do we need this?
|
2009-10-25 03:26:54 +00:00
|
|
|
Build openssl:
|
|
|
|
cd ~/mydroid/external/openssl/include/openssl/
|
|
|
|
export OPENSSLDIR=`pwd`
|
|
|
|
CC=droid-gcc LD=droid-ld ./configure
|
|
|
|
|
|
|
|
|
2009-10-25 02:47:27 +00:00
|
|
|
Fetch and build libevent:
|
|
|
|
|
|
|
|
cd ~/mydroid/external/libevent
|
2009-10-25 03:36:52 +00:00
|
|
|
svn co https://levent.svn.sourceforge.net/svnroot/levent/tags/release-1.4.12-stable/libevent/ .
|
2009-10-25 02:47:27 +00:00
|
|
|
export LIBEVENTDIR=`pwd`
|
|
|
|
./autogen.sh
|
2009-10-25 03:36:52 +00:00
|
|
|
# http://pastebin.ca/1577159
|
|
|
|
patch < /tmp/libevent-patch
|
2009-10-25 02:47:27 +00:00
|
|
|
CC=droid-gcc LD=droid-ld ./configure --host=arm-none-linux-gnueabi
|
|
|
|
make
|
|
|
|
|
|
|
|
Fetch and build Tor:
|
|
|
|
|
|
|
|
export OPENSSLDIR=`cd ~/mydroid/external/openssl/include/ && pwd`
|
|
|
|
export ZLIBDIR=`cd ~/mydroid/external/zlib && pwd`
|
|
|
|
|
|
|
|
cd ~/mydroid/external/tor
|
|
|
|
git clone https://git.torproject.org/git/tor.git
|
|
|
|
cd tor/
|
|
|
|
CC=droid-gcc LD=droid-ld ./configure --host=arm-none-linux-gnueabi \
|
|
|
|
--with-libevent-dir=$LIBEVENTDIR --with-openssl-dir=$OPENSSLDIR \
|
|
|
|
--with-zlib-dir=$ZLIBDIR
|
|
|
|
make
|
|
|
|
|
|
|
|
At this point, you'll have a Tor binary that can be run on an Android handset.
|
|
|
|
This isn't enough though and we'll now sew up the binary into a small package
|
|
|
|
that will handle basic Tor controlling features.
|
2009-10-25 01:06:59 +00:00
|
|
|
|
2009-10-25 00:01:12 +00:00
|
|
|
XXX TODO: Explain build process for making a .apk file for install.
|