Add intent filter for handling WKD link in Firefox

Firefox for Android requires `mimeType` condition on the intent filter.
Built-in browsers (e.g. Chrome) need an intent filter that will *not* have
`mimeType` conditions.

Using two common MIME types: `application/octet-stream` is mentioned in
the I-D and `application/pgp-keys` is a common type for keys used in the
wild.
This commit is contained in:
Wiktor Kwapisiewicz 2018-05-23 15:02:10 +02:00
parent 92e7995b83
commit 7e3c985c54
No known key found for this signature in database
GPG key ID: B97A1EE09DB417EC

View file

@ -719,7 +719,7 @@
<data android:pathPattern="/..*/publickey/download" />
</intent-filter>
<!-- VIEW from Web Key Directory urls opened in a browser -->
<!-- VIEW from Web Key Directory urls opened in a browser/Chrome -->
<intent-filter android:label="@string/intent_import_key">
<action android:name="android.intent.action.VIEW" />
@ -732,6 +732,27 @@
<data android:host="*" />
<data android:pathPattern="/.well-known/openpgpkey/hu/.*" />
<!-- Chrome/Built-in browser will not be triggered if there is mimeType -->
</intent-filter>
<!-- VIEW from Web Key Directory urls opened in Firefox for Android -->
<intent-filter android:label="@string/intent_import_key">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="https" />
<!-- if we don't specify a host, pathPattern will be ignored-->
<data android:host="*" />
<data android:pathPattern="/.well-known/openpgpkey/hu/.*" />
<!-- Firefox for Android requires mimeType -->
<data android:mimeType="application/octet-stream" />
<data android:mimeType="application/pgp-keys" />
</intent-filter>
<!-- IMPORT_KEY with files TODO: does this work? -->