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
- Install 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-sdk
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 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 Ant
sudo apt-get install ant
Install JDK
sudo apt-get install openjdk-jdk-6
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)
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/
** TODO: Mirror repository-XX.xml that android studio 1.1 attempts to download to
- http://dl.google.com/android/repository/repository-10.xml
- http://dl.google.com/android/repository/build-tools_r21.1.1-macosx.zip (on mac)
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)