Discover Packages
go.psiphon.dev/tunnel-core
AndroidLibrary
directory
Version:
v0.0.10-alpha
Opens a new window with list of versions in this module.
Published: Nov 27, 2015
License: GPL-3.0
Opens a new window with license information.
README
README
¶
Psiphon Library for Android 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.
Status
Building From Source
Follow Go Android documentation:
gomobile documentation
Requires Go 1.5 or later.
Build command: gomobile bind -target=android github.com/Psiphon-Labs/psiphon-tunnel-core/AndroidLibrary/psi
Record build version info, as described here , by passing a -ldflags
argument to gomobile bind
.
Output: psi.aar
Using
Build psi.aar
from source or use the binary release
Add psi.aar
to your Android Studio project as described in the gomobile documentation
Example usage in Psibot sample app
See sample API usage in Psibot's PsiphonVpn.java . Uses gobind
conventions for data passing.
Embed a config file
Call Go.init(getApplicationContext());
in Application.onCreate()
Extend Psi.Listener.Stub
to receive messages in Message(String line)
Call Psi.Start(configFile, Psi.Listener)
to start Psiphon. Catch Exception
to receive errors.
Call Psi.Stop()
to stop Psiphon.
Sample shows how to monitor messages and detect which proxy ports to use and when the tunnel is active.
NOTE: may add more explicit interface for state change events.
Limitations
Only supports one concurrent instance of Psiphon.
Expand ▾
Collapse ▴
Directories
¶
Click to show internal directories.
Click to hide internal directories.