n2n/android
Felix Pojtinger 8d64ed3ff8
Standardize documentation (#211)
* Use Markdown for Android build docs, fix typos

* Format and correct syntax errors/irregularities in existing Markdown documents

* Convert `txt`-based docs to Markdown, update macOS instructions

* Use GitHub conventions for README, fix typos, add link to `gon2n`

* Fix case sensitivity issues
2020-03-28 19:24:34 +00:00
..
Hin2n Updated instructions, dependencies and configurations for gradle 4.4. 2019-07-03 22:02:40 +02:00
tun2tap Add support for Android 2018-06-12 02:59:13 +08:00
uip Add support for Android 2018-06-12 02:59:13 +08:00
edge_android.c Fix occasional connection issues on startup due to bad MAC address read 2019-09-22 20:16:01 +02:00
edge_android.h Add support for Android 2018-06-12 02:59:13 +08:00
edge_jni.c Add support for Android 2018-06-12 02:59:13 +08:00
README.md Standardize documentation (#211) 2020-03-28 19:24:34 +00:00
tuntap_android.c Add support for Android 2018-06-12 02:59:13 +08:00

Building n2n on Android

  • Install jdk.

  • Generate app keystore by the command keytool -genkey -alias Hin2n -keystore Hin2n.jks. And remember these two passwords:

    keytool -genkey -dname "CN=Unknown,O=Unknown,C=Unknown" -keystore Hin2n.jks -keysize 1024 -alias Hin2nalias -validity 14000 -keypass yourpassword -storepass yourpassword
    
  • Move Hin2n.jks to android/Hin2n/app directory. We will use this file to sign the application.

  • In the file app/build.gradle replace yourpassword with the password used to generate the keystore.

  • Download Android tools from https://developer.android.com/, and unzip it.

  • Install Android development environment.

    echo y | ./tools/bin/sdkmanager tools
    echo y | ./tools/bin/sdkmanager platform-tools
    echo y | ./tools/bin/sdkmanager ndk-bundle
    echo y | ./tools/bin/sdkmanager "cmake;3.6.4111459"
    echo y | ./tools/bin/sdkmanager "lldb;3.1"
    
  • Set environment variables.

    export ANDROID_HOME=YOUE_ANDROID_DEV_HOME
    export ANDROID_NDK_HOME=\$ANDROID_HOME/ndk-bundle
    export HIN2N_KSTOREPWD=YOUR_APP_KEYSTORE_PASSWORD
    export HIN2N_KEYPWD=YOUR_APP_KEY_PASSWORD
    
  • Compile the app.

    cd android/Hin2n
    ./gradlew assemble
    
  • You will get the app in android/Hin2n/app/build/outputs/apk/ directory.