2011-04-15 16:39:35 +00:00
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
This document explains how to properly build an Android package of Orbot from
|
|
|
|
source.
|
2012-02-13 12:32:16 +00:00
|
|
|
|
2012-05-03 23:40:21 +00:00
|
|
|
Orbot includes, in the external directory, git repo submodules of:
|
|
|
|
- Tor
|
|
|
|
- OpenSSL (statically built and patched for Android)
|
|
|
|
- LibEvent
|
|
|
|
- JTorControl: The Tor Control Library for Java
|
2011-04-15 16:39:35 +00:00
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
The Orbot repo also includes the Polipo source code of a recent stable release.
|
2009-10-25 00:01:12 +00:00
|
|
|
|
2009-10-25 02:47:27 +00:00
|
|
|
Please install the following prerequisites (instructions for each follows):
|
2009-10-25 04:49:06 +00:00
|
|
|
ant: http://ant.apache.org/
|
2014-08-11 18:00:26 +00:00
|
|
|
Android Native Dev Kit or NDK (for C/C++ code):
|
|
|
|
http://developer.android.com/sdk/ndk/index.html
|
|
|
|
Android Software Dev Kit or SDK (for Java code):
|
|
|
|
http://developer.android.com/sdk/index.html
|
2010-03-18 04:52:53 +00:00
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
You will need to run the 'android' command in the SDK to install the necessary
|
|
|
|
Android platform supports (ICS 4.x or android-15)
|
2009-10-25 00:47:19 +00:00
|
|
|
|
2013-12-05 23:49:23 +00:00
|
|
|
Be sure that you have all of the git submodules up-to-date:
|
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
git submodule update --init --recursive
|
2013-12-05 23:49:23 +00:00
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
To begin building, from the Orbot root directory, you first need to build all
|
|
|
|
external C/native dependencies:
|
2009-10-25 00:47:19 +00:00
|
|
|
|
2012-05-03 23:40:21 +00:00
|
|
|
export NDK_BASE={PATH TO YOUR NDK INSTALL}
|
|
|
|
make -C external
|
2009-10-25 00:47:19 +00:00
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
At this point, you'll have Tor and Polipo binaries that can be run on an
|
|
|
|
Android handset. You can verify the ARM binary was properly built using the
|
|
|
|
following command:
|
2009-10-25 01:06:59 +00:00
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
file external/bin/tor external/bin/polipo
|
2011-05-10 02:08:50 +00:00
|
|
|
|
|
|
|
You should see something like:
|
2014-08-11 18:00:26 +00:00
|
|
|
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
|
2009-10-25 05:06:49 +00:00
|
|
|
|
2011-05-10 02:08:50 +00:00
|
|
|
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 05:06:49 +00:00
|
|
|
|
2012-05-03 23:40:21 +00:00
|
|
|
android update project --name Orbot --target android-15 --path .
|
2009-11-28 15:41:28 +00:00
|
|
|
|
2014-08-11 18:00:26 +00:00
|
|
|
Now you need to split and copy the tor binary into external/bin. We split it
|
|
|
|
into < 1M chunks because some Android devices don't like resources larger than
|
|
|
|
1M.
|
|
|
|
split --bytes=1m ./external/tor/src/or/tor ./external/bin/tor
|
2011-07-25 21:35:39 +00:00
|
|
|
|
|
|
|
Now build the Android app
|
2012-05-03 23:40:21 +00:00
|
|
|
|
2015-06-03 20:00:09 +00:00
|
|
|
./setup-ant
|
2009-10-25 04:33:05 +00:00
|
|
|
ant release
|
|
|
|
|
2009-10-25 05:11:16 +00:00
|
|
|
This will produce an unsigned Tor package in ./bin/Orbot-unsigned.apk!
|
2009-10-25 05:27:19 +00:00
|
|
|
|
|
|
|
To produce a usable package, you'll need to sign the .apk. The basics on
|
|
|
|
signing can be found on the Android developer site:
|
|
|
|
|
|
|
|
http://developer.android.com/guide/publishing/app-signing.html
|
|
|
|
|
|
|
|
The three steps are quite simple. First, you'll generate a key. Secondly,
|
|
|
|
you'll sign the application. Thirdly, you'll verify the the apk.
|
|
|
|
|
|
|
|
Generating a signing key:
|
|
|
|
|
|
|
|
keytool -genkey -v -keystore my-release-key.keystore \
|
|
|
|
-alias orbots_key -keyalg RSA -validity 10000
|
|
|
|
|
|
|
|
Sign the apk:
|
|
|
|
|
|
|
|
jarsigner -verbose -keystore my-release-key.keystore \
|
|
|
|
bin/Orbot-unsigned.apk orbots_key
|
|
|
|
|
|
|
|
Verify the signature for the apk:
|
|
|
|
|
|
|
|
jarsigner -verify bin/Orbot-unsigned.apk
|
|
|
|
mv bin/Orbot-unsigned.apk bin/Orbot-signed-alpha.apk
|
|
|
|
|
2010-02-23 04:45:50 +00:00
|
|
|
You can also GPG sign the apk and generate an .asc:
|
|
|
|
|
|
|
|
gpg -ab Orbot-signed-alpha.apk
|
|
|
|
|
2009-10-25 05:27:19 +00:00
|
|
|
Now you should have a fully signed and production ready alpha release of Orbot!
|
|
|
|
Give bin/Orbot-signed-alpha.apk an install and send us bug reports!
|
2010-03-18 04:52:53 +00:00
|
|
|
|