F-Droid repo URL matching made more general (#188)

This commit is contained in:
Imran Remtulla
2022-12-22 08:01:26 -05:00
parent 45a23e9025
commit 4e0c655538
2 changed files with 3 additions and 2 deletions

View File

@@ -15,7 +15,8 @@ Currently supported App sources:
- [Signal](https://signal.org/) - [Signal](https://signal.org/)
- [SourceForge](https://sourceforge.net/) - [SourceForge](https://sourceforge.net/)
- [APKMirror](https://apkmirror.com/) (Track-Only) - [APKMirror](https://apkmirror.com/) (Track-Only)
- Third Party F-Droid Repos (URLs ending with `/fdroid/repo`) - Third Party F-Droid Repos
- Any URLs ending with `/fdroid/<word>`, where `<word>` can be anything - most often `repo`
- [Steam](https://store.steampowered.com/mobile) - [Steam](https://store.steampowered.com/mobile)
## Limitations ## Limitations

View File

@@ -22,7 +22,7 @@ class FDroidRepo extends AppSource {
@override @override
String standardizeURL(String url) { String standardizeURL(String url) {
RegExp standardUrlRegExp = RegExp standardUrlRegExp =
RegExp('^https?://.+/fdroid/(repo(/|\\?)|repo\$)'); RegExp('^https?://.+/fdroid/([^/]+(/|\\?)|[^/]+\$)');
RegExpMatch? match = standardUrlRegExp.firstMatch(url.toLowerCase()); RegExpMatch? match = standardUrlRegExp.firstMatch(url.toLowerCase());
if (match == null) { if (match == null) {
throw InvalidURLError(name); throw InvalidURLError(name);