Compare commits
2 Commits
2869-fix-b
...
2869-bug-b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43addb3cdc | ||
|
|
f5f2adb88d |
@@ -66,6 +66,7 @@ using Exception = System.Exception;
|
|||||||
using String = System.String;
|
using String = System.String;
|
||||||
using Toolbar = AndroidX.AppCompat.Widget.Toolbar;
|
using Toolbar = AndroidX.AppCompat.Widget.Toolbar;
|
||||||
using AndroidX.Core.Content;
|
using AndroidX.Core.Content;
|
||||||
|
using Google.Android.Material.Snackbar;
|
||||||
|
|
||||||
namespace keepass2android
|
namespace keepass2android
|
||||||
{
|
{
|
||||||
@@ -131,8 +132,7 @@ namespace keepass2android
|
|||||||
ISharedPreferences _prefs;
|
ISharedPreferences _prefs;
|
||||||
|
|
||||||
private bool _starting;
|
private bool _starting;
|
||||||
private bool _resumeCompleted;
|
private OtpInfo _otpInfo;
|
||||||
private OtpInfo _otpInfo;
|
|
||||||
private IOConnectionInfo _otpAuxIoc;
|
private IOConnectionInfo _otpAuxIoc;
|
||||||
private ChallengeInfo _chalInfo;
|
private ChallengeInfo _chalInfo;
|
||||||
private byte[] _challengeSecret;
|
private byte[] _challengeSecret;
|
||||||
@@ -801,6 +801,8 @@ namespace keepass2android
|
|||||||
|
|
||||||
_password = i.GetStringExtra(KeyPassword) ?? "";
|
_password = i.GetStringExtra(KeyPassword) ?? "";
|
||||||
if (!KeyProviderTypes.Any())
|
if (!KeyProviderTypes.Any())
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
SetKeyProviderFromString(LoadKeyProviderStringForIoc(_ioConnection.Path));
|
SetKeyProviderFromString(LoadKeyProviderStringForIoc(_ioConnection.Path));
|
||||||
}
|
}
|
||||||
@@ -1253,7 +1255,7 @@ namespace keepass2android
|
|||||||
case 6:
|
case 6:
|
||||||
KeyProviderTypes.Add(KeyProviders.ChallengeXC);
|
KeyProviderTypes.Add(KeyProviders.ChallengeXC);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
//don't set to "" to prevent losing the filename. (ItemSelected is also called during recreation!)
|
//don't set to "" to prevent losing the filename. (ItemSelected is also called during recreation!)
|
||||||
Kp2aLog.Log("key file length before: " + _keyFile?.Length);
|
Kp2aLog.Log("key file length before: " + _keyFile?.Length);
|
||||||
_keyFile = (FindViewById(Resource.Id.label_keyfilename).Tag ?? "").ToString();
|
_keyFile = (FindViewById(Resource.Id.label_keyfilename).Tag ?? "").ToString();
|
||||||
@@ -1570,9 +1572,7 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool hasRequestedKeyboardActivation = false;
|
private bool hasRequestedKeyboardActivation = false;
|
||||||
|
protected override void OnStart()
|
||||||
|
|
||||||
protected override void OnStart()
|
|
||||||
{
|
{
|
||||||
base.OnStart();
|
base.OnStart();
|
||||||
_starting = true;
|
_starting = true;
|
||||||
@@ -1647,65 +1647,60 @@ namespace keepass2android
|
|||||||
if (intent != null)
|
if (intent != null)
|
||||||
{
|
{
|
||||||
if (intent.HasExtra(Intents.OtpExtraKey))
|
if (intent.HasExtra(Intents.OtpExtraKey))
|
||||||
{
|
{
|
||||||
string otp = intent.GetStringExtra(Intents.OtpExtraKey);
|
string otp = intent.GetStringExtra(Intents.OtpExtraKey);
|
||||||
_keepPasswordInOnResume = true;
|
_keepPasswordInOnResume = true;
|
||||||
if (KeyProviderTypes.Contains(KeyProviders.Otp))
|
if (KeyProviderTypes.Contains(KeyProviders.Otp))
|
||||||
{
|
|
||||||
|
|
||||||
if (_otpInfo == null)
|
|
||||||
{
|
|
||||||
//Entering OTPs not yet initialized:
|
|
||||||
_pendingOtps.Add(otp);
|
|
||||||
UpdateKeyProviderUiState();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Entering OTPs is initialized. Write OTP into first empty field:
|
|
||||||
bool foundEmptyField = false;
|
|
||||||
foreach (int otpId in _otpTextViewIds)
|
|
||||||
{
|
|
||||||
EditText otpEdit = FindViewById<EditText>(otpId);
|
|
||||||
if ((otpEdit.Visibility == ViewStates.Visible) && String.IsNullOrEmpty(otpEdit.Text))
|
|
||||||
{
|
|
||||||
otpEdit.Text = otp;
|
|
||||||
foundEmptyField = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//did we find a field?
|
|
||||||
if (!foundEmptyField)
|
|
||||||
{
|
|
||||||
App.Kp2a.ShowMessage(this, GetString(Resource.String.otp_discarded_no_space), MessageSeverity.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Spinner passwordModeSpinner = FindViewById<Spinner>(Resource.Id.password_mode_spinner);
|
|
||||||
if (passwordModeSpinner.SelectedItemPosition != (int)KeyProviders.Otp)
|
|
||||||
{
|
|
||||||
passwordModeSpinner.SetSelection((int)KeyProviders.Otp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//assume the key should be used as static password
|
|
||||||
FindViewById<EditText>(Resource.Id.password_edit).Text += otp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// if the activity is launched twice and the first initialization hasn't even finished, we cannot
|
|
||||||
// reset the state and re-initialize the activity.
|
|
||||||
// This can happen with autofill in some cases (#2869)
|
|
||||||
if (_resumeCompleted)
|
|
||||||
{
|
{
|
||||||
ResetState();
|
|
||||||
GetIocFromLaunchIntent(intent);
|
if (_otpInfo == null)
|
||||||
InitializeAfterSetIoc();
|
{
|
||||||
OnStart();
|
//Entering OTPs not yet initialized:
|
||||||
|
_pendingOtps.Add(otp);
|
||||||
|
UpdateKeyProviderUiState();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Entering OTPs is initialized. Write OTP into first empty field:
|
||||||
|
bool foundEmptyField = false;
|
||||||
|
foreach (int otpId in _otpTextViewIds)
|
||||||
|
{
|
||||||
|
EditText otpEdit = FindViewById<EditText>(otpId);
|
||||||
|
if ((otpEdit.Visibility == ViewStates.Visible) && String.IsNullOrEmpty(otpEdit.Text))
|
||||||
|
{
|
||||||
|
otpEdit.Text = otp;
|
||||||
|
foundEmptyField = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//did we find a field?
|
||||||
|
if (!foundEmptyField)
|
||||||
|
{
|
||||||
|
App.Kp2a.ShowMessage(this, GetString(Resource.String.otp_discarded_no_space), MessageSeverity.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spinner passwordModeSpinner = FindViewById<Spinner>(Resource.Id.password_mode_spinner);
|
||||||
|
if (passwordModeSpinner.SelectedItemPosition != (int)KeyProviders.Otp)
|
||||||
|
{
|
||||||
|
passwordModeSpinner.SetSelection((int)KeyProviders.Otp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
}
|
{
|
||||||
|
//assume the key should be used as static password
|
||||||
|
FindViewById<EditText>(Resource.Id.password_edit).Text += otp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ResetState();
|
||||||
|
GetIocFromLaunchIntent(intent);
|
||||||
|
InitializeAfterSetIoc();
|
||||||
|
OnStart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1744,150 +1739,185 @@ namespace keepass2android
|
|||||||
|
|
||||||
protected override View? SnackbarAnchorView => FindViewById(Resource.Id.main_content);
|
protected override View? SnackbarAnchorView => FindViewById(Resource.Id.main_content);
|
||||||
|
|
||||||
protected override void OnResume()
|
protected override void OnResume()
|
||||||
{
|
{
|
||||||
base.OnResume();
|
base.OnResume();
|
||||||
|
|
||||||
|
_activityDesign.ReapplyTheme();
|
||||||
|
|
||||||
_activityDesign.ReapplyTheme();
|
Kp2aLog.Log("starting: " + _starting + ", Finishing: " + IsFinishing + ", _performingLoad: " +
|
||||||
|
_performingLoad);
|
||||||
|
|
||||||
Kp2aLog.Log("starting: " + _starting + ", Finishing: " + IsFinishing + ", _performingLoad: " +
|
CheckBox cbOfflineMode = (CheckBox)FindViewById(Resource.Id.work_offline);
|
||||||
_performingLoad);
|
App.Kp2a.OfflineMode =
|
||||||
|
cbOfflineMode.Checked =
|
||||||
|
App.Kp2a
|
||||||
|
.OfflineModePreference; //this won't overwrite new user settings because every change is directly saved in settings
|
||||||
|
LinearLayout offlineModeContainer = FindViewById<LinearLayout>(Resource.Id.work_offline_container);
|
||||||
|
var cachingFileStorage = App.Kp2a.GetFileStorage(_ioConnection) as CachingFileStorage;
|
||||||
|
if ((cachingFileStorage != null) && cachingFileStorage.IsCached(_ioConnection))
|
||||||
|
{
|
||||||
|
offlineModeContainer.Visibility = ViewStates.Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
offlineModeContainer.Visibility = ViewStates.Gone;
|
||||||
|
App.Kp2a.OfflineMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
CheckBox cbOfflineMode = (CheckBox)FindViewById(Resource.Id.work_offline);
|
|
||||||
App.Kp2a.OfflineMode =
|
|
||||||
cbOfflineMode.Checked =
|
|
||||||
App.Kp2a
|
View killButton = FindViewById(Resource.Id.kill_app);
|
||||||
.OfflineModePreference; //this won't overwrite new user settings because every change is directly saved in settings
|
if (PreferenceManager.GetDefaultSharedPreferences(this)
|
||||||
LinearLayout offlineModeContainer = FindViewById<LinearLayout>(Resource.Id.work_offline_container);
|
.GetBoolean(GetString(Resource.String.show_kill_app_key), false))
|
||||||
var cachingFileStorage = App.Kp2a.GetFileStorage(_ioConnection) as CachingFileStorage;
|
{
|
||||||
if ((cachingFileStorage != null) && cachingFileStorage.IsCached(_ioConnection))
|
killButton.Click += (sender, args) =>
|
||||||
|
{
|
||||||
|
_killOnDestroy = true;
|
||||||
|
SetResult(Result.Canceled);
|
||||||
|
Finish();
|
||||||
|
|
||||||
|
};
|
||||||
|
killButton.Visibility = ViewStates.Visible;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
killButton.Visibility = ViewStates.Gone;
|
||||||
|
}
|
||||||
|
|
||||||
|
TryGetOtpFromClipboard();
|
||||||
|
|
||||||
|
if (!_keepPasswordInOnResume)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
_lastOnPauseTime <
|
||||||
|
DateTime.Now -
|
||||||
|
TimeSpan.FromSeconds(
|
||||||
|
5) //only clear when user left the app for more than 5 seconds (allows to use Yubiclip, also allows to switch shortly to another app)
|
||||||
|
&&
|
||||||
|
PreferenceManager.GetDefaultSharedPreferences(this)
|
||||||
|
.GetBoolean(GetString(Resource.String.ClearPasswordOnLeave_key), true))
|
||||||
|
{
|
||||||
|
ClearEnteredPassword();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_keepPasswordInOnResume = false;
|
||||||
|
|
||||||
|
MakePasswordMaskedOrVisible();
|
||||||
|
|
||||||
|
UpdateOkButtonState();
|
||||||
|
|
||||||
|
if (KeyProviderTypes.Contains(KeyProviders.Challenge))
|
||||||
|
{
|
||||||
|
FindViewById(Resource.Id.otpInitView).Visibility =
|
||||||
|
_challengeSecret == null ? ViewStates.Visible : ViewStates.Gone;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
Snackbar snackbar = Snackbar
|
||||||
|
.Make(FindViewById(Resource.Id.main_content),
|
||||||
|
"snack snack snack snack snack snack snack snack snack snack snack snack snack snack snacksnack snack snacksnack snack snacksnack snack snack snack snack snack snack snack snack snack snack snack snack snack snack snacksnack snack snacksnack snack snacksnack snack snack snack snack snacksnack snack snack ",
|
||||||
|
Snackbar.LengthLong);
|
||||||
|
snackbar.SetTextMaxLines(5);
|
||||||
|
snackbar.SetBackgroundTint(GetColor(Resource.Color.md_theme_secondaryContainer));
|
||||||
|
snackbar.SetTextColor(GetColor(Resource.Color.md_theme_onSecondaryContainer));
|
||||||
|
snackbar.SetAction("dismiss",
|
||||||
|
view => snackbar.SetBackgroundTint(GetColor(Resource.Color.md_theme_surfaceContainer)));
|
||||||
|
|
||||||
|
snackbar.Show();
|
||||||
|
|
||||||
|
new Handler().PostDelayed(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
Snackbar snackbar2 = Snackbar
|
||||||
|
.Make(FindViewById(Resource.Id.main_content), "snack snack snack ",
|
||||||
|
Snackbar.LengthLong);
|
||||||
|
snackbar2.SetTextMaxLines(5);
|
||||||
|
snackbar2.SetBackgroundTint(GetColor(Resource.Color.md_theme_errorContainer));
|
||||||
|
snackbar2.SetTextColor(GetColor(Resource.Color.md_theme_onErrorContainer));
|
||||||
|
snackbar2.Show();
|
||||||
|
}, 1500);
|
||||||
|
|
||||||
|
|
||||||
|
new Handler().PostDelayed(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
Snackbar snackbar2 = Snackbar
|
||||||
|
.Make(FindViewById(Resource.Id.main_content), "snack snack warn ",
|
||||||
|
Snackbar.LengthLong);
|
||||||
|
snackbar2.SetTextMaxLines(5);
|
||||||
|
snackbar2.SetBackgroundTint(GetColor(Resource.Color.md_theme_inverseSurface));
|
||||||
|
snackbar2.SetTextColor(GetColor(Resource.Color.md_theme_inverseOnSurface));
|
||||||
|
snackbar2.Show();
|
||||||
|
}, 2500);*/
|
||||||
|
|
||||||
|
//use !IsFinishing to make sure we're not starting another activity when we're already finishing (e.g. due to TaskComplete in OnActivityResult)
|
||||||
|
//use !performingLoad to make sure we're not already loading the database (after ActivityResult from File-Prepare-Activity; this would cause _loadDbFileTask to exist when we reload later!)
|
||||||
|
if ( !IsFinishing && !_performingLoad)
|
||||||
{
|
{
|
||||||
offlineModeContainer.Visibility = ViewStates.Visible;
|
|
||||||
}
|
|
||||||
else
|
// OnResume is run every time the activity comes to the foreground. This code should only run when the activity is started (OnStart), but must
|
||||||
{
|
|
||||||
offlineModeContainer.Visibility = ViewStates.Gone;
|
|
||||||
App.Kp2a.OfflineMode = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
View killButton = FindViewById(Resource.Id.kill_app);
|
|
||||||
if (PreferenceManager.GetDefaultSharedPreferences(this)
|
|
||||||
.GetBoolean(GetString(Resource.String.show_kill_app_key), false))
|
|
||||||
{
|
|
||||||
killButton.Click += (sender, args) =>
|
|
||||||
{
|
|
||||||
_killOnDestroy = true;
|
|
||||||
SetResult(Result.Canceled);
|
|
||||||
Finish();
|
|
||||||
|
|
||||||
};
|
|
||||||
killButton.Visibility = ViewStates.Visible;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
killButton.Visibility = ViewStates.Gone;
|
|
||||||
}
|
|
||||||
|
|
||||||
TryGetOtpFromClipboard();
|
|
||||||
|
|
||||||
if (!_keepPasswordInOnResume)
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
_lastOnPauseTime <
|
|
||||||
DateTime.Now -
|
|
||||||
TimeSpan.FromSeconds(
|
|
||||||
5) //only clear when user left the app for more than 5 seconds (allows to use Yubiclip, also allows to switch shortly to another app)
|
|
||||||
&&
|
|
||||||
PreferenceManager.GetDefaultSharedPreferences(this)
|
|
||||||
.GetBoolean(GetString(Resource.String.ClearPasswordOnLeave_key), true))
|
|
||||||
{
|
|
||||||
ClearEnteredPassword();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_keepPasswordInOnResume = false;
|
|
||||||
|
|
||||||
MakePasswordMaskedOrVisible();
|
|
||||||
|
|
||||||
UpdateOkButtonState();
|
|
||||||
|
|
||||||
if (KeyProviderTypes.Contains(KeyProviders.Challenge))
|
|
||||||
{
|
|
||||||
FindViewById(Resource.Id.otpInitView).Visibility =
|
|
||||||
_challengeSecret == null ? ViewStates.Visible : ViewStates.Gone;
|
|
||||||
}
|
|
||||||
|
|
||||||
//use !IsFinishing to make sure we're not starting another activity when we're already finishing (e.g. due to TaskComplete in OnActivityResult)
|
|
||||||
//use !performingLoad to make sure we're not already loading the database (after ActivityResult from File-Prepare-Activity; this would cause _loadDbFileTask to exist when we reload later!)
|
|
||||||
if (!IsFinishing && !_performingLoad)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
// OnResume is run every time the activity comes to the foreground. This code should only run when the activity is started (OnStart), but must
|
|
||||||
// be run in OnResume rather than OnStart so that it always occurrs after OnActivityResult (when re-creating a killed activity, OnStart occurs before OnActivityResult)
|
// be run in OnResume rather than OnStart so that it always occurrs after OnActivityResult (when re-creating a killed activity, OnStart occurs before OnActivityResult)
|
||||||
if (_starting)
|
if (_starting)
|
||||||
{
|
{
|
||||||
|
|
||||||
_starting = false;
|
_starting = false;
|
||||||
|
|
||||||
//database not yet loaded.
|
//database not yet loaded.
|
||||||
|
|
||||||
//check if pre-loading is enabled but wasn't started yet:
|
//check if pre-loading is enabled but wasn't started yet:
|
||||||
if (_loadDbFileTask == null &&
|
if (_loadDbFileTask == null &&
|
||||||
_prefs.GetBoolean(GetString(Resource.String.PreloadDatabaseEnabled_key), true))
|
_prefs.GetBoolean(GetString(Resource.String.PreloadDatabaseEnabled_key), true))
|
||||||
{
|
{
|
||||||
// Create task to kick off file loading while the user enters the password
|
// Create task to kick off file loading while the user enters the password
|
||||||
_loadDbFileTask = Task.Factory.StartNew(PreloadDbFile);
|
_loadDbFileTask = Task.Factory.StartNew(PreloadDbFile);
|
||||||
_loadDbTaskOffline = App.Kp2a.OfflineMode;
|
_loadDbTaskOffline = App.Kp2a.OfflineMode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compositeKeyForImmediateLoad != null)
|
if (compositeKeyForImmediateLoad != null)
|
||||||
{
|
{
|
||||||
//reload the database (without most other stuff performed in PerformLoadDatabase.
|
//reload the database (without most other stuff performed in PerformLoadDatabase.
|
||||||
// We're assuming that the db file (and if appropriate also the key file) are still available
|
// We're assuming that the db file (and if appropriate also the key file) are still available
|
||||||
// and there's no need to re-init the file storage. if it is, loading will fail and the user has
|
// and there's no need to re-init the file storage. if it is, loading will fail and the user has
|
||||||
// to retry with typing the full password, but that's intended to avoid showing the password to a
|
// to retry with typing the full password, but that's intended to avoid showing the password to a
|
||||||
// a potentially unauthorized user (feature request https://keepass2android.codeplex.com/workitem/274)
|
// a potentially unauthorized user (feature request https://keepass2android.codeplex.com/workitem/274)
|
||||||
Handler handler = new Handler();
|
Handler handler = new Handler();
|
||||||
OnFinish onFinish = new AfterLoad(handler, this, _ioConnection);
|
OnFinish onFinish = new AfterLoad(handler, this, _ioConnection);
|
||||||
_performingLoad = true;
|
_performingLoad = true;
|
||||||
LoadDb task = new LoadDb(this, App.Kp2a, _ioConnection, _loadDbFileTask, compositeKeyForImmediateLoad, GetKeyProviderString(),
|
LoadDb task = new LoadDb(this, App.Kp2a, _ioConnection, _loadDbFileTask, compositeKeyForImmediateLoad, GetKeyProviderString(),
|
||||||
onFinish, false, _makeCurrent);
|
onFinish, false, _makeCurrent);
|
||||||
_loadDbFileTask = null; // prevent accidental re-use
|
_loadDbFileTask = null; // prevent accidental re-use
|
||||||
new ProgressTask(App.Kp2a, this, task).Run();
|
new ProgressTask(App.Kp2a, this, task).Run();
|
||||||
compositeKeyForImmediateLoad = null; //don't reuse or keep in memory
|
compositeKeyForImmediateLoad = null; //don't reuse or keep in memory
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool showKeyboard = true;
|
bool showKeyboard = true;
|
||||||
|
|
||||||
|
|
||||||
EditText pwd = (EditText)FindViewById(Resource.Id.password_edit);
|
EditText pwd = (EditText) FindViewById(Resource.Id.password_edit);
|
||||||
pwd.PostDelayed(() =>
|
pwd.PostDelayed(() =>
|
||||||
{
|
{
|
||||||
InputMethodManager keyboard = (InputMethodManager)GetSystemService(InputMethodService);
|
InputMethodManager keyboard = (InputMethodManager) GetSystemService(InputMethodService);
|
||||||
if (showKeyboard)
|
if (showKeyboard)
|
||||||
{
|
{
|
||||||
pwd.RequestFocus();
|
pwd.RequestFocus();
|
||||||
keyboard.ShowSoftInput(pwd, 0);
|
keyboard.ShowSoftInput(pwd, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
keyboard.HideSoftInputFromWindow(pwd.WindowToken, HideSoftInputFlags.ImplicitOnly);
|
keyboard.HideSoftInputFromWindow(pwd.WindowToken, HideSoftInputFlags.ImplicitOnly);
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
_resumeCompleted = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TryGetOtpFromClipboard()
|
private void TryGetOtpFromClipboard()
|
||||||
|
|||||||
@@ -803,15 +803,13 @@ namespace keepass2android
|
|||||||
var hasUnsecureDisplay = HasUnsecureDisplay(context);
|
var hasUnsecureDisplay = HasUnsecureDisplay(context);
|
||||||
if (hasUnsecureDisplay)
|
if (hasUnsecureDisplay)
|
||||||
{
|
{
|
||||||
Kp2aLog.Log("Display is not secure");
|
|
||||||
var intent = new Intent(context, typeof(NoSecureDisplayActivity));
|
var intent = new Intent(context, typeof(NoSecureDisplayActivity));
|
||||||
intent.AddFlags(ActivityFlags.SingleTop | ActivityFlags.ClearTop);
|
intent.AddFlags(ActivityFlags.SingleTop | ActivityFlags.ClearTop);
|
||||||
context.StartActivityForResult(intent, 9999);
|
context.StartActivityForResult(intent, 9999);
|
||||||
}
|
}
|
||||||
Kp2aLog.Log("Setting FLAG_SECURE.");
|
|
||||||
context.Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);
|
context.Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);
|
||||||
}
|
}
|
||||||
else Kp2aLog.Log("Secure display disabled by user preference.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool SecureDisplayConfigured(Activity context)
|
public static bool SecureDisplayConfigured(Activity context)
|
||||||
|
|||||||
@@ -742,7 +742,7 @@
|
|||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.7.0.5" />
|
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.7.0.5" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources" Version="1.7.0.5" />
|
<PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources" Version="1.7.0.5" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.AutoFill" Version="1.1.0.30" />
|
<PackageReference Include="Xamarin.AndroidX.AutoFill" Version="1.1.0.30" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.Biometric" Version="1.1.0.27" />
|
<PackageReference Include="Xamarin.AndroidX.Biometric" Version="1.1.0.6" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.CoordinatorLayout" Version="1.3.0" />
|
<PackageReference Include="Xamarin.AndroidX.CoordinatorLayout" Version="1.3.0" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.CursorAdapter" Version="1.0.0.31" />
|
<PackageReference Include="Xamarin.AndroidX.CursorAdapter" Version="1.0.0.31" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.8.7.2" />
|
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.8.7.2" />
|
||||||
|
|||||||
Reference in New Issue
Block a user