diff --git a/app/src/main/java/org/freenetproject/mobile/services/node/Installer.java b/app/src/main/java/org/freenetproject/mobile/services/node/Installer.java index fea34d4..1ebf6d7 100644 --- a/app/src/main/java/org/freenetproject/mobile/services/node/Installer.java +++ b/app/src/main/java/org/freenetproject/mobile/services/node/Installer.java @@ -20,6 +20,7 @@ private Installer() { } private final String FREENET_INI = "freenet.ini"; private final String SEEDNODES = "seednodes.fref"; + private final String BOOKMARKS = "bookmarks.dat"; public static Installer getInstance() { if (instance == null) { @@ -35,10 +36,11 @@ public static Installer getInstance() { * @param path Path to installation location. * @param seeds Input stream of seeds file. * @param config Input stream of default configuration. + * @param bookmarks Input stream of default bookmarks * * @throws FileNotFoundException */ - public void install(String path, InputStream seeds, InputStream config, String lang) throws FileNotFoundException { + public void install(String path, InputStream seeds, InputStream config, InputStream bookmarks, String lang) throws FileNotFoundException { File f = new File(path); if (!f.exists() || !f.canWrite()) { throw new FileNotFoundException("Invalid installation directory: " + path); @@ -49,6 +51,7 @@ public void install(String path, InputStream seeds, InputStream config, String l // Install bundled configurations createConfiguration(seeds, getSeednodesPath()); createConfiguration(config, getFreenetIniPath()); + createConfiguration(bookmarks, getBookmarksPath()); // Update freenet.ini with dynamic configuration final FileOutputStream ini = new FileOutputStream(getFreenetIniPath(), true); @@ -138,4 +141,8 @@ public String getSeednodesPath() { public String getFreenetIniPath() { return path + "/" + FREENET_INI; } + + public String getBookmarksPath() { + return path + "/" + BOOKMARKS; + } } diff --git a/app/src/main/java/org/freenetproject/mobile/services/node/Manager.java b/app/src/main/java/org/freenetproject/mobile/services/node/Manager.java index 4972231..dc5412e 100644 --- a/app/src/main/java/org/freenetproject/mobile/services/node/Manager.java +++ b/app/src/main/java/org/freenetproject/mobile/services/node/Manager.java @@ -85,6 +85,7 @@ public int startService(Context context) { context.getDir("data", Context.MODE_PRIVATE).getAbsolutePath(), res.openRawResource(R.raw.seednodes), res.openRawResource(R.raw.freenet), + res.openRawResource(R.raw.bookmarks), res.getConfiguration().locale.getDisplayLanguage() ); } catch (FileNotFoundException e) { diff --git a/app/src/main/res/raw/bookmarks.dat b/app/src/main/res/raw/bookmarks.dat new file mode 100644 index 0000000..60b95ce --- /dev/null +++ b/app/src/main/res/raw/bookmarks.dat @@ -0,0 +1,3 @@ +BookmarkCategory=4 +Version=1 +End \ No newline at end of file