mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
catch ACTION_SEND intent to decrypt, allowing k9mail's "Forward (alternate)" feature to send to APG
This commit is contained in:
parent
51866bb2b2
commit
508d7ac197
@ -83,6 +83,12 @@
|
|||||||
<data android:mimeType="text/*"/>
|
<data android:mimeType="text/*"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.SEND" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
<data android:mimeType="text/*"/>
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="org.thialfihar.android.apg.intent.DECRYPT" />
|
<action android:name="org.thialfihar.android.apg.intent.DECRYPT" />
|
||||||
<action android:name="org.thialfihar.android.apg.intent.DECRYPT_FILE" />
|
<action android:name="org.thialfihar.android.apg.intent.DECRYPT_FILE" />
|
||||||
|
@ -177,6 +177,19 @@ public class DecryptActivity extends BaseActivity {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// ignore, then
|
// ignore, then
|
||||||
}
|
}
|
||||||
|
} else if (intent.getAction() != null && intent.getAction().equals(Intent.ACTION_SEND)) {
|
||||||
|
Bundle extras = intent.getExtras();
|
||||||
|
if (extras == null) {
|
||||||
|
extras = new Bundle();
|
||||||
|
}
|
||||||
|
String data = extras.getString(Intent.EXTRA_TEXT);
|
||||||
|
if (data != null) {
|
||||||
|
mMessage.setText(data);
|
||||||
|
}
|
||||||
|
mSubject = extras.getString(Intent.EXTRA_SUBJECT);
|
||||||
|
if (mSubject.startsWith("Fwd: ")) {
|
||||||
|
mSubject = mSubject.substring(5);
|
||||||
|
}
|
||||||
} else if (intent.getAction() != null && intent.getAction().equals(Apg.Intent.DECRYPT)) {
|
} else if (intent.getAction() != null && intent.getAction().equals(Apg.Intent.DECRYPT)) {
|
||||||
Bundle extras = intent.getExtras();
|
Bundle extras = intent.getExtras();
|
||||||
if (extras == null) {
|
if (extras == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user