diff --git a/android/README.txt b/android/README.txt index 70774a279..5f633b966 100644 --- a/android/README.txt +++ b/android/README.txt @@ -36,3 +36,5 @@ ant install #to rebuild and reinstall to emulator: ant reinstall + +# Now click on the I2P icon on your phone! diff --git a/android/res/raw/router_config b/android/res/raw/router_config index be361459b..ab9594484 100644 --- a/android/res/raw/router_config +++ b/android/res/raw/router_config @@ -6,17 +6,27 @@ i2p.dir.pid=/data/data/net.i2p.router/files/tmp prng.buffers=2 router.decayingBloomFilterM=20 stat.full=false -i2np.udp.maxConnections=30 +# # no I2CP +# i2p.dummyClientFacade=true -# for now +# +##### Transport +# +# +# NTCP +# #i2np.ntcp.enable=false +i2np.ntcp.maxConnections=8 # # UDP crashes the JVM, don't know why # i2np.udp.enable=false +i2np.udp.maxConnections=12 +# # no COMM at all!!! #i2p.vmCommSystem=true +# # not on android i2np.upnp.enable=false routerconsole.geoip.enable=false diff --git a/core/java/src/net/i2p/crypto/SHA256Generator.java b/core/java/src/net/i2p/crypto/SHA256Generator.java index a62f2129b..4224d2e21 100644 --- a/core/java/src/net/i2p/crypto/SHA256Generator.java +++ b/core/java/src/net/i2p/crypto/SHA256Generator.java @@ -32,6 +32,9 @@ public final class SHA256Generator { _useGnu = useGnu; } + /** + * @param context unused + */ public SHA256Generator(I2PAppContext context) { _digests = new LinkedBlockingQueue(32); } diff --git a/core/java/src/net/i2p/util/ReusableGZIPOutputStream.java b/core/java/src/net/i2p/util/ReusableGZIPOutputStream.java index bbc1c334a..f7665e2fc 100644 --- a/core/java/src/net/i2p/util/ReusableGZIPOutputStream.java +++ b/core/java/src/net/i2p/util/ReusableGZIPOutputStream.java @@ -15,7 +15,9 @@ import net.i2p.data.DataHelper; */ public class ReusableGZIPOutputStream extends ResettableGZIPOutputStream { // Apache Harmony 5.0M13 Deflater doesn't work after reset() - private static final boolean ENABLE_CACHING = !System.getProperty("java.vendor").startsWith("Apache"); + // Neither does Android + private static final boolean ENABLE_CACHING = !(System.getProperty("java.vendor").startsWith("Apache") || + System.getProperty("java.vendor").contains("Android")); private static final LinkedBlockingQueue _available; static { if (ENABLE_CACHING) diff --git a/history.txt b/history.txt index 5e4612090..184b42bc4 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,12 @@ +2011-06-02 zzz + * Android: Build fixes + * Crypto: + - HMAC Javadocs and cleanups + - HMAC Use SimpleByteCache + * ElGamalAESEngine: Fixups required after SessionKey enforcement + * Reseed: Give up on a seed after 90% of fetches fail + * SessionKey: Enforce data size and prevent reuse + 2011-06-01 zzz * Crypto: - Use java.security.MessageDigest instead of bundled GNU SHA-256 code diff --git a/router/java/src/net/i2p/data/i2np/DatabaseStoreMessage.java b/router/java/src/net/i2p/data/i2np/DatabaseStoreMessage.java index b0a4cfc6d..6ac4b4367 100644 --- a/router/java/src/net/i2p/data/i2np/DatabaseStoreMessage.java +++ b/router/java/src/net/i2p/data/i2np/DatabaseStoreMessage.java @@ -150,12 +150,15 @@ public class DatabaseStoreMessage extends I2NPMessageImpl { int len = Hash.HASH_LENGTH + 1 + 4; // key+type+replyToken if (_replyToken > 0) len += 4 + Hash.HASH_LENGTH; // replyTunnel+replyGateway - if (_dbEntry.getType() == DatabaseEntry.KEY_TYPE_LEASESET) { + int type = _dbEntry.getType(); + if (type == DatabaseEntry.KEY_TYPE_LEASESET) { _byteCache = _dbEntry.toByteArray(); - } else if (_dbEntry.getType() == DatabaseEntry.KEY_TYPE_ROUTERINFO) { + } else if (type == DatabaseEntry.KEY_TYPE_ROUTERINFO) { byte uncompressed[] = _dbEntry.toByteArray(); _byteCache = DataHelper.compress(uncompressed); len += 2; + } else { + throw new IllegalStateException("Invalid key type " + type); } len += _byteCache.length; return len; @@ -166,7 +169,7 @@ public class DatabaseStoreMessage extends I2NPMessageImpl { if (_dbEntry == null) throw new I2NPMessageException("Missing entry"); int type = _dbEntry.getType(); if (type != DatabaseEntry.KEY_TYPE_LEASESET && type != DatabaseEntry.KEY_TYPE_ROUTERINFO) - throw new I2NPMessageException("Invalid key type"); + throw new I2NPMessageException("Invalid key type " + type); // Use the hash of the DatabaseEntry System.arraycopy(getKey().getData(), 0, out, curIndex, Hash.HASH_LENGTH); diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index f9275bada..1245a6208 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -311,8 +311,11 @@ public class Router { } public RouterInfo getRouterInfo() { return _routerInfo; } + public void setRouterInfo(RouterInfo info) { _routerInfo = info; + if (_log.shouldLog(Log.INFO)) + _log.info("setRouterInfo() : " + info, new Exception("I did it")); if (info != null) _context.jobQueue().addJob(new PersistRouterInfoJob(_context)); } @@ -614,6 +617,10 @@ public class Router { } } // hard and ugly + if (System.getProperty("wrapper.version") != null) + _log.log(Log.CRIT, "Restarting with new router identity"); + else + _log.log(Log.CRIT, "Shutting down because old router identity was invalid - restart I2P"); finalShutdown(EXIT_HARD_RESTART); } diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index ea17ad55f..e1f87e077 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 15; + public final static long BUILD = 16; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java b/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java index c2275a90d..8ca29317c 100644 --- a/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java +++ b/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java @@ -65,7 +65,7 @@ public class PublishLocalRouterInfoJob extends JobImpl { try { getContext().netDb().publish(ri); } catch (IllegalArgumentException iae) { - _log.log(Log.CRIT, "Error publishing our identity - corrupt?", iae); + _log.log(Log.CRIT, "Error publishing our identity - corrupt? Restart required", iae); getContext().router().rebuildNewIdentity(); } } catch (DataFormatException dfe) {