mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-08-13 17:03:49 -04:00
allow passing password/keyfile from external to KP2A
This commit is contained in:
parent
89546c1427
commit
c0267034f4
@ -68,6 +68,7 @@ namespace keepass2android
|
|||||||
|
|
||||||
public const String KeyFilename = "fileName";
|
public const String KeyFilename = "fileName";
|
||||||
private const String KeyKeyfile = "keyFile";
|
private const String KeyKeyfile = "keyFile";
|
||||||
|
private const String KeyPassword = "password";
|
||||||
public const String KeyServerusername = "serverCredUser";
|
public const String KeyServerusername = "serverCredUser";
|
||||||
public const String KeyServerpassword = "serverCredPwd";
|
public const String KeyServerpassword = "serverCredPwd";
|
||||||
public const String KeyServercredmode = "serverCredRememberMode";
|
public const String KeyServercredmode = "serverCredRememberMode";
|
||||||
@ -358,6 +359,7 @@ namespace keepass2android
|
|||||||
{
|
{
|
||||||
SetIoConnectionFromIntent(_ioConnection, i);
|
SetIoConnectionFromIntent(_ioConnection, i);
|
||||||
_keyFileOrProvider = i.GetStringExtra(KeyKeyfile);
|
_keyFileOrProvider = i.GetStringExtra(KeyKeyfile);
|
||||||
|
_password = i.GetStringExtra(KeyPassword) ?? "";
|
||||||
if (string.IsNullOrEmpty(_keyFileOrProvider))
|
if (string.IsNullOrEmpty(_keyFileOrProvider))
|
||||||
{
|
{
|
||||||
_keyFileOrProvider = GetKeyFile(_ioConnection.Path);
|
_keyFileOrProvider = GetKeyFile(_ioConnection.Path);
|
||||||
@ -397,6 +399,7 @@ namespace keepass2android
|
|||||||
|
|
||||||
|
|
||||||
EditText passwordEdit = FindViewById<EditText>(Resource.Id.password);
|
EditText passwordEdit = FindViewById<EditText>(Resource.Id.password);
|
||||||
|
passwordEdit.Text = _password;
|
||||||
passwordEdit.RequestFocus();
|
passwordEdit.RequestFocus();
|
||||||
Window.SetSoftInputMode(SoftInput.StateVisible);
|
Window.SetSoftInputMode(SoftInput.StateVisible);
|
||||||
|
|
||||||
@ -414,6 +417,13 @@ namespace keepass2android
|
|||||||
InitializeQuickUnlockCheckbox();
|
InitializeQuickUnlockCheckbox();
|
||||||
|
|
||||||
RestoreState(savedInstanceState);
|
RestoreState(savedInstanceState);
|
||||||
|
|
||||||
|
if (i.GetBooleanExtra("launchImmediately", false))
|
||||||
|
{
|
||||||
|
App.Kp2a.GetFileStorage(_ioConnection)
|
||||||
|
.PrepareFileUsage(new FileStorageSetupInitiatorActivity(this, OnActivityResult, null), _ioConnection,
|
||||||
|
RequestCodePrepareDbFile, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeOtpSecretSpinner()
|
private void InitializeOtpSecretSpinner()
|
||||||
|
Loading…
Reference in New Issue
Block a user