diff --git a/app/build.gradle b/app/build.gradle
index 3d7d822..b6cbeaa 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -24,6 +24,7 @@ android {
}
dependencies {
+ compile 'net.i2p.android:client:0.1@aar'
compile project(':botejars')
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:support-v4:19.1.0'
diff --git a/app/src/main/aidl/net/i2p/android/router/service/IRouterState.aidl b/app/src/main/aidl/net/i2p/android/router/service/IRouterState.aidl
deleted file mode 100644
index 1a087bc..0000000
--- a/app/src/main/aidl/net/i2p/android/router/service/IRouterState.aidl
+++ /dev/null
@@ -1,33 +0,0 @@
-package net.i2p.android.router.service;
-
-import net.i2p.android.router.service.IRouterStateCallback;
-
-/**
- * An interface for determining the state of the I2P RouterService.
- */
-interface IRouterState {
-
- /**
- * This allows I2P to inform on state changes.
- */
- void registerCallback(IRouterStateCallback cb);
-
- /**
- * Remove registered callback interface.
- */
- void unregisterCallback(IRouterStateCallback cb);
-
- /**
- * Determines whether the RouterService has been started. If it hasn't, no
- * state changes will ever occur from this RouterService instance, and the
- * client should unbind and inform the user that the I2P router is not
- * running (and optionally send a net.i2p.android.router.START_I2P Intent).
- */
- boolean isStarted();
-
- /**
- * Get the state of the I2P router
- **/
- String getState();
-
-}
diff --git a/app/src/main/aidl/net/i2p/android/router/service/IRouterStateCallback.aidl b/app/src/main/aidl/net/i2p/android/router/service/IRouterStateCallback.aidl
deleted file mode 100644
index a5ee84c..0000000
--- a/app/src/main/aidl/net/i2p/android/router/service/IRouterStateCallback.aidl
+++ /dev/null
@@ -1,13 +0,0 @@
-package net.i2p.android.router.service;
-
-/**
- * Callback interface used to send synchronous notifications of the current
- * RouterService state back to registered clients. Note that this is a
- * one-way interface so the server does not block waiting for the client.
- */
-oneway interface IRouterStateCallback {
- /**
- * Called when the state of the I2P router changes
- */
- void stateChanged(String newState);
-}
diff --git a/app/src/main/java/i2p/bote/android/service/BoteService.java b/app/src/main/java/i2p/bote/android/service/BoteService.java
index c99057a..9f8b344 100644
--- a/app/src/main/java/i2p/bote/android/service/BoteService.java
+++ b/app/src/main/java/i2p/bote/android/service/BoteService.java
@@ -8,6 +8,7 @@ import javax.mail.MessagingException;
import net.i2p.android.router.service.IRouterState;
import net.i2p.android.router.service.IRouterStateCallback;
+import net.i2p.android.router.service.State;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.RouterLaunch;
@@ -146,8 +147,8 @@ public class BoteService extends Service implements NetworkStatusListener, NewEm
mStateService = IRouterState.Stub.asInterface(service);
try {
mStateService.registerCallback(mStatusListener);
- String state = mStateService.getState();
- if ("ACTIVE".equals(state))
+ final int state = mStateService.getState();
+ if (state == State.ACTIVE)
I2PBote.getInstance().connectNow();
} catch (RemoteException e) {
// TODO Auto-generated catch block
@@ -164,11 +165,11 @@ public class BoteService extends Service implements NetworkStatusListener, NewEm
private final IRouterStateCallback.Stub mStatusListener =
new IRouterStateCallback.Stub() {
- public void stateChanged(String newState) throws RemoteException {
- if ("STOPPING".equals(newState) ||
- "MANUAL_STOPPING".equals(newState) ||
- "MANUAL_QUITTING".equals(newState) ||
- "NETWORK_STOPPING".equals(newState))
+ public void stateChanged(int newState) throws RemoteException {
+ if (newState == State.STOPPING ||
+ newState == State.MANUAL_STOPPING ||
+ newState == State.MANUAL_QUITTING ||
+ newState == State.NETWORK_STOPPING)
stopSelf();
}
};
diff --git a/botejars/build.gradle b/botejars/build.gradle
index 6855de4..7fa72eb 100644
--- a/botejars/build.gradle
+++ b/botejars/build.gradle
@@ -8,10 +8,7 @@ task buildJars(type: Exec) {
// TODO an empty botejars.jar is added to the classpath
artifacts {
- 'default' file: file('libs/i2p.jar'), builtBy: buildJars
'default' file: file('libs/router.jar'), builtBy: buildJars
- 'default' file: file('libs/mstreaming.jar'), builtBy: buildJars
- 'default' file: file('libs/streaming.jar'), builtBy: buildJars
'default' file: file('libs/bcprov-ecc-jdk16-146.jar'), builtBy: buildJars
'default' file: file('libs/flexi-gmss-1.7p1.jar'), builtBy: buildJars
'default' file: file('libs/lzma-9.20.jar'), builtBy: buildJars
diff --git a/botejars/build.xml b/botejars/build.xml
index 5facff4..ba28680 100644
--- a/botejars/build.xml
+++ b/botejars/build.xml
@@ -69,21 +69,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/build.gradle b/build.gradle
index 76a4eef..660c6e4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -10,6 +10,9 @@ buildscript {
allprojects {
repositories {
+// flatDir {
+// dirs file("${project.rootDir}/aars")
+// }
mavenCentral()
}
}
\ No newline at end of file