diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-24 21:42:35 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-24 21:42:35 +0100 |
commit | fefae63f1dceef88c42a2c80ce7265419095316f (patch) | |
tree | 304098147b44995538ff9ca6cb7d46c6825254ed /src/main/java/de/pixart/messenger/ui | |
parent | 02ff5375371d5178c6e0bb099d2a962488c1ef4a (diff) |
introduced blind trust before verification mode
read more about the concept on https://gultsch.de/trust.html
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/SettingsActivity.java | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java index 9c712a553..7c3131a0f 100644 --- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java @@ -39,6 +39,7 @@ public class SettingsActivity extends XmppActivity implements public static final String AWAY_WHEN_SCREEN_IS_OFF = "away_when_screen_off"; public static final String TREAT_VIBRATE_AS_SILENT = "treat_vibrate_as_silent"; public static final String MANUALLY_CHANGE_PRESENCE = "manually_change_presence"; + public static final String BLIND_TRUST_BEFORE_VERIFICATION = "btbv"; public static final int REQUEST_WRITE_LOGS = 0xbf8701; private SettingsFragment mSettingsFragment; diff --git a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java index a354f5a88..3564f7fc1 100644 --- a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java +++ b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java @@ -75,6 +75,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat }; private XmppUri mPendingFingerprintVerificationUri = null; + private Toast mUseCameraHintToast = null; @Override protected void refreshUiReal() { @@ -116,10 +117,10 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.trust_keys, menu); - Toast toast = Toast.makeText(this,R.string.use_camera_icon_to_scan_barcode,Toast.LENGTH_LONG); + mUseCameraHintToast = Toast.makeText(this,R.string.use_camera_icon_to_scan_barcode,Toast.LENGTH_LONG); ActionBar actionBar = getActionBar(); - toast.setGravity(Gravity.TOP | Gravity.END, 0 ,actionBar == null ? 0 : actionBar.getHeight()); - toast.show(); + mUseCameraHintToast.setGravity(Gravity.TOP | Gravity.END, 0 ,actionBar == null ? 0 : actionBar.getHeight()); + mUseCameraHintToast.show(); return super.onCreateOptionsMenu(menu); } @@ -309,15 +310,22 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat @Override public void onKeyStatusUpdated(final AxolotlService.FetchStatus report) { + final boolean keysToTrust = reloadFingerprints(); if (report != null) { lastFetchReport = report; runOnUiThread(new Runnable() { @Override public void run() { + if (mUseCameraHintToast != null && !keysToTrust) { + mUseCameraHintToast.cancel(); + } switch (report) { case ERROR: Toast.makeText(TrustKeysActivity.this, R.string.error_fetching_omemo_key, Toast.LENGTH_SHORT).show(); break; + case SUCCESS_TRUSTED: + Toast.makeText(TrustKeysActivity.this,R.string.blindly_trusted_omemo_keys,Toast.LENGTH_LONG).show(); + break; case SUCCESS_VERIFIED: Toast.makeText(TrustKeysActivity.this, Config.X509_VERIFICATION ? R.string.verified_omemo_key_with_certificate : R.string.all_omemo_keys_have_been_verified, @@ -328,7 +336,6 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat }); } - boolean keysToTrust = reloadFingerprints(); if (keysToTrust || hasPendingKeyFetches() || hasNoOtherTrustedKeys()) { refreshUi(); } else { |