Drastically improved UI for creating a new database (own activity, file browser for key files, explanation texts, password generator, show password button)

Added DejaVuSansMono.ttf for password display in EntryActivity
This commit is contained in:
Philipp Crocoll
2013-10-12 22:20:02 +02:00
parent 2f3bbff841
commit c81ca4268e
29 changed files with 3470 additions and 2433 deletions

View File

@@ -30,13 +30,24 @@ namespace keepass2android
private readonly bool _dontSave;
private readonly Context _ctx;
private readonly IKp2aApp _app;
private CompositeKey _key;
public CreateDb(IKp2aApp app, Context ctx, IOConnectionInfo ioc, OnFinish finish, bool dontSave): base(finish) {
_ctx = ctx;
_ioc = ioc;
_dontSave = dontSave;
_app = app;
}
public CreateDb(IKp2aApp app, Context ctx, IOConnectionInfo ioc, OnFinish finish, bool dontSave, CompositeKey key)
: base(finish)
{
_ctx = ctx;
_ioc = ioc;
_dontSave = dontSave;
_app = app;
_key = key;
}
public override void Run() {
@@ -44,10 +55,13 @@ namespace keepass2android
Database db = _app.CreateNewDatabase();
db.KpDatabase = new KeePassLib.PwDatabase();
//Key will be changed/created immediately after creation:
CompositeKey tempKey = new CompositeKey();
db.KpDatabase.New(_ioc, tempKey);
if (_key == null)
{
_key = new CompositeKey(); //use a temporary key which should be changed after creation
}
db.KpDatabase.New(_ioc, _key);
db.KpDatabase.KeyEncryptionRounds = DefaultEncryptionRounds;
db.KpDatabase.Name = "Keepass2Android Password Database";