From eaa426db33f033304164948571d6ed9613d9beac Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Fri, 9 Aug 2013 22:31:30 +0200 Subject: [PATCH] FileSelectActivity is only shown when necessary or when explicitly selected by user --- src/keepass2android/KeePass.cs | 45 +- src/keepass2android/PasswordActivity.cs | 86 +- .../Resources/Resource.designer.cs | 779 +++++++++--------- .../Resources/layout-v14/password.xml | 8 +- .../Resources/layout/password.xml | 8 +- .../Resources/menu-v11/password.xml | 5 + .../Resources/menu/password.xml | 4 + .../Resources/values/strings.xml | 1 + .../fileselect/FileSelectActivity.cs | 39 +- 9 files changed, 494 insertions(+), 481 deletions(-) diff --git a/src/keepass2android/KeePass.cs b/src/keepass2android/KeePass.cs index 74b2031c..a5b37b10 100644 --- a/src/keepass2android/KeePass.cs +++ b/src/keepass2android/KeePass.cs @@ -24,6 +24,7 @@ using Android.Preferences; using Android.Content.PM; using Android.Text; using Android.Text.Method; +using KeePassLib.Serialization; namespace keepass2android { @@ -103,7 +104,7 @@ namespace keepass2android Dialog dialog = builder.Create(); dialog.DismissEvent += (sender, e) => { - StartFileSelect(); + LaunchNextActivity(); }; dialog.Show(); TextView message = (TextView) dialog.FindViewById(Android.Resource.Id.Message); @@ -116,7 +117,7 @@ namespace keepass2android } else { - StartFileSelect(); + LaunchNextActivity(); } @@ -154,12 +155,42 @@ namespace keepass2android } - private void StartFileSelect() { - Intent intent = new Intent(this, typeof(FileSelectActivity)); - //TEST Intent intent = new Intent(this, typeof(EntryActivity)); - //Intent intent = new Intent(this, typeof(SearchActivity)); - //Intent intent = new Intent(this, typeof(QuickUnlock)); + IOConnectionInfo LoadIoc(string defaultFileName) + { + return App.Kp2a.FileDbHelper.CursorToIoc(App.Kp2a.FileDbHelper.FetchFileByName(defaultFileName)); + } + private void LaunchNextActivity() { + + if (!App.Kp2a.GetDb().Loaded) + { + // Load default database + ISharedPreferences prefs = Android.Preferences.PreferenceManager.GetDefaultSharedPreferences(this); + String defaultFileName = prefs.GetString(PasswordActivity.KeyDefaultFilename, ""); + + if (defaultFileName.Length > 0) + { + try + { + PasswordActivity.Launch(this, LoadIoc(defaultFileName), _appTask); + Finish(); + return; + } + catch (Exception e) + { + Toast.MakeText(this, e.Message, ToastLength.Long); + // Ignore exception + } + } + } + else + { + PasswordActivity.Launch(this, App.Kp2a.GetDb().Ioc, _appTask); + Finish(); + return; + } + + Intent intent = new Intent(this, typeof(FileSelectActivity)); _appTask.ToIntent(intent); diff --git a/src/keepass2android/PasswordActivity.cs b/src/keepass2android/PasswordActivity.cs index 6223bf7b..36db7c2b 100644 --- a/src/keepass2android/PasswordActivity.cs +++ b/src/keepass2android/PasswordActivity.cs @@ -291,6 +291,8 @@ namespace keepass2android LoadDb task = new LoadDb(App.Kp2a, _ioConnection, _loadDbTask, pass, key, new AfterLoad(handler, this)); _loadDbTask = null; // prevent accidental re-use + SetNewDefaultFile(); + new ProgressTask(App.Kp2a, this, task).Run(); }; @@ -319,31 +321,7 @@ namespace keepass2android } }; - CheckBox defaultCheck = (CheckBox)FindViewById(Resource.Id.default_database); - //Don't allow the current file to be the default if we don't have stored credentials - if ((_ioConnection.IsLocalFile() == false) && (_ioConnection.CredSaveMode != IOCredSaveMode.SaveCred)) - { - defaultCheck.Enabled = false; - } else - { - defaultCheck.Enabled = true; - } - defaultCheck.CheckedChange += (sender, e) => - { - String newDefaultFileName; - - if (e.IsChecked) - { - newDefaultFileName = _ioConnection.Path; - } else - { - newDefaultFileName = ""; - } - - ISharedPreferencesEditor editor = _prefs.Edit(); - editor.PutString(KeyDefaultFilename, newDefaultFileName); - EditorCompat.Apply(editor); - }; + ImageButton browse = (ImageButton)FindViewById(Resource.Id.browse_button); browse.Click += (sender, evt) => @@ -365,6 +343,34 @@ namespace keepass2android RetrieveSettings(); } + private void SetNewDefaultFile() + { +//Don't allow the current file to be the default if we don't have stored credentials + bool makeFileDefault; + if ((_ioConnection.IsLocalFile() == false) && (_ioConnection.CredSaveMode != IOCredSaveMode.SaveCred)) + { + makeFileDefault = false; + } + else + { + makeFileDefault = true; + } + String newDefaultFileName; + + if (makeFileDefault) + { + newDefaultFileName = _ioConnection.Path; + } + else + { + newDefaultFileName = ""; + } + + ISharedPreferencesEditor editor = _prefs.Edit(); + editor.PutString(KeyDefaultFilename, newDefaultFileName); + EditorCompat.Apply(editor); + } + protected override void OnStart() { base.OnStart(); @@ -432,11 +438,6 @@ namespace keepass2android } private void RetrieveSettings() { - String defaultFilename = _prefs.GetString(KeyDefaultFilename, ""); - if (!String.IsNullOrEmpty(_ioConnection.Path) && _ioConnection.Path.Equals(defaultFilename)) { - CheckBox checkbox = (CheckBox) FindViewById(Resource.Id.default_database); - checkbox.Checked = true; - } CheckBox cbQuickUnlock = (CheckBox)FindViewById(Resource.Id.enable_quickunlock); cbQuickUnlock.Checked = _prefs.GetBoolean(GetString(Resource.String.QuickUnlockDefaultEnabled_key), true); } @@ -494,15 +495,26 @@ namespace keepass2android public override bool OnOptionsItemSelected(IMenuItem item) { switch ( item.ItemId ) { - case Resource.Id.menu_about: - AboutDialog dialog = new AboutDialog(this); - dialog.Show(); - return true; + case Resource.Id.menu_about: + AboutDialog dialog = new AboutDialog(this); + dialog.Show(); + return true; - case Resource.Id.menu_app_settings: - AppSettingsActivity.Launch(this); - return true; + case Resource.Id.menu_app_settings: + AppSettingsActivity.Launch(this); + return true; + + case Resource.Id.menu_change_db: + Intent intent = new Intent(this, typeof(FileSelectActivity)); + AppTask.ToIntent(intent); + StartActivityForResult(intent, 0); + Finish(); + return true; + + } + + return base.OnOptionsItemSelected(item); } diff --git a/src/keepass2android/Resources/Resource.designer.cs b/src/keepass2android/Resources/Resource.designer.cs index 08d7a64f..3eb7d55b 100644 --- a/src/keepass2android/Resources/Resource.designer.cs +++ b/src/keepass2android/Resources/Resource.designer.cs @@ -576,17 +576,17 @@ namespace keepass2android // aapt resource value: 0x7f0d0072 public const int IconGridView = 2131558514; - // aapt resource value: 0x7f0d0082 - public const int QuickUnlock_button = 2131558530; + // aapt resource value: 0x7f0d0081 + public const int QuickUnlock_button = 2131558529; - // aapt resource value: 0x7f0d0083 - public const int QuickUnlock_buttonLock = 2131558531; + // aapt resource value: 0x7f0d0082 + public const int QuickUnlock_buttonLock = 2131558530; + + // aapt resource value: 0x7f0d007f + public const int QuickUnlock_label = 2131558527; // aapt resource value: 0x7f0d0080 - public const int QuickUnlock_label = 2131558528; - - // aapt resource value: 0x7f0d0081 - public const int QuickUnlock_password = 2131558529; + public const int QuickUnlock_password = 2131558528; // aapt resource value: 0x7f0d0056 public const int RelativeLayout = 2131558486; @@ -612,8 +612,8 @@ namespace keepass2android // aapt resource value: 0x7f0d0068 public const int add_group = 2131558504; - // aapt resource value: 0x7f0d0096 - public const int add_url_entry = 2131558550; + // aapt resource value: 0x7f0d0095 + public const int add_url_entry = 2131558549; // aapt resource value: 0x7f0d0027 public const int advanced_container = 2131558439; @@ -648,38 +648,38 @@ namespace keepass2android // aapt resource value: 0x7f0d0054 public const int cancel_button = 2131558484; - // aapt resource value: 0x7f0d0093 - public const int cbCaseSensitive = 2131558547; - - // aapt resource value: 0x7f0d0094 - public const int cbExcludeExpiredEntries = 2131558548; - - // aapt resource value: 0x7f0d0089 - public const int cbRegEx = 2131558537; - // aapt resource value: 0x7f0d0092 - public const int cbSearchInGroupName = 2131558546; + public const int cbCaseSensitive = 2131558546; - // aapt resource value: 0x7f0d008f - public const int cbSearchInNotes = 2131558543; + // aapt resource value: 0x7f0d0093 + public const int cbExcludeExpiredEntries = 2131558547; - // aapt resource value: 0x7f0d0090 - public const int cbSearchInOtherStrings = 2131558544; - - // aapt resource value: 0x7f0d008e - public const int cbSearchInPassword = 2131558542; + // aapt resource value: 0x7f0d0088 + public const int cbRegEx = 2131558536; // aapt resource value: 0x7f0d0091 - public const int cbSearchInTags = 2131558545; + public const int cbSearchInGroupName = 2131558545; - // aapt resource value: 0x7f0d008b - public const int cbSearchInTitle = 2131558539; + // aapt resource value: 0x7f0d008e + public const int cbSearchInNotes = 2131558542; - // aapt resource value: 0x7f0d008c - public const int cbSearchInUrl = 2131558540; + // aapt resource value: 0x7f0d008f + public const int cbSearchInOtherStrings = 2131558543; // aapt resource value: 0x7f0d008d - public const int cbSearchInUsername = 2131558541; + public const int cbSearchInPassword = 2131558541; + + // aapt resource value: 0x7f0d0090 + public const int cbSearchInTags = 2131558544; + + // aapt resource value: 0x7f0d008a + public const int cbSearchInTitle = 2131558538; + + // aapt resource value: 0x7f0d008b + public const int cbSearchInUrl = 2131558539; + + // aapt resource value: 0x7f0d008c + public const int cbSearchInUsername = 2131558540; // aapt resource value: 0x7f0d0066 public const int cb_brackets = 2131558502; @@ -708,17 +708,14 @@ namespace keepass2android // aapt resource value: 0x7f0d004f public const int create = 2131558479; - // aapt resource value: 0x7f0d009c - public const int cred_password = 2131558556; - - // aapt resource value: 0x7f0d009d - public const int cred_remember_mode = 2131558557; - // aapt resource value: 0x7f0d009b - public const int cred_username = 2131558555; + public const int cred_password = 2131558555; - // aapt resource value: 0x7f0d007b - public const int default_database = 2131558523; + // aapt resource value: 0x7f0d009c + public const int cred_remember_mode = 2131558556; + + // aapt resource value: 0x7f0d009a + public const int cred_username = 2131558554; // aapt resource value: 0x7f0d0014 public const int delete_extra = 2131558420; @@ -738,8 +735,8 @@ namespace keepass2android // aapt resource value: 0x7f0d0032 public const int edit_extra = 2131558450; - // aapt resource value: 0x7f0d007c - public const int enable_quickunlock = 2131558524; + // aapt resource value: 0x7f0d007b + public const int enable_quickunlock = 2131558523; // aapt resource value: 0x7f0d0043 public const int entry_accessed = 2131558467; @@ -927,8 +924,8 @@ namespace keepass2android // aapt resource value: 0x7f0d0073 public const int keyboard = 2131558515; - // aapt resource value: 0x7f0d007e - public const int keyfileLine = 2131558526; + // aapt resource value: 0x7f0d007d + public const int keyfileLine = 2131558525; // aapt resource value: 0x7f0d004b public const int label_open_by_filename = 2131558475; @@ -945,53 +942,56 @@ namespace keepass2android // aapt resource value: 0x7f0d0059 public const int length_label = 2131558489; - // aapt resource value: 0x7f0d0088 - public const int linearLayout1 = 2131558536; - - // aapt resource value: 0x7f0d00a7 - public const int menu_about = 2131558567; + // aapt resource value: 0x7f0d0087 + public const int linearLayout1 = 2131558535; // aapt resource value: 0x7f0d00a6 - public const int menu_app_settings = 2131558566; + public const int menu_about = 2131558566; // aapt resource value: 0x7f0d00a5 - public const int menu_cancel_edit = 2131558565; - - // aapt resource value: 0x7f0d00a9 - public const int menu_change_master_key = 2131558569; - - // aapt resource value: 0x7f0d009e - public const int menu_donate = 2131558558; - - // aapt resource value: 0x7f0d00a0 - public const int menu_goto_url = 2131558560; - - // aapt resource value: 0x7f0d00a1 - public const int menu_lock = 2131558561; - - // aapt resource value: 0x7f0d00a3 - public const int menu_rate = 2131558563; - - // aapt resource value: 0x7f0d00a8 - public const int menu_search = 2131558568; - - // aapt resource value: 0x7f0d00ab - public const int menu_search_advanced = 2131558571; - - // aapt resource value: 0x7f0d00aa - public const int menu_sort = 2131558570; - - // aapt resource value: 0x7f0d00a2 - public const int menu_suggest_improvements = 2131558562; - - // aapt resource value: 0x7f0d009f - public const int menu_toggle_pass = 2131558559; + public const int menu_app_settings = 2131558565; // aapt resource value: 0x7f0d00a4 - public const int menu_translate = 2131558564; + public const int menu_cancel_edit = 2131558564; - // aapt resource value: 0x7f0d0097 - public const int no_results = 2131558551; + // aapt resource value: 0x7f0d00ab + public const int menu_change_db = 2131558571; + + // aapt resource value: 0x7f0d00a8 + public const int menu_change_master_key = 2131558568; + + // aapt resource value: 0x7f0d009d + public const int menu_donate = 2131558557; + + // aapt resource value: 0x7f0d009f + public const int menu_goto_url = 2131558559; + + // aapt resource value: 0x7f0d00a0 + public const int menu_lock = 2131558560; + + // aapt resource value: 0x7f0d00a2 + public const int menu_rate = 2131558562; + + // aapt resource value: 0x7f0d00a7 + public const int menu_search = 2131558567; + + // aapt resource value: 0x7f0d00aa + public const int menu_search_advanced = 2131558570; + + // aapt resource value: 0x7f0d00a9 + public const int menu_sort = 2131558569; + + // aapt resource value: 0x7f0d00a1 + public const int menu_suggest_improvements = 2131558561; + + // aapt resource value: 0x7f0d009e + public const int menu_toggle_pass = 2131558558; + + // aapt resource value: 0x7f0d00a3 + public const int menu_translate = 2131558563; + + // aapt resource value: 0x7f0d0096 + public const int no_results = 2131558550; // aapt resource value: 0x7f0d006b public const int ok = 2131558507; @@ -999,8 +999,8 @@ namespace keepass2android // aapt resource value: 0x7f0d004e public const int open = 2131558478; - // aapt resource value: 0x7f0d0099 - public const int pass_conf_password = 2131558553; + // aapt resource value: 0x7f0d0098 + public const int pass_conf_password = 2131558552; // aapt resource value: 0x7f0d0079 public const int pass_keyfile = 2131558521; @@ -1008,14 +1008,14 @@ namespace keepass2android // aapt resource value: 0x7f0d007a public const int pass_ok = 2131558522; - // aapt resource value: 0x7f0d0098 - public const int pass_password = 2131558552; + // aapt resource value: 0x7f0d0097 + public const int pass_password = 2131558551; // aapt resource value: 0x7f0d0057 public const int password = 2131558487; - // aapt resource value: 0x7f0d007d - public const int passwordLine = 2131558525; + // aapt resource value: 0x7f0d007c + public const int passwordLine = 2131558524; // aapt resource value: 0x7f0d0077 public const int password_label = 2131558519; @@ -1023,8 +1023,8 @@ namespace keepass2android // aapt resource value: 0x7f0d0013 public const int protection = 2131558419; - // aapt resource value: 0x7f0d007f - public const int qu_filename = 2131558527; + // aapt resource value: 0x7f0d007e + public const int qu_filename = 2131558526; // aapt resource value: 0x7f0d000f public const int rounds = 2131558415; @@ -1032,29 +1032,29 @@ namespace keepass2android // aapt resource value: 0x7f0d0010 public const int rounds_explaination = 2131558416; - // aapt resource value: 0x7f0d0087 - public const int scrollView1 = 2131558535; - // aapt resource value: 0x7f0d0086 - public const int searchEditText = 2131558534; + public const int scrollView1 = 2131558534; // aapt resource value: 0x7f0d0085 - public const int search_button = 2131558533; - - // aapt resource value: 0x7f0d008a - public const int search_in_label = 2131558538; + public const int searchEditText = 2131558533; // aapt resource value: 0x7f0d0084 - public const int search_label = 2131558532; + public const int search_button = 2131558532; - // aapt resource value: 0x7f0d0095 - public const int select_other_entry = 2131558549; + // aapt resource value: 0x7f0d0089 + public const int search_in_label = 2131558537; + + // aapt resource value: 0x7f0d0083 + public const int search_label = 2131558531; + + // aapt resource value: 0x7f0d0094 + public const int select_other_entry = 2131558548; // aapt resource value: 0x7f0d0049 public const int start_create = 2131558473; - // aapt resource value: 0x7f0d009a - public const int start_create_import = 2131558554; + // aapt resource value: 0x7f0d0099 + public const int start_create_import = 2131558553; // aapt resource value: 0x7f0d0047 public const int start_open_file = 2131558471; @@ -1257,47 +1257,47 @@ namespace keepass2android // aapt resource value: 0x7f080035 public const int AboutText = 2131230773; - // aapt resource value: 0x7f080129 - public const int AddingEntry = 2131231017; - // aapt resource value: 0x7f08012a - public const int AddingGroup = 2131231018; + public const int AddingEntry = 2131231018; - // aapt resource value: 0x7f08011f - public const int AskDeletePermanentlyEntry = 2131231007; + // aapt resource value: 0x7f08012b + public const int AddingGroup = 2131231019; // aapt resource value: 0x7f080120 - public const int AskDeletePermanentlyGroup = 2131231008; + public const int AskDeletePermanentlyEntry = 2131231008; // aapt resource value: 0x7f080121 - public const int AskDeletePermanently_title = 2131231009; - - // aapt resource value: 0x7f080124 - public const int AskDiscardChanges = 2131231012; - - // aapt resource value: 0x7f080125 - public const int AskDiscardChanges_title = 2131231013; - - // aapt resource value: 0x7f080119 - public const int AskOverwriteBinary = 2131231001; - - // aapt resource value: 0x7f08011c - public const int AskOverwriteBinary_no = 2131231004; - - // aapt resource value: 0x7f08011a - public const int AskOverwriteBinary_title = 2131231002; - - // aapt resource value: 0x7f08011b - public const int AskOverwriteBinary_yes = 2131231003; - - // aapt resource value: 0x7f080123 - public const int AskReloadFile = 2131231011; + public const int AskDeletePermanentlyGroup = 2131231009; // aapt resource value: 0x7f080122 - public const int AskReloadFile_title = 2131231010; + public const int AskDeletePermanently_title = 2131231010; + + // aapt resource value: 0x7f080125 + public const int AskDiscardChanges = 2131231013; + + // aapt resource value: 0x7f080126 + public const int AskDiscardChanges_title = 2131231014; + + // aapt resource value: 0x7f08011a + public const int AskOverwriteBinary = 2131231002; // aapt resource value: 0x7f08011d - public const int AttachFailed = 2131231005; + public const int AskOverwriteBinary_no = 2131231005; + + // aapt resource value: 0x7f08011b + public const int AskOverwriteBinary_title = 2131231003; + + // aapt resource value: 0x7f08011c + public const int AskOverwriteBinary_yes = 2131231004; + + // aapt resource value: 0x7f080124 + public const int AskReloadFile = 2131231012; + + // aapt resource value: 0x7f080123 + public const int AskReloadFile_title = 2131231011; + + // aapt resource value: 0x7f08011e + public const int AttachFailed = 2131231006; // aapt resource value: 0x7f080021 public const int BinaryDirectory_default = 2131230753; @@ -1305,50 +1305,50 @@ namespace keepass2android // aapt resource value: 0x7f080020 public const int BinaryDirectory_key = 2131230752; - // aapt resource value: 0x7f0800f9 - public const int BinaryDirectory_summary = 2131230969; + // aapt resource value: 0x7f0800fa + public const int BinaryDirectory_summary = 2131230970; - // aapt resource value: 0x7f0800f8 - public const int BinaryDirectory_title = 2131230968; + // aapt resource value: 0x7f0800f9 + public const int BinaryDirectory_title = 2131230969; + + // aapt resource value: 0x7f080141 + public const int ChangeLog = 2131231041; // aapt resource value: 0x7f080140 - public const int ChangeLog = 2131231040; - - // aapt resource value: 0x7f08013f - public const int ChangeLog_0_7 = 2131231039; - - // aapt resource value: 0x7f08013d - public const int ChangeLog_0_8 = 2131231037; - - // aapt resource value: 0x7f08013c - public const int ChangeLog_0_8_1 = 2131231036; - - // aapt resource value: 0x7f08013b - public const int ChangeLog_0_8_2 = 2131231035; - - // aapt resource value: 0x7f08013a - public const int ChangeLog_0_8_3 = 2131231034; - - // aapt resource value: 0x7f080139 - public const int ChangeLog_0_8_4 = 2131231033; + public const int ChangeLog_0_7 = 2131231040; // aapt resource value: 0x7f08013e - public const int ChangeLog_keptDonate = 2131231038; + public const int ChangeLog_0_8 = 2131231038; - // aapt resource value: 0x7f080138 - public const int ChangeLog_title = 2131231032; + // aapt resource value: 0x7f08013d + public const int ChangeLog_0_8_1 = 2131231037; + + // aapt resource value: 0x7f08013c + public const int ChangeLog_0_8_2 = 2131231036; + + // aapt resource value: 0x7f08013b + public const int ChangeLog_0_8_3 = 2131231035; + + // aapt resource value: 0x7f08013a + public const int ChangeLog_0_8_4 = 2131231034; + + // aapt resource value: 0x7f08013f + public const int ChangeLog_keptDonate = 2131231039; + + // aapt resource value: 0x7f080139 + public const int ChangeLog_title = 2131231033; // aapt resource value: 0x7f080028 public const int CheckForFileChangesOnSave_key = 2131230760; + // aapt resource value: 0x7f08010f + public const int CheckForFileChangesOnSave_summary = 2131230991; + // aapt resource value: 0x7f08010e - public const int CheckForFileChangesOnSave_summary = 2131230990; + public const int CheckForFileChangesOnSave_title = 2131230990; - // aapt resource value: 0x7f08010d - public const int CheckForFileChangesOnSave_title = 2131230989; - - // aapt resource value: 0x7f080132 - public const int CheckingTargetFileForChanges = 2131231026; + // aapt resource value: 0x7f080133 + public const int CheckingTargetFileForChanges = 2131231027; // aapt resource value: 0x7f08004a public const int ClearClipboard = 2131230794; @@ -1359,14 +1359,14 @@ namespace keepass2android // aapt resource value: 0x7f080036 public const int CreditsText = 2131230774; - // aapt resource value: 0x7f080130 - public const int DecodingDatabase = 2131231024; - - // aapt resource value: 0x7f08012b - public const int DeletingEntry = 2131231019; + // aapt resource value: 0x7f080131 + public const int DecodingDatabase = 2131231025; // aapt resource value: 0x7f08012c - public const int DeletingGroup = 2131231020; + public const int DeletingEntry = 2131231020; + + // aapt resource value: 0x7f08012d + public const int DeletingGroup = 2131231021; // aapt resource value: 0x7f080083 public const int FileNotFound = 2131230851; @@ -1383,41 +1383,41 @@ namespace keepass2android // aapt resource value: 0x7f0800a0 public const int MaskedPassword = 2131230880; - // aapt resource value: 0x7f080134 - public const int MessageSyncQuestion = 2131231028; + // aapt resource value: 0x7f080135 + public const int MessageSyncQuestion = 2131231029; - // aapt resource value: 0x7f080137 - public const int NoOverwrite = 2131231031; + // aapt resource value: 0x7f080138 + public const int NoOverwrite = 2131231032; // aapt resource value: 0x7f08002e public const int OpenKp2aKeyboardAutomatically_key = 2131230766; + // aapt resource value: 0x7f080115 + public const int OpenKp2aKeyboardAutomatically_summary = 2131230997; + // aapt resource value: 0x7f080114 - public const int OpenKp2aKeyboardAutomatically_summary = 2131230996; + public const int OpenKp2aKeyboardAutomatically_title = 2131230996; - // aapt resource value: 0x7f080113 - public const int OpenKp2aKeyboardAutomatically_title = 2131230995; - - // aapt resource value: 0x7f080131 - public const int ParsingDatabase = 2131231025; + // aapt resource value: 0x7f080132 + public const int ParsingDatabase = 2131231026; // aapt resource value: 0x7f080032 public const int PreloadDatabaseEnabled_key = 2131230770; - // aapt resource value: 0x7f080118 - public const int PreloadDatabaseEnabled_summary = 2131231000; + // aapt resource value: 0x7f080119 + public const int PreloadDatabaseEnabled_summary = 2131231001; - // aapt resource value: 0x7f080117 - public const int PreloadDatabaseEnabled_title = 2131230999; + // aapt resource value: 0x7f080118 + public const int PreloadDatabaseEnabled_title = 2131231000; // aapt resource value: 0x7f080022 public const int QuickUnlockDefaultEnabled_key = 2131230754; - // aapt resource value: 0x7f0800f4 - public const int QuickUnlockDefaultEnabled_summary = 2131230964; + // aapt resource value: 0x7f0800f5 + public const int QuickUnlockDefaultEnabled_summary = 2131230965; - // aapt resource value: 0x7f0800f3 - public const int QuickUnlockDefaultEnabled_title = 2131230963; + // aapt resource value: 0x7f0800f4 + public const int QuickUnlockDefaultEnabled_title = 2131230964; // aapt resource value: 0x7f080024 public const int QuickUnlockLength_default = 2131230756; @@ -1425,104 +1425,104 @@ namespace keepass2android // aapt resource value: 0x7f080023 public const int QuickUnlockLength_key = 2131230755; - // aapt resource value: 0x7f0800f6 - public const int QuickUnlockLength_summary = 2131230966; - - // aapt resource value: 0x7f0800f5 - public const int QuickUnlockLength_title = 2131230965; - - // aapt resource value: 0x7f0800f1 - public const int QuickUnlock_button = 2131230961; - // aapt resource value: 0x7f0800f7 - public const int QuickUnlock_fail = 2131230967; + public const int QuickUnlockLength_summary = 2131230967; - // aapt resource value: 0x7f0800f0 - public const int QuickUnlock_label = 2131230960; + // aapt resource value: 0x7f0800f6 + public const int QuickUnlockLength_title = 2131230966; // aapt resource value: 0x7f0800f2 - public const int QuickUnlock_lockButton = 2131230962; + public const int QuickUnlock_button = 2131230962; - // aapt resource value: 0x7f08011e - public const int RecycleBin = 2131231006; + // aapt resource value: 0x7f0800f8 + public const int QuickUnlock_fail = 2131230968; - // aapt resource value: 0x7f0800fd - public const int SaveAttachmentDialog_open = 2131230973; + // aapt resource value: 0x7f0800f1 + public const int QuickUnlock_label = 2131230961; - // aapt resource value: 0x7f0800fc - public const int SaveAttachmentDialog_save = 2131230972; + // aapt resource value: 0x7f0800f3 + public const int QuickUnlock_lockButton = 2131230963; - // aapt resource value: 0x7f0800fb - public const int SaveAttachmentDialog_text = 2131230971; - - // aapt resource value: 0x7f0800fa - public const int SaveAttachmentDialog_title = 2131230970; - - // aapt resource value: 0x7f0800ff - public const int SaveAttachment_Failed = 2131230975; + // aapt resource value: 0x7f08011f + public const int RecycleBin = 2131231007; // aapt resource value: 0x7f0800fe - public const int SaveAttachment_doneMessage = 2131230974; + public const int SaveAttachmentDialog_open = 2131230974; - // aapt resource value: 0x7f08012d - public const int SettingPassword = 2131231021; + // aapt resource value: 0x7f0800fd + public const int SaveAttachmentDialog_save = 2131230973; - // aapt resource value: 0x7f080110 - public const int ShowCopyToClipboardNotification_summary = 2131230992; + // aapt resource value: 0x7f0800fc + public const int SaveAttachmentDialog_text = 2131230972; - // aapt resource value: 0x7f08010f - public const int ShowCopyToClipboardNotification_title = 2131230991; + // aapt resource value: 0x7f0800fb + public const int SaveAttachmentDialog_title = 2131230971; - // aapt resource value: 0x7f080112 - public const int ShowKp2aKeyboardNotification_summary = 2131230994; + // aapt resource value: 0x7f080100 + public const int SaveAttachment_Failed = 2131230976; + + // aapt resource value: 0x7f0800ff + public const int SaveAttachment_doneMessage = 2131230975; + + // aapt resource value: 0x7f08012e + public const int SettingPassword = 2131231022; // aapt resource value: 0x7f080111 - public const int ShowKp2aKeyboardNotification_title = 2131230993; + public const int ShowCopyToClipboardNotification_summary = 2131230993; + + // aapt resource value: 0x7f080110 + public const int ShowCopyToClipboardNotification_title = 2131230992; + + // aapt resource value: 0x7f080113 + public const int ShowKp2aKeyboardNotification_summary = 2131230995; + + // aapt resource value: 0x7f080112 + public const int ShowKp2aKeyboardNotification_title = 2131230994; // aapt resource value: 0x7f080031 public const int ShowUnlockedNotification_key = 2131230769; - // aapt resource value: 0x7f080116 - public const int ShowUnlockedNotification_summary = 2131230998; + // aapt resource value: 0x7f080117 + public const int ShowUnlockedNotification_summary = 2131230999; - // aapt resource value: 0x7f080115 - public const int ShowUnlockedNotification_title = 2131230997; + // aapt resource value: 0x7f080116 + public const int ShowUnlockedNotification_title = 2131230998; // aapt resource value: 0x7f08001d public const int ShowUsernameInList_key = 2131230749; - // aapt resource value: 0x7f0800e4 - public const int ShowUsernameInList_summary = 2131230948; + // aapt resource value: 0x7f0800e5 + public const int ShowUsernameInList_summary = 2131230949; - // aapt resource value: 0x7f0800e3 - public const int ShowUsernameInList_title = 2131230947; + // aapt resource value: 0x7f0800e4 + public const int ShowUsernameInList_title = 2131230948; // aapt resource value: 0x7f08002a public const int SuggestionsURL = 2131230762; - // aapt resource value: 0x7f080135 - public const int SynchronizingDatabase = 2131231029; + // aapt resource value: 0x7f080136 + public const int SynchronizingDatabase = 2131231030; // aapt resource value: 0x7f08001c public const int TanExpiresOnUse_key = 2131230748; + // aapt resource value: 0x7f0800e3 + public const int TanExpiresOnUse_summary = 2131230947; + // aapt resource value: 0x7f0800e2 - public const int TanExpiresOnUse_summary = 2131230946; + public const int TanExpiresOnUse_title = 2131230946; - // aapt resource value: 0x7f0800e1 - public const int TanExpiresOnUse_title = 2131230945; + // aapt resource value: 0x7f080134 + public const int TitleSyncQuestion = 2131231028; - // aapt resource value: 0x7f080133 - public const int TitleSyncQuestion = 2131231027; - - // aapt resource value: 0x7f08012f - public const int TransformingKey = 2131231023; + // aapt resource value: 0x7f080130 + public const int TransformingKey = 2131231024; // aapt resource value: 0x7f08002b public const int TranslationURL = 2131230763; - // aapt resource value: 0x7f08012e - public const int UndoingChanges = 2131231022; + // aapt resource value: 0x7f08012f + public const int UndoingChanges = 2131231023; // aapt resource value: 0x7f080025 public const int UsageCount_key = 2131230757; @@ -1530,17 +1530,17 @@ namespace keepass2android // aapt resource value: 0x7f080027 public const int UseFileTransactions_key = 2131230759; - // aapt resource value: 0x7f08010c - public const int UseFileTransactions_summary = 2131230988; + // aapt resource value: 0x7f08010d + public const int UseFileTransactions_summary = 2131230989; - // aapt resource value: 0x7f08010b - public const int UseFileTransactions_title = 2131230987; + // aapt resource value: 0x7f08010c + public const int UseFileTransactions_title = 2131230988; // aapt resource value: 0x7f08002d public const int UseKp2aKeyboard_key = 2131230765; - // aapt resource value: 0x7f080136 - public const int YesSynchronize = 2131231030; + // aapt resource value: 0x7f080137 + public const int YesSynchronize = 2131231031; // aapt resource value: 0x7f080033 public const int about_feedback = 2131230771; @@ -1551,14 +1551,14 @@ namespace keepass2android // aapt resource value: 0x7f080037 public const int accept = 2131230775; - // aapt resource value: 0x7f080105 - public const int add_binary = 2131230981; + // aapt resource value: 0x7f080106 + public const int add_binary = 2131230982; // aapt resource value: 0x7f080038 public const int add_entry = 2131230776; - // aapt resource value: 0x7f080106 - public const int add_extra_string = 2131230982; + // aapt resource value: 0x7f080107 + public const int add_extra_string = 2131230983; // aapt resource value: 0x7f08003a public const int add_group = 2131230778; @@ -1617,8 +1617,8 @@ namespace keepass2android // aapt resource value: 0x7f080049 public const int cancel = 2131230793; - // aapt resource value: 0x7f0800e8 - public const int caseSensitive = 2131230952; + // aapt resource value: 0x7f0800e9 + public const int caseSensitive = 2131230953; // aapt resource value: 0x7f080002 public const int change_entry = 2131230722; @@ -1644,8 +1644,8 @@ namespace keepass2android // aapt resource value: 0x7f080052 public const int creating_db_key = 2131230802; - // aapt resource value: 0x7f08010a - public const int credentials_dialog_title = 2131230986; + // aapt resource value: 0x7f08010b + public const int credentials_dialog_title = 2131230987; // aapt resource value: 0x7f080053 public const int current_group = 2131230803; @@ -1656,14 +1656,14 @@ namespace keepass2android // aapt resource value: 0x7f080055 public const int database = 2131230805; - // aapt resource value: 0x7f080108 - public const int database_loaded_quickunlock_enabled = 2131230984; - // aapt resource value: 0x7f080109 - public const int database_loaded_unlocked = 2131230985; + public const int database_loaded_quickunlock_enabled = 2131230985; - // aapt resource value: 0x7f0800cb - public const int database_name = 2131230923; + // aapt resource value: 0x7f08010a + public const int database_loaded_unlocked = 2131230986; + + // aapt resource value: 0x7f0800cc + public const int database_name = 2131230924; // aapt resource value: 0x7f08001f public const int database_name_key = 2131230751; @@ -1683,14 +1683,14 @@ namespace keepass2android // aapt resource value: 0x7f08000a public const int default_file_path = 2131230730; - // aapt resource value: 0x7f0800cc - public const int default_username = 2131230924; + // aapt resource value: 0x7f0800cd + public const int default_username = 2131230925; // aapt resource value: 0x7f08001e public const int default_username_key = 2131230750; - // aapt resource value: 0x7f080107 - public const int delete_extra_string = 2131230983; + // aapt resource value: 0x7f080108 + public const int delete_extra_string = 2131230984; // aapt resource value: 0x7f080059 public const int digits = 2131230809; @@ -1704,17 +1704,17 @@ namespace keepass2android // aapt resource value: 0x7f08005b public const int ellipsis = 2131230811; - // aapt resource value: 0x7f0800ef - public const int enable_quickunlock = 2131230959; + // aapt resource value: 0x7f0800f0 + public const int enable_quickunlock = 2131230960; // aapt resource value: 0x7f08005c public const int enter_filename = 2131230812; - // aapt resource value: 0x7f0800ee - public const int enter_filename_details_create_import = 2131230958; + // aapt resource value: 0x7f0800ef + public const int enter_filename_details_create_import = 2131230959; - // aapt resource value: 0x7f0800ed - public const int enter_filename_details_url = 2131230957; + // aapt resource value: 0x7f0800ee + public const int enter_filename_details_url = 2131230958; // aapt resource value: 0x7f08005d public const int entry_accessed = 2131230813; @@ -1800,8 +1800,8 @@ namespace keepass2android // aapt resource value: 0x7f080078 public const int error_invalid_db = 2131230840; - // aapt resource value: 0x7f080100 - public const int error_invalid_expiry_date = 2131230976; + // aapt resource value: 0x7f080101 + public const int error_invalid_expiry_date = 2131230977; // aapt resource value: 0x7f080079 public const int error_invalid_path = 2131230841; @@ -1827,8 +1827,8 @@ namespace keepass2android // aapt resource value: 0x7f080080 public const int error_rounds_too_large = 2131230848; - // aapt resource value: 0x7f080101 - public const int error_string_key = 2131230977; + // aapt resource value: 0x7f080102 + public const int error_string_key = 2131230978; // aapt resource value: 0x7f080081 public const int error_title_required = 2131230849; @@ -1836,14 +1836,14 @@ namespace keepass2android // aapt resource value: 0x7f080082 public const int error_wrong_length = 2131230850; - // aapt resource value: 0x7f0800e6 - public const int excludeExpiredEntries = 2131230950; - - // aapt resource value: 0x7f080102 - public const int field_name = 2131230978; + // aapt resource value: 0x7f0800e7 + public const int excludeExpiredEntries = 2131230951; // aapt resource value: 0x7f080103 - public const int field_value = 2131230979; + public const int field_name = 2131230979; + + // aapt resource value: 0x7f080104 + public const int field_value = 2131230980; // aapt resource value: 0x7f080084 public const int file_browser = 2131230852; @@ -1926,8 +1926,8 @@ namespace keepass2android // aapt resource value: 0x7f080017 public const int keyfile_key = 2131230743; - // aapt resource value: 0x7f0800e5 - public const int kp2a_findUrl = 2131230949; + // aapt resource value: 0x7f0800e6 + public const int kp2a_findUrl = 2131230950; // aapt resource value: 0x7f080005 public const int label_go_key = 2131230725; @@ -1980,6 +1980,9 @@ namespace keepass2android // aapt resource value: 0x7f0800a8 public const int menu_app_settings = 2131230888; + // aapt resource value: 0x7f0800b5 + public const int menu_change_db = 2131230901; + // aapt resource value: 0x7f0800a4 public const int menu_change_key = 2131230884; @@ -2028,23 +2031,23 @@ namespace keepass2android // aapt resource value: 0x7f0800b4 public const int menu_url = 2131230900; - // aapt resource value: 0x7f0800b5 - public const int minus = 2131230901; - // aapt resource value: 0x7f0800b6 - public const int never = 2131230902; + public const int minus = 2131230902; - // aapt resource value: 0x7f0800b8 - public const int no = 2131230904; + // aapt resource value: 0x7f0800b7 + public const int never = 2131230903; // aapt resource value: 0x7f0800b9 - public const int no_keys = 2131230905; + public const int no = 2131230905; // aapt resource value: 0x7f0800ba - public const int no_results = 2131230906; + public const int no_keys = 2131230906; // aapt resource value: 0x7f0800bb - public const int no_url_handler = 2131230907; + public const int no_results = 2131230907; + + // aapt resource value: 0x7f0800bc + public const int no_url_handler = 2131230908; // aapt resource value: 0x7f080050 public const int not_possible_im_picker = 2131230800; @@ -2058,11 +2061,11 @@ namespace keepass2android // aapt resource value: 0x7f080019 public const int omitbackup_key = 2131230745; - // aapt resource value: 0x7f0800be - public const int omitbackup_summary = 2131230910; + // aapt resource value: 0x7f0800bf + public const int omitbackup_summary = 2131230911; - // aapt resource value: 0x7f0800bd - public const int omitbackup_title = 2131230909; + // aapt resource value: 0x7f0800be + public const int omitbackup_title = 2131230910; // aapt resource value: 0x7f080003 public const int open_entry = 2131230723; @@ -2070,83 +2073,83 @@ namespace keepass2android // aapt resource value: 0x7f080004 public const int open_entry_for_app = 2131230724; - // aapt resource value: 0x7f0800bc - public const int open_recent = 2131230908; - - // aapt resource value: 0x7f0800bf - public const int pass_filename = 2131230911; + // aapt resource value: 0x7f0800bd + public const int open_recent = 2131230909; // aapt resource value: 0x7f0800c0 - public const int password_title = 2131230912; + public const int pass_filename = 2131230912; + + // aapt resource value: 0x7f0800c1 + public const int password_title = 2131230913; // aapt resource value: 0x7f080051 public const int please_activate_keyboard = 2131230801; - // aapt resource value: 0x7f0800c1 - public const int progress_create = 2131230913; - // aapt resource value: 0x7f0800c2 - public const int progress_title = 2131230914; - - // aapt resource value: 0x7f080104 - public const int protection = 2131230980; - - // aapt resource value: 0x7f080127 - public const int rate_app = 2131231015; - - // aapt resource value: 0x7f0800e0 - public const int regular_expression = 2131230944; + public const int progress_create = 2131230914; // aapt resource value: 0x7f0800c3 - public const int remember_keyfile_summary = 2131230915; + public const int progress_title = 2131230915; + + // aapt resource value: 0x7f080105 + public const int protection = 2131230981; + + // aapt resource value: 0x7f080128 + public const int rate_app = 2131231016; + + // aapt resource value: 0x7f0800e1 + public const int regular_expression = 2131230945; // aapt resource value: 0x7f0800c4 - public const int remember_keyfile_title = 2131230916; + public const int remember_keyfile_summary = 2131230916; // aapt resource value: 0x7f0800c5 - public const int remove_from_filelist = 2131230917; + public const int remember_keyfile_title = 2131230917; // aapt resource value: 0x7f0800c6 - public const int rijndael = 2131230918; + public const int remove_from_filelist = 2131230918; // aapt resource value: 0x7f0800c7 - public const int root = 2131230919; + public const int rijndael = 2131230919; // aapt resource value: 0x7f0800c8 - public const int rounds = 2131230920; + public const int root = 2131230920; // aapt resource value: 0x7f0800c9 - public const int rounds_explaination = 2131230921; + public const int rounds = 2131230921; // aapt resource value: 0x7f0800ca - public const int rounds_hint = 2131230922; + public const int rounds_explaination = 2131230922; + + // aapt resource value: 0x7f0800cb + public const int rounds_hint = 2131230923; // aapt resource value: 0x7f080016 public const int rounds_key = 2131230742; - // aapt resource value: 0x7f0800cd - public const int saving_database = 2131230925; - - // aapt resource value: 0x7f0800d4 - public const int search_hint = 2131230932; - - // aapt resource value: 0x7f0800d6 - public const int search_in = 2131230934; - - // aapt resource value: 0x7f0800cf - public const int search_label = 2131230927; - - // aapt resource value: 0x7f0800e7 - public const int search_options = 2131230951; + // aapt resource value: 0x7f0800ce + public const int saving_database = 2131230926; // aapt resource value: 0x7f0800d5 - public const int search_results = 2131230933; - - // aapt resource value: 0x7f0800d8 - public const int select_group_then_add = 2131230936; + public const int search_hint = 2131230933; // aapt resource value: 0x7f0800d7 - public const int select_other_entry = 2131230935; + public const int search_in = 2131230935; + + // aapt resource value: 0x7f0800d0 + public const int search_label = 2131230928; + + // aapt resource value: 0x7f0800e8 + public const int search_options = 2131230952; + + // aapt resource value: 0x7f0800d6 + public const int search_results = 2131230934; + + // aapt resource value: 0x7f0800d9 + public const int select_group_then_add = 2131230937; + + // aapt resource value: 0x7f0800d8 + public const int select_other_entry = 2131230936; // aapt resource value: 0x7f08003f public const int short_app_name = 2131230783; @@ -2154,68 +2157,68 @@ namespace keepass2android // aapt resource value: 0x7f080041 public const int short_app_name_nonet = 2131230785; - // aapt resource value: 0x7f0800d0 - public const int show_password = 2131230928; + // aapt resource value: 0x7f0800d1 + public const int show_password = 2131230929; - // aapt resource value: 0x7f0800d2 - public const int sort_db = 2131230930; + // aapt resource value: 0x7f0800d3 + public const int sort_db = 2131230931; // aapt resource value: 0x7f08001b public const int sort_key = 2131230747; - // aapt resource value: 0x7f0800d1 - public const int sort_name = 2131230929; + // aapt resource value: 0x7f0800d2 + public const int sort_name = 2131230930; - // aapt resource value: 0x7f0800ce - public const int space = 2131230926; + // aapt resource value: 0x7f0800cf + public const int space = 2131230927; - // aapt resource value: 0x7f0800d3 - public const int special = 2131230931; - - // aapt resource value: 0x7f0800ea - public const int start_create = 2131230954; - - // aapt resource value: 0x7f0800ec - public const int start_create_import = 2131230956; - - // aapt resource value: 0x7f0800e9 - public const int start_open_file = 2131230953; + // aapt resource value: 0x7f0800d4 + public const int special = 2131230932; // aapt resource value: 0x7f0800eb - public const int start_open_url = 2131230955; + public const int start_create = 2131230955; - // aapt resource value: 0x7f080126 - public const int suggest_improvements = 2131231014; + // aapt resource value: 0x7f0800ed + public const int start_create_import = 2131230957; - // aapt resource value: 0x7f080128 - public const int translate_app = 2131231016; + // aapt resource value: 0x7f0800ea + public const int start_open_file = 2131230954; - // aapt resource value: 0x7f0800d9 - public const int twofish = 2131230937; + // aapt resource value: 0x7f0800ec + public const int start_open_url = 2131230956; + + // aapt resource value: 0x7f080127 + public const int suggest_improvements = 2131231015; + + // aapt resource value: 0x7f080129 + public const int translate_app = 2131231017; // aapt resource value: 0x7f0800da - public const int underline = 2131230938; + public const int twofish = 2131230938; // aapt resource value: 0x7f0800db - public const int unsupported_db_version = 2131230939; + public const int underline = 2131230939; // aapt resource value: 0x7f0800dc - public const int uppercase = 2131230940; - - // aapt resource value: 0x7f0800df - public const int version_label = 2131230943; + public const int unsupported_db_version = 2131230940; // aapt resource value: 0x7f0800dd - public const int warning_read_only = 2131230941; + public const int uppercase = 2131230941; + + // aapt resource value: 0x7f0800e0 + public const int version_label = 2131230944; // aapt resource value: 0x7f0800de - public const int warning_unmounted = 2131230942; + public const int warning_read_only = 2131230942; + + // aapt resource value: 0x7f0800df + public const int warning_unmounted = 2131230943; // aapt resource value: 0x7f080001 public const int word_separators = 2131230721; - // aapt resource value: 0x7f0800b7 - public const int yes = 2131230903; + // aapt resource value: 0x7f0800b8 + public const int yes = 2131230904; static String() { diff --git a/src/keepass2android/Resources/layout-v14/password.xml b/src/keepass2android/Resources/layout-v14/password.xml index 0c6e927f..134b6b16 100644 --- a/src/keepass2android/Resources/layout-v14/password.xml +++ b/src/keepass2android/Resources/layout-v14/password.xml @@ -91,16 +91,10 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/keyfileLine" /> - \ No newline at end of file diff --git a/src/keepass2android/Resources/layout/password.xml b/src/keepass2android/Resources/layout/password.xml index e586320f..5fd886d4 100644 --- a/src/keepass2android/Resources/layout/password.xml +++ b/src/keepass2android/Resources/layout/password.xml @@ -79,16 +79,10 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/pass_keyfile" /> - \ No newline at end of file diff --git a/src/keepass2android/Resources/menu-v11/password.xml b/src/keepass2android/Resources/menu-v11/password.xml index f1e24664..3d2e0470 100644 --- a/src/keepass2android/Resources/menu-v11/password.xml +++ b/src/keepass2android/Resources/menu-v11/password.xml @@ -20,6 +20,11 @@ android:title="@string/menu_about" android:icon="@android:drawable/ic_menu_help" android:showAsAction="ifRoom" + /> + + Search Advanced Search Go to URL + Change database… Minus Never Yes diff --git a/src/keepass2android/fileselect/FileSelectActivity.cs b/src/keepass2android/fileselect/FileSelectActivity.cs index 01c36742..1468e7f5 100644 --- a/src/keepass2android/fileselect/FileSelectActivity.cs +++ b/src/keepass2android/fileselect/FileSelectActivity.cs @@ -62,11 +62,6 @@ namespace keepass2android internal AppTask AppTask; - IOConnectionInfo LoadIoc(string defaultFileName) - { - return _DbHelper.CursorToIoc(_DbHelper.FetchFileByName(defaultFileName)); - } - void ShowFilenameDialog(bool showOpenButton, bool showCreateButton, bool showBrowseButton, string defaultFilename, string detailsText, int requestCodeBrowse) { AlertDialog.Builder builder = new AlertDialog.Builder(this); @@ -376,6 +371,7 @@ namespace keepass2android ioc.Password = password; ioc.CredSaveMode = (IOCredSaveMode)credentialRememberMode; PasswordActivity.Launch(this, ioc, AppTask); + Finish(); }); builder.SetView(LayoutInflater.Inflate(Resource.Layout.url_credentials, null)); builder.SetNeutralButton(GetString(Android.Resource.String.Cancel), @@ -391,6 +387,7 @@ namespace keepass2android try { PasswordActivity.Launch(this, ioc, AppTask); + Finish(); } catch (Java.IO.FileNotFoundException) { Toast.MakeText(this, Resource.String.FileNotFound, ToastLength.Long).Show(); @@ -474,36 +471,6 @@ namespace keepass2android _fileSelectButtons.UpdateExternalStorageWarning(); - if (!_createdWithActivityResult) - { - if ((Intent.Action == Intent.ActionSend) && (App.Kp2a.GetDb().Loaded)) - { - PasswordActivity.Launch(this, App.Kp2a.GetDb().Ioc , AppTask); - } else - { - - // Load default database - ISharedPreferences prefs = Android.Preferences.PreferenceManager.GetDefaultSharedPreferences(this); - String defaultFileName = prefs.GetString(PasswordActivity.KeyDefaultFilename, ""); - - if (defaultFileName.Length > 0) - { - Java.IO.File db = new Java.IO.File(defaultFileName); - - if (db.Exists()) - { - try - { - PasswordActivity.Launch(this, LoadIoc(defaultFileName), AppTask); - } catch (Exception e) - { - Toast.MakeText(this, e.Message, ToastLength.Long); - // Ignore exception - } - } - } - } - } } @@ -516,7 +483,9 @@ namespace keepass2android if (db.Loaded) { PasswordActivity.Launch(this, db.Ioc, AppTask); + Finish(); } + } public override bool OnCreateOptionsMenu(IMenu menu) {