Compare commits
16 Commits
android-0.
...
android-0.
Author | SHA1 | Date | |
---|---|---|---|
3863c0e183 | |||
69ea3d8bde | |||
7cafe6da48 | |||
9464b46ad0 | |||
c230a5a101 | |||
3d37f2ae07 | |||
f88aafe292 | |||
aa2dab1d3c | |||
8e85eaa2f0 | |||
6a1848caf6 | |||
aa36b4cb14 | |||
78d4b12142 | |||
c2f3a80dec | |||
a679784aab | |||
835667437b | |||
f016edec7a |
@ -12,15 +12,16 @@ in their main repository.
|
||||
|
||||
## Prerequirements
|
||||
|
||||
1. Ensure you got the deprecated maven ant tasks. ( https://maven.apache.org/ant-tasks/download.cgi )
|
||||
1. Ensure you have the deprecated maven ant tasks. ( https://maven.apache.org/ant-tasks/download.cgi )
|
||||
2. It should exist at `~/.ant/lib/maven-ant-tasks-2.1.3.jar`
|
||||
3. Ensure you got hamcrest-integration, hamcrest-library, hamcrest-core in the hamcrest.home directory.
|
||||
3. Ensure you have hamcrest-integration, hamcrest-library, hamcrest-core in the hamcrest.home directory.
|
||||
4. Ensure junit 4.12 at least in junit.home, ensure the jar file is named `junit4.jar`.
|
||||
5. Ensure to have updated the changelog with the changes done.
|
||||
6. Ensure that you are configured to build i2p.i2p with Java 8. On Debian it is easiest to set with
|
||||
5. Ensure you have the Mockito framework and accompanying documentation in your $JAVA_HOME
|
||||
6. Ensure to have updated the changelog with the changes done.
|
||||
7. Ensure that you are configured to build i2p.i2p with Java 8. On Debian it is easiest to set with
|
||||
`update-java-alternatives --set java-8-openjdk-amd64` and picking Java 8. **TODO:** add instructions for non-Debian-based
|
||||
systems.
|
||||
7. Ensure that you have a Java 1.7 bootclasspath available. (See **Maven Central** step 2A.)
|
||||
8. Ensure that you have a Java 1.7 bootclasspath available. (See **Maven Central** step 2A.)
|
||||
|
||||
|
||||
## Get all the dependencies ready
|
||||
@ -33,10 +34,6 @@ in their main repository.
|
||||
2. **A)** I2P for Android requires a Java 1.7 bootclasspath, but the servlet jar requires Java 8. So, to do the builds:
|
||||
- First set `javac.compilerargs=-bootclasspath /path/to/java/7/rt.jar:/path/to/java/7/jce.jar` in override.properties
|
||||
- Build with `ant mavenCentral`
|
||||
- upload everything *except* servlet.jar
|
||||
- Unset bootclasspath in override.properties
|
||||
- Build with `ant mavenCentral`
|
||||
- upload servlet.jar
|
||||
3. Login to http://oss.sonatype.org for uploading the mavencentral-*.jar bundles.
|
||||
4. In nexus, choose "Staging Upload" and upload all of the files with upload mode set to "Artifacts with POM".
|
||||
When uploading the files to nexus, you *must* upload the pom.xml files, and all of their artifacts. For each
|
||||
|
@ -7,7 +7,7 @@ repositories {
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
defaultConfig {
|
||||
versionCode 4745259
|
||||
versionCode 4745260
|
||||
versionName "$I2P_VERSION"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION as String)
|
||||
@ -114,7 +114,7 @@ task copyI2PResources(type: Copy) {
|
||||
outputs.upToDateWhen { false }
|
||||
into 'src/main/res'
|
||||
into('drawable') {
|
||||
from file(i2pbase + '/installer/resources/themes/console/images/i2plogo.png')
|
||||
from file(i2pbase + '/apps/routerconsole/jsp/themes/console/images/i2plogo.png')
|
||||
}
|
||||
into('raw') {
|
||||
from(i2pbase + '/installer/resources/blocklist.txt') { rename { 'blocklist_txt' } }
|
||||
@ -177,15 +177,15 @@ task copyI2PAssets(type: Copy) {
|
||||
outputs.upToDateWhen { false }
|
||||
into 'src/main/assets/themes/console'
|
||||
into('images') {
|
||||
from file(i2pbase + '/installer/resources/themes/console/images/i2plogo.png')
|
||||
from file(i2pbase + '/installer/resources/themes/console/images/inbound.png')
|
||||
from file(i2pbase + '/installer/resources/themes/console/images/outbound.png')
|
||||
from file(i2pbase + '/apps/routerconsole/jsp/themes/console/images/i2plogo.png')
|
||||
from file(i2pbase + '/apps/routerconsole/jsp/themes/console/images/inbound.png')
|
||||
from file(i2pbase + '/apps/routerconsole/jsp/themes/console/images/outbound.png')
|
||||
}
|
||||
into('light') {
|
||||
from file(i2pbase + '/installer/resources/themes/console/light/console.css')
|
||||
from file(i2pbase + '/apps/routerconsole/jsp/themes/console/light/console.css')
|
||||
}
|
||||
into('light/images') {
|
||||
from file(i2pbase + '/installer/resources/themes/console/light/images/header.png')
|
||||
from file(i2pbase + '/apps/routerconsole/jsp/themes/console/light/images/header.png')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ class InitActivities {
|
||||
|
||||
File docsDir = new File(myDir, "docs");
|
||||
docsDir.mkdir();
|
||||
copyResourceToFile(R.raw.ahelper_conflict_header_ht, "docs/ahelper-conflict-header.ht");
|
||||
/*copyResourceToFile(R.raw.ahelper_conflict_header_ht, "docs/ahelper-conflict-header.ht");
|
||||
copyResourceToFile(R.raw.ahelper_new_header_ht, "docs/ahelper-new-header.ht");
|
||||
copyResourceToFile(R.raw.ahelper_notfound_header_ht, "docs/ahelper-notfound-header.ht");
|
||||
copyResourceToFile(R.raw.auth_header_ht, "docs/auth-header.ht");
|
||||
@ -110,7 +110,7 @@ class InitActivities {
|
||||
copyResourceToFile(R.raw.noproxy_header_ht, "docs/noproxy-header.ht");
|
||||
copyResourceToFile(R.raw.protocol_header_ht, "docs/protocol-header.ht");
|
||||
copyResourceToFile(R.raw.reset_header_ht, "docs/reset-header.ht");
|
||||
copyResourceToFile(R.raw.resetp_header_ht, "docs/resetp-header.ht");
|
||||
copyResourceToFile(R.raw.resetp_header_ht, "docs/resetp-header.ht");*/
|
||||
|
||||
File cssDir = new File(docsDir, "themes/console/light");
|
||||
cssDir.mkdirs();
|
||||
|
@ -5,11 +5,13 @@ import android.os.Build;
|
||||
import android.support.v4.util.Pair;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.i2p.android.router.R;
|
||||
import net.i2p.android.util.FragmentUtils;
|
||||
@ -129,6 +131,17 @@ public class TunnelEntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
}
|
||||
}
|
||||
|
||||
private void setClipboard(Context context, String text) {
|
||||
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clipboard.setText(text);
|
||||
} else {
|
||||
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
android.content.ClipData clip = android.content.ClipData.newPlainText("Copied Text", text);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
}
|
||||
}
|
||||
|
||||
// Replace the contents of a view (invoked by the layout manager)
|
||||
@Override
|
||||
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
|
||||
@ -183,6 +196,19 @@ public class TunnelEntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
ViewCompat.getTransitionName(tvh.status));
|
||||
Pair<View, String>[] pairs = new Pair[]{ statusPair};
|
||||
mListener.onTunnelSelected(tunnel.getId(), pairs);
|
||||
view.invalidate();
|
||||
}
|
||||
});
|
||||
tvh.itemView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
//@Override
|
||||
public boolean onLongClick(View view) {
|
||||
setClipboard(mCtx, tunnel.getDestHashBase32());
|
||||
Toast clipboardMessage = Toast.makeText(mCtx, R.string.copied_base32_system_notification_title, Toast. LENGTH_LONG);
|
||||
clipboardMessage.setGravity(Gravity.TOP, 0, 0); //optional
|
||||
clipboardMessage.show();
|
||||
view.invalidate();
|
||||
return true;
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
@ -190,6 +216,7 @@ public class TunnelEntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Return the size of the dataset (invoked by the layout manager)
|
||||
|
@ -5,6 +5,7 @@ import android.content.Context;
|
||||
//import net.i2p.BOB.BOB;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.addressbook.DaemonThread;
|
||||
import android.preference.PreferenceManager;
|
||||
import net.i2p.android.apps.NewsFetcher;
|
||||
import net.i2p.android.router.util.Notifications;
|
||||
import net.i2p.android.router.util.Util;
|
||||
@ -14,8 +15,11 @@ import net.i2p.router.JobImpl;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.startup.RouterAppManager;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.sam.SAMBridge;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Load the clients we want.
|
||||
@ -41,6 +45,7 @@ class LoadClientsJob extends JobImpl {
|
||||
private final Context mCtx;
|
||||
private final Notifications _notif;
|
||||
private DaemonThread _addressbook;
|
||||
public SAMBridge SAM_BRIDGE;
|
||||
//private BOB _bob;
|
||||
|
||||
/** this is the delay to load (and start) the clients. */
|
||||
@ -57,8 +62,9 @@ class LoadClientsJob extends JobImpl {
|
||||
public String getName() { return "Start Clients"; }
|
||||
|
||||
public void runJob() {
|
||||
Job j = new RunI2PTunnel(getContext());
|
||||
getContext().jobQueue().addJob(j);
|
||||
Job jtunnel = new RunI2PTunnel(getContext());
|
||||
getContext().jobQueue().addJob(jtunnel);
|
||||
|
||||
|
||||
Thread t = new I2PAppThread(new StatSummarizer(), "StatSummarizer", true);
|
||||
t.setPriority(Thread.NORM_PRIORITY - 1);
|
||||
@ -69,7 +75,15 @@ class LoadClientsJob extends JobImpl {
|
||||
//try {
|
||||
// _bob.startup();
|
||||
//} catch (IOException ioe) {}
|
||||
|
||||
boolean useSAM = PreferenceManager.getDefaultSharedPreferences(mCtx).getBoolean("i2pandroid.client.SAM", true);
|
||||
Util.i("SAM API " + useSAM);
|
||||
if (useSAM) {
|
||||
Job jsam = new RunI2PSAM(getContext());
|
||||
getContext().jobQueue().addJob(jsam);
|
||||
Util.i("SAM API started successfully" + useSAM);
|
||||
}else{
|
||||
Util.i("SAM API disabled, not starting "+useSAM);
|
||||
}
|
||||
getContext().addShutdownTask(new ClientShutdownHook());
|
||||
}
|
||||
|
||||
@ -82,12 +96,13 @@ class LoadClientsJob extends JobImpl {
|
||||
public String getName() { return "Start I2P Tunnel"; }
|
||||
|
||||
public void runJob() {
|
||||
while (!getContext().router().isRunning()) {
|
||||
try { Thread.sleep(1000); } catch (InterruptedException ie) { return; }
|
||||
if (!getContext().router().isAlive()) {
|
||||
if (!getContext().router().isRunning()) {
|
||||
if (getContext().router().isAlive()) {
|
||||
requeue(1000);
|
||||
} else {
|
||||
Util.e("Router stopped before i2ptunnel could start");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
Util.d("Starting i2ptunnel");
|
||||
TunnelControllerGroup tcg = TunnelControllerGroup.getInstance(getContext());
|
||||
@ -112,6 +127,46 @@ class LoadClientsJob extends JobImpl {
|
||||
}
|
||||
}
|
||||
|
||||
private class RunI2PSAM extends JobImpl {
|
||||
|
||||
public RunI2PSAM(RouterContext ctx) {
|
||||
super(ctx);
|
||||
}
|
||||
|
||||
public String getName() { return "Start SAM API"; }
|
||||
|
||||
public void runJob() {
|
||||
if (!getContext().router().isRunning()) {
|
||||
if (getContext().router().isAlive()) {
|
||||
requeue(1000);
|
||||
} else {
|
||||
Util.e("Router stopped before SAM API could start");
|
||||
}
|
||||
return;
|
||||
}
|
||||
Util.d("Starting SAM");
|
||||
try {
|
||||
Util.i("Starting the SAM API");
|
||||
SAM_BRIDGE = new SAMBridge("127.0.0.1",
|
||||
7656,
|
||||
false,
|
||||
SAM_PROPERTIES(),
|
||||
"sam.keys",
|
||||
new File("sam_config"));
|
||||
SAM_BRIDGE.run();
|
||||
} catch (IOException e) {
|
||||
Util.e( e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public Properties SAM_PROPERTIES() throws IOException {
|
||||
Util.i("Getting the default properties");
|
||||
Properties sam_properties = new Properties();
|
||||
return sam_properties;
|
||||
}
|
||||
}
|
||||
|
||||
private class ClientShutdownHook implements Runnable {
|
||||
public void run() {
|
||||
Util.d("client shutdown hook");
|
||||
@ -120,6 +175,8 @@ class LoadClientsJob extends JobImpl {
|
||||
// NewsFetcher registers its own hook
|
||||
//if (_bob != null)
|
||||
// _bob.shutdown(null);
|
||||
if (SAM_BRIDGE != null)
|
||||
SAM_BRIDGE.shutdown(null);
|
||||
if (_addressbook != null)
|
||||
_addressbook.halt();
|
||||
}
|
||||
|
@ -1,23 +1,17 @@
|
||||
package net.i2p.android.router.service;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteCallbackList;
|
||||
import android.os.RemoteException;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
|
||||
import net.i2p.android.router.R;
|
||||
@ -175,42 +169,22 @@ public class RouterService extends Service {
|
||||
}
|
||||
_handler.removeCallbacks(_updater);
|
||||
_handler.postDelayed(_updater, 50);
|
||||
|
||||
// We need to *not* check if we're restarting on Android greater than Oreo due to
|
||||
// changes in how notifications work and the use of NotificationChannels.
|
||||
if(!restart) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
startOwnForeground();
|
||||
else
|
||||
startForeground(1337, _statusBar.getNote());
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
startForeground(1337, _statusBar.getNote());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//return START_STICKY;
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Android 8.1, 9.0, 10 handle foreground applications differently and as such require us to
|
||||
* start our foreground service differently.
|
||||
* */
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
private void startOwnForeground(){
|
||||
String NOTIFICATION_CHANNEL_ID = "com.example.simpleapp";
|
||||
String channelName = "My Background Service";
|
||||
NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_NONE);
|
||||
chan.setLightColor(Color.BLUE);
|
||||
chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
assert manager != null;
|
||||
manager.createNotificationChannel(chan);
|
||||
|
||||
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
|
||||
Notification notification = notificationBuilder.setOngoing(true)
|
||||
.setSmallIcon(R.drawable.i2plogo)
|
||||
.setContentTitle(getString(R.string.running_background))
|
||||
.setPriority(NotificationManager.IMPORTANCE_MIN)
|
||||
.setCategory(Notification.CATEGORY_SERVICE)
|
||||
.build();
|
||||
startForeground(1337, notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* maybe this goes away when the receiver can bind to us
|
||||
*/
|
||||
|
@ -1,11 +1,15 @@
|
||||
package net.i2p.android.router.service;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.view.Gravity;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.i2p.android.I2PActivity;
|
||||
import net.i2p.android.router.R;
|
||||
@ -16,6 +20,9 @@ class StatusBar {
|
||||
private final NotificationManager mNotificationManager;
|
||||
private final NotificationCompat.Builder mNotifyBuilder;
|
||||
private Notification mNotif;
|
||||
private final String NOTIFICATION_CHANNEL_ID = "net.i2p.android.STARTUP_STATE_CHANNEL";
|
||||
private final String channelName = "I2P Router Service";
|
||||
NotificationChannel mNotificationChannel;
|
||||
|
||||
private static final int ID = 1337;
|
||||
|
||||
@ -28,25 +35,33 @@ class StatusBar {
|
||||
|
||||
StatusBar(Context ctx) {
|
||||
mCtx = ctx;
|
||||
mNotificationManager = (NotificationManager) ctx.getSystemService(
|
||||
mNotificationManager = (NotificationManager) mCtx.getSystemService(
|
||||
Context.NOTIFICATION_SERVICE);
|
||||
assert mNotificationManager != null;
|
||||
|
||||
Thread.currentThread().setUncaughtExceptionHandler(
|
||||
new CrashHandler(mNotificationManager));
|
||||
|
||||
int icon = ICON_STARTING;
|
||||
// won't be shown if replace() is called
|
||||
String text = ctx.getString(R.string.notification_status_starting);
|
||||
String text = mCtx.getString(R.string.notification_status_starting);
|
||||
|
||||
mNotifyBuilder = new NotificationCompat.Builder(ctx)
|
||||
.setContentText(text)
|
||||
.setSmallIcon(icon)
|
||||
.setColor(mCtx.getResources().getColor(R.color.primary_light))
|
||||
.setOngoing(true)
|
||||
.setOnlyAlertOnce(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
mNotifyBuilder = new NotificationCompat.Builder(mCtx);
|
||||
} else {
|
||||
mNotifyBuilder = new NotificationCompat.Builder(mCtx, NOTIFICATION_CHANNEL_ID);
|
||||
}
|
||||
|
||||
Intent intent = new Intent(ctx, I2PActivity.class);
|
||||
mNotifyBuilder.setContentText(text);
|
||||
mNotifyBuilder.setSmallIcon(icon);
|
||||
mNotifyBuilder.setColor(mCtx.getResources().getColor(R.color.primary_light));
|
||||
mNotifyBuilder.setOngoing(true);
|
||||
mNotifyBuilder.setPriority(NotificationManager.IMPORTANCE_LOW);
|
||||
mNotifyBuilder.setCategory(Notification.CATEGORY_SERVICE);
|
||||
|
||||
Intent intent = new Intent(mCtx, I2PActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent pi = PendingIntent.getActivity(ctx, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
PendingIntent pi = PendingIntent.getActivity(mCtx, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
mNotifyBuilder.setContentIntent(pi);
|
||||
}
|
||||
|
||||
@ -74,6 +89,12 @@ class StatusBar {
|
||||
public void update(String title, String text) {
|
||||
mNotifyBuilder.setContentTitle(title)
|
||||
.setContentText(text);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
mNotificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_LOW);
|
||||
mNotificationManager.createNotificationChannel(mNotificationChannel);
|
||||
mNotificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
mNotifyBuilder.setChannelId(NOTIFICATION_CHANNEL_ID);
|
||||
}
|
||||
mNotif = mNotifyBuilder.build();
|
||||
mNotificationManager.notify(ID, mNotif);
|
||||
}
|
||||
|
@ -2,16 +2,20 @@ package net.i2p.android.router.util;
|
||||
|
||||
import net.i2p.android.router.R;
|
||||
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
public class Notifications {
|
||||
private final Context mCtx;
|
||||
private final NotificationManager mNotificationManager;
|
||||
|
||||
|
||||
|
||||
public static final int ICON = R.drawable.ic_stat_router_active;
|
||||
|
||||
public Notifications(Context ctx) {
|
||||
@ -25,13 +29,26 @@ public class Notifications {
|
||||
}
|
||||
|
||||
public void notify(String title, String text, Class<?> c) {
|
||||
NotificationCompat.Builder b =
|
||||
new NotificationCompat.Builder(mCtx)
|
||||
.setContentTitle(title)
|
||||
.setContentText(text)
|
||||
.setSmallIcon(ICON)
|
||||
.setColor(mCtx.getResources().getColor(R.color.primary_light))
|
||||
.setAutoCancel(true);
|
||||
notify(title, text, "", c);
|
||||
}
|
||||
|
||||
public void notify(String title, String text, String channel, Class<?> c) {
|
||||
NotificationCompat.Builder b;
|
||||
if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
b = new NotificationCompat.Builder(mCtx);
|
||||
} else {
|
||||
if (channel.equals("")){
|
||||
b = new NotificationCompat.Builder(mCtx);
|
||||
} else {
|
||||
b = new NotificationCompat.Builder(mCtx, channel);
|
||||
}
|
||||
}
|
||||
|
||||
b.setContentTitle(title);
|
||||
b.setContentText(text);
|
||||
b.setSmallIcon(ICON);
|
||||
b.setColor(mCtx.getResources().getColor(R.color.primary_light));
|
||||
b.setAutoCancel(true);
|
||||
|
||||
if (c != null) {
|
||||
Intent intent = new Intent(mCtx, c);
|
||||
|
@ -100,3 +100,56 @@ tunnel.3.option.outbound.length=2
|
||||
tunnel.3.option.outbound.lengthVariance=0
|
||||
tunnel.3.option.outbound.priority=15
|
||||
tunnel.3.startOnLoad=true
|
||||
|
||||
# I2P Git Repositories SSH Access
|
||||
tunnel.6.description=I2P Git Repositories SSH Access
|
||||
tunnel.6.interface=127.0.0.1
|
||||
tunnel.6.listenPort=7670
|
||||
tunnel.6.name=gitssh.idk.i2p
|
||||
tunnel.6.option.i2cp.closeIdleTime=1800000
|
||||
tunnel.6.option.i2cp.closeOnIdle=false
|
||||
tunnel.6.option.i2cp.delayOpen=true
|
||||
tunnel.6.option.i2cp.destination.sigType=7
|
||||
tunnel.6.option.i2cp.newDestOnResume=false
|
||||
tunnel.6.option.i2cp.reduceIdleTime=1200000
|
||||
tunnel.6.option.i2cp.reduceOnIdle=true
|
||||
tunnel.6.option.i2cp.reduceQuantity=1
|
||||
tunnel.6.option.inbound.backupQuantity=1
|
||||
tunnel.6.option.inbound.length=3
|
||||
tunnel.6.option.inbound.nickname=gitssh.idk.i2p
|
||||
tunnel.6.option.inbound.quantity=3
|
||||
tunnel.6.option.outbound.backupQuantity=1
|
||||
tunnel.6.option.outbound.length=3
|
||||
tunnel.6.option.outbound.nickname=gitssh.idk.i2p
|
||||
tunnel.6.option.outbound.quantity=3
|
||||
tunnel.6.sharedClient=false
|
||||
tunnel.6.startOnLoad=false
|
||||
tunnel.6.targetDestination=gitssh.idk.i2p
|
||||
tunnel.6.type=client
|
||||
|
||||
# I2P Git Repositories HTTP Access(Android only)
|
||||
# Disabled by default, useful for Android gitlab clients like labcoat
|
||||
tunnel.7.description=I2P Git Repositories HTTP Access(Android Only)
|
||||
tunnel.7.interface=127.0.0.1
|
||||
tunnel.7.listenPort=7671
|
||||
tunnel.7.name=git.idk.i2p
|
||||
tunnel.7.option.i2cp.closeIdleTime=1800000
|
||||
tunnel.7.option.i2cp.closeOnIdle=false
|
||||
tunnel.7.option.i2cp.delayOpen=true
|
||||
tunnel.7.option.i2cp.destination.sigType=7
|
||||
tunnel.7.option.i2cp.newDestOnResume=false
|
||||
tunnel.7.option.i2cp.reduceIdleTime=1200000
|
||||
tunnel.7.option.i2cp.reduceOnIdle=true
|
||||
tunnel.7.option.i2cp.reduceQuantity=1
|
||||
tunnel.7.option.inbound.backupQuantity=1
|
||||
tunnel.7.option.inbound.length=3
|
||||
tunnel.7.option.inbound.nickname=git.idk.i2p
|
||||
tunnel.7.option.inbound.quantity=3
|
||||
tunnel.7.option.outbound.backupQuantity=1
|
||||
tunnel.7.option.outbound.length=3
|
||||
tunnel.7.option.outbound.nickname=git.idk.i2p
|
||||
tunnel.7.option.outbound.quantity=3
|
||||
tunnel.7.sharedClient=false
|
||||
tunnel.7.startOnLoad=false
|
||||
tunnel.7.targetDestination=ssh.idk.i2p
|
||||
tunnel.7.type=client
|
||||
|
@ -50,7 +50,7 @@ i2np.bandwidth.outboundKBytesPerSecond=50
|
||||
#
|
||||
# NTCP
|
||||
#
|
||||
i2np.ntcp.enable=false
|
||||
i2np.ntcp.enable=true
|
||||
i2np.ntcp.maxConnections=32
|
||||
#
|
||||
# NTCP2
|
||||
|
@ -150,6 +150,9 @@
|
||||
<string name="notification_status_expl">Exploratory tunnels: %1$d/%2$d</string>
|
||||
<string name="notification_status_client">Client tunnels: %1$d/%2$d</string>
|
||||
|
||||
<string name="copied_base32_system_notification_title">Base32 copied to clipboard</string>
|
||||
<string name="copied_base32_system_notification_body">The address of your I2P tunnel has been copied to the clipboard.</string>
|
||||
|
||||
<string name="menu_settings">Settings</string>
|
||||
<string name="settings_enable">Enable</string>
|
||||
<string name="settings_desc_subscriptions">Subscription URLs</string>
|
||||
@ -182,7 +185,9 @@
|
||||
<string name="settings_label_transports">Transports</string>
|
||||
<string name="settings_label_maxConns">Max connections</string>
|
||||
<string name="settings_label_i2cp">I2CP interface</string>
|
||||
<string name="settings_desc_i2cp">Allow third-party apps to create tunnels (requires router restart)</string>
|
||||
<string name="settings_desc_i2cp">Allow third-party apps to create tunnels using I2CP (requires router restart)</string>
|
||||
<string name="settings_label_sam">SAM interface</string>
|
||||
<string name="settings_desc_sam">Allow third-party apps to create tunnels using SAM (requires router restart)</string>
|
||||
<string name="settings_label_exploratory_pool">Exploratory pool</string>
|
||||
<string name="settings_desc_exploratory_pool">Tunnel parameters</string>
|
||||
<string name="settings_label_expl_inbound">Inbound tunnels</string>
|
||||
|
@ -23,6 +23,13 @@
|
||||
android:summary="@string/settings_desc_i2cp"
|
||||
/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="i2pandroid.client.sam"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/settings_label_sam"
|
||||
android:summary="@string/settings_desc_sam"
|
||||
/>
|
||||
|
||||
<Preference
|
||||
android:key="preference_category_expl_tunnels"
|
||||
android:summary="@string/settings_desc_exploratory_pool"
|
||||
|
@ -408,14 +408,14 @@
|
||||
<target name="copy-i2p-resources" depends="-dirs" >
|
||||
<copy file="LICENSE.txt" tofile="res/raw/license_app_txt" />
|
||||
<copy file="licenses/LICENSE-Apache2.0.txt" tofile="res/raw/license_apache20_txt" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" />
|
||||
<copy file="${i2pbase}/apps/routerconsole/jsp/themes/console/images/i2plogo.png" todir="res/drawable/" />
|
||||
|
||||
<!-- Static web sources should be in the assets directory. -->
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/outbound.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/inbound.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/light/images/header.png" todir="assets/themes/console/light/images/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/light/console.css" todir="assets/themes/console/light/" />
|
||||
<copy file="${i2pbase}/apps/routerconsole/jsp/themes/console/images/i2plogo.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/apps/routerconsole/jsp/themes/console/images/outbound.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/apps/routerconsole/jsp/themes/console/images/inbound.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/apps/routerconsole/jsp/themes/console/light/images/header.png" todir="assets/themes/console/light/images/" />
|
||||
<copy file="${i2pbase}/apps/routerconsole/jsp/themes/console/light/console.css" todir="assets/themes/console/light/" />
|
||||
|
||||
<copy file="${i2pbase}/installer/resources/blocklist.txt" tofile="res/raw/blocklist_txt" />
|
||||
<copy file="${i2pbase}/installer/resources/hosts.txt" tofile="res/raw/hosts_txt" />
|
||||
|
@ -14,7 +14,7 @@ POM_DEVELOPER_ID=idk
|
||||
POM_DEVELOPER_NAME=idk
|
||||
POM_DEVELOPER_EMAIL=hankhill19580@gmail.com
|
||||
|
||||
I2P_VERSION=0.9.48
|
||||
ANDROID_BUILD_TARGET_SDK_VERSION=29
|
||||
ANDROID_BUILD_SDK_VERSION=28
|
||||
|
||||
I2P_VERSION=0.9.49
|
||||
|
@ -13,6 +13,7 @@ artifacts {
|
||||
routerjars file: file('libs/i2ptunnel.jar'), builtBy: buildRouter
|
||||
routerjars file: file('libs/i2ptunnel-ui.jar'), builtBy: buildRouter
|
||||
routerjars file: file('libs/addressbook.jar'), builtBy: buildRouter
|
||||
routerjars file: file('libs/sam.jar'), builtBy: buildRouter
|
||||
//routerjars file: file('libs/BOB.jar'), builtBy: buildRouter
|
||||
}
|
||||
clean.dependsOn cleanBuildRouter
|
||||
|
@ -20,6 +20,7 @@
|
||||
<available property="have.bob" file="${i2plib}/BOB.jar" />
|
||||
<available property="have.newsxml" file="${i2pbase}/apps/routerconsole/java/build/newsxml.jar" />
|
||||
<available property="have.i2ptunnel" file="${i2plib}/i2ptunnel-ui.jar" />
|
||||
<available property="have.sam" file="${i2plib}/sam.jar" />
|
||||
<available property="have.addressbook" file="${i2plib}/addressbook.jar" />
|
||||
|
||||
<target name="buildNewsXMLJar" unless="have.newsxml">
|
||||
@ -36,7 +37,11 @@
|
||||
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildBOB" />
|
||||
</target>
|
||||
|
||||
<target name="buildrouter" depends="buildNewsXMLJar, buildI2PTunnelJar, buildAddressbook">
|
||||
<target name="buildSAM" unless="have.sam">
|
||||
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildSAM" />
|
||||
</target>
|
||||
|
||||
<target name="buildrouter" depends="buildNewsXMLJar, buildI2PTunnelJar, buildAddressbook, buildSAM">
|
||||
<mkdir dir="${jar.libs.dir}" />
|
||||
|
||||
<!-- newsxml -->
|
||||
@ -50,10 +55,15 @@
|
||||
<copy file="${i2plib}/addressbook.jar" todir="${jar.libs.dir}" />
|
||||
|
||||
<!-- bob -->
|
||||
<!--
|
||||
|
||||
<!--
|
||||
<copy file="${i2plib}/BOB.jar" todir="${jar.libs.dir}" />
|
||||
-->
|
||||
|
||||
<!-- sam -->
|
||||
<copy file="${i2plib}/sam.jar" todir="${jar.libs.dir}" />
|
||||
|
||||
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
|
Reference in New Issue
Block a user