diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f6a6a23d5..e11473eec 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -424,6 +424,9 @@
query parameters. An alternative would be to do something like fdroidswap:// as
a scheme, but then we need to copy/paste all of this intent-filter stuff and
keep it up to date when it changes or a bug is found.
+
+ This filter supports HTTP and HTTPS schemes. There is an additional filter for
+ fdroidrepo:// and fdroidrepos://
-->
@@ -441,10 +444,6 @@
-
-
-
-
@@ -480,6 +479,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/org/fdroid/fdroid/data/NewRepoConfig.java b/app/src/main/java/org/fdroid/fdroid/data/NewRepoConfig.java
index 5594a7d64..51a642be6 100644
--- a/app/src/main/java/org/fdroid/fdroid/data/NewRepoConfig.java
+++ b/app/src/main/java/org/fdroid/fdroid/data/NewRepoConfig.java
@@ -76,21 +76,27 @@ public class NewRepoConfig {
uri = Uri.parse(uri.toString().toLowerCase(Locale.ENGLISH));
}
+ // make scheme and host lowercase so they're readable in dialogs
+ scheme = scheme.toLowerCase(Locale.ENGLISH);
+ host = host.toLowerCase(Locale.ENGLISH);
+
+ // We only listen for /fdroid/archive or /fdroid/repo paths when receiving a HTTP(S) intent.
+ // For fdroidrepo(s) intents, we are less picky and will accept any path.
+ boolean isHttpScheme = TextUtils.equals("http", scheme) || TextUtils.equals("https", scheme);
String path = uri.getPath();
- if (path == null || !(path.contains("/fdroid/archive") || path.contains("/fdroid/repo"))) {
+ if (path == null || isHttpScheme && !(path.contains("/fdroid/archive") || path.contains("/fdroid/repo"))) {
isValidRepo = false;
return;
}
- // make scheme and host lowercase so they're readable in dialogs
- scheme = scheme.toLowerCase(Locale.ENGLISH);
- host = host.toLowerCase(Locale.ENGLISH);
+ boolean isFdroidScheme = TextUtils.equals("fdroidrepo", scheme) || TextUtils.equals("fdroidrepos", scheme);
+
fingerprint = uri.getQueryParameter("fingerprint");
bssid = uri.getQueryParameter("bssid");
ssid = uri.getQueryParameter("ssid");
fromSwap = uri.getQueryParameter("swap") != null;
- if (!Arrays.asList("fdroidrepos", "fdroidrepo", "https", "http").contains(scheme)) {
+ if (!isFdroidScheme && !isHttpScheme) {
isValidRepo = false;
return;
}