Fixed bug with loading attachments from kdb

Update to GPL V3
Regard CanWrite in UI
This commit is contained in:
Philipp Crocoll
2014-01-26 05:27:27 -08:00
parent 8bbd18d3f8
commit dc4088e7c7
71 changed files with 2436 additions and 6611 deletions

View File

@@ -5,8 +5,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeePassLib2Android", "KeePa
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "keepass2android", "keepass2android\keepass2android.csproj", "{A6CF8A86-37C1-4197-80FE-519DE2C842F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kp2akeytransform", "kp2akeytransform\kp2akeytransform.csproj", "{A57B3ACE-5634-469A-88C4-858BB409F356}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kp2aKeyboardBinding", "Kp2aKeyboardBinding\Kp2aKeyboardBinding.csproj", "{A8779D4D-7C49-4C2F-82BD-2CDC448391DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kp2aBusinessLogic", "Kp2aBusinessLogic\Kp2aBusinessLogic.csproj", "{53A9CB7F-6553-4BC0-B56B-9410BB2E59AA}"
@@ -88,28 +86,6 @@ Global
{A6CF8A86-37C1-4197-80FE-519DE2C842F5}.ReleaseNoNet|Mixed Platforms.Deploy.0 = ReleaseNoNet|Any CPU
{A6CF8A86-37C1-4197-80FE-519DE2C842F5}.ReleaseNoNet|Win32.ActiveCfg = ReleaseNoNet|Any CPU
{A6CF8A86-37C1-4197-80FE-519DE2C842F5}.ReleaseNoNet|x64.ActiveCfg = ReleaseNoNet|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|Win32.ActiveCfg = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|Win32.Build.0 = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|x64.ActiveCfg = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Debug|x64.Build.0 = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|Any CPU.Build.0 = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|Win32.ActiveCfg = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|Win32.Build.0 = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|x64.ActiveCfg = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.Release|x64.Build.0 = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.ReleaseNoNet|Any CPU.ActiveCfg = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.ReleaseNoNet|Any CPU.Build.0 = Debug|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.ReleaseNoNet|Mixed Platforms.ActiveCfg = ReleaseNoNet|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.ReleaseNoNet|Mixed Platforms.Build.0 = ReleaseNoNet|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU
{A57B3ACE-5634-469A-88C4-858BB409F356}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU
{A8779D4D-7C49-4C2F-82BD-2CDC448391DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8779D4D-7C49-4C2F-82BD-2CDC448391DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8779D4D-7C49-4C2F-82BD-2CDC448391DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU

View File

@@ -125,7 +125,7 @@ namespace keepass2android
SetFieldIfAvailable(pwEntry, PwDefs.PasswordField, true, entryV3.Password);
SetFieldIfAvailable(pwEntry, PwDefs.NotesField, true, entryV3.Additional);
if (entryV3.GetBinaryData() != null)
if ((entryV3.GetBinaryData() != null) && (entryV3.GetBinaryData().Length > 0))
{
pwEntry.Binaries.Set(entryV3.BinaryDesc, new ProtectedBinary(true, entryV3.GetBinaryData()));
}

View File

@@ -83,6 +83,13 @@ namespace keepass2android
{
try
{
if (_app.GetDb().CanWrite == false)
{
//this should only happen if there is a problem in the UI so that the user sees an edit interface.
Finish(false,"Cannot save changes. File is read-only!");
return;
}
StatusLogger.UpdateMessage(UiStringKey.saving_database);
IOConnectionInfo ioc = _app.GetDb().Ioc;
IFileStorage fileStorage = _app.GetFileStorage(ioc);

View File

@@ -25,9 +25,9 @@ namespace Kp2aUnitTests
//runner.AddTests(new List<Type> { typeof(TestLoadDb) });
//runner.AddTests(new List<Type> { typeof(TestCachingFileStorage) });
runner.AddTests(typeof(TestLoadDb).GetMethod("TestLoadKdb1"));
runner.AddTests(typeof(TestLoadDb).GetMethod("TestLoadWithKeyfileOnly"));
runner.AddTests(typeof(TestLoadDb).GetMethod("TestLoadKdbpWithPasswordOnly"));
runner.AddTests(typeof(TestSaveDb).GetMethod("TestLoadKdbxAndSaveKdbp_TestIdenticalFiles"));
//runner.AddTests(typeof(TestLoadDb).GetMethod("TestLoadWithKeyfileOnly"));
//runner.AddTests(typeof(TestLoadDb).GetMethod("TestLoadKdbpWithPasswordOnly"));
//runner.AddTests(typeof(TestSaveDb).GetMethod("TestLoadKdbxAndSaveKdbp_TestIdenticalFiles"));
return runner;
}
}

View File

@@ -68,6 +68,8 @@ namespace Kp2aUnitTests
Assert.AreEqual(6, app.GetDb().KpDatabase.RootGroup.Groups.Count());
PwGroup generalGroup = app.GetDb().KpDatabase.RootGroup.Groups.Single(g => g.Name == "General");
Assert.AreEqual(2, generalGroup.Entries.Count());
foreach (PwEntry e in generalGroup.Entries)
Assert.IsFalse(e.Binaries.Any());
}
[TestMethod]

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll.
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -74,9 +74,19 @@ namespace keepass2android
protected void SetupEditButtons() {
View edit = FindViewById(Resource.Id.entry_edit);
edit.Click += (sender, e) => {
EntryEditActivity.Launch(this, Entry,_appTask);
};
if (App.Kp2a.GetDb().CanWrite)
{
edit.Visibility = ViewStates.Visible;
edit.Click += (sender, e) =>
{
EntryEditActivity.Launch(this, Entry, _appTask);
};
}
else
{
edit.Visibility = ViewStates.Gone;
}
}
protected override void OnCreate(Bundle savedInstanceState)

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -35,8 +35,6 @@ namespace keepass2android
public const int Uninit = -1;
protected bool AddGroupEnabled = true;
protected bool AddEntryEnabled = true;
private const String Tag = "Group Activity:";
@@ -80,9 +78,17 @@ namespace keepass2android
GroupView.SetNormalButtonVisibility(AddGroupEnabled, AddEntryEnabled);
GroupView.Invalidate();
}
private bool AddGroupEnabled
{
get { return App.Kp2a.GetDb().CanWrite; }
}
private bool AddEntryEnabled
{
get { return App.Kp2a.GetDb().CanWrite; }
}
protected override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -63,7 +63,7 @@ namespace keepass2android
public virtual void SetupNormalButtons()
{
GroupView.SetNormalButtonVisibility(true, true);
GroupView.SetNormalButtonVisibility(App.Kp2a.GetDb().CanWrite, App.Kp2a.GetDb().CanWrite);
}
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
@@ -271,6 +271,11 @@ namespace keepass2android
else
item.SetVisible(true);
}
item = menu.FindItem(Resource.Id.menu_change_master_key);
if (item != null)
{
item.SetVisible(App.Kp2a.GetDb().CanWrite);
}
return true;
}

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll.
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll.
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -118,13 +118,18 @@
android:layout_height="wrap_content"
android:layout_below="@id/plugin1"
android:text="@string/credit_android_filechooser" />
<TextView
android:id="@+id/keyboard_contrib"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/android_filechooser_contrib"
android:text="@string/credit_keyboard" />
<TextView
android:id="@+id/Credit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/android_filechooser_contrib"
android:layout_below="@id/keyboard_contrib"
android:text="@string/CreditsText" />
<TextView
android:id="@+id/Credit2"

View File

@@ -56,7 +56,7 @@
<item name="android:layout_marginRight">12dip</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textColor">@color/dark_gray</item>
<item name="android:textSize">18sp</item>
<item name="android:textSize">16sp</item>
</style>
<style name="EntryFieldHeader" parent="android:Widget.Holo.Light.TextView">
@@ -69,7 +69,7 @@
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/light_gray</item>
<item name="android:textSize">18sp</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="InfoHeader" parent="android:Widget.Holo.Light.TextView">

View File

@@ -183,6 +183,7 @@
<string name="further_authors">Thanks to code contributions by %1$s.</string>
<string name="credit_plugin1">The Twofish Cipher Plugin for Keepass was developed by Scott Greenberg and is included in KP2A.</string>
<string name="credit_android_filechooser">android-filechooser was developed by Hai Bison</string>
<string name="credit_keyboard">The KP2A keyboard is based on the Gingerbread keyboard by the Android Open Source Project and uses the Plugin Manager code from Hacker\'s Keyboard by Klaus Weidner.</string>
<string name="please_note">Please note</string>
<string name="contributors">Contributors</string>
<string name="regular_expression">Regular expression</string>

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll.
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -155,11 +155,22 @@ namespace keepass2android
View createUrlEntry = FindViewById (Resource.Id.add_url_entry);
createUrlEntry.Click += (sender, e) => {
GroupActivity.Launch (this, new CreateEntryThenCloseTask { Url = url } );
Toast.MakeText(this, GetString(Resource.String.select_group_then_add, new Java.Lang.Object[]{GetString(Resource.String.add_entry)}), ToastLength.Long ).Show();
};
if (App.Kp2a.GetDb().CanWrite)
{
createUrlEntry.Visibility = ViewStates.Visible;
createUrlEntry.Click += (sender, e) =>
{
GroupActivity.Launch(this, new CreateEntryThenCloseTask { Url = url });
Toast.MakeText(this, GetString(Resource.String.select_group_then_add, new Java.Lang.Object[] { GetString(Resource.String.add_entry) }), ToastLength.Long).Show();
};
}
else
{
createUrlEntry.Visibility = ViewStates.Gone;
}
}

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -214,6 +214,7 @@ namespace keepass2android
public static void ShowSftpDialog(Activity activity, FileSelectedHandler onStartBrowse)
{
#if !EXCLUDE_JAVAFILESTORAGE
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
View dlgContents = activity.LayoutInflater.Inflate(Resource.Layout.sftpcredentials, null);
builder.SetView(dlgContents);
@@ -237,6 +238,7 @@ namespace keepass2android
Dialog dialog = builder.Create();
dialog.Show();
#endif
}
public static void ShowFilenameDialog(Activity activity, FileSelectedHandler onOpen, FileSelectedHandler onCreate, bool showBrowseButton,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -1,19 +1,3 @@
// Copyright (c) 2013 Philipp Crocoll
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
using System;
using Android.App;
using Android.Content;
@@ -377,7 +361,8 @@ namespace keepass2android
public override void AfterAddNewEntry(EntryEditActivity entryEditActivity, PwEntry newEntry)
{
EntryActivity.Launch(entryEditActivity, newEntry, -1, new SelectEntryTask());
entryEditActivity.SetResult(KeePass.ExitCloseAfterTaskComplete);
entryEditActivity.SetResult
(KeePass.ExitCloseAfterTaskComplete);
//no need to call Finish here, that's done in EntryEditActivity ("closeOrShowError")
}

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -77,10 +77,6 @@
<DeployExternal>True</DeployExternal>
</PropertyGroup>
<ItemGroup>
<Reference Include="GooglePlayServicesFroyoLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Components\googleplayservicesfroyo-9.0\lib\android\GooglePlayServicesFroyoLib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
@@ -690,18 +686,6 @@
<Folder Include="SupportLib\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AndroidFileChooserBinding\AndroidFileChooserBinding.csproj" Condition="!$(DefineConstants.Contains('EXCLUDE_FILECHOOSER'))">
<Project>{3C0F7FE5-639F-4422-A087-8B26CF862D1B}</Project>
<Name>AndroidFileChooserBinding</Name>
</ProjectReference>
<ProjectReference Include="..\AppCompatV7Binding\AppCompatV7Binding.csproj" Condition="!$(DefineConstants.Contains('EXCLUDE_FILECHOOSER'))">
<Project>{23233A28-D74F-4BF8-B4D8-834060840BD7}</Project>
<Name>AppCompatV7Binding</Name>
</ProjectReference>
<ProjectReference Include="..\JavaFileStorageBindings\JavaFileStorageBindings.csproj" Condition="!$(DefineConstants.Contains('EXCLUDE_JAVAFILESTORAGE'))">
<Project>{48574278-4779-4B3A-A9E4-9CF1BC285D0B}</Project>
<Name>JavaFileStorageBindings</Name>
</ProjectReference>
<ProjectReference Include="..\KeePassLib2Android\KeePassLib2Android.csproj">
<Project>{545B4A6B-8BBA-4FBE-92FC-4AC060122A54}</Project>
<Name>KeePassLib2Android</Name>
@@ -710,13 +694,9 @@
<Project>{53A9CB7F-6553-4BC0-B56B-9410BB2E59AA}</Project>
<Name>Kp2aBusinessLogic</Name>
</ProjectReference>
<ProjectReference Include="..\kp2akeytransform\kp2akeytransform.csproj" Condition="!$(DefineConstants.Contains('EXCLUDE_KEYTRANSFORM'))">
<Project>{A57B3ACE-5634-469A-88C4-858BB409F356}</Project>
<Name>kp2akeytransform</Name>
</ProjectReference>
<ProjectReference Include="..\Kp2aKeyboardBinding\Kp2aKeyboardBinding.csproj" Condition="!$(DefineConstants.Contains('EXCLUDE_KEYBOARD'))">
<Project>{A8779D4D-7C49-4C2F-82BD-2CDC448391DA}</Project>
<Name>Kp2aKeyboardBinding</Name>
<ProjectReference Include="..\KP2AKdbLibraryBinding\KP2AKdbLibraryBinding.csproj">
<Project>{70d3844a-d9fa-4a64-b205-a84c6a822196}</Project>
<Name>KP2AKdbLibraryBinding</Name>
</ProjectReference>
<ProjectReference Include="..\TwofishCipher\TwofishCipher.csproj" Condition="!$(DefineConstants.Contains('EXCLUDE_TWOFISH'))">
<Project>{5CF675A5-9BEE-4720-BED9-D5BF14A2EBF9}</Project>
@@ -911,9 +891,6 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable\ic_storage_sftp.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\4-collections-new-label.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\device_access_new_account.png" />
</ItemGroup>

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll.
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll.
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -336,6 +336,8 @@ namespace keepass2android
SendBroadcast(new Intent(Intents.KeyboardCleared));
return hadData;
#else
return false;
#endif
}
@@ -511,7 +513,9 @@ namespace keepass2android
}
else
{
#if !EXCLUDE_KEYBOARD
Keepass2android.Kbbridge.ImeSwitcher.SwitchToKeyboard(service, kp2aIme, false);
#endif
}
}
}

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -51,8 +51,10 @@ namespace keepass2android
Preference rounds = FindPreference(GetString(Resource.String.rounds_key));
rounds.PreferenceChange += (sender, e) => SetRounds(db, e.Preference);
rounds.Enabled = db.CanWrite;
Preference defaultUser = FindPreference(GetString(Resource.String.default_username_key));
defaultUser.Enabled = db.CanWrite;
((EditTextPreference)defaultUser).EditText.Text = db.KpDatabase.DefaultUserName;
((EditTextPreference)defaultUser).Text = db.KpDatabase.DefaultUserName;
defaultUser.PreferenceChange += (sender, e) =>
@@ -75,6 +77,7 @@ namespace keepass2android
};
Preference databaseName = FindPreference(GetString(Resource.String.database_name_key));
databaseName.Enabled = db.CanWrite;
((EditTextPreference)databaseName).EditText.Text = db.KpDatabase.Name;
((EditTextPreference)databaseName).Text = db.KpDatabase.Name;
databaseName.PreferenceChange += (sender, e) =>

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -150,8 +150,11 @@ namespace keepass2android.view
public override void OnCreateMenu(IContextMenu menu, IContextMenuContextMenuInfo menuInfo)
{
menu.Add(0, MenuOpen, 0, Resource.String.menu_open);
menu.Add(0, MenuDelete, 0, Resource.String.menu_delete);
menu.Add(0, MenuMove, 0, Resource.String.menu_move);
if (App.Kp2a.GetDb().CanWrite)
{
menu.Add(0, MenuDelete, 0, Resource.String.menu_delete);
menu.Add(0, MenuMove, 0, Resource.String.menu_move);
}
}
public override bool OnContextItemSelected(IMenuItem item)

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,
@@ -107,9 +107,12 @@ namespace keepass2android.view
public override void OnCreateMenu(IContextMenu menu, IContextMenuContextMenuInfo menuInfo) {
menu.Add(0, MenuOpen, 0, Resource.String.menu_open);
menu.Add(0, MenuDelete, 0, Resource.String.menu_delete);
menu.Add(0, MenuMove, 0, Resource.String.menu_move);
menu.Add(0, MenuEdit, 0, Resource.String.menu_edit);
if (App.Kp2a.GetDb().CanWrite)
{
menu.Add(0, MenuDelete, 0, Resource.String.menu_delete);
menu.Add(0, MenuMove, 0, Resource.String.menu_move);
menu.Add(0, MenuEdit, 0, Resource.String.menu_edit);
}
}
public override bool OnContextItemSelected(IMenuItem item)

View File

@@ -3,7 +3,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Keepass2Android is distributed in the hope that it will be useful,