Skip to content

Commit

Permalink
README and BUILD adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Krueger committed Oct 23, 2013
1 parent 3a4b2c9 commit 859fb0f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
2 changes: 1 addition & 1 deletion BUILD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export JAVA_JDK=/opt/jdk1.6.0_45/bin

export WORKSPACE=`pwd`

export PATH=$PATH:$ANDROID_NDK:$ANDROID_ADT:$ANDROID_ANT:$ANDROID_SDK/tools:$JAVA_JDK
export PATH=$ANDROID_NDK:$ANDROID_ADT:$ANDROID_ANT:$ANDROID_SDK/tools:$JAVA_JDK:$PATH

export SRC_ROOT=$WORKSPACE

Expand Down
71 changes: 38 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
## Introduction

These are the sources for Silent Circle's Silent Phone for Android project. Using these sources and the the instructions that follow, you should be able to build a Silent Phone APK, which can be installed and run on an Android device.
This repository contains the sources for Silent Circle's Silent Phone for Android project. Using these sources and the the instructions that follow, you should be able to build a Silent Phone APK that can be installed and run on an Android device.

### What's New In This Update
- these instructions have been updated, with details about the build environment to make it easier for those who wish to build the APK from source to succeed.
- these sources are for the version 1.6.5 project which was the version of the project shipping at the time we started building this commit.
### What's New In This Version
- These instructions have been updated with details about the build environment, to make it easier for those who want to build the APK from source.
- These sources are for the version 1.6.5 project, which was the version of the project that was shipping at the time we started building this commit.

### Coming "Soon"
- We will update these sources to the currently shipping Silent Phone 1.6.6 release soon.
- We will update these sources to the currently shipping Silent Phone 1.6.6 release.
- Beyond the 1.6.6 release we will switch to using gradle as the build tool.

### Overview

Silent Phone consists of two major parts. The first comprises the Android Java modules and their associated layout files, resources files, and generated source and resource files. The second part, the phone engine, includes the SIP, RTP, ZRTP, TLS, and codec handling, along with some other functions. It is based on C/C++. The Java part uses standard JNI techniques to communicate with the C/C++ parts.
Silent Phone consists of two major parts. The first comprises the Android Java modules and their associated layout files, resources files, and generated source and resource files. The second part, the phone engine, includes the SIP, RTP, ZRTP, TLS, and codec handling, along with some other functions. It is based on C/C++. The Java part uses standard JNI techniques to communicate with the C/C++ part.

### Prerequisites

This short description assumes that you have a good understanding of the Android SDK, the Android NDK, and their build procedures.
This short description assumes that you have a good understanding of the Android SDK, the Android NDK (Native Development Kit), and their build procedures.

To compile and build Silent Phone you need a full Android development environment that includes the Android Java SDK and the Android NDK (Native Development Kit). Because SilentPhone depends upon Android API 17 (Jelly Bean), make sure you also download and install the necessary SDK modules. You may wish to use the Eclipse Android SDK extensions.
To compile and build Silent Phone you need a full Android development environment that includes the Android Java SDK and the Android NDK. Because SilentPhone depends upon Android API 17 (Jelly Bean), make sure you also download and install the necessary SDK modules. You may wish to use the Eclipse Android SDK extensions.

#### Specific Recommendations

We have built the product in both a virtual machine and on bare iron using the following components. Certainly other successful configurations are possible, but this is the one we tested with.
Using the following components, we have built the product in a virtual machine, on bare iron, and on a laptop that also serves as a personal machine. Other successful configurations are certainly possible, but this is the one we tested with.

- system configuration: 512 Mb memory, 20 GB disk
- minimum system configuration: 512 Mb memory, 20 GB disk
- debian-7.0.0-amd64-DVD-1.iso

In response to "`software selection`" all you need is
Expand All @@ -34,9 +34,9 @@ We have built the product in both a virtual machine and on bare iron using the f

Use a mirror

- if appropriate install virtual machine additions
- If appropriate, install virtual machine additions.

- install additional packages
- Install additional packages:

$ dpkg --add-architecture i386
$ apt-get update
Expand All @@ -48,37 +48,40 @@ We have built the product in both a virtual machine and on bare iron using the f

- java

The version of java that gives the least trouble is the Sun/Oracle JDK6. For the test build, we used the `jdk-6u45-linux-x64.bin` system. It can be acquired from
The version of java that gives the least trouble is Sun/Oracle JDK6. For the test build, we used the `jdk-6u45-linux-x64.bin` system. It can be acquired from

[http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jre-6u45-oth-JPR]().

We found that we had to download it from a system with a browser and then move it to the build system.
[https://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR]().

$ sh jdk-6u45-linux-x64.bin
$ sudo mv jdk1.6.0_45 /opt

The hash of the version that we tested with is
$ openssl sha1 jdk-6u45-linux-x64.bin
SHA1(jdk-6u45-linux-x64.bin)= 24425cdb69c11e86d6b58757b29e5ba4e4977660

- ADT - Android Development Toolkit

While the build doesn't use Eclipse, pulling the whole ADT ensures many needed things are fetched.
While the build doesn't use Eclipse, pulling the whole ADT ensures that many needed things are fetched.

$ wget http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20130729.zip
$ sudo unzip adt-bundle-linux-x86_64-20130729.zip -d /opt

- NDK - Native Development Kit

Silent Phone has native components. The lastest NDK causes complier errors, so use this one:
Silent Phone has native components. The lastest NDK causes compiler errors, so use this one instead:

$ wget https://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
$ sudo tar -xjf android-ndk-r8e-linux-x86_64.tar.bz2 -C /opt

- Android configuration
- Android configuration

Note: We had do the following few steps as the root user in order to update with the needed configurations.

We had do the following as the root user in order to update with the needed configurations.
First add java and android tools to the path:
First, add java and android tools to the path:

$ export PATH=$PATH:/opt/jdk1.6.0_45/bin:/opt/adt-bundle-linux-x86_64-20130729/sdk/tools
Now use the android tool to find "SDK Platform Android 4.2.2, API 17, revision 2" and "Android Support Repository, revision 2"
Next, use the android tool to find "SDK Platform Android 4.2.2, API 17, revision 2" and "Android Support Repository, revision 2"

$ android list sdk

Expand All @@ -87,7 +90,7 @@ We have built the product in both a virtual machine and on bare iron using the f
4- SDK Platform Android 4.2.2, API 17, revision 2
44- Android Support Repository, revision 2

Now, update with those entries doing the higher number one first so the ordering does not change.
Update those entries, doing the higher number one first so the ordering does not change:

$ android update sdk --no-ui --filter 44
...license stuff...
Expand All @@ -100,7 +103,7 @@ We have built the product in both a virtual machine and on bare iron using the f
Installed Android Support Repository, revision 299%)
Done. 1 package installed.

And then again
Then:

$ android update sdk --no-ui --filter 4
...license stuff...
Expand All @@ -113,17 +116,21 @@ We have built the product in both a virtual machine and on bare iron using the f
Installed SDK Platform Android 4.2.2, API 17, revision 296%)
Done. 1 package installed.

It may also be necessary to change the privileges on one of the files, to permit the build script to execute it:

$ chmod g+x /opt/adt-bundle-linux-x86_64-20130729/eclipse/plugins/org.apache.ant_1.8.3.v201301120609/bin/ant
You can now exit root.

- fix up access to /opt
- Fix up access to /opt

It could be that the prerequisites don't permit the needed access
(It could be that the prerequisites don't permit the needed access.)

$ sudo groupadd android
$ sudo usermod -a -G android my-account-goes-here
$ sudo chgrp -R android /opt/adt-bundle-linux-x86_64-20130729 /opt/android-ndk-r8e /opt/jdk1.6.0_45

You will have to logout and in again to have the shell pick up the android group
In order to have the shell pick up the android group, you will have to logout and log back in.

### Directory structure

Expand Down Expand Up @@ -167,16 +174,14 @@ We have built the product in both a virtual machine and on bare iron using the f
|- silentphone - Main directory for Silent Phone C/C++ sources
|- zrtpcpp - See on Github - C++ implementation of ZRTP protocol

##Building the SilentPhone from existing Git Repository
##Building SilentPhone from the existing Git Repository

Clone the sources from github. If you followed the "Specific Recommendations" above then the supporting toolsets will all be in the expected places. If not then edit `BUILD.sh` and adjust the symbols to match your environment.
Clone the sources from github. If you followed the "Specific Recommendations" above, the supporting toolsets will all be in the expected places. If not, edit `BUILD.sh` and adjust the symbols to match your environment.

cd to the top level repository directory and invoke BUILD.sh

$ bash -x BUILD.sh >& build.log

##Post build instructions

A successful build will result in a `silentphone.apk` file in the top level directory. Move this file to your Android device and run it to install Silent Phone. Go to [https://silentcircle.com/login]() and enter your account credentials. On the next screen click on "`Add Silent Phone`" and enter the displayed activation code into your android device. You can now use your application to send and receive calls.

##Post-Build Instructions

A successful build will result in a `silentphone.apk` file in the top level directory. Move this file to your Android device and run it to install Silent Phone. Then go to [https://silentcircle.com/login]() and enter your account credentials. On the next screen click on "`Add Silent Phone`" and enter the displayed activation code into your android device. You can now use your application to send and receive calls.

0 comments on commit 859fb0f

Please sign in to comment.