handle openpgp4fpr intent filter as import rather than certify (see #1661)
This commit is contained in:
parent
2e69952326
commit
c7761d09cb
|
@ -503,21 +503,6 @@
|
||||||
android:theme="@style/Theme.Keychain.Transparent"
|
android:theme="@style/Theme.Keychain.Transparent"
|
||||||
android:windowSoftInputMode="stateHidden">
|
android:windowSoftInputMode="stateHidden">
|
||||||
|
|
||||||
<!-- VIEW with fingerprint scheme:
|
|
||||||
Handle URIs with fingerprints when scanning directly from Barcode Scanner -->
|
|
||||||
<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" />
|
|
||||||
|
|
||||||
<!-- Android's scheme matcher is case-sensitive, so include most likely variations -->
|
|
||||||
<data android:scheme="openpgp4fpr" />
|
|
||||||
<data android:scheme="OPENPGP4FPR" />
|
|
||||||
<data android:scheme="OpenPGP4FPR" />
|
|
||||||
<data android:scheme="OpenPGP4Fpr" />
|
|
||||||
<data android:scheme="OpenPGP4fpr" />
|
|
||||||
</intent-filter>
|
|
||||||
<!-- IMPORT_KEY without mimeType to allow import with extras Bundle -->
|
<!-- IMPORT_KEY without mimeType to allow import with extras Bundle -->
|
||||||
<intent-filter android:label="@string/intent_import_key">
|
<intent-filter android:label="@string/intent_import_key">
|
||||||
<action android:name="org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_QR_CODE" />
|
<action android:name="org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_QR_CODE" />
|
||||||
|
@ -730,6 +715,23 @@
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
<!-- VIEW with fingerprint scheme:
|
||||||
|
Handle URIs with fingerprints when scanning directly from Barcode Scanner -->
|
||||||
|
<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" />
|
||||||
|
|
||||||
|
<!-- Android's scheme matcher is case-sensitive, so include most likely variations -->
|
||||||
|
<data android:scheme="openpgp4fpr" />
|
||||||
|
<data android:scheme="OPENPGP4FPR" />
|
||||||
|
<data android:scheme="OpenPGP4FPR" />
|
||||||
|
<data android:scheme="OpenPGP4Fpr" />
|
||||||
|
<data android:scheme="OpenPGP4fpr" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value=".ui.MainActivity" />
|
android:value=".ui.MainActivity" />
|
||||||
|
|
|
@ -131,8 +131,11 @@ public class ImportKeysActivity extends BaseActivity
|
||||||
if (Intent.ACTION_VIEW.equals(action)) {
|
if (Intent.ACTION_VIEW.equals(action)) {
|
||||||
if (FacebookKeyserver.isFacebookHost(dataUri)) {
|
if (FacebookKeyserver.isFacebookHost(dataUri)) {
|
||||||
action = ACTION_IMPORT_KEY_FROM_FACEBOOK;
|
action = ACTION_IMPORT_KEY_FROM_FACEBOOK;
|
||||||
} else if ("http".equals(scheme) || "https".equals(scheme)) {
|
} else if ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) {
|
||||||
action = ACTION_SEARCH_KEYSERVER_FROM_URL;
|
action = ACTION_SEARCH_KEYSERVER_FROM_URL;
|
||||||
|
} else if ("openpgp4fpr".equalsIgnoreCase(scheme)) {
|
||||||
|
action = ACTION_IMPORT_KEY_FROM_KEYSERVER;
|
||||||
|
extras.putString(EXTRA_FINGERPRINT, dataUri.getSchemeSpecificPart());
|
||||||
} else {
|
} else {
|
||||||
// Android's Action when opening file associated to Keychain (see AndroidManifest.xml)
|
// Android's Action when opening file associated to Keychain (see AndroidManifest.xml)
|
||||||
// delegate action to ACTION_IMPORT_KEY
|
// delegate action to ACTION_IMPORT_KEY
|
||||||
|
|
Loading…
Reference in a new issue