From 12463911f171792f17138b276c047de347feb225 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 13 Feb 2022 10:22:31 +0100 Subject: [PATCH] allow verification of own omemo keys via uri --- src/main/AndroidManifest.xml | 1 + .../persistance/FileBackend.java | 14 +++--- .../conversations/ui/EditAccountActivity.java | 43 ++++++++++++++++--- src/main/res/values/strings.xml | 2 + 4 files changed, 47 insertions(+), 13 deletions(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index c46fad8b1..ff41c07c2 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -194,6 +194,7 @@ android:launchMode="singleTop" /> { + if (isTrustedSource.isChecked()) { + processFingerprintVerification(xmppUri, false); + } else { + finish(); + } + }); + builder.setNegativeButton(R.string.cancel, (dialog, which) -> finish()); + AlertDialog dialog = builder.create(); + dialog.setCanceledOnTouchOutside(false); + dialog.setOnCancelListener(d -> finish()); + dialog.show(); + } + @Override public void onNewIntent(final Intent intent) { super.onNewIntent(intent); @@ -749,7 +780,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } @Override - public void onSaveInstanceState(final Bundle savedInstanceState) { + public void onSaveInstanceState(@NonNull final Bundle savedInstanceState) { if (mAccount != null) { savedInstanceState.putString("account", mAccount.getJid().asBareJid().toEscapedString()); savedInstanceState.putBoolean("initMode", mInitMode); diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index ff1894533..8b5e67eb2 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -622,6 +622,8 @@ Clean private storage where files are kept (They can be re-downloaded from the server) I followed this link from a trusted source You are about to verify the OMEMO keys of %1$s after clicking a link. This is only secure if you followed this link from a trusted source where only %2$s could have published this link. + You are about to verify the OMEMO keys of your own account. This is only secure if you followed this link from a trusted source where only you could have published this link. + Continue Verify OMEMO keys Show inactive Hide inactive