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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user