Vault7: CIA Hacking Tools Revealed
Navigation: » Latest version
Android Developer Setup
Set Up SSHSecure Shell key pair
Using ssh-keygen, create a private/public key pair:
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (~/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in ~/.ssh/id_rsa.
Your public key has been saved in ~/.ssh/id_rsa.pub.
The key fingerprint is:
...
Configure SSH
Open ~/.ssh/config and add the following:
host stash
hostname stash.devlan.net
port 7999
user git
SSH will determine your username from the key you created. Test this by checking out a
project from git (try ssh://stash/dto/dto_logger).
git clone ssh://stash/dto/dto_logger
Set up Stash
On Stash, go to "Manage Account" under the user menu icon on the upper right (it may have a non-image display). On the left, navigate to "SSH Keys," and then click "Add Key." On your host, open the file ~/.ssh/id_rsa.pub and copy the contents into text box on the Add Key page.=
Install Repo
Download Repo from the link and place it in either /usr/local/bin or /usr/bin
If you already have repo installed, check that the REPO_URL points to the following url:
REPO_URL = 'ssh://git@stash.devlan.net:7999/gitrepo/git-repo.git'
It is located at the top of the repo script.
Setting up Environment on OSXApple operating system 10.10.2
- Homebrew
- brew install android-ndk
- brew install ant
- cp smb://FS-01/share/MDB/Android/Software/SDK/android-sdk-macosx-platforms-3-21.tar.gz to your machine, then untar it.
- mv android-sdk-macosx directory to /opt/
- Define the following environment variables in your .bashrc:
-
export NDK=/usr/local/Cellar/android-ndk/r10d
export NDK_BIN=${NDK}/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin
export NDK_BIN64=${NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
export ANT_HOME=/usr/local/Cellar/ant/1.9.4/libexec
export ANDROID_SDK=/opt/android-sdk-macosx
export ANDROID_HOME=/usr/local/opt/android-sdkexport PATH=$PATH:${ANDROID_SDK}/platform-tools:/path/to/homebrew/bin
Install NDK
- Copy appropriate self-extracting NDKNative Development Kit bin from smb://FS-01/share/MDB/Android/Software/NDK
chmod u+x <NDK bin file>
./<NDK bin file>
Install Pandoc
smb://FS-01/share/MDB/OSX/Software/FreeSoftware/Utility/BasicTex.pkg
smb://FS-01/share/MDB/OSX/Software/FreeSoftware/Utility/pandoc-1.14.0.1-osx.pkg
copy it to local drive first
Setting up Environment on Ubuntu
Install SDK
From smb://FS-01/share/MDB/Android/Software
unzip depending on your platform android-sdk-linux-platforms.tar.gz or android-sdk-macosx-platforms-3-21.tar.gz
Install Dev tools
sudo apt-get install ant pandoc texlive build-essentials
Install JDK
sudo apt-get install openjdk-6-jdk
Setup Environment Variables
Put the following in your bashrc or environment. make sure it points to the correct location of your sdk, ndk, ant, etc...
export NDK=/opt/android-ndk-r10d
export NDK_BIN=${NDK}/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin
export NDK_BIN64=${NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin
export ANT_HOME=/usr/local/apache-ant-1.9.3
export ANDROID_SDK=/opt/android-sdk-linux
export ANDROID_PLATFORM_TOOLS=${ANDROID_SDK}/platform-tools
Install 32bit libs (if running on x86_64)
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
Some tools seem to require a 32bit env to build. Looking at you legba.
Troubleshooting
Proguard errors (on OSXApple operating system 10.9.x)
BUILD FAILED
... Can't read /Library/Java/JavaVirtualMachines/1.6.0_37-b06-434.jdk/Contents/lib/jsse.jar ...
cd /Library/Java/JavaVirtualMachines/1.6.0_37-b06-434.jdk/Contents/Home/lib
sudo ln -s ../../Classes/jsse.jar .
sudo ln -s ../../Classes/classes.jar rt.jar
The proguard configuration is looking for JARs in the wrong place. This will symlink the jar files to where they are expected
Android Studio Errors (on OSXApple operating system 10.10)
setup
put in your host file
#mdbtest
10.2.3.102 dl.google.com
When setting up, just ignore the errors, and select custom install. Unselect everything possible.
Set the sdk path to whatever you configured above.
It tries to download two files from the internets.
- http://dl.google.com/android/repository/repository-10.xml
- http://dl.google.com/android/repository/build-tools_r21.1.1-macosx.zip (on mac)
If it crashes immediately, verify or set your default jdk for Android Studio. It should be 1.7 or newer.
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
1.7.0_71, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
1.6.0_37-b06-434, x86_64: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0_37-b06-434.jdk/Contents/Home
1.6.0_37-b06-434, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0_37-b06-434.jdk/Contents/Home
$ launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/
Optional cool stuff
Private Key with passwords
Secure your private key, but save your password with keychain. When creating your public/private key, use a good password. OSXApple operating system will store the password in your login keychain. To avoid entering your password more than once per boot, you can use keychain on Linux.
apt-get install keychain
# in your bashrc, put the following
eval $(keychain --eval id_rsa)
Show your Git branch name (current branch you are pointed to) on the Terminal prompt
Steps:
1. Go to your home directory
2. type
gedit .bashrc
3. Find the block of code that looks like this and replace it with this code
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
unset color_prompt force_color_prompt