Miro Kuratczyk 778398d30c Added IPv6Synthesizer interface which allows the core tunnel to call into the host application to synthesize IPv6 addresses from IPv4 ones. This is used to correctly lookup IPs on DNS64/NAT64 networks. 9 лет назад
..
PsiphonTunnel 778398d30c Added IPv6Synthesizer interface which allows the core tunnel to call into the host application to synthesize IPv6 addresses from IPv4 ones. This is used to correctly lookup IPs on DNS64/NAT64 networks. 9 лет назад
SampleApps f6a0ce683d Add permissive license for sample code 9 лет назад
.gitignore 84688f702f Build script for for Android umbrella library 9 лет назад
Dockerfile 1ff34f84b7 - Fix: gomobile.goCmd doesn't treat "-tags" arguments correctly (see: https://github.com/golang/mobile/blob/0ba4e6463d71334d91dfbe1e4a92bb4ab2091716/cmd/gomobile/build.go#L268) 9 лет назад
README.md f2be0e3429 Make all builds work with new OPENSSL tag 9 лет назад
make.bash 4290bd35ba Build script changes 9 лет назад

README.md

Psiphon Android Library README

Overview

Psiphon Library for Android enables you to easily embed Psiphon in your Android app. The Psiphon Library for Android is implemented in Go and follows the standard conventions for using a Go library in an Android app.

Building with Docker

Note that you may need to use sudo docker below, depending on your OS.

Create the build image:
  1. While in the MobileLibrary/Android directory, run the command: docker build --no-cache=true -t psiandroid .

  2. Once completed, verify that you see an image named psiandroid when running: docker images

Run the build:

Ensure that the command below is run from within the MobileLibrary/Android directory

cd ../.. && \
  docker run \
  --rm \
  -v $(pwd):/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core \
  psiandroid \
  /bin/bash -c 'source /tmp/setenv-android.sh && cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android && ./make.bash' \
; cd -

When that command completes, the compiled .aar files (suitable for use in an Android Studio project) will be located in the current directory (it will likely be owned by root, so be sure to chown to an appropriate user).

Building without Docker (from source)

Prerequisites:
  • The build-essential package (on Debian based systems - or its equivalent for your platform)
  • Go 1.5 or later
  • Full JDK
  • Android NDK
  • Android SDK
  • OpenSSL (tested against the version here)
    • Follow its README to prepare the environment before you follow the steps below
Steps:
  1. Follow Go Android documentation (gomobile documentation)
  2. Run make.bash

Using the Library

  1. Build ca.psiphon.aar from via the docker container, from source, or use the binary release
  2. Add ca.psiphon.aar to your Android Studio project as described in the gomobile documentation
  3. Example usage in TunneledWebView sample app
Limitations
  • Only supports one concurrent instance of Psiphon.