diff --git a/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java b/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java index ad49044f2457dc24a1a67063fe51b98822bbf915..6b7c80bd75e470bfef8985b52a919b8954e64f3f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java +++ b/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java @@ -158,6 +158,8 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { // right at instantiation if the news is already indicating a new version Checker c = new NewsHandler(_context, this); register(c, NEWS, HTTP, 0); + // TODO + //register(c, NEWS_SU3, HTTP, 0); register(c, ROUTER_SIGNED, HTTP, 0); // news is an update checker for the router Updater u = new UpdateHandler(_context, this); register(u, ROUTER_SIGNED, HTTP, 0); @@ -734,9 +736,9 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { UpdateType type, String id, Map<UpdateMethod, List<URI>> sourceMap, String newVersion, String minVersion) { - if (type == NEWS) { + if (type == NEWS || type == NEWS_SU3) { // shortcut - notifyInstalled(NEWS, "", newVersion); + notifyInstalled(type, "", newVersion); return true; } UpdateItem ui = new UpdateItem(type, id); @@ -806,6 +808,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { String msg = null; switch (type) { case NEWS: + case NEWS_SU3: break; case ROUTER_UNSIGNED: @@ -900,6 +903,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { String msg = null; switch (task.getType()) { case NEWS: + case NEWS_SU3: case ROUTER_SIGNED: case ROUTER_SIGNED_SU3: case ROUTER_UNSIGNED: @@ -1009,6 +1013,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { switch (task.getType()) { case TYPE_DUMMY: case NEWS: + case NEWS_SU3: rv = true; break; @@ -1132,6 +1137,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { switch (type) { case NEWS: + case NEWS_SU3: // handled in NewsHandler break; diff --git a/apps/routerconsole/java/src/net/i2p/router/update/NewsFetcher.java b/apps/routerconsole/java/src/net/i2p/router/update/NewsFetcher.java index cb276b0b9defc5e7d7996982d93cd7eefbbbef54..ccbaaba3444c78d951839008aca1849a56d1b779 100644 --- a/apps/routerconsole/java/src/net/i2p/router/update/NewsFetcher.java +++ b/apps/routerconsole/java/src/net/i2p/router/update/NewsFetcher.java @@ -124,6 +124,7 @@ class NewsFetcher extends UpdateRunner { * Parse the installed (not the temp) news file for the latest version. * TODO: Real XML parsing * TODO: Check minVersion, use backup URLs specified + * TODO: SU3 */ void checkForUpdates() { FileInputStream in = null; diff --git a/apps/routerconsole/java/src/net/i2p/router/update/NewsHandler.java b/apps/routerconsole/java/src/net/i2p/router/update/NewsHandler.java index b0f1515f77d71acfb6badd1f81d29ea009891635..1209cc49d0751285bf412756bd96f461c5cb29fe 100644 --- a/apps/routerconsole/java/src/net/i2p/router/update/NewsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/update/NewsHandler.java @@ -29,6 +29,7 @@ class NewsHandler extends UpdateHandler implements Checker { * @since 0.7.14 not configurable */ private static final String BACKUP_NEWS_URL = "http://avviiexdngd32ccoy4kuckvc3mkf53ycvzbz6vz75vzhv4tbpk5a.b32.i2p/news.xml"; + private static final String BACKUP_NEWS_URL_SU3 = "http://avviiexdngd32ccoy4kuckvc3mkf53ycvzbz6vz75vzhv4tbpk5a.b32.i2p/news.su3"; public NewsHandler(RouterContext ctx, ConsoleUpdateManager mgr) { super(ctx, mgr); @@ -41,14 +42,17 @@ class NewsHandler extends UpdateHandler implements Checker { */ public UpdateTask check(UpdateType type, UpdateMethod method, String id, String currentVersion, long maxTime) { - if ((type != ROUTER_SIGNED && type != NEWS) || + if ((type != ROUTER_SIGNED && type != NEWS && type != NEWS_SU3) || method != HTTP) return null; List<URI> updateSources = new ArrayList<URI>(2); try { + // TODO SU3 updateSources.add(new URI(ConfigUpdateHelper.getNewsURL(_context))); } catch (URISyntaxException use) {} try { + // TODO + //updateSources.add(new URI(BACKUP_NEWS_URL_SU3)); updateSources.add(new URI(BACKUP_NEWS_URL)); } catch (URISyntaxException use) {} UpdateRunner update = new NewsFetcher(_context, _mgr, updateSources); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java index 6ff7f35649f1df670d611b8940be6022fb13f106..e33ab2bc7ddda08a8bcdf87f715f806f4b3d4171 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java @@ -32,6 +32,7 @@ public class ConfigUpdateHandler extends FormHandler { // public static final String DEFAULT_NEWS_URL = "http://dev.i2p.net/cgi-bin/cvsweb.cgi/i2p/news.xml?rev=HEAD"; public static final String OLD_DEFAULT_NEWS_URL = "http://complication.i2p/news.xml"; public static final String DEFAULT_NEWS_URL = "http://echelon.i2p/i2p/news.xml"; + public static final String DEFAULT_NEWS_URL_SU3 = "http://echelon.i2p/i2p/news.su3"; public static final String PROP_REFRESH_FREQUENCY = "router.newsRefreshFrequency"; public static final long DEFAULT_REFRESH_FREQ = 36*60*60*1000l; public static final String DEFAULT_REFRESH_FREQUENCY = Long.toString(DEFAULT_REFRESH_FREQ); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java index 4b7281fd9ae17c1594e34d8948454fcbd94fd177..4f5daab18f1e6fb5436f61dea23afedbffa5c640 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java @@ -32,6 +32,7 @@ public class ConfigUpdateHelper extends HelperBase { /** hack to replace the old news location with the new one, even if they have saved the update page at some point */ public static String getNewsURL(I2PAppContext ctx) { + // TODO SU3 String url = ctx.getProperty(ConfigUpdateHandler.PROP_NEWS_URL); if (url != null && !url.equals(ConfigUpdateHandler.OLD_DEFAULT_NEWS_URL)) return url; diff --git a/core/java/src/net/i2p/crypto/SU3File.java b/core/java/src/net/i2p/crypto/SU3File.java index 2592907eab9a1ad07b61618034d9984115730165..ef56d8bdd1240412c699e4307d00c4ff583985a7 100644 --- a/core/java/src/net/i2p/crypto/SU3File.java +++ b/core/java/src/net/i2p/crypto/SU3File.java @@ -67,12 +67,16 @@ public class SU3File { private static final int VERSION_OFFSET = 40; // Signature.SIGNATURE_BYTES; avoid early ctx init public static final int TYPE_ZIP = 0; + /** @since 0.9.15 */ public static final int TYPE_XML = 1; + /** @since 0.9.15 */ + public static final int TYPE_HTML = 2; public static final int CONTENT_UNKNOWN = 0; public static final int CONTENT_ROUTER = 1; public static final int CONTENT_PLUGIN = 2; public static final int CONTENT_RESEED = 3; + /** @since 0.9.15 */ public static final int CONTENT_NEWS = 4; private enum ContentType { diff --git a/core/java/src/net/i2p/update/UpdateType.java b/core/java/src/net/i2p/update/UpdateType.java index 73786ef6ca20abc036524109b45367d80132d67a..4c699785bcff3a1bd42c3364eceb20fd3a437dbd 100644 --- a/core/java/src/net/i2p/update/UpdateType.java +++ b/core/java/src/net/i2p/update/UpdateType.java @@ -23,5 +23,7 @@ public enum UpdateType { /** unused */ ADDRESSBOOK, /** @since 0.9.9 */ - ROUTER_SIGNED_SU3 + ROUTER_SIGNED_SU3, + /** @since 0.9.15 */ + NEWS_SU3 }