diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e4d28bff9..834132306 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -182,6 +182,19 @@
+
+
+
+
+
+
+
+
diff --git a/res/layout/local_repo_activity.xml b/res/layout/local_repo_activity.xml
new file mode 100644
index 000000000..81ba324ca
--- /dev/null
+++ b/res/layout/local_repo_activity.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/menu/local_repo_activity.xml b/res/menu/local_repo_activity.xml
new file mode 100644
index 000000000..823701dac
--- /dev/null
+++ b/res/menu/local_repo_activity.xml
@@ -0,0 +1,10 @@
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e8e837990..dd2a23dfe 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -150,8 +150,17 @@
What\'s New
Recently Updated
+ Local Repo
Local FDroid Repos
Discovering local FDroid repos…
+ Your local FDroid repo is accessible.
+ Touch to setup your local repo.
+ Fingerprint:
+ WiFi Network:
+ Enable WiFi
+ Enabling WiFi…
+ To connect to other people\'s devices, make sure both devices are on the same WiFi network. Then either type the URL above into F-Droid, or scan this QR Code:
+ QR Code of repo URL
\n" +
+ "" +
+ "" + heading + "
");
+
+ String up = null;
+ if (uri.length() > 1) {
+ String u = uri.substring(0, uri.length() - 1);
+ int slash = u.lastIndexOf('/');
+ if (slash >= 0 && slash < u.length()) {
+ up = uri.substring(0, slash + 1);
+ }
+ }
+
+ List files = Arrays.asList(f.list(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return new File(dir, name).isFile();
+ }
+ }));
+ Collections.sort(files);
+ List directories = Arrays.asList(f.list(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return new File(dir, name).isDirectory();
+ }
+ }));
+ Collections.sort(directories);
+ if (up != null || directories.size() + files.size() > 0) {
+ msg.append("");
+ if (up != null || directories.size() > 0) {
+ msg.append("");
+ if (up != null) {
+ msg.append("- ..
");
+ }
+ for (String directory : directories) {
+ String dir = directory + "/";
+ msg.append("- ").append(dir)
+ .append("
");
+ }
+ msg.append("");
+ }
+ if (files.size() > 0) {
+ msg.append("");
+ for (String file : files) {
+ msg.append("- ").append(file)
+ .append("");
+ File curFile = new File(f, file);
+ long len = curFile.length();
+ msg.append(" (");
+ if (len < 1024) {
+ msg.append(len).append(" bytes");
+ } else if (len < 1024 * 1024) {
+ msg.append(len / 1024).append(".").append(len % 1024 / 10 % 100)
+ .append(" KB");
+ } else {
+ msg.append(len / (1024 * 1024)).append(".")
+ .append(len % (1024 * 1024) / 10 % 100).append(" MB");
+ }
+ msg.append(")
");
+ }
+ msg.append("");
+ }
+ msg.append("
");
+ }
+ msg.append("