Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #58

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
00279a1
Some cleaning up of AdminApi
benhylau Apr 19, 2016
89b8ee5
Make the app work without root via VpnService
benhylau Apr 28, 2016
d142a19
Add a second public peer
benhylau Apr 29, 2016
2ca111d
Hook up basic UI to AdminApi
benhylau Apr 29, 2016
8638481
Reset IPv6 identity of node
benhylau Apr 29, 2016
701295c
Hide Connectivity Settings
benhylau Apr 29, 2016
09e8638
Sharing cjdns IPv6 on click
benhylau Apr 29, 2016
8f92f7a
Proper shutdown sequence of VPN service
benhylau Apr 30, 2016
fae6224
Automatically build cjdroute and some updates
sssemil Jul 5, 2016
288de07
Update gradle
sssemil Jul 5, 2016
c4718c6
Update API in travis
sssemil Jul 5, 2016
1fb93d8
Oups
sssemil Jul 5, 2016
acfdd7e
Update readme n travis
sssemil Jul 5, 2016
1ba4d57
Hide cjdns build output unless an error is faced
sssemil Jul 5, 2016
221717f
Merge sssemil/patch-2 with hyperboria/develop
benhylau Oct 10, 2016
36d4357
Make everything build
benhylau Oct 12, 2016
a36d9b3
Merge develop
benhylau Oct 12, 2016
5e87f2a
Travis, use jdk8
benhylau Oct 12, 2016
e4203cc
Format
benhylau Oct 12, 2016
b760207
Update docs and fix Travis
benhylau Oct 12, 2016
b2162fe
Merge pull request #66 from hyperboria/sssemil-patch-2-merge
benhylau Oct 13, 2016
147cbc7
Update Gradle and Android SDK versions
benhylau Nov 29, 2016
9121429
Add flag to toggle compilation of cjdns native artifacts
benhylau Nov 29, 2016
4acb574
Update to Dagger 2.8
benhylau Nov 29, 2016
fa329ba
Disable incremental compile
benhylau Nov 29, 2016
f68e7a5
Fix .gitignore and commit missed files
benhylau Nov 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
.gradle/
.idea/
build/
cjdns-src/
local.properties
*.iml
*.class
src/main/assets/x86/
src/main/libs/
src/main/obj/
src/main/assets/armeabi/
src/main/assets/armeabi-v7a/
src/main/assets/cjdroute.conf
src/main/assets/arm64-v8a/
src/main/assets/x86/
src/main/assets/x86_64/
src/main/assets/mips/
src/main/assets/mips64/
src/main/assets/all/
20 changes: 14 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
language: android

android:
components:
- platform-tools
- tools

# The BuildTools version used by your project
- build-tools-23.0.2

# The SDK version used to compile your project
- android-23
- build-tools-25.0.1
- android-25

- extra-google-google_play_services
- extra-google-m2repository
Expand All @@ -18,4 +16,14 @@ android:
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'

script: ./gradlew assembleDebug
jdk:
- oraclejdk8

before_script:
- export NDK_VERSION=android-ndk-r11c
- curl -L https://dl.google.com/android/repository/${NDK_VERSION}-linux-x86_64.zip -O
- unzip -q ${NDK_VERSION}-linux-x86_64.zip
- export ANDROID_NDK_HOME=`pwd`/${NDK_VERSION}
- export PATH=${ANDROID_NDK_HOME}:${PATH}

script: ./assemble_debug
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,26 @@ cjdns for Android

Meshnet is an Android app that lets you connect to cjdns networks, without the need for a rooted phone—thanks to the android.net.VpnService API introduced with Android 4.0 (Ice Cream Sandwich). Older versions still require root and routes through a TUN device.

**Current state:** App starts and stops cjdroute for rooted devices with Android 4.4 (KitKat) and below. A public peer is added by default, so you should be able to browse websites and reach services on Hyperboria just by starting the cjdns service with the toggle. All other menus are only populated with mock data at the moment and you cannot add additional peers.
**Current state:** App starts and stops cjdroute and sets up a VPN to access Hyperboria for non-rooted devices. Two public peers are added by default, so you should be able to browse websites and reach services on Hyperboria just by starting the cjdns service with the toggle. All other menus are only populated with mock data at the moment and you cannot add additional peers.

Installation
------------

1. Install the [Android SDK](http://developer.android.com/sdk/index.html)
2. Clone this application repo
3. Clone [cjdns](https://github.com/hyperboria/cjdns) and build native binaries:
1. Install the [Android SDK](http://developer.android.com/sdk/index.html)
1. Clone this application repo

```
./android_do
```
1. Optionally download the [Android NDK](https://developer.android.com/ndk/index.html) version r11c and set `ANDROID_NDK_HOME` to its path

4. Copy built artifacts from **./build_android/** into the application repo such that corresponding **cjdroute** binaries are located as such:
1. Build application and install on device by running `./install_debug`. This will also clone the [cjdns repo](https://github.com/cjdelisle/cjdns) and build the native artifacts for Android. If `ANDROID_NDK_HOME` is not set or the version is incorrect, the Android NDK will also be downloaded.

```
./src/main/assets/armeabi-v7a/cjdroute
./src/main/assets/x86/cjdroute
```

5. Build application and install on device:

```
./gradlew installDebug
```
**Note:** The cjdns repo is currently cloned from a fork until patches are merged into **cjdelisle/cjdns**.

Contact
-------

- Find out how to help by visiting our [issue tracker](https://github.com/hyperboria/android/issues)
- IRC channel for this project: **#android on [HypeIRC](irc://irc.hypeirc.net)**

```
fc13:6176:aaca:8c7f:9f55:924f:26b3:4b14
fcbf:7bbc:32e4:0716:bd00:e936:c927:fc14
```
- [Matrix](https://matrix.org) chat room for this project: [#android:tomesh.net](https://chat.tomesh.net/#/room/#android:tomesh.net)

Notes
-----
Expand Down
4 changes: 4 additions & 0 deletions assemble_debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

ndk-build NDK_DEBUG=true NDK_PROJECT_PATH=src/main/
./gradlew assembleDebug
4 changes: 4 additions & 0 deletions assemble_release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

ndk-build NDK_DEBUG=false NDK_PROJECT_PATH=src/main/
./gradlew assembleRelease
72 changes: 60 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,93 @@ allprojects {
buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'org.ajoberstar:gradle-git:0.2.3'
}
}

ext {
supportVersion = '25.0.1'
}

import org.ajoberstar.gradle.git.tasks.GitClone

task cloneCjdns(type: GitClone) {
def destination = file("cjdns-src")

uri = "https://github.com/benhylau/cjdns"
// Use this repo until patch is merged in cjdelisle/cjdns
destinationPath = destination
bare = false
enabled = !destination.exists() // Clone only on first run
}

task buildCjdns(type: Exec) {
workingDir file("cjdns-src")
commandLine file("cjdns-src/android_do")
}

task copyNativeArtifacts(type: Copy) {
from 'cjdns-src/build_android/out/*'
into 'src/main/assets/'
}

apply plugin: 'com.android.application'
apply plugin: 'checkstyle'

android {
buildToolsVersion '23.0.2'
compileSdkVersion 23
buildToolsVersion "25.0.1"
compileSdkVersion 25

defaultConfig {
minSdkVersion 9
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0.0-SNAPSHOT"
}

sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir 'src/main/libs'
}

signingConfigs {
release
}

buildTypes {
release {
signingConfig signingConfigs.release
}
}

lintOptions {
disable 'InvalidPackage'
}
}

afterEvaluate {
if (COMPILE_CJDNS_NATIVE_ARTIFACTS.toBoolean()) {
android.applicationVariants.all { variant ->
variant.javaCompiler.dependsOn(cloneCjdns)
}
}
}

cloneCjdns.finalizedBy(buildCjdns)
buildCjdns.finalizedBy(copyNativeArtifacts)

dependencies {
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:preference-v7:23.1.1'
compile 'com.android.support:preference-v14:23.1.1'
compile "com.android.support:support-v4:$supportVersion"
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:cardview-v7:$supportVersion"
compile "com.android.support:recyclerview-v7:$supportVersion"
compile "com.android.support:preference-v7:$supportVersion"
compile "com.android.support:preference-v14:$supportVersion"
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.joanzapata.android:android-iconify:1.0.9'
compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') {
Expand All @@ -57,8 +105,8 @@ dependencies {
compile 'io.reactivex:rxjava:1.0.7'
compile 'io.reactivex:rxandroid:0.24.0'
compile 'com.squareup:otto:1.3.5'
compile 'com.squareup.dagger:dagger:1.2.2'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'com.google.dagger:dagger:2.8'
provided 'com.google.dagger:dagger-compiler:2.8'
}

if (project.hasProperty('keyAlias')) {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPILE_CJDNS_NATIVE_ARTIFACTS=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jan 06 21:17:32 EST 2015
#Tue Nov 29 01:09:49 EST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
4 changes: 4 additions & 0 deletions install_debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

ndk-build NDK_DEBUG=true NDK_PROJECT_PATH=src/main/
./gradlew installDebug
4 changes: 4 additions & 0 deletions install_release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

ndk-build NDK_DEBUG=false NDK_PROJECT_PATH=src/main/
./gradlew installRelease
3 changes: 3 additions & 0 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
</activity>

<service android:name=".CjdnsService" />
<service
android:name=".CjdnsVpnService"
android:permission="android.permission.BIND_VPN_SERVICE" />

</application>
</manifest>
Loading