Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a39af89 authored by Fahim M. Choudhury's avatar Fahim M. Choudhury Committed by Nishith Khanna
Browse files

feat: improve f-droid link handling

- Handle only app-specific links
- Add pathPrefix to handle only app-specific links

The pathPattern .*/packages/.*\..* ensures that the path contains /packages/ followed by a string with at least one dot, which is characteristic of a package name. This will correctly handle URLs like
  https://f-droid.org/en/packages/com.klee.sapio/ and ignore URLs like https://f-droid.org/en/packages/.
parent 03de4a47
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -84,14 +84,40 @@
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <nav-graph android:value="@navigation/navigation_resource" />

            <!-- Google Play Store -->
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="http" />

                <data android:scheme="https" />
                <data android:scheme="http" />
                <data android:host="play.google.com" />
                <data android:pathPrefix="/store/apps/details" />
            </intent-filter>
            <!-- F-Droid -->
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="https" />
                <data android:scheme="http" />
                <data android:host="f-droid.org" />
                <data android:pathPattern=".*/packages/.*\..*" />
            </intent-filter>
            <!-- Google Play short links -->
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="https" />
                <data android:scheme="http" />
                <data android:host="play.app.goog.gl" />
            </intent-filter>
        </activity>