use of de.slackspace.openkeepass.KeePassDatabase in project TinyKeePass by sorz.
the class OpenKeePassTask method doInBackground.
@Override
protected KeePassFile doInBackground(Void... voids) {
try {
long t = System.currentTimeMillis();
KeePassDatabase instance = KeePassDatabase.getInstance(path);
Log.d(TAG, "get instance in " + (System.currentTimeMillis() - t) + "ms");
t = System.currentTimeMillis();
KeePassFile keePassFile = instance.openDatabase(key);
Log.d(TAG, "open db in " + (System.currentTimeMillis() - t) + "ms");
return keePassFile;
} catch (KeePassDatabaseUnreadableException | UnsupportedOperationException e) {
Log.w(TAG, "cannot open database.", e);
errorMessage = e.getLocalizedMessage();
}
return null;
}
Aggregations