]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Add additional Intent filter for import Activity with MIME type mask
authorTobias Brunner <tobias@strongswan.org>
Wed, 6 Jun 2018 13:35:00 +0000 (15:35 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 3 Jul 2018 09:31:32 +0000 (11:31 +0200)
Chrome creates such an Intent when opening downloaded files (not when
directly opening them), a MIME type is set, but apparently not ours.

src/frontends/android/app/src/main/AndroidManifest.xml

index 287208238f21cae7b7994d84825795428dcdddeb..53463fed25a5f3c50a7f8ab0723c676bf036be8c 100644 (file)
@@ -83,6 +83,7 @@
                 <data android:scheme="content" />
                 <data android:mimeType="application/vnd.strongswan.profile" />
             </intent-filter>
+            <!-- this matches by file extension if no MIME type is provided -->
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:pathPattern=".*\\..*\\.sswan" />
                 <data android:pathPattern=".*\\.sswan" />
             </intent-filter>
+            <!-- this matches by file extension if any MIME type (but not ours) is provided -->
+            <intent-filter>
+                <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="file" />
+                <data android:scheme="content" />
+                <data android:host="*" />
+                <data android:mimeType="*/*" />
+                <data android:pathPattern=".*\\..*\\..*\\..*\\.sswan" />
+                <data android:pathPattern=".*\\..*\\..*\\.sswan" />
+                <data android:pathPattern=".*\\..*\\.sswan" />
+                <data android:pathPattern=".*\\.sswan" />
+            </intent-filter>
         </activity>
         <activity
             android:name=".ui.TrustedCertificateImportActivity"